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

Public Member Functions

 boss_kaelthas (Creature *creature)
 
void PrepareAdvisors ()
 
void SetRoomState (GOState state)
 
void Reset () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void KilledUnit (Unit *victim) override
 
void JustSummoned (Creature *summon) override
 
void SpellHit (Unit *caster, SpellInfo const *spell) override
 
void MovementInform (uint32 type, uint32 point) override
 
void ExecuteMiddleEvent ()
 
void IntroduceNewAdvisor (KTYells talkIntroduction, KTActions kaelAction)
 
void PhaseEnchantedWeaponsExecute ()
 
void PhaseAllAdvisorsExecute ()
 
void PhaseKaelExecute ()
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
bool CheckEvadeIfOutOfCombatArea () const override
 
void JustDied (Unit *killer) 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
 Called at any Damage from any attacker (before damage apply) More...
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent. More...
 
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. More...
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
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
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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 DoTeleportPlayer (Unit *unit, Position pos)
 
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)
 
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
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () 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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
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 JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
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 SummonedCreatureEvade (Creature *)
 
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
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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)
 To specify the caster as target if the spell is self-cast. More...
 
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, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
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)
 Called when a summon reaches a waypoint or point movement finished. More...
 
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

uint32 _phase
 
uint8 _advisorsAlive
 
bool _transitionSceneReached = false
 

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
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
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_kaelthas()

boss_kaelthas::boss_kaelthas ( Creature creature)
inline
222: BossAI(creature, DATA_KAELTHAS) { }
@ DATA_KAELTHAS
Definition: magisters_terrace.h:31
Definition: ScriptedCreature.h:467

Member Function Documentation

◆ AttackStart()

void boss_kaelthas::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

271 {
272 if (_phase == PHASE_FINAL /* check is scheduled&& events.GetNextEventTime(EVENT_GRAVITY_LAPSE_END) == 0*/)
274 }
@ PHASE_FINAL
Definition: boss_kaelthas.cpp:144
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
uint32 _phase
Definition: boss_kaelthas.cpp:720

References _phase, UnitAI::AttackStart(), and PHASE_FINAL.

Referenced by MovementInform().

◆ CheckEvadeIfOutOfCombatArea()

bool boss_kaelthas::CheckEvadeIfOutOfCombatArea ( ) const
inlineoverridevirtual

Reimplemented from ScriptedAI.

711 {
712 return me->GetHomePosition().GetExactDist2d(me) > 165.0f || !SelectTargetFromPlayerList(165.0f);
713 }
Creature * me
Definition: ScriptedCreature.h:280
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:571
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:338

◆ ExecuteMiddleEvent()

