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

Public Member Functions

 npc_thrall ()
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
CreatureAIGetAI (Creature *creature) const 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_thrall::npc_thrall ( )
inline
133 : CreatureScript("npc_thrall") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

189  {
190  if (!creature->GetInstanceScript())
191  return NULL;
192 
193  hyjalAI* ai = new hyjalAI(creature);
194 
195  ai->Reset();
196  ai->EnterEvadeMode();
197 
199  ai->Spells[0].Cooldown = urand(3000, 8000);
201 
203  ai->Spells[1].Cooldown = urand(6000, 41000);
205 
206  return ai;
207  }
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
Definition: bosses_opera.cpp:86
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: hyjalAI.h:118
Definition: hyjalAI.h:103
uint32 TargetType
Definition: hyjalAI.h:202
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
struct hyjalAI::Spell Spells[HYJAL_AI_MAX_SPELLS]
uint32 Cooldown
Definition: hyjalAI.h:201
Definition: hyjalAI.h:40
void EnterEvadeMode(EvadeReason=EVADE_REASON_OTHER) override
Definition: hyjalAI.cpp:420
Definition: hyjalAI.h:104
void Reset() override
Definition: hyjalAI.cpp:383
uint32 SpellId
Definition: hyjalAI.h:200

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

162  {
163  hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
164  if (ai->EventBegun)
165  return false;
166 
167  uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
168  // Only let them start the Horde phases if Anetheron is dead.
169  if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT))
170  {
171  uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT);
172  uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
173  if (KazrogalEvent == NOT_STARTED)
175  else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
177  else if (AzgalorEvent == DONE)
179  }
180 
181  if (player->IsGameMaster())
183 
184  player->SEND_GOSSIP_MENU(907, creature->GetGUID());
185  return true;
186  }
bool EventBegun
Definition: hyjalAI.h:174
Definition: hyjal.h:43
Definition: ScriptedGossip.h:71
Definition: GossipDef.h:62
#define GOSSIP_ITEM_RETREAT
Definition: hyjal.cpp:44
Definition: inflate.h:49
#define GOSSIP_ITEM_GM1
Definition: hyjal.cpp:49
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
Definition: hyjalAI.h:118
Definition: hyjal.h:29
Definition: InstanceScript.h:58
CreatureAI * AI() const
Definition: Creature.h:525
uint32_t uint32
Definition: Define.h:150
Definition: hyjal.h:33
#define GOSSIP_ITEM_BEGIN_HORDE
Definition: hyjal.cpp:41
Definition: ScriptedGossip.h:73
#define GOSSIP_ITEM_AZGALOR
Definition: hyjal.cpp:42
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: hyjal.h:36
Definition: GossipDef.h:59
uint32 GetInstanceData(uint32 Event)
Definition: hyjalAI.cpp:609

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

136  {
137  player->PlayerTalkClass->ClearMenus();
138  hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
139  ai->DeSpawnVeins();//despawn the alliance veins
140  switch (action)
141  {
142  case GOSSIP_ACTION_INFO_DEF + 1:
143  ai->StartEvent(player);
144  break;
145  case GOSSIP_ACTION_INFO_DEF + 2:
146  ai->FirstBossDead = true;
147  ai->WaveCount = 9;
148  ai->StartEvent(player);
149  break;
150  case GOSSIP_ACTION_INFO_DEF + 3:
151  ai->Retreat();
152  break;
154  ai->Debug = !ai->Debug;
155  TC_LOG_DEBUG("scripts", "HyjalAI - Debug mode has been toggled");
156  break;
157  }
158  return true;
159  }
Definition: ScriptedGossip.h:71
bool FirstBossDead
Definition: hyjalAI.h:175
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
void DeSpawnVeins()
Definition: hyjalAI.cpp:673
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
Definition: hyjalAI.h:118
bool Debug
Definition: hyjalAI.h:179
void StartEvent(Player *player)
Definition: hyjalAI.cpp:586
CreatureAI * AI() const
Definition: Creature.h:525
uint32 WaveCount
Definition: hyjalAI.h:168
void Retreat()
Definition: hyjalAI.cpp:614

+ Here is the call graph for this function:


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