TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_emily Class Reference

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
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Creature *)
 
virtual bool OnGossipHello (Player *, Creature *)
 
virtual bool OnGossipSelect (Player *, Creature *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, Creature *, uint32, uint32, const char *)
 
virtual bool OnQuestSelect (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
- Public Member Functions inherited from UnitScript
virtual void OnHeal (Unit *, Unit *, uint32 &)
 
virtual void OnDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifyPeriodicDamageAurasTick (Unit *, Unit *, uint32 &)
 
virtual void ModifyMeleeDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifySpellDamageTaken (Unit *, Unit *, int32 &)
 
- Public Member Functions inherited from ScriptObject
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 UnitScript
 UnitScript (const char *name, bool addToScripts=true)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

npc_emily::npc_emily ( )
inline
61 : CreatureScript("npc_emily") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

207  {
208  return new npc_emilyAI(creature);
209  }
bool npc_emily::OnQuestAccept ( Player player,
Creature creature,
Quest const quest 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

193  {
194  if (quest->GetQuestId() == QUEST_PERILOUS_ADVENTURE)
195  {
196  creature->AI()->Talk(SAY_QUEST_ACCEPT);
197  if (Creature* Mrfloppy = GetClosestCreatureWithEntry(creature, NPC_MRFLOPPY, 180.0f))
198  Mrfloppy->GetMotionMaster()->MoveFollow(creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
199 
200  if (npc_escortAI* pEscortAI = CAST_AI(npc_emily::npc_emilyAI, (creature->AI())))
201  pEscortAI->Start(true, false, player->GetGUID());
202  }
203  return true;
204  }
#define PET_FOLLOW_ANGLE
Definition: PetDefines.h:78
Definition: ScriptedEscortAI.h:52
TC_GAME_API Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
Definition: ScriptedCreature.cpp:611
Definition: zone_grizzly_hills.cpp:38
Definition: Creature.h:467
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
CreatureAI * AI() const
Definition: Creature.h:525
Definition: zone_grizzly_hills.cpp:63
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: zone_grizzly_hills.cpp:33
#define PET_FOLLOW_DIST
Definition: PetDefines.h:77
Definition: zone_grizzly_hills.cpp:53

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: