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

Public Member Functions

 boss_shade_of_aran (Creature *creature)
 
void Reset () override
 
bool CheckAranInRoom ()
 
void SetGUID (ObjectGuid guid, int32 id) override
 
void AttackStart (Unit *who) override
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *) override
 
void DamageTaken (Unit *doneBy, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 
void OnPowerUpdate (Powers, int32, int32, uint32 currentPower) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void UpdateAI (uint32 diff) 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.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
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 IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
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 OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
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
 

Private Attributes

TaskScheduler _drinkScheduler
 
uint32 _currentNormalSpell
 
uint32 _lastSuperSpell
 
bool _drinking
 
bool _hasDrunk
 
bool _atieshReaction
 

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 ()
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 
- 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
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_shade_of_aran()

boss_shade_of_aran::boss_shade_of_aran ( Creature creature)
inline
105: BossAI(creature, DATA_ARAN), _atieshReaction(false) { }
@ DATA_ARAN
Definition: karazhan.h:36
Definition: ScriptedCreature.h:469
bool _atieshReaction
Definition: boss_shade_of_aran.cpp:369

Member Function Documentation

◆ AttackStart()

void boss_shade_of_aran::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

156 {
157 if (who && who->isTargetableForAttack() && me->GetReactState() != REACT_PASSIVE)
158 {
159 if (me->Attack(who, false))
160 {
161 me->GetMotionMaster()->MoveChase(who, 45.0f, 0);
162 me->AddThreat(who, 0.0f);
163 }
164 }
165 }
@ REACT_PASSIVE
Definition: Unit.h:1035
Creature * me
Definition: ScriptedCreature.h:282
ReactStates GetReactState() const
Definition: Creature.h:91
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14639
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10280
bool isTargetableForAttack(bool checkFakeDeath=true, Unit const *byWho=nullptr) const
Definition: Unit.cpp:13842
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:300

References Unit::AddThreat(), Unit::Attack(), Unit::GetMotionMaster(), Creature::GetReactState(), Unit::isTargetableForAttack(), ScriptedAI::me, MotionMaster::MoveChase(), and REACT_PASSIVE.

◆ CheckAranInRoom()

bool boss_shade_of_aran::CheckAranInRoom ( )
inline
137 {
139 }
Position const roomCenter
Definition: boss_shade_of_aran.cpp:101
float GetDistance2d(WorldObject const *obj) const
Definition: Object.cpp:1263
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118

References WorldObject::GetDistance2d(), Position::GetPositionX(), Position::GetPositionY(), ScriptedAI::me, and roomCenter.

◆ DamageTaken()

void boss_shade_of_aran::DamageTaken ( Unit doneBy,
uint32 damage,
DamageEffectType  damagetype,
SpellSchoolMask  damageSchoolMask 
)
inlineoverridevirtual

Reimplemented from BossAI.

185 {
186 BossAI::DamageTaken(doneBy, damage, damagetype, damageSchoolMask);
187
188 if ((damagetype == DIRECT_DAMAGE || damagetype == SPELL_DIRECT_DAMAGE) && _drinking && me->GetReactState() == REACT_PASSIVE)
189 {
196 {
198 _drinking = false;
199 });
200 }
201 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1037
@ UNIT_STAND_STATE_STAND
Definition: Unit.h:53
@ DIRECT_DAMAGE
Definition: Unit.h:435
@ SPELL_DIRECT_DAMAGE
Definition: Unit.h:436
@ SPELL_DRINK
Definition: boss_shade_of_aran.cpp:63
@ SPELL_AOE_PYROBLAST
Definition: boss_shade_of_aran.cpp:65
@ GROUP_DRINKING
Definition: boss_shade_of_aran.cpp:93
@ POWER_MANA
Definition: SharedDefines.h:269
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:232
TaskScheduler & CancelGroup(group_t const group)
Definition: TaskScheduler.cpp:53
Definition: TaskScheduler.h:418
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:379
void DamageTaken(Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
Definition: ScriptedCreature.cpp:707
void SetReactState(ReactStates st)
Definition: Creature.h:90
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15552
uint32 GetMaxPower(Powers power) const
Definition: Unit.h:1476
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4855
void SetStandState(uint8 state)
Definition: Unit.cpp:16994
TaskScheduler _drinkScheduler
Definition: boss_shade_of_aran.cpp:362
bool _drinking
Definition: boss_shade_of_aran.cpp:367

References _drinking, _drinkScheduler, TaskScheduler::CancelGroup(), BossAI::DamageTaken(), DIRECT_DAMAGE, UnitAI::DoCastSelf(), Unit::GetMaxPower(), Creature::GetReactState(), GROUP_DRINKING, ScriptedAI::me, POWER_MANA, REACT_AGGRESSIVE, REACT_PASSIVE, Unit::RemoveAurasDueToSpell(), TaskScheduler::Schedule(), Unit::SetPower(), Creature::SetReactState(), Unit::SetStandState(), SPELL_AOE_PYROBLAST, SPELL_DIRECT_DAMAGE, SPELL_DRINK, and UNIT_STAND_STATE_STAND.

◆ JustDied()

void boss_shade_of_aran::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

173 {
175 _JustDied();
176
178 {
179 libraryDoor->SetGoState(GO_STATE_ACTIVE);
180 libraryDoor->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
181 }
182 }
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ SAY_DEATH
Definition: boss_shade_of_aran.cpp:40
@ DATA_GO_LIBRARY_DOOR
Definition: karazhan.h:51
Talk
Definition: boss_fathomlord_karathress.cpp:25
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
InstanceScript *const instance
Definition: ScriptedCreature.h:474
void _JustDied()
Definition: ScriptedCreature.cpp:620
Definition: GameObject.h:122
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94
Map * instance
Definition: InstanceScript.h:147
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3312

References BossAI::_JustDied(), DATA_GO_LIBRARY_DOOR, Map::GetGameObject(), InstanceScript::GetGuidData(), GO_FLAG_NOT_SELECTABLE, GO_STATE_ACTIVE, BossAI::instance, InstanceScript::instance, and SAY_DEATH.

◆ JustEngagedWith()

void boss_shade_of_aran::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from BossAI.

239 {
242
243 //handle timed closing door
244 scheduler.Schedule(15s, [this](TaskContext)
245 {
247 {
248 libraryDoor->SetGoState(GO_STATE_READY);
249 libraryDoor->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
250 }
251 }).Schedule(1s, [this](TaskContext context)
252 {
253 if (!_drinking)
254 {
255 if (me->IsNonMeleeSpellCast(false))
256 {
257 return;
258 }
259
260 std::list<uint32> normalSpells = { SPELL_ARCANE_MISSILE, SPELL_FIREBALL, SPELL_FROSTBOLT };
261 normalSpells.remove_if([&](uint32 spell) -> bool { return !me->CanCastSpell(spell); });
262
263 if (!normalSpells.empty())
264 {
265 // If we are able to cast spells, cast them.
266 _currentNormalSpell = Acore::Containers::SelectRandomContainerElement(normalSpells);
267
268 DoCastRandomTarget(_currentNormalSpell, 0, 100.0f);
269 if (me->GetVictim())
270 {
271 me->GetMotionMaster()->MoveChase(me->GetVictim(), 45.0f);
272 }
273 }
274 else
275 {
276 // Otherwise, chase in melee range for auto attacks (and drink mana potion, if needed).
277 me->SetWalk(false);
279
280 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(_currentNormalSpell))
281 {
282 if (int32(me->GetPower(POWER_MANA)) < spellInfo->CalcPowerCost(me, (SpellSchoolMask)spellInfo->SchoolMask))
283 {
284 DoCastSelf(SPELL_POTION);
285 }
286 }
287 }
288 }
289 context.Repeat(2s);
290 }).Schedule(5s, [this](TaskContext context)
291 {
292 if (!_drinking)
293 {
295 }
296 context.Repeat(5s, 20s);
297 }).Schedule(6s, [this](TaskContext context)
298 {
299 if (!_drinking)
300 {
302
304
305 std::vector<uint32> superSpells = { SPELL_SUMMON_BLIZZARD, SPELL_AEXPLOSION, SPELL_FLAME_WREATH };
306 _lastSuperSpell = Acore::Containers::SelectRandomContainerElementIf(superSpells, [&](uint32 superSpell) -> bool { return superSpell != _lastSuperSpell; });
307 switch (_lastSuperSpell)
308 {
309 case SPELL_AEXPLOSION:
314 break;
317 break;
320 break;
321 }
322
324 }
325 context.Repeat(35s, 40s);
326 }).Schedule(12min, [this](TaskContext context)
327 {
328 for (uint32 i = 0; i < 5; ++i)
329 {
330 if (Creature* unit = me->SummonCreature(NPC_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
331 {
332 unit->Attack(me->GetVictim(), true);
333 unit->SetFaction(me->GetFaction());
334 }
335 }
336
338
339 context.Repeat(1min);
340 });
341 }
std::uint32_t uint32
Definition: Define.h:108
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: Object.h:45
#define sSpellMgr
Definition: SpellMgr.h:825
@ NPC_SHADOW_OF_ARAN
Definition: boss_shade_of_aran.cpp:81
@ SPELL_CHAINSOFICE
Definition: boss_shade_of_aran.cpp:50
@ SPELL_PLAYERPULL
Definition: boss_shade_of_aran.cpp:58
@ SPELL_AOE_CS
Definition: boss_shade_of_aran.cpp:57
@ SPELL_FLAME_WREATH
Definition: boss_shade_of_aran.cpp:53
@ SPELL_MASSSLOW
Definition: boss_shade_of_aran.cpp:52
@ SPELL_BLINK_CENTER
Definition: boss_shade_of_aran.cpp:61
@ SPELL_AEXPLOSION
Definition: boss_shade_of_aran.cpp:59
@ SPELL_SUMMON_BLIZZARD
Definition: boss_shade_of_aran.cpp:72
@ EMOTE_ARCANE_EXPLOSION
Definition: boss_shade_of_aran.cpp:42
@ SAY_AGGRO
Definition: boss_shade_of_aran.cpp:32
@ SAY_FLAMEWREATH
Definition: boss_shade_of_aran.cpp:33
@ SAY_TIMEOVER
Definition: boss_shade_of_aran.cpp:39
@ SAY_BLIZZARD
Definition: boss_shade_of_aran.cpp:34
@ SAY_EXPLOSION
Definition: boss_shade_of_aran.cpp:35
auto SelectRandomContainerElementIf(C const &container, Predicate &&predicate) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:148
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition: TaskScheduler.h:488
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:248
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
Definition: UnitAI.cpp:256
TaskScheduler scheduler
Definition: CreatureAI.h:76
void _JustEngagedWith()
Definition: ScriptedCreature.cpp:633
Definition: Creature.h:46
void ClearProhibitedSpellTimers()
Definition: Creature.cpp:2765
bool SetWalk(bool enable) override
Definition: Creature.cpp:3098
void ResumeChasingVictim()
Helper to resume chasing current victim.
Definition: Creature.h:402
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:2343
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:4051
uint32 GetFaction() const
Definition: Unit.h:1509
Unit * GetVictim() const
Definition: Unit.h:1398
Definition: SpellInfo.h:314
uint32 _currentNormalSpell
Definition: boss_shade_of_aran.cpp:364
uint32 _lastSuperSpell
Definition: boss_shade_of_aran.cpp:365

References _currentNormalSpell, _drinking, BossAI::_JustEngagedWith(), DATA_GO_LIBRARY_DOOR, Map::GetGameObject(), InstanceScript::GetGuidData(), BossAI::instance, InstanceScript::instance, Unit::IsNonMeleeSpellCast(), ScriptedAI::me, Creature::ResumeChasingVictim(), SAY_AGGRO, TaskScheduler::Schedule(), CreatureAI::scheduler, Creature::SetWalk(), and sSpellMgr.

◆ KilledUnit()

void boss_shade_of_aran::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

168 {
169 Talk(SAY_KILL);
170 }
@ SAY_KILL
Definition: boss_shade_of_aran.cpp:38

References SAY_KILL.

◆ OnPowerUpdate()

void boss_shade_of_aran::OnPowerUpdate ( Powers  ,
int32  ,
int32  ,
uint32  currentPower 
)
inlineoverridevirtual

Reimplemented from UnitAI.

204 {
205 // Should drink at 10%, need 10% mana for mass polymorph
206 if (!_hasDrunk && me->GetMaxPower(POWER_MANA) && (currentPower * 100 / me->GetMaxPower(POWER_MANA)) < 13)
207 {
208 _drinking = true;
209 _hasDrunk = true;
214
215 // Start drinking after conjuring drinks
217 {
219 }).Schedule(2s, GROUP_DRINKING, [this](TaskContext)
220 {
222 }).Schedule(4s, GROUP_DRINKING, [this](TaskContext)
223 {
226 }).Schedule(10s, GROUP_DRINKING, [this](TaskContext)
227 {
233 _drinking = false;
234 });
235 }
236 }
@ UNIT_STAND_STATE_SIT
Definition: Unit.h:54
@ SPELL_CONJURE
Definition: boss_shade_of_aran.cpp:62
@ SPELL_MASS_POLY
Definition: boss_shade_of_aran.cpp:60
@ SPELL_ARCANE_MISSILE
Definition: boss_shade_of_aran.cpp:49
@ SAY_DRINK
Definition: boss_shade_of_aran.cpp:36
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4081
bool _hasDrunk
Definition: boss_shade_of_aran.cpp:368

References _drinking, _drinkScheduler, _hasDrunk, TaskScheduler::CancelGroup(), UnitAI::DoCastAOE(), UnitAI::DoCastSelf(), Unit::GetMaxPower(), GROUP_DRINKING, Unit::InterruptNonMeleeSpells(), ScriptedAI::me, POWER_MANA, REACT_AGGRESSIVE, REACT_PASSIVE, Unit::RemoveAurasDueToSpell(), SAY_DRINK, TaskScheduler::Schedule(), Unit::SetPower(), Creature::SetReactState(), Unit::SetStandState(), SPELL_AOE_PYROBLAST, SPELL_ARCANE_MISSILE, SPELL_CONJURE, SPELL_DRINK, SPELL_MASS_POLY, UNIT_STAND_STATE_SIT, and UNIT_STAND_STATE_STAND.

◆ Reset()

void boss_shade_of_aran::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

108 {
111 _lastSuperSpell = 0;
112
114
115 _drinking = false;
116 _hasDrunk = false;
117
119 {
120 libraryDoor->SetGoState(GO_STATE_ACTIVE);
121 libraryDoor->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
122 }
123
126
128
129 for (auto const& spell : elementalSpells)
130 {
131 DoCastAOE(spell, true);
132 }
133 });
134 }
@ SPELL_SUMMON_WELEMENTAL_2
Definition: boss_shade_of_aran.cpp:68
@ SPELL_SUMMON_WELEMENTAL_3
Definition: boss_shade_of_aran.cpp:69
@ SPELL_SUMMON_WELEMENTAL_4
Definition: boss_shade_of_aran.cpp:70
@ SPELL_SUMMON_WELEMENTAL_1
Definition: boss_shade_of_aran.cpp:67
@ SAY_ELEMENTALS
Definition: boss_shade_of_aran.cpp:37
TaskScheduler & CancelAll()
Definition: TaskScheduler.cpp:45
void ScheduleHealthCheckEvent(uint32 healthPct, std::function< void()> exec)
Executes a function once the creature reaches the defined health point percent.
Definition: ScriptedCreature.cpp:724
void Reset() override
Definition: ScriptedCreature.h:496

