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

Classes

struct  npc_emilyAI
 

Public Member Functions

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

Constructor & Destructor Documentation

◆ npc_emily()

npc_emily::npc_emily ( )
inline
66: CreatureScript("npc_emily") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

218 {
219 return new npc_emilyAI(creature);
220 }

◆ OnQuestAccept()

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

Reimplemented from CreatureScript.

204 {
205 if (quest->GetQuestId() == QUEST_PERILOUS_ADVENTURE)
206 {
207 creature->AI()->Talk(SAY_QUEST_ACCEPT);
208 if (Creature* Mrfloppy = GetClosestCreatureWithEntry(creature, NPC_MRFLOPPY, 180.0f))
209 Mrfloppy->GetMotionMaster()->MoveFollow(creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
210
211 if (npc_escortAI* pEscortAI = CAST_AI(npc_emily::npc_emilyAI, (creature->AI())))
212 pEscortAI->Start(true, false, player->GetGUID());
213 }
214 return true;
215 }
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
Definition: ScriptedCreature.cpp:817
#define CAST_AI(a, b)
Definition: UnitAI.h:26
#define PET_FOLLOW_ANGLE
Definition: PetDefines.h:199
#define PET_FOLLOW_DIST
Definition: PetDefines.h:198
@ QUEST_PERILOUS_ADVENTURE
Definition: zone_grizzly_hills.cpp:43
@ SAY_QUEST_ACCEPT
Definition: zone_grizzly_hills.cpp:58
@ NPC_MRFLOPPY
Definition: zone_grizzly_hills.cpp:38
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
Definition: ScriptedEscortAI.h:53
Definition: Creature.h:46
CreatureAI * AI() const
Definition: Creature.h:143
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
Definition: zone_grizzly_hills.cpp:69

References Creature::AI(), CAST_AI, GetClosestCreatureWithEntry(), Object::GetGUID(), Quest::GetQuestId(), NPC_MRFLOPPY, PET_FOLLOW_ANGLE, PET_FOLLOW_DIST, QUEST_PERILOUS_ADVENTURE, SAY_QUEST_ACCEPT, and CreatureAI::Talk().