AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_thrall_warchief Class Reference
Inheritance diagram for npc_thrall_warchief:
CreatureScript ScriptObject UpdatableScript< Creature >

Classes

struct  npc_thrall_warchiefAI
 

Public Member Functions

 npc_thrall_warchief ()
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnQuestReward (Player *, Creature *creature, Quest const *quest, uint32) override
 
CreatureAIGetAI (Creature *creature) const override
 
- Public Member Functions inherited from CreatureScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, Creature *)
 
virtual bool OnGossipSelect (Player *, Creature *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, Creature *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, Creature *, Quest const *)
 
virtual bool OnQuestSelect (Player *, Creature *, Quest const *)
 
virtual bool OnQuestComplete (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 
- Public Member Functions inherited from UpdatableScript< Creature >
virtual void OnUpdate (Creature *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from CreatureScript
 CreatureScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Todo:
verify abilities/timers

Constructor & Destructor Documentation

◆ npc_thrall_warchief()

npc_thrall_warchief::npc_thrall_warchief ( )
inline
170: CreatureScript("npc_thrall_warchief") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

CreatureAI * npc_thrall_warchief::GetAI ( Creature creature) const
inlineoverridevirtual

Reimplemented from CreatureScript.

225 {
226 return new npc_thrall_warchiefAI(creature);
227 }

◆ OnGossipHello()

bool npc_thrall_warchief::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

196 {
197 if (creature->IsQuestGiver())
198 {
199 player->PrepareQuestMenu(creature->GetGUID());
200 }
201
203 {
205 }
206
207 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
208 return true;
209 }
@ GOSSIP_MENU_THRALL
Definition: zone_orgrimmar.cpp:160
@ QUEST_WHAT_THE_WIND_CARRIES
Definition: zone_orgrimmar.cpp:159
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition: ScriptedGossip.cpp:28
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
bool IsQuestGiver() const
Definition: Unit.h:762

References AddGossipItemFor(), Player::GetGossipTextId(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_THRALL, GOSSIP_SENDER_MAIN, Unit::IsQuestGiver(), Player::PrepareQuestMenu(), QUEST_STATUS_INCOMPLETE, QUEST_WHAT_THE_WIND_CARRIES, and SendGossipMenuFor().

◆ OnGossipSelect()

bool npc_thrall_warchief::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

173 {
174 ClearGossipMenuFor(player);
175
176 uint32 DiscussionOrder = action - GOSSIP_ACTION_INFO_DEF;
177
178 if (DiscussionOrder>= 1 && DiscussionOrder <= 6)
179 {
180 uint32 NextAction = GOSSIP_ACTION_INFO_DEF + DiscussionOrder + 1;
181 uint32 GossipResponse = GOSSIP_RESPONSE_THRALL_FIRST + DiscussionOrder - 1;
182
183 AddGossipItemFor(player, GOSSIP_MENU_THRALL + DiscussionOrder, 0, GOSSIP_SENDER_MAIN, NextAction);
184 SendGossipMenuFor(player, GossipResponse, creature->GetGUID());
185 }
186 else if (DiscussionOrder == 7)
187 {
188 CloseGossipMenuFor(player);
190 }
191
192 return true;
193 }
std::uint32_t uint32
Definition: Define.h:107
@ GOSSIP_RESPONSE_THRALL_FIRST
Definition: zone_orgrimmar.cpp:161
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
void AreaExploredOrEventHappens(uint32 questId)
Definition: PlayerQuest.cpp:1790

References AddGossipItemFor(), Player::AreaExploredOrEventHappens(), ClearGossipMenuFor(), CloseGossipMenuFor(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_THRALL, GOSSIP_RESPONSE_THRALL_FIRST, GOSSIP_SENDER_MAIN, QUEST_WHAT_THE_WIND_CARRIES, and SendGossipMenuFor().

◆ OnQuestReward()

bool npc_thrall_warchief::OnQuestReward ( Player ,
Creature creature,
Quest const *  quest,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureScript.

212 {
213 if (quest->GetQuestId() == QUEST_FOR_THE_HORDE)
214 {
215 if (creature && creature->AI())
216 {
217 creature->AI()->DoAction(ACTION_START_TALKING);
218 }
219 }
220
221 return true;
222 }
@ ACTION_START_TALKING
Definition: zone_orgrimmar.cpp:146
@ QUEST_FOR_THE_HORDE
Definition: zone_orgrimmar.cpp:143
virtual void DoAction(int32)
Definition: UnitAI.h:212
CreatureAI * AI() const
Definition: Creature.h:140

References ACTION_START_TALKING, Creature::AI(), UnitAI::DoAction(), Quest::GetQuestId(), and QUEST_FOR_THE_HORDE.