void boss_kaelthas::ExecuteMiddleEvent ( )
inline
418 {
422 me->SetTarget();
423 me->SetFacingTo(M_PI);
424 me->SetWalk(true);
426 ScheduleUniqueTimedEvent(2500ms, [&]
427 {
428 me->SetTarget();
431 }, EVENT_SCENE_2);
432 ScheduleUniqueTimedEvent(4000ms, [&]
433 {
434 me->SetTarget();
435 for (uint8 i = 0; i < 2; ++i)
437 trigger->CastSpell(me, SPELL_NETHERBEAM1 + i, false);
438 me->SetDisableGravity(true);
440 me->GetMotionMaster()->MoveTakeoff(POINT_AIR, me->GetPositionX(), me->GetPositionY(), 75.0f, 2.99, true); // AnimType Movement::ToFly does not exist for Kael
441 DoCastSelf(SPELL_GROW, true);
442 }, EVENT_SCENE_3);
443 ScheduleUniqueTimedEvent(7000ms, [&]
444 {
445 me->SetTarget();
446 DoCastSelf(SPELL_GROW, true);
449 for (uint8 i = 0; i < 2; ++i)
451 trigger->CastSpell(me, SPELL_NETHERBEAM1 + i, false);
452 }, EVENT_SCENE_4);
453 ScheduleUniqueTimedEvent(10000ms, [&]
454 {
455 me->SetTarget();
456 DoCastSelf(SPELL_GROW, true);
459 for (uint8 i = 0; i < 2; ++i)
461 trigger->CastSpell(me, SPELL_NETHERBEAM1 + i, false);
462 }, EVENT_SCENE_5);
463 ScheduleUniqueTimedEvent(14000ms, [&]
464 {
465 DoCastSelf(SPELL_GROW, true);
468 }, EVENT_SCENE_6);
469 ScheduleUniqueTimedEvent(17500ms, [&]
470 {
472 }, EVENT_SCENE_7);
473 ScheduleUniqueTimedEvent(19000ms, [&]
474 {
480 }, EVENT_SCENE_8);
481 ScheduleUniqueTimedEvent(22000ms, [&]
482 {
486 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
487 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM1, true);
488 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() - 5, me->GetPositionY(), me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
489 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM2, true);
490 }, EVENT_SCENE_9);
491 ScheduleUniqueTimedEvent(22800ms, [&]
492 {
493 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() - 5, me->GetPositionY() - 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
494 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM3, true);
495 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() + 5, me->GetPositionY() + 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
496 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM1, true);
497 }, EVENT_SCENE_10);
498 ScheduleUniqueTimedEvent(23600ms, [&]
499 {
500 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX(), me->GetPositionY() + 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
501 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM2, true);
502 }, EVENT_SCENE_11);
503 ScheduleUniqueTimedEvent(24500ms, [&]
504 {
505 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX(), me->GetPositionY() - 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
506 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM3, true);
507 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() + 5, me->GetPositionY() - 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
508 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM1, true);
509 }, EVENT_SCENE_12);
510 ScheduleUniqueTimedEvent(24800ms, [&]
511 {
512 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() - 5, me->GetPositionY() + 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
513 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM2, true);
514 }, EVENT_SCENE_13);
515 ScheduleUniqueTimedEvent(25300ms, [&]
516 {
517 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX()-5, me->GetPositionY()+5, me->GetPositionZ()+15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
518 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM3, true);
519 }, EVENT_SCENE_14);
520 ScheduleUniqueTimedEvent(30500ms, [&]
521 {
522 me->SetFacingTo(M_PI);
524 me->CastStop();
525 }, EVENT_SCENE_15);
526 ScheduleUniqueTimedEvent(30700ms, [&]
527 {
528 me->CastStop();
530 }, EVENT_SCENE_16);
531 ScheduleUniqueTimedEvent(32000ms, [&]
532 {
537 }, EVENT_SCENE_17);
538 ScheduleUniqueTimedEvent(36000ms, [&]
539 {
541 me->CastStop();
542 me->GetMotionMaster()->Clear();
544 me->SetDisableGravity(true);
547 }, EVENT_SCENE_18);
548 }
std::uint8_t uint8
Definition: Define.h:109
@ EVENT_SCENE_15
Definition: boss_kaelthas.cpp:186
@ EVENT_SCENE_11
Definition: boss_kaelthas.cpp:182
@ EVENT_SCENE_5
Definition: boss_kaelthas.cpp:176
@ EVENT_SCENE_4
Definition: boss_kaelthas.cpp:175
@ EVENT_SCENE_17
Definition: boss_kaelthas.cpp:188
@ EVENT_SCENE_2
Definition: boss_kaelthas.cpp:173
@ EVENT_SCENE_13
Definition: boss_kaelthas.cpp:184
@ EVENT_SCENE_3
Definition: boss_kaelthas.cpp:174
@ EVENT_SCENE_7
Definition: boss_kaelthas.cpp:178
@ EVENT_SCENE_9
Definition: boss_kaelthas.cpp:180
@ EVENT_SCENE_12
Definition: boss_kaelthas.cpp:183
@ EVENT_SCENE_18
Definition: boss_kaelthas.cpp:189
@ EVENT_SCENE_10
Definition: boss_kaelthas.cpp:181
@ EVENT_SCENE_16
Definition: boss_kaelthas.cpp:187
@ EVENT_SCENE_6
Definition: boss_kaelthas.cpp:177
@ EVENT_SCENE_8
Definition: boss_kaelthas.cpp:179
@ EVENT_SCENE_14
Definition: boss_kaelthas.cpp:185
@ SPELL_PURE_NETHER_BEAM4
Definition: boss_kaelthas.cpp:98
@ SPELL_PURE_NETHER_BEAM3
Definition: boss_kaelthas.cpp:97
@ SPELL_KAEL_EXPLODES1
Definition: boss_kaelthas.cpp:83
@ SPELL_PURE_NETHER_BEAM1
Definition: boss_kaelthas.cpp:95
@ SPELL_KAEL_FULL_POWER
Definition: boss_kaelthas.cpp:90
@ SPELL_NETHERBEAM_AURA2
Definition: boss_kaelthas.cpp:78
@ SPELL_ARCANE_EXPLOSION_VISUAL
Definition: boss_kaelthas.cpp:93
@ SPELL_DARK_BANISH_STATE
Definition: boss_kaelthas.cpp:92
@ SPELL_KAEL_PHASE_TWO
Definition: boss_kaelthas.cpp:116
@ SPELL_PURE_NETHER_BEAM5
Definition: boss_kaelthas.cpp:99
@ SPELL_NETHERBEAM_AURA3
Definition: boss_kaelthas.cpp:79
@ SPELL_PURE_NETHER_BEAM6
Definition: boss_kaelthas.cpp:100
@ SPELL_KAEL_EXPLODES2
Definition: boss_kaelthas.cpp:84
@ SPELL_KAEL_EXPLODES3
Definition: boss_kaelthas.cpp:85
@ SPELL_KAEL_EXPLODES5
Definition: boss_kaelthas.cpp:87
@ SPELL_GROW
Definition: boss_kaelthas.cpp:88
@ SPELL_KAEL_EXPLODES4
Definition: boss_kaelthas.cpp:86
@ SPELL_KAEL_GAINING_POWER
Definition: boss_kaelthas.cpp:82
@ SPELL_NETHERBEAM1
Definition: boss_kaelthas.cpp:80
@ SPELL_FLOATING_DROWNED
Definition: boss_kaelthas.cpp:91
@ SPELL_NETHERBEAM_AURA1
Definition: boss_kaelthas.cpp:77
@ SPELL_PURE_NETHER_BEAM2
Definition: boss_kaelthas.cpp:96
@ SAY_PHASE5_NUTS
Definition: boss_kaelthas.cpp:37
@ NPC_WORLD_TRIGGER
Definition: boss_kaelthas.cpp:155
@ POINT_AIR
Definition: boss_kaelthas.cpp:150
@ POINT_START_LAST_PHASE
Definition: boss_kaelthas.cpp:151
const Position triggersPos[6]
Definition: boss_kaelthas.cpp:210
Talk
Definition: hyjal.cpp:82
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
#define WORLD_TRIGGER
Definition: Unit.h:37
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
TaskScheduler & ClearValidator()
Clears the validator which is asked if tasks are allowed to be executed.
Definition: TaskScheduler.cpp:21
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:392
TaskScheduler scheduler
Definition: CreatureAI.h:75
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
void ScheduleUniqueTimedEvent(Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
Definition: ScriptedCreature.h:362
SummonList summons
Definition: ScriptedCreature.h:511
Definition: Creature.h:43
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3205
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition: Creature.cpp:3545
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition: Creature.cpp:3191
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:2366
float GetPositionZ() const
Definition: Position.h:118
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
void SetFacingTo(float ori)
Definition: Unit.cpp:20527
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void CastStop(uint32 except_spellid=0, bool withInstant=true)
Interrupt the unit cast for all the current spells.
Definition: Unit.cpp:1160
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16704
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:1167
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
void RemoveAllAttackers()
Remove all units in m_attackers list and send them AttackStop()
Definition: Unit.cpp:10484
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
void MoveTakeoff(uint32 id, Position const &pos, float speed=0.0f, bool skipAnimation=false)
Use to move the unit from the ground to the air. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:523
void SetRoomState(GOState state)
Definition: boss_kaelthas.cpp:239

References Unit::CastSpell(), Unit::CastStop(), TaskScheduler::ClearValidator(), SummonList::DespawnEntry(), UnitAI::DoCastSelf(), EVENT_SCENE_10, EVENT_SCENE_11, EVENT_SCENE_12, EVENT_SCENE_13, EVENT_SCENE_14, EVENT_SCENE_15, EVENT_SCENE_16, EVENT_SCENE_17, EVENT_SCENE_18, EVENT_SCENE_2, EVENT_SCENE_3, EVENT_SCENE_4, EVENT_SCENE_5, EVENT_SCENE_6, EVENT_SCENE_7, EVENT_SCENE_8, EVENT_SCENE_9, Creature::GetHomePosition(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_STATE_ACTIVE, ScriptedAI::me, MotionMaster::MoveTakeoff(), NPC_WORLD_TRIGGER, POINT_AIR, POINT_START_LAST_PHASE, Unit::RemoveAllAttackers(), Unit::RemoveAurasDueToSpell(), SAY_PHASE5_NUTS, CreatureAI::scheduler, ScriptedAI::ScheduleUniqueTimedEvent(), Unit::SendMovementFlagUpdate(), Creature::SetDisableGravity(), Unit::SetFacingTo(), SetRoomState(), Creature::SetTarget(), Unit::SetUnitFlag(), Creature::SetWalk(), SPELL_ARCANE_EXPLOSION_VISUAL, SPELL_DARK_BANISH_STATE, SPELL_FLOATING_DROWNED, SPELL_GROW, SPELL_KAEL_EXPLODES1, SPELL_KAEL_EXPLODES2, SPELL_KAEL_EXPLODES3, SPELL_KAEL_EXPLODES4, SPELL_KAEL_EXPLODES5, SPELL_KAEL_FULL_POWER, SPELL_KAEL_GAINING_POWER, SPELL_KAEL_PHASE_TWO, SPELL_NETHERBEAM1, SPELL_NETHERBEAM_AURA1, SPELL_NETHERBEAM_AURA2, SPELL_NETHERBEAM_AURA3, SPELL_PURE_NETHER_BEAM1, SPELL_PURE_NETHER_BEAM2, SPELL_PURE_NETHER_BEAM3, SPELL_PURE_NETHER_BEAM4, SPELL_PURE_NETHER_BEAM5, SPELL_PURE_NETHER_BEAM6, WorldObject::SummonCreature(), BossAI::summons, TEMPSUMMON_TIMED_DESPAWN, triggersPos, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, and WORLD_TRIGGER.

Referenced by MovementInform().

◆ IntroduceNewAdvisor()

void boss_kaelthas::IntroduceNewAdvisor ( KTYells  talkIntroduction,
KTActions  kaelAction 
)
inline
551 {
552 std::chrono::milliseconds attackStartTimer = 0ms;
553 EyeNPCs advisorNPCId = NPC_THALADRED;
554 scheduler.Schedule(2s, [this, talkIntroduction](TaskContext)
555 {
556 Talk(talkIntroduction);
557 });
558 //switch because talk times are different
559 switch (kaelAction)
560 {
562 attackStartTimer = 7000ms;
563 advisorNPCId = NPC_THALADRED;
564 break;
566 attackStartTimer = 14500ms;
567 advisorNPCId = NPC_LORD_SANGUINAR;
568 break;
570 attackStartTimer = 9000ms;
571 advisorNPCId = NPC_CAPERNIAN;
572 break;
574 attackStartTimer = 10400ms;
575 advisorNPCId = NPC_TELONICUS;
576 break;
577 default:
578 break;
579 }
580 scheduler.Schedule(attackStartTimer, [this, advisorNPCId](TaskContext)
581 {
582 if (Creature* advisor = summons.GetCreatureWithEntry(advisorNPCId))
583 {
584 advisor->SetReactState(REACT_AGGRESSIVE);
585 advisor->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
586 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
587 advisor->AI()->AttackStart(target);
588 advisor->SetInCombatWithZone();
589 advisor->AI()->Talk(SAY_ADVISOR_AGGRO);
590 }
591 });
592 }
EyeNPCs
Definition: the_eye.h:45
@ NPC_TELONICUS
Definition: the_eye.h:51
@ NPC_CAPERNIAN
Definition: the_eye.h:50
@ NPC_THALADRED
Definition: the_eye.h:48
@ NPC_LORD_SANGUINAR
Definition: the_eye.h:49
@ ACTION_START_THALADRED
Definition: boss_kaelthas.cpp:194
@ ACTION_START_SANGUINAR
Definition: boss_kaelthas.cpp:195
@ ACTION_START_CAPERNIAN
Definition: boss_kaelthas.cpp:196
@ ACTION_START_TELONICUS
Definition: boss_kaelthas.cpp:197
@ SAY_ADVISOR_AGGRO
Definition: boss_kaelthas.cpp:46
@ REACT_AGGRESSIVE
Definition: Unit.h:550
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:232
Definition: TaskScheduler.h:421
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
Creature * GetCreatureWithEntry(uint32 entry) const
Definition: ScriptedCreature.cpp:132
Definition: Unit.h:630

References ACTION_START_CAPERNIAN, ACTION_START_SANGUINAR, ACTION_START_TELONICUS, ACTION_START_THALADRED, SummonList::GetCreatureWithEntry(), NPC_CAPERNIAN, NPC_LORD_SANGUINAR, NPC_TELONICUS, NPC_THALADRED, REACT_AGGRESSIVE, SAY_ADVISOR_AGGRO, TaskScheduler::Schedule(), CreatureAI::scheduler, UnitAI::SelectTarget(), BossAI::summons, and UNIT_FLAG_NON_ATTACKABLE.

Referenced by MoveInLineOfSight(), and SpellHit().

◆ JustDied()

void boss_kaelthas::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from BossAI.

715 {
716 BossAI::JustDied(killer);
718 }
@ SPELL_REMOVE_ENCHANTED_WEAPONS
Definition: boss_kaelthas.cpp:112
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:248
void JustDied(Unit *) override
Definition: ScriptedCreature.h:499

References BossAI::JustDied(), and SPELL_REMOVE_ENCHANTED_WEAPONS.

◆ JustSummoned()

void boss_kaelthas::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

299 {
300 summons.Summon(summon);
301 if (summon->GetEntry() == NPC_NETHER_VAPOR)
302 summon->GetMotionMaster()->MoveRandom(20.0f);
305 }
@ NPC_NETHER_VAPOR
Definition: boss_kaelthas.cpp:156
@ NPC_NETHERSTRAND_LONGBOW
Definition: boss_kaelthas.cpp:157
@ NPC_STAFF_OF_DISINTEGRATION
Definition: boss_kaelthas.cpp:158
@ REACT_PASSIVE
Definition: Unit.h:548
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
uint32 GetEntry() const
Definition: Object.h:115
void MoveRandom(float wanderDistance=0.0f)
Enable a random movement in desired range around the unit. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:242

References Object::GetEntry(), Unit::GetMotionMaster(), MotionMaster::MoveRandom(), NPC_NETHER_VAPOR, NPC_NETHERSTRAND_LONGBOW, NPC_STAFF_OF_DISINTEGRATION, REACT_PASSIVE, Creature::SetReactState(), SummonList::Summon(), and BossAI::summons.

◆ KilledUnit()

void boss_kaelthas::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

293 {
294 if (victim->IsPlayer())
295 Talk(SAY_SLAY);
296 }
@ SAY_SLAY
Definition: boss_kaelthas.cpp:38
bool IsPlayer() const
Definition: Object.h:200

References Object::IsPlayer(), and SAY_SLAY.

◆ MoveInLineOfSight()

void boss_kaelthas::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

277 {
278 if (_phase == PHASE_NONE && who->IsPlayer() && me->IsValidAttackTarget(who))
279 {
286 {
289 }
290 }
@ EVENT_PREFIGHT_PHASE1_01
Definition: boss_kaelthas.cpp:163
@ SAY_INTRO_THALADRED
Definition: boss_kaelthas.cpp:32
@ SAY_INTRO
Definition: boss_kaelthas.cpp:29
@ PHASE_NONE
Definition: boss_kaelthas.cpp:139
@ PHASE_SINGLE_ADVISOR
Definition: boss_kaelthas.cpp:140
@ UNIT_FLAG_DISABLE_MOVE
Definition: UnitDefines.h:231
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811
bool IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell=nullptr) const
Definition: Unit.cpp:13871
void IntroduceNewAdvisor(KTYells talkIntroduction, KTActions kaelAction)
Definition: boss_kaelthas.cpp:550

References _phase, ACTION_START_THALADRED, UnitAI::DoCastAOE(), EVENT_PREFIGHT_PHASE1_01, IntroduceNewAdvisor(), Object::IsPlayer(), Unit::IsValidAttackTarget(), ScriptedAI::me, PHASE_NONE, PHASE_SINGLE_ADVISOR, SAY_INTRO, SAY_INTRO_THALADRED, ScriptedAI::ScheduleUniqueTimedEvent(), Creature::SetInCombatWithZone(), Unit::SetUnitFlag(), SPELL_REMOVE_ENCHANTED_WEAPONS, UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_NOT_SELECTABLE.

◆ MovementInform()

void boss_kaelthas::MovementInform ( uint32  type,
uint32  point 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

340 {
341 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
342 return;
343
344 if (point == POINT_MIDDLE)
345 {
347 }
348 else if (point == POINT_AIR)
349 {
350 me->SetDisableGravity(true, false, false); // updating AnimationTier will break drowning animation later
351 }
352 else if (point == POINT_START_LAST_PHASE)
353 {
354 me->SetDisableGravity(false);
355 me->SetWalk(false);
359 //re-set validator
360 scheduler.SetValidator([this]{
362 });
363 ScheduleTimedEvent(0ms, [&]
364 {
366 }, 2400ms, 7500ms);
367 ScheduleTimedEvent(10000ms, [&]
368 {
370 }, 30250ms, 50650ms);
371 ScheduleTimedEvent(50000ms, [&]
372 {
375 }, 61450ms, 96550ms);
376 ScheduleTimedEvent(5s, [&]
377 {
378 scheduler.DelayAll(30s);
383 {
385 context.Repeat(4s);
386 }).Schedule(0s, GROUP_SHOCK_BARRIER, [this](TaskContext context)
387 {
389 context.Repeat(10s);
390 }).Schedule(20500ms, GROUP_SHOCK_BARRIER, [this](TaskContext)
391 {
393 }).Schedule(32s, [this](TaskContext)
394 {
397
398 if (Unit* victim = me->GetVictim())
399 {
400 me->SetTarget(victim->GetGUID());
401 me->GetMotionMaster()->MoveChase(victim);
402 }
403 });
404 me->SetTarget();
406 me->StopMoving();
408 }, 90s);
409 if (me->GetVictim())
410 {
413 }
414 }
415 }
@ GROUP_NETHER_BEAM
Definition: boss_kaelthas.cpp:207
@ GROUP_SHOCK_BARRIER
Definition: boss_kaelthas.cpp:206
@ SPELL_PHOENIX
Definition: boss_kaelthas.cpp:69
@ SPELL_SHOCK_BARRIER
Definition: boss_kaelthas.cpp:71
@ SPELL_SUMMON_NETHER_VAPOR
Definition: boss_kaelthas.cpp:107
@ SPELL_NETHER_BEAM
Definition: boss_kaelthas.cpp:108
@ SPELL_FIREBALL
Definition: boss_kaelthas.cpp:67
@ SPELL_GRAVITY_LAPSE
Definition: boss_kaelthas.cpp:103
@ SPELL_FLAME_STRIKE
Definition: boss_kaelthas.cpp:73
@ SAY_GRAVITYLAPSE
Definition: boss_kaelthas.cpp:40
@ SAY_SUMMON_PHOENIX
Definition: boss_kaelthas.cpp:41
@ POINT_MIDDLE
Definition: boss_kaelthas.cpp:149
@ BASE_ATTACK
Definition: Unit.h:209
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:48
@ EFFECT_MOTION_TYPE
Definition: MotionMaster.h:56
TaskScheduler & DelayAll(std::chrono::duration< _Rep, _Period > const &duration)
Delays all tasks with the given duration.
Definition: TaskScheduler.h:283
TaskScheduler & CancelGroup(group_t const group)
Definition: TaskScheduler.cpp:53
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
Definition: TaskScheduler.h:197
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition: TaskScheduler.h:493
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
Cast the spell on a random unit from the threat list.
Definition: UnitAI.cpp:259
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
Definition: ScriptedCreature.cpp:321
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
void setAttackTimer(WeaponAttackType type, int32 time)
Definition: Unit.h:835
void StopMoving()
Definition: Unit.cpp:16650
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:313
void Clear(bool reset=true)
Definition: MotionMaster.h:167
void ExecuteMiddleEvent()
Definition: boss_kaelthas.cpp:417
void AttackStart(Unit *who) override
Definition: boss_kaelthas.cpp:270

References AttackStart(), BASE_ATTACK, TaskScheduler::CancelGroup(), MotionMaster::Clear(), TaskScheduler::DelayAll(), SummonList::DespawnEntry(), UnitAI::DoCastRandomTarget(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), EFFECT_MOTION_TYPE, ExecuteMiddleEvent(), Object::GetGUID(), Unit::GetMotionMaster(), Unit::GetVictim(), GROUP_NETHER_BEAM, GROUP_SHOCK_BARRIER, Unit::HasUnitState(), ScriptedAI::me, MotionMaster::MoveChase(), NPC_NETHER_VAPOR, POINT_AIR, POINT_MIDDLE, POINT_MOTION_TYPE, POINT_START_LAST_PHASE, REACT_AGGRESSIVE, Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), TaskContext::Repeat(), SAY_GRAVITYLAPSE, SAY_SUMMON_PHOENIX, TaskScheduler::Schedule(), CreatureAI::scheduler, ScriptedAI::ScheduleTimedEvent(), Unit::setAttackTimer(), Creature::SetDisableGravity(), Creature::SetReactState(), Creature::SetTarget(), TaskScheduler::SetValidator(), Creature::SetWalk(), SPELL_FIREBALL, SPELL_FLAME_STRIKE, SPELL_GRAVITY_LAPSE, SPELL_KAEL_FULL_POWER, SPELL_NETHER_BEAM, SPELL_PHOENIX, SPELL_SHOCK_BARRIER, SPELL_SUMMON_NETHER_VAPOR, Unit::StopMoving(), BossAI::summons, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, and UNIT_STATE_CASTING.

◆ PhaseAllAdvisorsExecute()

void boss_kaelthas::PhaseAllAdvisorsExecute ( )
inline
625 {
634 {
636 });
637 }
@ GROUP_PROGRESS_PHASE
Definition: boss_kaelthas.cpp:204
@ EVENT_PREFIGHT_PHASE6_02
Definition: boss_kaelthas.cpp:166
@ SPELL_RESURRECTION
Definition: boss_kaelthas.cpp:64
@ SAY_PHASE3_ADVANCE
Definition: boss_kaelthas.cpp:35
@ PHASE_TRANSITION
Definition: boss_kaelthas.cpp:142
@ PHASE_ALL_ADVISORS
Definition: boss_kaelthas.cpp:143
void PhaseKaelExecute()
Definition: boss_kaelthas.cpp:639