References _currentNormalSpell, _drinking, _drinkScheduler, _hasDrunk, _lastSuperSpell, TaskScheduler::CancelAll(), DATA_GO_LIBRARY_DOOR, UnitAI::DoCastAOE(), Map::GetGameObject(), InstanceScript::GetGuidData(), GO_FLAG_NOT_SELECTABLE, GO_STATE_ACTIVE, BossAI::instance, InstanceScript::instance, BossAI::Reset(), SAY_ELEMENTALS, BossAI::ScheduleHealthCheckEvent(), SPELL_SUMMON_WELEMENTAL_1, SPELL_SUMMON_WELEMENTAL_2, SPELL_SUMMON_WELEMENTAL_3, and SPELL_SUMMON_WELEMENTAL_4.

◆ SetGUID()

void boss_shade_of_aran::SetGUID ( ObjectGuid  guid,
int32  id 
)
inlineoverridevirtual

Reimplemented from UnitAI.

142 {
144 {
146 _atieshReaction = true;
147 if (Unit* atieshOwner = ObjectAccessor::GetUnit(*me, guid))
148 {
149 me->PauseMovement(3000);
150 me->SetFacingToObject(atieshOwner);
151 }
152 }
153 }
@ ACTION_ATIESH_REACT
Definition: boss_shade_of_aran.cpp:98
@ SAY_ATIESH
Definition: boss_shade_of_aran.cpp:41
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
Definition: Unit.h:1302
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20894
virtual void PauseMovement(uint32 timer=0, uint8 slot=0)
Definition: Unit.cpp:16937

