AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_shade_of_aran::boss_aranAI Struct Reference
Inheritance diagram for boss_shade_of_aran::boss_aranAI:
BossAI ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_aranAI (Creature *creature)
 
void Reset () override
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void FlameWreathEffect ()
 
void UpdateAI (uint32 diff) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
void SpellHit (Unit *, SpellInfo const *Spell) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent.
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
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 DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
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 const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, 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
 
virtual bool CheckEvadeIfOutOfCombatArea () 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
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
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.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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 (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 
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 sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

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 BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
bool _ProccessHealthCheckEvent (uint8 healthPct, uint32 damage, std::function< void()> exec) const
 
void TeleportCheaters ()
 
- 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)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_aranAI()

boss_shade_of_aran::boss_aranAI::boss_aranAI ( Creature creature)
inline
80 : BossAI(creature, DATA_ARAN)
81 {
82 }
@ DATA_ARAN
Definition: karazhan.h:36
Definition: ScriptedCreature.h:456

Member Function Documentation

◆ DamageTaken()

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

Reimplemented from BossAI.

524 {
525 if (!DrinkInturrupted && Drinking && damage)
526 DrinkInturrupted = true;
527 }
bool DrinkInturrupted
Definition: boss_shade_of_aran.cpp:107
bool Drinking
Definition: boss_shade_of_aran.cpp:106

References Drinking, and DrinkInturrupted.

◆ FlameWreathEffect()

void boss_shade_of_aran::boss_aranAI::FlameWreathEffect ( )
inline
163 {
164 std::vector<Unit*> targets;
166
167 if (t_list.empty())
168 return;
169
170 //store the threat list in a different container
171 for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
172 {
173 Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
174 //only on alive players
175 if (target && target->IsAlive() && target->GetTypeId() == TYPEID_PLAYER)
176 targets.push_back(target);
177 }
178
179 //cut down to size if we have more than 3 targets
180 while (targets.size() > 3)
181 targets.erase(targets.begin() + rand() % targets.size());
182
183 uint32 i = 0;
184 for (std::vector<Unit*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
185 {
186 if (*itr)
187 {
188 FlameWreathTarget[i] = (*itr)->GetGUID();
189 FWTargPosX[i] = (*itr)->GetPositionX();
190 FWTargPosY[i] = (*itr)->GetPositionY();
191 DoCast((*itr), SPELL_FLAME_WREATH, true);
192 ++i;
193 }
194 }
195 }
std::uint32_t uint32
Definition: Define.h:108
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ SPELL_FLAME_WREATH
Definition: boss_shade_of_aran.cpp:43
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:204
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:178
Creature * me
Definition: ScriptedCreature.h:282
std::list< HostileReference * > StorageType
Definition: ThreatMgr.h:148
ThreatContainer::StorageType const & GetThreatList() const
Definition: ThreatMgr.h:274
TypeID GetTypeId() const
Definition: Object.h:121
Definition: Unit.h:1290
bool IsAlive() const
Definition: Unit.h:1808
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2145
float FWTargPosY[3]
Definition: boss_shade_of_aran.cpp:96
ObjectGuid FlameWreathTarget[3]
Definition: boss_shade_of_aran.cpp:94
float FWTargPosX[3]
Definition: boss_shade_of_aran.cpp:95

References UnitAI::DoCast(), FlameWreathTarget, FWTargPosX, FWTargPosY, ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), Object::GetTypeId(), ObjectAccessor::GetUnit(), Unit::IsAlive(), ScriptedAI::me, SPELL_FLAME_WREATH, and TYPEID_PLAYER.

Referenced by UpdateAI().

◆ JustDied()

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

Reimplemented from BossAI.

146 {
148
151 }
@ DONE
Definition: InstanceScript.h:59
@ SAY_DEATH
Definition: boss_shade_of_aran.cpp:34
@ DATA_GO_LIBRARY_DOOR
Definition: karazhan.h:52
Talk
Definition: boss_fathomlord_karathress.cpp:23
InstanceScript *const instance
Definition: ScriptedCreature.h:461
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:109
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References DATA_ARAN, DATA_GO_LIBRARY_DOOR, DONE, InstanceScript::GetGuidData(), InstanceScript::HandleGameObject(), BossAI::instance, SAY_DEATH, and ZoneScript::SetData().

◆ JustEngagedWith()

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

Called for reaction when initially engaged.

Reimplemented from BossAI.

154 {
156
160 }
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ SAY_AGGRO
Definition: boss_shade_of_aran.cpp:26
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:95