References EVENT_PREFIGHT_PHASE6_02, GROUP_PROGRESS_PHASE, PHASE_ALL_ADVISORS, PHASE_TRANSITION, SAY_PHASE3_ADVANCE, and SPELL_RESURRECTION.

Referenced by PhaseEnchantedWeaponsExecute().

◆ PhaseEnchantedWeaponsExecute()

void boss_kaelthas::PhaseEnchantedWeaponsExecute ( )
inline
595 {
601 {
603 });
607 {
608 if (Creature* summonedCreature = summon->ToCreature())
609 {
610 if (!summonedCreature->GetSpawnId())
611 {
612 summonedCreature->SetReactState(REACT_AGGRESSIVE);
613 summonedCreature->SetInCombatWithZone();
614 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
615 {
616 summonedCreature->AI()->AttackStart(target);
617 }
618 }
619 }
620 });
622 }
@ EVENT_PREFIGHT_PHASE5_02
Definition: boss_kaelthas.cpp:165
@ EVENT_PREFIGHT_PHASE5_01
Definition: boss_kaelthas.cpp:164
@ SPELL_SUMMON_WEAPONS
Definition: boss_kaelthas.cpp:54
@ SAY_PHASE2_WEAPON
Definition: boss_kaelthas.cpp:34
@ PHASE_WEAPONS
Definition: boss_kaelthas.cpp:141
void DoForAllSummons(std::function< void(WorldObject *)> exec)
Definition: ScriptedCreature.h:140
Creature * ToCreature()
Definition: Object.h:205
Definition: Object.h:410
void PhaseAllAdvisorsExecute()
Definition: boss_kaelthas.cpp:624

