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

Classes

struct  npc_thrall_old_hillsbradAI
 

Public Member Functions

 npc_thrall_old_hillsbrad ()
 
CreatureAIGetAI (Creature *creature) const override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32) 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

Constructor & Destructor Documentation

◆ npc_thrall_old_hillsbrad()

npc_thrall_old_hillsbrad::npc_thrall_old_hillsbrad ( )
inline
206: CreatureScript("npc_thrall_old_hillsbrad") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

209 {
210 return GetOldHillsbradAI<npc_thrall_old_hillsbradAI>(creature);
211 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

214 {
215 InstanceScript* instance = creature->GetInstanceScript();
216 if (!instance)
217 return true;
218
219 uint32 menuId = creature->GetCreatureTemplate()->GossipMenuId;
221 menuId = 7830;
223 menuId = 7840;
225 menuId = 7853;
226
227 player->PrepareGossipMenu(creature, menuId, true);
228 player->SendPreparedGossip(creature);
229 return true;
230 }
std::uint32_t uint32
Definition: Define.h:107
@ DATA_ESCORT_PROGRESS
Definition: old_hillsbrad.h:29
@ ENCOUNTER_PROGRESS_TARETHA_MEET
Definition: old_hillsbrad.h:82
@ ENCOUNTER_PROGRESS_SKARLOC_KILLED
Definition: old_hillsbrad.h:80
@ ENCOUNTER_PROGRESS_TARREN_MILL
Definition: old_hillsbrad.h:81
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:205
uint32 GossipMenuId
Definition: CreatureData.h:194
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
void SendPreparedGossip(WorldObject *source)
Definition: PlayerGossip.cpp:209
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition: PlayerGossip.cpp:32
Definition: InstanceScript.h:142
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51

References DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_SKARLOC_KILLED, ENCOUNTER_PROGRESS_TARETHA_MEET, ENCOUNTER_PROGRESS_TARREN_MILL, Creature::GetCreatureTemplate(), ZoneScript::GetData(), WorldObject::GetInstanceScript(), CreatureTemplate::GossipMenuId, Player::PrepareGossipMenu(), and Player::SendPreparedGossip().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

233 {
234 GossipMenuItemData const* gossipMenuItemData = player->PlayerTalkClass->GetGossipMenu().GetItemData(0);
235 InstanceScript* instance = creature->GetInstanceScript();
236 if (!instance || (gossipMenuItemData && gossipMenuItemData->GossipActionMenuId != 0))
237 return false;
238
239 ClearGossipMenuFor(player);
240 CloseGossipMenuFor(player);
241
242 creature->AI()->DoAction(instance->GetData(DATA_ESCORT_PROGRESS));
244 return true;
245 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: UnitDefines.h:295
virtual void DoAction(int32)
Definition: UnitAI.h:212
CreatureAI * AI() const
Definition: Creature.h:140
Definition: GossipDef.h:146
uint32 GossipActionMenuId
Definition: GossipDef.h:147
GossipMenuItemData const * GetItemData(uint32 indexId) const
Definition: GossipDef.h:197
GossipMenu & GetGossipMenu()
Definition: GossipDef.h:264
PlayerMenu * PlayerTalkClass
Definition: Player.h:2239
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:727

References Creature::AI(), ClearGossipMenuFor(), CloseGossipMenuFor(), DATA_ESCORT_PROGRESS, UnitAI::DoAction(), ZoneScript::GetData(), PlayerMenu::GetGossipMenu(), WorldObject::GetInstanceScript(), GossipMenu::GetItemData(), GossipMenuItemData::GossipActionMenuId, Player::PlayerTalkClass, Unit::RemoveNpcFlag(), UNIT_NPC_FLAG_GOSSIP, and UNIT_NPC_FLAG_QUESTGIVER.