References DATA_ARAN, DATA_GO_LIBRARY_DOOR, CreatureAI::DoZoneInCombat(), InstanceScript::GetGuidData(), InstanceScript::HandleGameObject(), IN_PROGRESS, BossAI::instance, SAY_AGGRO, and ZoneScript::SetData().

◆ KilledUnit()

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

Reimplemented from ScriptedAI.

141 {
142 Talk(SAY_KILL);
143 }
@ SAY_KILL
Definition: boss_shade_of_aran.cpp:32

References SAY_KILL.

◆ Reset()

void boss_shade_of_aran::boss_aranAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

109 {
110 SecondarySpellTimer = 5000;
111 NormalCastTimer = 0;
112 SuperCastTimer = 35000;
113 BerserkTimer = 720000;
114 CloseDoorTimer = 15000;
115
116 LastSuperSpell = rand() % 3;
117
120
121 for (uint8 i = 0; i < 3; ++i)
122 FlameWreathTarget[i].Clear();
123
125 ArcaneCooldown = 0;
126 FireCooldown = 0;
127 FrostCooldown = 0;
128
129 DrinkInterruptTimer = 10000;
130
131 ElementalsSpawned = false;
132 Drinking = false;
133 DrinkInturrupted = false;
134
135 // Not in progress
138 }
std::uint8_t uint8
Definition: Define.h:110
@ NOT_STARTED
Definition: InstanceScript.h:56
bool ElementalsSpawned
Definition: boss_shade_of_aran.cpp:105
uint32 FlameWreathTimer
Definition: boss_shade_of_aran.cpp:92
uint32 BerserkTimer
Definition: boss_shade_of_aran.cpp:87
uint32 ArcaneCooldown
Definition: boss_shade_of_aran.cpp:99
uint32 CloseDoorTimer
Definition: boss_shade_of_aran.cpp:88
uint32 FireCooldown
Definition: boss_shade_of_aran.cpp:100
uint32 CurrentNormalSpell
Definition: boss_shade_of_aran.cpp:98
uint32 DrinkInterruptTimer
Definition: boss_shade_of_aran.cpp:103
uint32 FlameWreathCheckTime
Definition: boss_shade_of_aran.cpp:93
uint32 SuperCastTimer
Definition: boss_shade_of_aran.cpp:86
uint32 NormalCastTimer
Definition: boss_shade_of_aran.cpp:85
uint8 LastSuperSpell
Definition: boss_shade_of_aran.cpp:90
uint32 SecondarySpellTimer
Definition: boss_shade_of_aran.cpp:84
uint32 FrostCooldown
Definition: boss_shade_of_aran.cpp:101

References ArcaneCooldown, BerserkTimer, CloseDoorTimer, CurrentNormalSpell, DATA_ARAN, DATA_GO_LIBRARY_DOOR, Drinking, DrinkInterruptTimer, DrinkInturrupted, ElementalsSpawned, FireCooldown, FlameWreathCheckTime, FlameWreathTarget, FlameWreathTimer, FrostCooldown, InstanceScript::GetGuidData(), InstanceScript::HandleGameObject(), BossAI::instance, LastSuperSpell, NormalCastTimer, NOT_STARTED, SecondarySpellTimer, ZoneScript::SetData(), and SuperCastTimer.

◆ SpellHit()

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

Reimplemented from ScriptedAI.