References _phase, UnitAI::DoCastSelf(), SummonList::DoForAllSummons(), EVENT_PREFIGHT_PHASE5_01, GROUP_PROGRESS_PHASE, PHASE_WEAPONS, PhaseAllAdvisorsExecute(), SAY_PHASE2_WEAPON, TaskScheduler::Schedule(), CreatureAI::scheduler, ScriptedAI::ScheduleUniqueTimedEvent(), SPELL_SUMMON_WEAPONS, BossAI::summons, and Object::ToCreature().

Referenced by SpellHit().

◆ PhaseKaelExecute()

void boss_kaelthas::PhaseKaelExecute ( )
inline
640 {
646 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
647 {
648 AttackStart(target);
649 }
652 {
655 me->AttackStop();
656 me->CastStop();
658 me->GetMotionMaster()->MovePoint(POINT_MIDDLE, me->GetHomePosition(), true, true);
659 }
660 });
661 ScheduleTimedEvent(1000ms, [&]
662 {
664 }, 2400ms, 7500ms);
665 ScheduleTimedEvent(15000ms, [&]
666 {
668 }, 30250ms, 50650ms);
669 ScheduleTimedEvent(50000ms, [&]
670 {
673 }, 35450ms, 41550ms);
674 ScheduleTimedEvent(20s, 23s, [&]
675 {
676 if (roll_chance_i(50))
679 scheduler.Schedule(3s, [this](TaskContext)
680 {
682 });
683 }, 23s, 26s);
684 ScheduleTimedEvent(60s, [&]
685 {
688 scheduler.DelayAll(10s);
689 scheduler.Schedule(0s, GROUP_PYROBLAST, [this](TaskContext context)
690 {
692 context.Repeat(4s);
693 }).Schedule(8500ms, GROUP_PYROBLAST, [this](TaskContext)
694 {
696 });
697 }, 50s);
698 }
bool roll_chance_i(int chance)
Definition: Random.h:59
@ GROUP_PYROBLAST
Definition: boss_kaelthas.cpp:205
@ SPELL_MIND_CONTROL
Definition: boss_kaelthas.cpp:70
@ SPELL_ARCANE_DISRUPTION
Definition: boss_kaelthas.cpp:68
@ SPELL_PYROBLAST
Definition: boss_kaelthas.cpp:72
@ SAY_PHASE4_INTRO2
Definition: boss_kaelthas.cpp:36
@ SAY_PYROBLAST
Definition: boss_kaelthas.cpp:43
@ SAY_MINDCONTROL
Definition: boss_kaelthas.cpp:39
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:117
TaskScheduler & CancelAll()
Definition: TaskScheduler.cpp:45
void DoResetThreatList()
Definition: ScriptedCreature.cpp:445
void ScheduleHealthCheckEvent(uint32 healthPct, std::function< void()> exec)
Executes a function once the creature reaches the defined health point percent.
Definition: ScriptedCreature.cpp:774
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1224
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition: Unit.cpp:10403
bool _transitionSceneReached
Definition: boss_kaelthas.cpp:722

