TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boss_shade_of_aran::boss_aranAI Struct Reference

Public Member Functions

 boss_aranAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *) override
 
void EnterCombat (Unit *) override
 
void FlameWreathEffect ()
 
void UpdateAI (uint32 diff) override
 
void DamageTaken (Unit *, uint32 &damage) override
 
void SpellHit (Unit *, const SpellInfo *Spell) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo constSelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Public Attributes

InstanceScriptinstance
 
uint32 SecondarySpellTimer
 
uint32 NormalCastTimer
 
uint32 SuperCastTimer
 
uint32 BerserkTimer
 
uint32 CloseDoorTimer
 
uint8 LastSuperSpell
 
uint32 FlameWreathTimer
 
uint32 FlameWreathCheckTime
 
ObjectGuid FlameWreathTarget [3]
 
float FWTargPosX [3]
 
float FWTargPosY [3]
 
uint32 CurrentNormalSpell
 
uint32 ArcaneCooldown
 
uint32 FireCooldown
 
uint32 FrostCooldown
 
uint32 DrinkInterruptTimer
 
bool ElementalsSpawned
 
bool Drinking
 
bool DrinkInturrupted
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason { EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_shade_of_aran::boss_aranAI::boss_aranAI ( Creature creature)
inline
94  : ScriptedAI(creature)
95  {
96  Initialize();
97  instance = creature->GetInstanceScript();
98  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * instance
Definition: boss_shade_of_aran.cpp:125
void Initialize()
Definition: boss_shade_of_aran.cpp:100

+ Here is the call graph for this function:

Member Function Documentation

void boss_shade_of_aran::boss_aranAI::DamageTaken ( Unit ,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

480  {
481  if (!DrinkInturrupted && Drinking && damage)
482  DrinkInturrupted = true;
483  }
bool Drinking
Definition: boss_shade_of_aran.cpp:149
bool DrinkInturrupted
Definition: boss_shade_of_aran.cpp:150
void boss_shade_of_aran::boss_aranAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

175  {
176  Talk(SAY_AGGRO);
177 
180  }
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: InstanceScript.h:59
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: boss_shade_of_aran.cpp:34
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
Definition: karazhan.h:48
InstanceScript * instance
Definition: boss_shade_of_aran.cpp:125
Definition: karazhan.h:32

+ Here is the call graph for this function:

void boss_shade_of_aran::boss_aranAI::FlameWreathEffect ( )
inline
183  {
184  std::vector<Unit*> targets;
186 
187  if (t_list.empty())
188  return;
189 
190  //store the threat list in a different container
191  for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
192  {
193  Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
194  //only on alive players
195  if (target && target->IsAlive() && target->GetTypeId() == TYPEID_PLAYER)
196  targets.push_back(target);
197  }
198 
199  //cut down to size if we have more than 3 targets
200  while (targets.size() > 3)
201  targets.erase(targets.begin() + rand32() % targets.size());
202 
203  uint32 i = 0;
204  for (std::vector<Unit*>::const_iterator itr = targets.begin(); itr!= targets.end(); ++itr)
205  {
206  if (*itr)
207  {
208  FlameWreathTarget[i] = (*itr)->GetGUID();
209  FWTargPosX[i] = (*itr)->GetPositionX();
210  FWTargPosY[i] = (*itr)->GetPositionY();
211  DoCast((*itr), SPELL_FLAME_WREATH, true);
212  ++i;
213  }
214  }
215  }
float FWTargPosY[3]
Definition: boss_shade_of_aran.cpp:139
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
ObjectGuid FlameWreathTarget[3]
Definition: boss_shade_of_aran.cpp:137
Creature *const me
Definition: CreatureAI.h:71
TypeID GetTypeId() const
Definition: Object.h:113
bool IsAlive() const
Definition: Unit.h:1692
uint32_t uint32
Definition: Define.h:150
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: boss_shade_of_aran.cpp:52
Definition: ObjectGuid.h:33
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
ThreatManager & getThreatManager()
Definition: Unit.h:1998
uint32 rand32()
Definition: Random.cpp:64
float FWTargPosX[3]
Definition: boss_shade_of_aran.cpp:138
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_shade_of_aran::boss_aranAI::Initialize ( void  )
inline
101  {
102  SecondarySpellTimer = 5000;
103  NormalCastTimer = 0;
104  SuperCastTimer = 35000;
105  BerserkTimer = 720000;
106  CloseDoorTimer = 15000;
107 
108  LastSuperSpell = rand32() % 3;
109 
110  FlameWreathTimer = 0;
112 
113  CurrentNormalSpell = 0;
114  ArcaneCooldown = 0;
115  FireCooldown = 0;
116  FrostCooldown = 0;
117 
118  DrinkInterruptTimer = 10000;
119 
120  ElementalsSpawned = false;
121  Drinking = false;
122  DrinkInturrupted = false;
123  }
uint32 FrostCooldown
Definition: boss_shade_of_aran.cpp:144
bool Drinking
Definition: boss_shade_of_aran.cpp:149
bool DrinkInturrupted
Definition: boss_shade_of_aran.cpp:150
uint32 SecondarySpellTimer
Definition: boss_shade_of_aran.cpp:127
uint32 ArcaneCooldown
Definition: boss_shade_of_aran.cpp:142
uint32 NormalCastTimer
Definition: boss_shade_of_aran.cpp:128
uint32 rand32()
Definition: Random.cpp:64
uint32 CloseDoorTimer
Definition: boss_shade_of_aran.cpp:131
uint32 CurrentNormalSpell
Definition: boss_shade_of_aran.cpp:141
uint32 FlameWreathCheckTime
Definition: boss_shade_of_aran.cpp:136
uint32 SuperCastTimer
Definition: boss_shade_of_aran.cpp:129
uint32 FlameWreathTimer
Definition: boss_shade_of_aran.cpp:135
uint8 LastSuperSpell
Definition: boss_shade_of_aran.cpp:133
uint32 BerserkTimer
Definition: boss_shade_of_aran.cpp:130
uint32 DrinkInterruptTimer
Definition: boss_shade_of_aran.cpp:146
bool ElementalsSpawned
Definition: boss_shade_of_aran.cpp:148
uint32 FireCooldown
Definition: boss_shade_of_aran.cpp:143

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_shade_of_aran::boss_aranAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

167  {
168  Talk(SAY_DEATH);
169 
172  }
Definition: inflate.h:49
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
Definition: karazhan.h:48
InstanceScript * instance
Definition: boss_shade_of_aran.cpp:125
Definition: boss_shade_of_aran.cpp:42
Definition: karazhan.h:32

+ Here is the call graph for this function:

void boss_shade_of_aran::boss_aranAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

162  {
163  Talk(SAY_KILL);
164  }
Definition: boss_shade_of_aran.cpp:40
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42

+ Here is the call graph for this function:

void boss_shade_of_aran::boss_aranAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

153  {
154  Initialize();
155 
156  // Not in progress
159  }
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: InstanceScript.h:58
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
Definition: karazhan.h:48
InstanceScript * instance
Definition: boss_shade_of_aran.cpp:125
void Initialize()
Definition: boss_shade_of_aran.cpp:100
Definition: karazhan.h:32

+ Here is the call graph for this function:

void boss_shade_of_aran::boss_aranAI::SpellHit ( Unit ,
const SpellInfo Spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

486  {
487  //We only care about interrupt effects and only if they are durring a spell currently being cast
488  for (SpellEffectInfo const* effect : Spell->GetEffectsForDifficulty(me->GetMap()->GetDifficultyID()))
489  if (effect && effect->Effect == SPELL_EFFECT_INTERRUPT_CAST && me->IsNonMeleeSpellCast(false))
490  {
491  //Interrupt effect
492  me->InterruptNonMeleeSpells(false);
493 
494  //Normally we would set the cooldown equal to the spell duration
495  //but we do not have access to the DurationStore
496 
497  switch (CurrentNormalSpell)
498  {
499  case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break;
500  case SPELL_FIREBALL: FireCooldown = 5000; break;
501  case SPELL_FROSTBOLT: FrostCooldown = 5000; break;
502  }
503  return;
504  }
505  }
uint32 FrostCooldown
Definition: boss_shade_of_aran.cpp:144
Map * GetMap() const
Definition: Object.h:543
Definition: boss_shade_of_aran.cpp:47
Difficulty GetDifficultyID() const
Definition: Map.h:390
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:2886
Definition: boss_shade_of_aran.cpp:46
Definition: SharedDefines.h:1078
uint32 ArcaneCooldown
Definition: boss_shade_of_aran.cpp:142
Creature *const me
Definition: CreatureAI.h:71
Definition: SpellInfo.h:238
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
SpellEffectInfoVector GetEffectsForDifficulty(uint32 difficulty) const
Definition: SpellInfo.cpp:3311
Definition: boss_shade_of_aran.cpp:48
uint32 CurrentNormalSpell
Definition: boss_shade_of_aran.cpp:141
uint32 FireCooldown
Definition: boss_shade_of_aran.cpp:143

+ Here is the call graph for this function:

void boss_shade_of_aran::boss_aranAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

218  {
219  if (!UpdateVictim())
220  return;
221 
222  if (CloseDoorTimer)
223  {
224  if (CloseDoorTimer <= diff)
225  {
227  CloseDoorTimer = 0;
228  } else CloseDoorTimer -= diff;
229  }
230 
231  //Cooldowns for casts
232  if (ArcaneCooldown)
233  {
234  if (ArcaneCooldown >= diff)
235  ArcaneCooldown -= diff;
236  else ArcaneCooldown = 0;
237  }
238 
239  if (FireCooldown)
240  {
241  if (FireCooldown >= diff)
242  FireCooldown -= diff;
243  else FireCooldown = 0;
244  }
245 
246  if (FrostCooldown)
247  {
248  if (FrostCooldown >= diff)
249  FrostCooldown -= diff;
250  else FrostCooldown = 0;
251  }
252 
254  {
255  Drinking = true;
256  me->InterruptNonMeleeSpells(false);
257 
258  Talk(SAY_DRINK);
259 
260  if (!DrinkInturrupted)
261  {
262  DoCast(me, SPELL_MASS_POLY, true);
263  DoCast(me, SPELL_CONJURE, false);
264  DoCast(me, SPELL_DRINK, false);
266  DrinkInterruptTimer = 10000;
267  }
268  }
269 
270  //Drink Interrupt
271  if (Drinking && DrinkInturrupted)
272  {
273  Drinking = false;
277  DoCast(me, SPELL_POTION, false);
278  }
279 
280  //Drink Interrupt Timer
281  if (Drinking && !DrinkInturrupted)
282  {
283  if (DrinkInterruptTimer >= diff)
284  DrinkInterruptTimer -= diff;
285  else
286  {
288  DoCast(me, SPELL_POTION, true);
289  DoCast(me, SPELL_AOE_PYROBLAST, false);
290  DrinkInturrupted = true;
291  Drinking = false;
292  }
293  }
294 
295  //Don't execute any more code if we are drinking
296  if (Drinking)
297  return;
298 
299  //Normal casts
300  if (NormalCastTimer <= diff)
301  {
302  if (!me->IsNonMeleeSpellCast(false))
303  {
304  Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
305  if (!target)
306  return;
307 
308  uint32 Spells[3];
309  uint8 AvailableSpells = 0;
310 
311  //Check for what spells are not on cooldown
312  if (!ArcaneCooldown)
313  {
314  Spells[AvailableSpells] = SPELL_ARCMISSLE;
315  ++AvailableSpells;
316  }
317  if (!FireCooldown)
318  {
319  Spells[AvailableSpells] = SPELL_FIREBALL;
320  ++AvailableSpells;
321  }
322  if (!FrostCooldown)
323  {
324  Spells[AvailableSpells] = SPELL_FROSTBOLT;
325  ++AvailableSpells;
326  }
327 
328  //If no available spells wait 1 second and try again
329  if (AvailableSpells)
330  {
331  CurrentNormalSpell = Spells[rand32() % AvailableSpells];
332  DoCast(target, CurrentNormalSpell);
333  }
334  }
335  NormalCastTimer = 1000;
336  } else NormalCastTimer -= diff;
337 
338  if (SecondarySpellTimer <= diff)
339  {
340  switch (urand(0, 1))
341  {
342  case 0:
344  break;
345  case 1:
346  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
347  DoCast(target, SPELL_CHAINSOFICE);
348  break;
349  }
350  SecondarySpellTimer = urand(5000, 20000);
351  } else SecondarySpellTimer -= diff;
352 
353  if (SuperCastTimer <= diff)
354  {
355  uint8 Available[2];
356 
357  switch (LastSuperSpell)
358  {
359  case SUPER_AE:
360  Available[0] = SUPER_FLAME;
361  Available[1] = SUPER_BLIZZARD;
362  break;
363  case SUPER_FLAME:
364  Available[0] = SUPER_AE;
365  Available[1] = SUPER_BLIZZARD;
366  break;
367  case SUPER_BLIZZARD:
368  Available[0] = SUPER_FLAME;
369  Available[1] = SUPER_AE;
370  break;
371  default:
372  Available[0] = 0;
373  Available[1] = 0;
374  break;
375  }
376 
377  LastSuperSpell = Available[urand(0, 1)];
378 
379  switch (LastSuperSpell)
380  {
381  case SUPER_AE:
383 
384  DoCast(me, SPELL_BLINK_CENTER, true);
385  DoCast(me, SPELL_PLAYERPULL, true);
386  DoCast(me, SPELL_MASSSLOW, true);
387  DoCast(me, SPELL_AEXPLOSION, false);
388  break;
389 
390  case SUPER_FLAME:
392 
393  FlameWreathTimer = 20000;
394  FlameWreathCheckTime = 500;
395 
399 
401  break;
402 
403  case SUPER_BLIZZARD:
405 
406  if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
407  {
408  pSpawn->setFaction(me->getFaction());
409  pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
410  }
411  break;
412  }
413 
414  SuperCastTimer = urand(35000, 40000);
415  } else SuperCastTimer -= diff;
416 
417  if (!ElementalsSpawned && HealthBelowPct(40))
418  {
419  ElementalsSpawned = true;
420 
421  for (uint32 i = 0; i < 4; ++i)
422  {
423  if (Creature* unit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
424  {
425  unit->Attack(me->GetVictim(), true);
426  unit->setFaction(me->getFaction());
427  }
428  }
429 
431  }
432 
433  if (BerserkTimer <= diff)
434  {
435  for (uint32 i = 0; i < 5; ++i)
436  {
437  if (Creature* unit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
438  {
439  unit->Attack(me->GetVictim(), true);
440  unit->setFaction(me->getFaction());
441  }
442  }
443 
445 
446  BerserkTimer = 60000;
447  } else BerserkTimer -= diff;
448 
449  //Flame Wreath check
450  if (FlameWreathTimer)
451  {
452  if (FlameWreathTimer >= diff)
453  FlameWreathTimer -= diff;
454  else FlameWreathTimer = 0;
455 
456  if (FlameWreathCheckTime <= diff)
457  {
458  for (uint8 i = 0; i < 3; ++i)
459  {
460  if (!FlameWreathTarget[i])
461  continue;
462 
464  if (unit && !unit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
465  {
466  unit->CastSpell(unit, 20476, true, 0, 0, me->GetGUID());
467  unit->CastSpell(unit, 11027, true);
469  }
470  }
471  FlameWreathCheckTime = 500;
472  } else FlameWreathCheckTime -= diff;
473  }
474 
477  }
float FWTargPosY[3]
Definition: boss_shade_of_aran.cpp:139
Definition: boss_shade_of_aran.cpp:65
Definition: boss_shade_of_aran.cpp:71
Definition: Unit.h:208
Definition: Unit.h:207
Definition: boss_shade_of_aran.cpp:57
Definition: boss_shade_of_aran.cpp:61
Definition: boss_shade_of_aran.cpp:78
Definition: boss_shade_of_aran.cpp:60
Definition: boss_shade_of_aran.cpp:53
uint32 FrostCooldown
Definition: boss_shade_of_aran.cpp:144
bool UpdateVictim()
Definition: CreatureAI.cpp:233
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
Definition: boss_shade_of_aran.cpp:47
bool Drinking
Definition: boss_shade_of_aran.cpp:149
Definition: boss_shade_of_aran.cpp:62
uint32 getFaction() const
Definition: Unit.h:1466
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
bool DrinkInturrupted
Definition: boss_shade_of_aran.cpp:150
Spells
Definition: BattlegroundIC.h:707
Definition: Creature.h:467
Definition: boss_shade_of_aran.cpp:37
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:2886
int32 GetPower(Powers power) const
Definition: Unit.cpp:11589
Definition: boss_shade_of_aran.cpp:46
Definition: boss_shade_of_aran.cpp:77
bool IsWithinDist2d(float x, float y, float dist) const
Definition: Object.cpp:1648
ObjectGuid FlameWreathTarget[3]
Definition: boss_shade_of_aran.cpp:137
Definition: boss_shade_of_aran.cpp:51
uint32 SecondarySpellTimer
Definition: boss_shade_of_aran.cpp:127
uint32 ArcaneCooldown
Definition: boss_shade_of_aran.cpp:142
Definition: boss_shade_of_aran.cpp:72
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: UnitAI.h:35
Unit * GetVictim() const
Definition: Unit.h:1379
Definition: Object.h:56
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
Definition: boss_shade_of_aran.cpp:36
Definition: boss_shade_of_aran.cpp:38
void FlameWreathEffect()
Definition: boss_shade_of_aran.cpp:182
uint32_t uint32
Definition: Define.h:150
uint32 NormalCastTimer
Definition: boss_shade_of_aran.cpp:128
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
Definition: boss_shade_of_aran.cpp:56
Definition: boss_shade_of_aran.cpp:79
void Clear()
Definition: ObjectGuid.h:215
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
Definition: boss_shade_of_aran.cpp:59
void SetPower(Powers power, int32 val)
Definition: Unit.cpp:11607
Definition: karazhan.h:48
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: boss_shade_of_aran.cpp:41
Definition: boss_shade_of_aran.cpp:55
InstanceScript * instance
Definition: boss_shade_of_aran.cpp:125
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
uint32 rand32()
Definition: Random.cpp:64
Definition: boss_shade_of_aran.cpp:48
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:12772
uint8_t uint8
Definition: Define.h:152
uint32 CloseDoorTimer
Definition: boss_shade_of_aran.cpp:131
int32 GetMaxPower(Powers power) const
Definition: Unit.cpp:11598
Definition: boss_shade_of_aran.cpp:39
uint32 CurrentNormalSpell
Definition: boss_shade_of_aran.cpp:141
uint32 FlameWreathCheckTime
Definition: boss_shade_of_aran.cpp:136
uint32 SuperCastTimer
Definition: boss_shade_of_aran.cpp:129
uint32 FlameWreathTimer
Definition: boss_shade_of_aran.cpp:135
uint8 LastSuperSpell
Definition: boss_shade_of_aran.cpp:133
uint32 BerserkTimer
Definition: boss_shade_of_aran.cpp:130
float FWTargPosX[3]
Definition: boss_shade_of_aran.cpp:138
Definition: Unit.h:1305
Definition: boss_shade_of_aran.cpp:35
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
uint32 DrinkInterruptTimer
Definition: boss_shade_of_aran.cpp:146
Definition: boss_shade_of_aran.cpp:70
Definition: boss_shade_of_aran.cpp:49
Definition: boss_shade_of_aran.cpp:54
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
bool ElementalsSpawned
Definition: boss_shade_of_aran.cpp:148
Definition: SharedDefines.h:248
uint32 FireCooldown
Definition: boss_shade_of_aran.cpp:143

+ Here is the call graph for this function:

Member Data Documentation

uint32 boss_shade_of_aran::boss_aranAI::ArcaneCooldown
uint32 boss_shade_of_aran::boss_aranAI::BerserkTimer
uint32 boss_shade_of_aran::boss_aranAI::CloseDoorTimer
uint32 boss_shade_of_aran::boss_aranAI::CurrentNormalSpell
bool boss_shade_of_aran::boss_aranAI::Drinking
uint32 boss_shade_of_aran::boss_aranAI::DrinkInterruptTimer
bool boss_shade_of_aran::boss_aranAI::DrinkInturrupted
bool boss_shade_of_aran::boss_aranAI::ElementalsSpawned
uint32 boss_shade_of_aran::boss_aranAI::FireCooldown
uint32 boss_shade_of_aran::boss_aranAI::FlameWreathCheckTime
ObjectGuid boss_shade_of_aran::boss_aranAI::FlameWreathTarget[3]
uint32 boss_shade_of_aran::boss_aranAI::FlameWreathTimer
uint32 boss_shade_of_aran::boss_aranAI::FrostCooldown
float boss_shade_of_aran::boss_aranAI::FWTargPosX[3]
float boss_shade_of_aran::boss_aranAI::FWTargPosY[3]
InstanceScript* boss_shade_of_aran::boss_aranAI::instance
uint8 boss_shade_of_aran::boss_aranAI::LastSuperSpell
uint32 boss_shade_of_aran::boss_aranAI::NormalCastTimer
uint32 boss_shade_of_aran::boss_aranAI::SecondarySpellTimer
uint32 boss_shade_of_aran::boss_aranAI::SuperCastTimer

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