530 {
531 //We only care about interrupt effects and only if they are durring a spell currently being cast
532 if ((Spell->Effects[0].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
533 Spell->Effects[1].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
534 Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCast(false))
535 return;
536
537 //Interrupt effect
539
540 //Normally we would set the cooldown equal to the spell duration
541 //but we do not have access to the DurationStore
542
543 switch (CurrentNormalSpell)
544 {
545 case SPELL_ARCMISSLE:
546 ArcaneCooldown = 5000;
547 break;
548 case SPELL_FIREBALL:
549 FireCooldown = 5000;
550 break;
551 case SPELL_FROSTBOLT:
552 FrostCooldown = 5000;
553 break;
554 }
555 }
@ SPELL_FROSTBOLT
Definition: boss_shade_of_aran.cpp:37
@ SPELL_ARCMISSLE
Definition: boss_shade_of_aran.cpp:39
@ SPELL_FIREBALL
Definition: boss_shade_of_aran.cpp:38
@ SPELL_EFFECT_INTERRUPT_CAST
Definition: SharedDefines.h:818
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4069
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:4039
Definition: Spell.h:284

References ArcaneCooldown, CurrentNormalSpell, FireCooldown, FrostCooldown, Unit::InterruptNonMeleeSpells(), Unit::IsNonMeleeSpellCast(), ScriptedAI::me, SPELL_ARCMISSLE, SPELL_EFFECT_INTERRUPT_CAST, SPELL_FIREBALL, and SPELL_FROSTBOLT.

◆ UpdateAI()

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

Reimplemented from BossAI.

198 {
199 if (!UpdateVictim())
200 return;
201
202 if (CloseDoorTimer)
203 {
204 if (CloseDoorTimer <= diff)
205 {
207 CloseDoorTimer = 0;
208 }
209 else
210 CloseDoorTimer -= diff;
211 }
212
213 //Cooldowns for casts
214 if (ArcaneCooldown)
215 {
216 if (ArcaneCooldown >= diff)
217 ArcaneCooldown -= diff;
218 else
219 ArcaneCooldown = 0;
220 }
221
222 if (FireCooldown)
223 {
224 if (FireCooldown >= diff)
225 FireCooldown -= diff;
226 else
227 FireCooldown = 0;
228 }
229
230 if (FrostCooldown)
231 {
232 if (FrostCooldown >= diff)
233 FrostCooldown -= diff;
234 else
235 FrostCooldown = 0;
236 }
237
239 {
240 Drinking = true;
242
244
245 if (!DrinkInturrupted)
246 {
247 DoCast(me, SPELL_MASS_POLY, true);
248 DoCast(me, SPELL_CONJURE, false);
249 DoCast(me, SPELL_DRINK, false);
251 DrinkInterruptTimer = 10000;
252 }
253 }
254
255 //Drink Interrupt
257 {
258 Drinking = false;
262 DoCast(me, SPELL_POTION, false);
263 }
264
265 //Drink Interrupt Timer
267 {
268 if (DrinkInterruptTimer >= diff)
269 DrinkInterruptTimer -= diff;
270 else
271 {
273 DoCast(me, SPELL_POTION, true);
275 DrinkInturrupted = true;
276 Drinking = false;
277 }
278 }
279
280 //Don't execute any more code if we are drinking
281 if (Drinking)
282 return;
283
284 //Normal casts
285 if (NormalCastTimer <= diff)
286 {
287 if (!me->IsNonMeleeSpellCast(false))
288 {
289 Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true);
290 if (!target)
291 return;
292
293 uint32 Spells[3];
294 uint8 AvailableSpells = 0;
295
296 //Check for what spells are not on cooldown
297 if (!ArcaneCooldown)
298 {
299 Spells[AvailableSpells] = SPELL_ARCMISSLE;
300 ++AvailableSpells;
301 }
302 if (!FireCooldown)
303 {
304 Spells[AvailableSpells] = SPELL_FIREBALL;
305 ++AvailableSpells;
306 }
307 if (!FrostCooldown)
308 {
309 Spells[AvailableSpells] = SPELL_FROSTBOLT;
310 ++AvailableSpells;
311 }
312
313 //If no available spells wait 1 second and try again
314 if (AvailableSpells)
315 {
316 CurrentNormalSpell = Spells[rand() % AvailableSpells];
317 DoCast(target, CurrentNormalSpell);
318 }
319 }
320 NormalCastTimer = 1000;
321 }
322 else
323 NormalCastTimer -= diff;
324
325 if (SecondarySpellTimer <= diff)
326 {
327 switch (urand(0, 1))
328 {
329 case 0:
331 break;
332 case 1:
333 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
334 DoCast(target, SPELL_CHAINSOFICE);
335 break;
336 }
337 SecondarySpellTimer = urand(5000, 20000);
338 }
339 else
340 SecondarySpellTimer -= diff;
341
342 if (SuperCastTimer <= diff)
343 {
344 uint8 Available[2];
345
346 switch (LastSuperSpell)
347 {
348 case SUPER_AE:
349 Available[0] = SUPER_FLAME;
350 Available[1] = SUPER_BLIZZARD;
351 break;
352 case SUPER_FLAME:
353 Available[0] = SUPER_AE;
354 Available[1] = SUPER_BLIZZARD;
355 break;
356 case SUPER_BLIZZARD:
357 Available[0] = SUPER_FLAME;
358 Available[1] = SUPER_AE;
359 break;
360 }
361
362 LastSuperSpell = Available[urand(0, 1)];
363
364 switch (LastSuperSpell)
365 {
366 case SUPER_AE:
368
370 DoCast(me, SPELL_PLAYERPULL, true);
371 DoCast(me, SPELL_MASSSLOW, true);
372 DoCast(me, SPELL_AEXPLOSION, false);
373 break;
374
375 case SUPER_FLAME:
377
378 FlameWreathTimer = 20000;
380
384
386 break;
387
388 case SUPER_BLIZZARD:
390
391 if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
392 {
393 pSpawn->SetFaction(me->GetFaction());
394 pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
395 }
396 break;
397 }
398
399 SuperCastTimer = urand(35000, 40000);
400 }
401 else
402 SuperCastTimer -= diff;
403
405 {
406 ElementalsSpawned = true;
407
408 Creature* ElementalOne = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11168.1f, -1939.29f, 232.092f, 1.46f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
409 Creature* ElementalTwo = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11138.2f, -1915.38f, 232.092f, 3.00f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
410 Creature* ElementalThree = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11161.7f, -1885.36f, 232.092f, 4.59f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
411 Creature* ElementalFour = me->SummonCreature(CREATURE_WATER_ELEMENTAL, -11192.4f, -1909.36f, 232.092f, 6.19f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
412
413 if (ElementalOne)
414 {
415 Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100, true);
416 if (!target)
417 return;
418
419 DoStartNoMovement(target);
420 ElementalOne->SetInCombatWithZone();
421 ElementalOne->CombatStart(target);
422 ElementalOne->SetFaction(me->GetFaction());
425 }
426
427 if (ElementalTwo)
428 {
429 Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100, true);
430 if (!target)
431 return;
432
433 DoStartNoMovement(target);
434 ElementalTwo->SetInCombatWithZone();
435 ElementalTwo->CombatStart(target);
436 ElementalTwo->SetFaction(me->GetFaction());
439 }
440
441 if (ElementalThree)
442 {
443 Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100, true);
444 if (!target)
445 return;
446
447 DoStartNoMovement(target);
448 ElementalThree->SetInCombatWithZone();
449 ElementalThree->CombatStart(target);
450 ElementalThree->SetFaction(me->GetFaction());
453 }
454
455 if (ElementalFour)
456 {
457 Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100, true);
458 if (!target)
459 return;
460
461 DoStartNoMovement(target);
462 ElementalFour->SetInCombatWithZone();
463 ElementalFour->CombatStart(target);
464 ElementalFour->SetFaction(me->GetFaction());
467 }
468
470 }
471
472 if (BerserkTimer <= diff)
473 {
474 for (uint32 i = 0; i < 5; ++i)
475 {
477 {
478 unit->Attack(me->GetVictim(), true);
479 unit->SetFaction(me->GetFaction());
480 }
481 }
482
484
485 BerserkTimer = 60000;
486 }
487 else
488 BerserkTimer -= diff;
489
490 //Flame Wreath check
492 {
493 if (FlameWreathTimer >= diff)
494 FlameWreathTimer -= diff;
495 else
497
498 if (FlameWreathCheckTime <= diff)
499 {
500 for (uint8 i = 0; i < 3; ++i)
501 {
502 if (!FlameWreathTarget[i])
503 continue;
504
506 if (unit && !unit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
507 {
508 unit->CastSpell(unit, 20476, true, 0, 0, me->GetGUID());
509 unit->CastSpell(unit, 11027, true);
511 }
512 }
514 }
515 else
516 FlameWreathCheckTime -= diff;
517 }
518
521 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
Spells
Definition: BattlegroundIC.h:711
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: Object.h:45
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition: Object.h:43
@ MOVEMENTFLAG_ROOT
Definition: Unit.h:563
@ UNIT_MOD_RESISTANCE_FROST
Definition: Unit.h:279
@ UNIT_STAND_STATE_STAND
Definition: Unit.h:53
@ UNIT_STAND_STATE_SIT
Definition: Unit.h:54
@ BASE_VALUE
Definition: Unit.h:245
@ SUPER_AE
Definition: boss_shade_of_aran.cpp:70
@ SUPER_FLAME
Definition: boss_shade_of_aran.cpp:68
@ SUPER_BLIZZARD
Definition: boss_shade_of_aran.cpp:69
@ SPELL_CHAINSOFICE
Definition: boss_shade_of_aran.cpp:40
@ SPELL_DRINK
Definition: boss_shade_of_aran.cpp:51
@ SPELL_PLAYERPULL
Definition: boss_shade_of_aran.cpp:45
@ SPELL_AOE_CS
Definition: boss_shade_of_aran.cpp:44
@ CREATURE_ARAN_BLIZZARD
Definition: boss_shade_of_aran.cpp:63
@ CREATURE_SHADOW_OF_ARAN
Definition: boss_shade_of_aran.cpp:62
@ SAY_ELEMENTALS
Definition: boss_shade_of_aran.cpp:31
@ SPELL_MASSSLOW
Definition: boss_shade_of_aran.cpp:42
@ SPELL_CONJURE
Definition: boss_shade_of_aran.cpp:50
@ SPELL_AOE_PYROBLAST
Definition: boss_shade_of_aran.cpp:53
@ SAY_FLAMEWREATH
Definition: boss_shade_of_aran.cpp:27
@ SPELL_BLINK_CENTER
Definition: boss_shade_of_aran.cpp:48
@ SPELL_AEXPLOSION
Definition: boss_shade_of_aran.cpp:46
@ CREATURE_WATER_ELEMENTAL
Definition: boss_shade_of_aran.cpp:61
@ SAY_TIMEOVER
Definition: boss_shade_of_aran.cpp:33
@ SAY_BLIZZARD
Definition: boss_shade_of_aran.cpp:28
@ SPELL_MASS_POLY
Definition: boss_shade_of_aran.cpp:47
@ SAY_DRINK
Definition: boss_shade_of_aran.cpp:30
@ SPELL_POTION
Definition: boss_shade_of_aran.cpp:52
@ SPELL_CIRCULAR_BLIZZARD
Definition: boss_shade_of_aran.cpp:56
@ SAY_EXPLOSION
Definition: boss_shade_of_aran.cpp:29
@ POWER_MANA
Definition: SharedDefines.h:241
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void DoStartNoMovement(Unit *target)
Definition: ScriptedCreature.cpp:229
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:356
Definition: Creature.h:46
void SetInCombatWithZone()
Definition: Creature.cpp:2723
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
bool IsWithinDist2d(float x, float y, float dist) const
Definition: Object.cpp:1305
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2318
void Clear()
Definition: ObjectGuid.h:140
void SetFaction(uint32 faction)
Definition: Unit.cpp:10029
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15458
void SetUnitMovementFlags(uint32 f)
Definition: Unit.h:2276
void CombatStart(Unit *target, bool initialAggro=true)
Definition: Unit.cpp:13536
uint32 GetFaction() const
Definition: Unit.h:1495
uint32 GetMaxPower(Powers power) const
Definition: Unit.h:1462
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4835
Unit * GetVictim() const
Definition: Unit.h:1386
void SetModifierValue(UnitMods unitMod, UnitModifierType modifierType, float value)
Definition: Unit.h:2098
uint32 GetPower(Powers power) const
Definition: Unit.h:1461
void SetStandState(uint8 state)
Definition: Unit.cpp:16900
void FlameWreathEffect()
Definition: boss_shade_of_aran.cpp:162

References ArcaneCooldown, BASE_VALUE, BerserkTimer, Unit::CastSpell(), ObjectGuid::Clear(), CloseDoorTimer, Unit::CombatStart(), CREATURE_ARAN_BLIZZARD, CREATURE_SHADOW_OF_ARAN, CREATURE_WATER_ELEMENTAL, CurrentNormalSpell, DATA_GO_LIBRARY_DOOR, UnitAI::DoCast(), UnitAI::DoMeleeAttackIfReady(), ScriptedAI::DoStartNoMovement(), Drinking, DrinkInterruptTimer, DrinkInturrupted, ElementalsSpawned, FireCooldown, FlameWreathCheckTime, FlameWreathEffect(), FlameWreathTarget, FlameWreathTimer, FrostCooldown, FWTargPosX, FWTargPosY, Unit::GetFaction(), Object::GetGUID(), InstanceScript::GetGuidData(), Unit::GetMaxPower(), Unit::GetPower(), ObjectAccessor::GetUnit(), Unit::GetVictim(), InstanceScript::HandleGameObject(), ScriptedAI::HealthBelowPct(), BossAI::instance, Unit::InterruptNonMeleeSpells(), Unit::IsNonMeleeSpellCast(), WorldObject::IsWithinDist2d(), LastSuperSpell, ScriptedAI::me, MOVEMENTFLAG_ROOT, NormalCastTimer, POWER_MANA, Unit::RemoveAurasDueToSpell(), SAY_BLIZZARD, SAY_DRINK, SAY_ELEMENTALS, SAY_EXPLOSION, SAY_FLAMEWREATH, SAY_TIMEOVER, SecondarySpellTimer, UnitAI::SelectTarget(), Unit::SetFaction(), Creature::SetInCombatWithZone(), Unit::SetModifierValue(), Unit::SetPower(), Unit::SetStandState(), Unit::SetUnitMovementFlags(), SPELL_AEXPLOSION, SPELL_AOE_CS, SPELL_AOE_PYROBLAST, SPELL_ARCMISSLE, SPELL_BLINK_CENTER, SPELL_CHAINSOFICE, SPELL_CIRCULAR_BLIZZARD, SPELL_CONJURE, SPELL_DRINK, SPELL_FIREBALL, SPELL_FROSTBOLT, SPELL_MASS_POLY, SPELL_MASSSLOW, SPELL_PLAYERPULL, SPELL_POTION, WorldObject::SummonCreature(), SUPER_AE, SUPER_BLIZZARD, SUPER_FLAME, SuperCastTimer, TEMPSUMMON_TIMED_DESPAWN, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, UNIT_MOD_RESISTANCE_FROST, UNIT_STAND_STATE_SIT, UNIT_STAND_STATE_STAND, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ ArcaneCooldown

uint32 boss_shade_of_aran::boss_aranAI::ArcaneCooldown

Referenced by Reset(), SpellHit(), and UpdateAI().

◆ BerserkTimer

uint32 boss_shade_of_aran::boss_aranAI::BerserkTimer

Referenced by Reset(), and UpdateAI().

◆ CloseDoorTimer

uint32 boss_shade_of_aran::boss_aranAI::CloseDoorTimer

Referenced by Reset(), and UpdateAI().

◆ CurrentNormalSpell

uint32 boss_shade_of_aran::boss_aranAI::CurrentNormalSpell

Referenced by Reset(), SpellHit(), and UpdateAI().

◆ Drinking

bool boss_shade_of_aran::boss_aranAI::Drinking

Referenced by DamageTaken(), Reset(), and UpdateAI().

◆ DrinkInterruptTimer

uint32 boss_shade_of_aran::boss_aranAI::DrinkInterruptTimer

Referenced by Reset(), and UpdateAI().

◆ DrinkInturrupted

bool boss_shade_of_aran::boss_aranAI::DrinkInturrupted

Referenced by DamageTaken(), Reset(), and UpdateAI().

◆ ElementalsSpawned

bool boss_shade_of_aran::boss_aranAI::ElementalsSpawned

Referenced by Reset(), and UpdateAI().

◆ FireCooldown

uint32 boss_shade_of_aran::boss_aranAI::FireCooldown

Referenced by Reset(), SpellHit(), and UpdateAI().

◆ FlameWreathCheckTime

uint32 boss_shade_of_aran::boss_aranAI::FlameWreathCheckTime

Referenced by Reset(), and UpdateAI().

◆ FlameWreathTarget

ObjectGuid boss_shade_of_aran::boss_aranAI::FlameWreathTarget[3]

Referenced by FlameWreathEffect(), Reset(), and UpdateAI().

◆ FlameWreathTimer

uint32 boss_shade_of_aran::boss_aranAI::FlameWreathTimer

Referenced by Reset(), and UpdateAI().

◆ FrostCooldown

uint32 boss_shade_of_aran::boss_aranAI::FrostCooldown

Referenced by Reset(), SpellHit(), and UpdateAI().

◆ FWTargPosX

float boss_shade_of_aran::boss_aranAI::FWTargPosX[3]

Referenced by FlameWreathEffect(), and UpdateAI().

◆ FWTargPosY

float boss_shade_of_aran::boss_aranAI::FWTargPosY[3]

Referenced by FlameWreathEffect(), and UpdateAI().

◆ LastSuperSpell

uint8 boss_shade_of_aran::boss_aranAI::LastSuperSpell

Referenced by Reset(), and UpdateAI().

◆ NormalCastTimer

uint32 boss_shade_of_aran::boss_aranAI::NormalCastTimer

Referenced by Reset(), and UpdateAI().

◆ SecondarySpellTimer

uint32 boss_shade_of_aran::boss_aranAI::SecondarySpellTimer

Referenced by Reset(), and UpdateAI().

◆ SuperCastTimer

uint32 boss_shade_of_aran::boss_aranAI::SuperCastTimer

Referenced by Reset(), and UpdateAI().