References GROUP_PYROBLAST, PHASE_FINAL, POINT_MIDDLE, Random, REACT_PASSIVE, TaskContext::Repeat(), roll_chance_i(), SAY_MINDCONTROL, SAY_PHASE4_INTRO2, SAY_PYROBLAST, SAY_SUMMON_PHOENIX, SPELL_ARCANE_DISRUPTION, SPELL_FIREBALL, SPELL_FLAME_STRIKE, SPELL_MIND_CONTROL, SPELL_PHOENIX, SPELL_PYROBLAST, SPELL_SHOCK_BARRIER, SPELLVALUE_MAX_TARGETS, UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_NOT_SELECTABLE.

Referenced by SpellHit().

◆ PrepareAdvisors()

void boss_kaelthas::PrepareAdvisors ( )
inline
225 {
226 for (uint8 advisorData = DATA_THALADRED; advisorData <= DATA_TELONICUS; ++advisorData)
227 {
228 if (Creature* advisor = instance->GetCreature(advisorData))
229 {
230 advisor->Respawn(true);
231 advisor->StopMovingOnCurrentPos();
232 advisor->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
233 advisor->SetReactState(REACT_PASSIVE);
234 summons.Summon(advisor);
235 }
236 }
237 }
@ DATA_TELONICUS
Definition: the_eye.h:38
@ DATA_THALADRED
Definition: the_eye.h:35
InstanceScript *const instance
Definition: ScriptedCreature.h:474
Creature * GetCreature(uint32 type)
Definition: InstanceScript.cpp:103

