TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
go_amberpine_outhouse Class Reference

Public Member Functions

 go_amberpine_outhouse ()
 
bool OnGossipHello (Player *player, GameObject *go) override
 
bool OnGossipSelect (Player *player, GameObject *go, uint32, uint32 action) override
 
- Public Member Functions inherited from GameObjectScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, GameObject *)
 
virtual bool OnGossipSelectCode (Player *, GameObject *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, GameObject *, Quest const *)
 
virtual bool OnQuestReward (Player *, GameObject *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, GameObject *)
 
virtual void OnDestroyed (GameObject *, Player *)
 
virtual void OnDamaged (GameObject *, Player *)
 
virtual void OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 
- Public Member Functions inherited from UpdatableScript< GameObject >
virtual void OnUpdate (GameObject *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from GameObjectScript
 GameObjectScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

go_amberpine_outhouse::go_amberpine_outhouse ( )
inline
962 : GameObjectScript("go_amberpine_outhouse") { }
GameObjectScript(const char *name)
Definition: ScriptMgr.cpp:1592

Member Function Documentation

bool go_amberpine_outhouse::OnGossipHello ( Player player,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

965  {
966  QuestStatus status = player->GetQuestStatus(QUEST_DOING_YOUR_DUTY);
967  if (status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_REWARDED)
968  {
970  player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, go->GetGUID());
971  }
972  else
973  player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, go->GetGUID());
974 
975  return true;
976  }
Definition: QuestDef.h:111
Definition: ScriptedGossip.h:71
Definition: go_scripts.cpp:955
Definition: go_scripts.cpp:951
QuestStatus
Definition: QuestDef.h:108
Definition: QuestDef.h:116
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: GossipDef.h:59
Definition: QuestDef.h:113
Definition: go_scripts.cpp:956
#define GOSSIP_USE_OUTHOUSE
Definition: go_scripts.cpp:944

+ Here is the call graph for this function:

bool go_amberpine_outhouse::OnGossipSelect ( Player player,
GameObject go,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

979  {
980  player->PlayerTalkClass->ClearMenus();
981  if (action == GOSSIP_ACTION_INFO_DEF +1)
982  {
983  player->CLOSE_GOSSIP_MENU();
985  if (target)
986  {
987  target->AI()->SetData(1, player->getGender());
988  go->CastSpell(target, SPELL_INDISPOSED_III);
989  }
990  go->CastSpell(player, SPELL_INDISPOSED);
991  if (player->HasItemCount(ITEM_ANDERHOLS_SLIDER_CIDER))
992  go->CastSpell(player, SPELL_CREATE_AMBERSEEDS);
993  return true;
994  }
995  else
996  {
997  player->CLOSE_GOSSIP_MENU();
998  player->GetSession()->SendNotification(GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND);
999  return false;
1000  }
1001  }
virtual void SetData(uint32, uint32)
Definition: UnitAI.h:140
Definition: ScriptedGossip.h:71
TC_GAME_API Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
Definition: ScriptedCreature.cpp:611
Definition: go_scripts.cpp:953
Definition: Creature.h:467
Definition: go_scripts.cpp:950
Definition: go_scripts.cpp:949
CreatureAI * AI() const
Definition: Creature.h:525
#define GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND
Definition: go_scripts.cpp:945
void CastSpell(Unit *target, uint32 spell, bool triggered=true)
Definition: GameObject.cpp:1833
Definition: go_scripts.cpp:954
Definition: go_scripts.cpp:952

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: