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

Public Member Functions

 npc_tyrande_whisperwind ()
 
CreatureAIGetAI (Creature *creature) const override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
- Public Member Functions inherited from CreatureScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Creature *)
 
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 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_tyrande_whisperwind::npc_tyrande_whisperwind ( )
inline
214 : CreatureScript("npc_tyrande_whisperwind") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

217  {
218  if (!creature->GetInstanceScript())
219  return NULL;
220 
221  hyjalAI* ai = new hyjalAI(creature);
222  ai->Reset();
223  ai->EnterEvadeMode();
224  return ai;
225  }
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: hyjalAI.h:118
void EnterEvadeMode(EvadeReason=EVADE_REASON_OTHER) override
Definition: hyjalAI.cpp:420
void Reset() override
Definition: hyjalAI.cpp:383

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

244  {
245  hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
246  uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
247 
248  // Only let them get item if Azgalor is dead.
249  if (AzgalorEvent == DONE && !player->HasItemCount(ITEM_TEAR_OF_GODDESS))
251  player->SEND_GOSSIP_MENU(907, creature->GetGUID());
252  return true;
253  }
Definition: ScriptedGossip.h:71
Definition: inflate.h:49
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
Definition: hyjalAI.h:118
CreatureAI * AI() const
Definition: Creature.h:525
uint32_t uint32
Definition: Define.h:150
Definition: hyjal.h:33
#define GOSSIP_ITEM_TYRANDE
Definition: hyjal.cpp:46
Definition: ScriptedGossip.h:73
#define ITEM_TEAR_OF_GODDESS
Definition: hyjal.cpp:47
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: GossipDef.h:59
uint32 GetInstanceData(uint32 Event)
Definition: hyjalAI.cpp:609

+ Here is the call graph for this function:

bool npc_tyrande_whisperwind::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

228  {
229  player->PlayerTalkClass->ClearMenus();
230  if (action == GOSSIP_ACTION_INFO_DEF)
231  {
232  ItemPosCountVec dest;
233  uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
234  if (msg == EQUIP_ERR_OK)
235  if (Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true))
236  player->SendNewItem(item, 1, true, false, true);
237 
238  player->SEND_GOSSIP_MENU(907, creature->GetGUID());
239  }
240  return true;
241  }
Definition: Unit.h:379
Definition: ScriptedGossip.h:71
Definition: Item.h:48
Definition: Unit.h:378
Definition: Item.h:259
#define ITEM_TEAR_OF_GODDESS
Definition: hyjal.cpp:47
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint8_t uint8
Definition: Define.h:152

+ Here is the call graph for this function:


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