References _atieshReaction, ACTION_ATIESH_REACT, ObjectAccessor::GetUnit(), ScriptedAI::me, Unit::PauseMovement(), SAY_ATIESH, and Unit::SetFacingToObject().

◆ UpdateAI()

void boss_shade_of_aran::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

344 {
345 scheduler.Update(diff);
347
348 if (!UpdateVictim())
349 return;
350
351 if (!CheckAranInRoom())
352 {
354 return;
355 }
356
357 if (!_drinking)
359 }
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:268
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:196
bool CheckAranInRoom()
Definition: boss_shade_of_aran.cpp:136

Member Data Documentation

◆ _atieshReaction

bool boss_shade_of_aran::_atieshReaction
private

Referenced by SetGUID().

◆ _currentNormalSpell

uint32 boss_shade_of_aran::_currentNormalSpell
private

Referenced by JustEngagedWith(), and Reset().

◆ _drinking

bool boss_shade_of_aran::_drinking
private

◆ _drinkScheduler

TaskScheduler boss_shade_of_aran::_drinkScheduler
private

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

◆ _hasDrunk

bool boss_shade_of_aran::_hasDrunk
private

Referenced by OnPowerUpdate(), and Reset().

◆ _lastSuperSpell

uint32 boss_shade_of_aran::_lastSuperSpell
private

Referenced by Reset().