AzeorthCore 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
 
- 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)
 
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
195: CreatureScript("npc_thrall_old_hillsbrad") { }
Definition: ScriptMgr.h:718

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

198 {
199 return GetOldHillsbradAI<npc_thrall_old_hillsbradAI>(creature);
200 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

203 {
204 InstanceScript* instance = creature->GetInstanceScript();
205 if (!instance)
206 return true;
207
208 uint32 menuId = creature->GetCreatureTemplate()->GossipMenuId;
210 menuId = 7830;
212 menuId = 7840;
214 menuId = 7853;
215
216 player->PrepareGossipMenu(creature, menuId, true);
217 player->SendPreparedGossip(creature);
218 return true;
219 }
std::uint32_t uint32
Definition: Define.h:108
@ DATA_ESCORT_PROGRESS
Definition: old_hillsbrad.h:27
@ ENCOUNTER_PROGRESS_TARETHA_MEET
Definition: old_hillsbrad.h:77
@ ENCOUNTER_PROGRESS_SKARLOC_KILLED
Definition: old_hillsbrad.h:75
@ ENCOUNTER_PROGRESS_TARREN_MILL
Definition: old_hillsbrad.h:76
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:196
uint32 GossipMenuId
Definition: CreatureData.h:187
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1194
void SendPreparedGossip(WorldObject *source)
Definition: PlayerGossip.cpp:210
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition: PlayerGossip.cpp:31
Definition: InstanceScript.h:140
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52

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.

222 {
223 GossipMenuItemData const* gossipMenuItemData = player->PlayerTalkClass->GetGossipMenu().GetItemData(0);
224 InstanceScript* instance = creature->GetInstanceScript();
225 if (!instance || (gossipMenuItemData && gossipMenuItemData->GossipActionMenuId != 0))
226 return false;
227
228 ClearGossipMenuFor(player);
229 CloseGossipMenuFor(player);
230
231 creature->AI()->DoAction(instance->GetData(DATA_ESCORT_PROGRESS));
233 return true;
234 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ UNIT_NPC_FLAG_GOSSIP
Definition: Unit.h:516
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: Unit.h:517
virtual void DoAction(int32)
Definition: UnitAI.h:196
CreatureAI * AI() const
Definition: Creature.h:134
Definition: GossipDef.h:145
uint32 GossipActionMenuId
Definition: GossipDef.h:146
GossipMenuItemData const * GetItemData(uint32 indexId) const
Definition: GossipDef.h:196
GossipMenu & GetGossipMenu()
Definition: GossipDef.h:263
PlayerMenu * PlayerTalkClass
Definition: Player.h:2187
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:1684

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.