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

Public Member Functions

 npc_tyrion ()
 
bool OnQuestAccept (Player *player, Creature *creature, Quest const *quest) 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_tyrion()

npc_tyrion::npc_tyrion ( )
inline
458: CreatureScript("npc_tyrion") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnQuestAccept()

bool npc_tyrion::OnQuestAccept ( Player player,
Creature creature,
Quest const *  quest 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

461 {
462 if (quest->GetQuestId() == QUEST_THE_ATTACK)
463 {
464 if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true))
465 {
466 CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, false, player->GetGUID());
467 CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f);
468 }
469 return true;
470 }
471 return false;
472 }
#define CAST_AI(a, b)
Definition: UnitAI.h:26
@ QUEST_THE_ATTACK
Definition: zone_stormwind_city.cpp:56
@ NPC_TYRION_SPYBOT
Definition: zone_stormwind_city.cpp:452
Definition: Creature.h:46
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
Definition: zone_stormwind_city.cpp:324

References CAST_AI, WorldObject::FindNearestCreature(), Object::GetGUID(), Quest::GetQuestId(), NPC_TYRION_SPYBOT, and QUEST_THE_ATTACK.