References DATA_TELONICUS, DATA_THALADRED, InstanceScript::GetCreature(), BossAI::instance, REACT_PASSIVE, SummonList::Summon(), BossAI::summons, and UNIT_FLAG_NON_ATTACKABLE.

Referenced by Reset().

◆ Reset()

void boss_kaelthas::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

251 {
253 scheduler.Schedule(1s, [this](TaskContext)
254 {
256 });
257
260 _advisorsAlive = 4;
261
262 me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_HOVER, true); // hover effect 36550 - Floating Drowned
266 me->SetDisableGravity(false);
267 me->SetWalk(false);
268 }
@ IMMUNITY_STATE
Definition: SharedDefines.h:1395
@ SPELL_AURA_HOVER
Definition: SpellAuraDefines.h:169
@ GO_STATE_READY
Definition: GameObjectData.h:690
void Reset() override
Definition: ScriptedCreature.h:496
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13389
void PrepareAdvisors()
Definition: boss_kaelthas.cpp:224
uint8 _advisorsAlive
Definition: boss_kaelthas.cpp:721

References _advisorsAlive, _phase, _transitionSceneReached, Unit::ApplySpellImmune(), GO_STATE_READY, IMMUNITY_STATE, ScriptedAI::me, PHASE_NONE, PrepareAdvisors(), Unit::RemoveUnitFlag(), BossAI::Reset(), TaskScheduler::Schedule(), CreatureAI::scheduler, Creature::SetDisableGravity(), SetRoomState(), Unit::SetUnitFlag(), Creature::SetWalk(), SPELL_AURA_HOVER, UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_NOT_SELECTABLE.

