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

Classes

struct  hyjalThrallAI
 

Public Member Functions

 npc_hyjal_thrall ()
 
CreatureAIGetAI (Creature *creature) const override
 
bool OnGossipSelect (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_hyjal_thrall()

npc_hyjal_thrall::npc_hyjal_thrall ( )
inline
201: CreatureScript("npc_hyjal_thrall") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

204 {
205 return new hyjalThrallAI(creature);
206 }

◆ OnGossipSelect()

bool npc_hyjal_thrall::OnGossipSelect ( Player ,
Creature creature,
uint32  ,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureScript.

253 {
255
256 if (InstanceScript* hyjal = creature->GetInstanceScript())
257 {
258 if (hyjal->GetBossState(DATA_KAZROGAL) != DONE || hyjal->GetBossState(DATA_AZGALOR) != DONE)
259 {
260 hyjal->SetData(DATA_RESET_WAVES, 0);
261 hyjal->SetData(DATA_SPAWN_WAVES, 0);
262 }
263 else
264 {
265 creature->AI()->Talk(SAY_SUCCESS);
266 creature->SummonCreatureGroup(0);
267 }
268 }
269 return true;
270 }
@ DONE
Definition: InstanceScript.h:60
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ DATA_RESET_WAVES
Definition: hyjal.h:49
@ DATA_KAZROGAL
Definition: hyjal.h:33
@ DATA_SPAWN_WAVES
Definition: hyjal.h:44
@ DATA_AZGALOR
Definition: hyjal.h:34
@ SAY_SUCCESS
Definition: hyjal.cpp:88
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
Definition: CreatureAI.cpp:50
CreatureAI * AI() const
Definition: Creature.h:143
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition: Object.cpp:2432
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:696
Definition: InstanceScript.h:142

References Creature::AI(), DATA_AZGALOR, DATA_KAZROGAL, DATA_RESET_WAVES, DATA_SPAWN_WAVES, DONE, WorldObject::GetInstanceScript(), Unit::RemoveNpcFlag(), SAY_SUCCESS, WorldObject::SummonCreatureGroup(), CreatureAI::Talk(), and UNIT_NPC_FLAG_GOSSIP.