◆ SetRoomState()

void boss_kaelthas::SetRoomState ( GOState  state)
inline
240 {
241 //TODO: handle door closing
243 window->SetGoState(state);
245 window->SetGoState(state);
247 window->SetGoState(state);
248 }
@ GO_KAEL_STATUE_LEFT
Definition: the_eye.h:58
@ GO_BRIDGE_WINDOW
Definition: the_eye.h:56
@ GO_KAEL_STATUE_RIGHT
Definition: the_eye.h:57
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:184
Definition: GameObject.h:120
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98

References ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GO_BRIDGE_WINDOW, GO_KAEL_STATUE_LEFT, GO_KAEL_STATUE_RIGHT, BossAI::instance, and ScriptedAI::me.

Referenced by ExecuteMiddleEvent(), and Reset().

◆ SpellHit()

void boss_kaelthas::SpellHit ( Unit caster,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

308 {
309 if (_phase == PHASE_SINGLE_ADVISOR && spell->Id == SPELL_KAEL_PHASE_TWO)
310 {
311 switch (caster->GetEntry())
312 {
313 case NPC_THALADRED:
315 break;
318 break;
319 case NPC_CAPERNIAN:
321 break;
322 case NPC_TELONICUS:
324 break;
325 default:
326 break;
327 }
328 }
329 else if (_phase == PHASE_ALL_ADVISORS && spell->Id == SPELL_KAEL_PHASE_TWO)
330 {
332 if (_advisorsAlive == 0)
333 {
335 }
336 }
337 }
@ SAY_INTRO_SANGUINAR
Definition: boss_kaelthas.cpp:33
@ SAY_INTRO_TELONICUS
Definition: boss_kaelthas.cpp:31
@ SAY_INTRO_CAPERNIAN
Definition: boss_kaelthas.cpp:30
void PhaseEnchantedWeaponsExecute()
Definition: boss_kaelthas.cpp:594

References _advisorsAlive, _phase, ACTION_START_CAPERNIAN, ACTION_START_SANGUINAR, ACTION_START_TELONICUS, Object::GetEntry(), SpellInfo::Id, IntroduceNewAdvisor(), NPC_CAPERNIAN, NPC_LORD_SANGUINAR, NPC_TELONICUS, NPC_THALADRED, PHASE_ALL_ADVISORS, PHASE_SINGLE_ADVISOR, PhaseEnchantedWeaponsExecute(), PhaseKaelExecute(), SAY_INTRO_CAPERNIAN, SAY_INTRO_SANGUINAR, SAY_INTRO_TELONICUS, and SPELL_KAEL_PHASE_TWO.

◆ UpdateAI()

void boss_kaelthas::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Reimplemented from BossAI.

701 {
702 scheduler.Update(diff);
703
704 if (!UpdateVictim())
705 return;
706
708 }
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:280

Member Data Documentation

◆ _advisorsAlive

uint8 boss_kaelthas::_advisorsAlive
private

Referenced by Reset(), and SpellHit().

◆ _phase

uint32 boss_kaelthas::_phase
private

◆ _transitionSceneReached

bool boss_kaelthas::_transitionSceneReached = false
private

Referenced by Reset().