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()
 
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 OnSpellCast (SpellInfo const *spell) override
 
void OnChannelFinished (SpellInfo const *spell) override
 
void OnSpellFailed (SpellInfo const *spell) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
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()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
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)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, 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)
 
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=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, 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:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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.
 
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.
 
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.
 
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.
 
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)
 
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
 
bool _isEngaged
 
- 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) { }
Definition ScriptedCreature.h:485
@ DATA_KAELTHAS
Definition magisters_terrace.h:31

Member Function Documentation

◆ AttackStart()

void boss_kaelthas::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from UnitAI.

268 {
269 if (_phase == PHASE_FINAL /* check is scheduled&& !events.HasTimeUntilEvent(EVENT_GRAVITY_LAPSE_END)*/)
271 }
@ PHASE_FINAL
Definition boss_kaelthas.cpp:144
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:28
uint32 _phase
Definition boss_kaelthas.cpp:717

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

Referenced by MovementInform().

◆ CheckEvadeIfOutOfCombatArea()

bool boss_kaelthas::CheckEvadeIfOutOfCombatArea ( ) const
inlineoverridevirtual

Reimplemented from ScriptedAI.

708 {
709 return me->GetHomePosition().GetExactDist2d(me) > 165.0f || !SelectTargetFromPlayerList(165.0f);
710 }
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:349
Creature * me
Definition ScriptedCreature.h:281
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:591

◆ ExecuteMiddleEvent()

void boss_kaelthas::ExecuteMiddleEvent ( )
inline
415 {
419 me->SetTarget();
420 me->SetFacingTo(M_PI);
421 me->SetWalk(true);
423 ScheduleUniqueTimedEvent(2500ms, [&]
424 {
425 me->SetTarget();
428 }, EVENT_SCENE_2);
430 {
431 me->SetTarget();
432 for (uint8 i = 0; i < 2; ++i)
434 trigger->CastSpell(me, SPELL_NETHERBEAM1 + i, false);
435 me->SetDisableGravity(true);
437 me->GetMotionMaster()->MoveTakeoff(POINT_AIR, me->GetPositionX(), me->GetPositionY(), 75.0f, 2.99, true); // AnimType Movement::ToFly does not exist for Kael
438 DoCastSelf(SPELL_GROW, true);
439 }, EVENT_SCENE_3);
441 {
442 me->SetTarget();
443 DoCastSelf(SPELL_GROW, true);
446 for (uint8 i = 0; i < 2; ++i)
448 trigger->CastSpell(me, SPELL_NETHERBEAM1 + i, false);
449 }, EVENT_SCENE_4);
451 {
452 me->SetTarget();
453 DoCastSelf(SPELL_GROW, true);
456 for (uint8 i = 0; i < 2; ++i)
458 trigger->CastSpell(me, SPELL_NETHERBEAM1 + i, false);
459 }, EVENT_SCENE_5);
461 {
462 DoCastSelf(SPELL_GROW, true);
465 }, EVENT_SCENE_6);
466 ScheduleUniqueTimedEvent(17500ms, [&]
467 {
469 }, EVENT_SCENE_7);
471 {
477 }, EVENT_SCENE_8);
479 {
483 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
484 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM1, true);
485 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() - 5, me->GetPositionY(), me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
486 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM2, true);
487 }, EVENT_SCENE_9);
488 ScheduleUniqueTimedEvent(22800ms, [&]
489 {
490 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() - 5, me->GetPositionY() - 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
491 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM3, true);
492 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() + 5, me->GetPositionY() + 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
493 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM1, true);
494 }, EVENT_SCENE_10);
495 ScheduleUniqueTimedEvent(23600ms, [&]
496 {
497 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX(), me->GetPositionY() + 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
498 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM2, true);
499 }, EVENT_SCENE_11);
500 ScheduleUniqueTimedEvent(24500ms, [&]
501 {
502 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX(), me->GetPositionY() - 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
503 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM3, true);
504 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() + 5, me->GetPositionY() - 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
505 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM1, true);
506 }, EVENT_SCENE_12);
507 ScheduleUniqueTimedEvent(24800ms, [&]
508 {
509 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX() - 5, me->GetPositionY() + 5, me->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
510 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM2, true);
511 }, EVENT_SCENE_13);
512 ScheduleUniqueTimedEvent(25300ms, [&]
513 {
514 if (Creature* trigger = me->SummonCreature(WORLD_TRIGGER, me->GetPositionX()-5, me->GetPositionY()+5, me->GetPositionZ()+15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
515 trigger->CastSpell(me, SPELL_PURE_NETHER_BEAM3, true);
516 }, EVENT_SCENE_14);
517 ScheduleUniqueTimedEvent(30500ms, [&]
518 {
519 me->SetFacingTo(M_PI);
521 me->CastStop();
522 }, EVENT_SCENE_15);
523 ScheduleUniqueTimedEvent(30700ms, [&]
524 {
525 me->CastStop();
527 }, EVENT_SCENE_16);
529 {
534 }, EVENT_SCENE_17);
536 {
538 me->CastStop();
539 me->GetMotionMaster()->Clear();
541 me->SetDisableGravity(true);
544 }, EVENT_SCENE_18);
545 }
std::uint8_t uint8
Definition Define.h:109
@ GO_STATE_ACTIVE
Definition GameObjectData.h:708
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:51
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:282
#define WORLD_TRIGGER
Definition Unit.h:37
@ 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
SummonList summons
Definition ScriptedCreature.h:539
TaskScheduler scheduler
Definition CreatureAI.h:74
Definition Creature.h:47
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition Creature.cpp:3540
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3323
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:588
void DespawnEntry(uint32 entry)
Definition ScriptedCreature.cpp:55
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:394
void SetFacingTo(float ori)
Definition Unit.cpp:16454
MotionMaster * GetMotionMaster()
Definition Unit.h:1759
void CastStop(uint32 except_spellid=0, bool withInstant=true)
Interrupt the unit cast for all the current spells.
Definition Unit.cpp:1371
void SendMovementFlagUpdate(bool self=false)
Definition Unit.cpp:13085
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:1378
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5174
void RemoveAllAttackers()
Remove all units in m_attackers list and send them AttackStop()
Definition Unit.cpp:7586
void SetDisableGravity(bool disable)
Definition Unit.cpp:16505
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
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:2393
Talk
Definition hyjal.cpp:82
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void ScheduleUniqueTimedEvent(Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
Definition ScriptedCreature.h:366
void SetRoomState(GOState state)
Definition boss_kaelthas.cpp:236

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(), Unit::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
548 {
549 std::chrono::milliseconds attackStartTimer = 0ms;
550 uint32 dataIdx = DATA_THALADRED;
551 scheduler.Schedule(2s, [this, talkIntroduction](TaskContext)
552 {
553 Talk(talkIntroduction);
554 });
555 //switch because talk times are different
556 switch (kaelAction)
557 {
559 attackStartTimer = 7s;
560 dataIdx = DATA_THALADRED;
561 break;
563 attackStartTimer = 14500ms;
564 dataIdx = DATA_LORD_SANGUINAR;
565 break;
567 attackStartTimer = 9s;
568 dataIdx = DATA_CAPERNIAN;
569 break;
571 attackStartTimer = 10400ms;
572 dataIdx = DATA_TELONICUS;
573 break;
574 default:
575 break;
576 }
577 scheduler.Schedule(attackStartTimer, [this, dataIdx](TaskContext)
578 {
579 if (Creature* advisor = instance->GetCreature(dataIdx))
580 {
581 advisor->SetReactState(REACT_AGGRESSIVE);
582 advisor->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
584 advisor->AI()->AttackStart(target);
585 advisor->SetInCombatWithZone();
586 advisor->AI()->Talk(SAY_ADVISOR_AGGRO);
587 }
588 });
589 }
std::uint32_t uint32
Definition Define.h:107
@ REACT_AGGRESSIVE
Definition Unit.h:568
@ 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
InstanceScript *const instance
Definition ScriptedCreature.h:492
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:116
Definition TaskScheduler.h:422
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:233
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:111
Definition Unit.h:664
@ DATA_TELONICUS
Definition the_eye.h:38
@ DATA_LORD_SANGUINAR
Definition the_eye.h:36
@ DATA_CAPERNIAN
Definition the_eye.h:37
@ DATA_THALADRED
Definition the_eye.h:35

References ACTION_START_CAPERNIAN, ACTION_START_SANGUINAR, ACTION_START_TELONICUS, ACTION_START_THALADRED, DATA_CAPERNIAN, DATA_LORD_SANGUINAR, DATA_TELONICUS, DATA_THALADRED, InstanceScript::GetCreature(), BossAI::instance, Random, REACT_AGGRESSIVE, SAY_ADVISOR_AGGRO, TaskScheduler::Schedule(), CreatureAI::scheduler, UnitAI::SelectTarget(), and UNIT_FLAG_NON_ATTACKABLE.

Referenced by MoveInLineOfSight(), and SpellHit().

◆ JustDied()

void boss_kaelthas::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from CreatureAI.

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

References BossAI::JustDied(), and SPELL_REMOVE_ENCHANTED_WEAPONS.

◆ JustSummoned()

void boss_kaelthas::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

296 {
297 summons.Summon(summon);
298 if (summon->GetEntry() == NPC_NETHER_VAPOR)
299 summon->GetMotionMaster()->MoveRandom(20.0f);
302 }
@ REACT_PASSIVE
Definition Unit.h:566
@ 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
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
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:244
uint32 GetEntry() const
Definition Object.h:117
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88

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 CreatureAI.

290 {
291 if (victim->IsPlayer())
292 Talk(SAY_SLAY);
293 }
@ SAY_SLAY
Definition boss_kaelthas.cpp:38
bool IsPlayer() const
Definition Object.h:201

References Object::IsPlayer(), and SAY_SLAY.

◆ MoveInLineOfSight()

void boss_kaelthas::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

274 {
275 if (_phase == PHASE_NONE && who->IsPlayer() && me->IsValidAttackTarget(who))
276 {
283 {
286 }
287 }
@ UNIT_FLAG_DISABLE_MOVE
Definition UnitDefines.h:259
@ 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
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2850
bool IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell=nullptr) const
Definition Unit.cpp:10739
void IntroduceNewAdvisor(KTYells talkIntroduction, KTActions kaelAction)
Definition boss_kaelthas.cpp:547

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 CreatureAI.

337 {
338 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
339 return;
340
341 if (point == POINT_MIDDLE)
342 {
344 }
345 else if (point == POINT_AIR)
346 {
347 me->SetDisableGravity(true); // updating AnimationTier will break drowning animation later
348 }
349 else if (point == POINT_START_LAST_PHASE)
350 {
351 me->SetDisableGravity(false);
352 me->SetWalk(false);
356 //re-set validator
357 scheduler.SetValidator([this]{
359 });
360 ScheduleTimedEvent(0ms, [&]
361 {
363 }, 2400ms, 7500ms);
364 ScheduleTimedEvent(10s, [&]
365 {
367 }, 30250ms, 50650ms);
368 ScheduleTimedEvent(50s, [&]
369 {
372 }, 61450ms, 96550ms);
373 ScheduleTimedEvent(5s, [&]
374 {
375 scheduler.DelayAll(30s);
380 {
382 context.Repeat(4s);
383 }).Schedule(0s, GROUP_SHOCK_BARRIER, [this](TaskContext context)
384 {
386 context.Repeat(10s);
387 }).Schedule(20500ms, GROUP_SHOCK_BARRIER, [this](TaskContext)
388 {
390 }).Schedule(32s, [this](TaskContext)
391 {
394
395 if (Unit* victim = me->GetVictim())
396 {
397 me->SetTarget(victim->GetGUID());
398 me->GetMotionMaster()->MoveChase(victim);
399 }
400 });
401 me->SetTarget();
403 me->StopMoving();
405 }, 90s);
406 if (me->GetVictim())
407 {
410 }
411 }
412 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ EFFECT_MOTION_TYPE
Definition MotionMaster.h:56
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ BASE_ATTACK
Definition Unit.h:215
@ 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
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:315
void Clear(bool reset=true)
Definition MotionMaster.h:193
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition TaskScheduler.h:494
TaskScheduler & DelayAll(std::chrono::duration< _Rep, _Period > const &duration)
Delays all tasks with the given duration.
Definition TaskScheduler.h:284
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:198
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:296
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:277
void setAttackTimer(WeaponAttackType type, int32 time)
Definition Unit.h:885
void StopMoving()
Definition Unit.cpp:13031
Unit * GetVictim() const
Definition Unit.h:903
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
Definition ScriptedCreature.cpp:349
void ExecuteMiddleEvent()
Definition boss_kaelthas.cpp:414
void AttackStart(Unit *who) override
Definition boss_kaelthas.cpp:267

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(), Unit::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
622 {
631 {
633 });
634 }
@ 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:636

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
592 {
598 {
600 });
604 {
605 if (Creature* summonedCreature = summon->ToCreature())
606 {
607 if (!summonedCreature->GetSpawnId())
608 {
609 summonedCreature->SetReactState(REACT_AGGRESSIVE);
610 summonedCreature->SetInCombatWithZone();
611 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
612 {
613 summonedCreature->AI()->AttackStart(target);
614 }
615 }
616 }
617 });
619 }
@ 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
Creature * ToCreature()
Definition Object.h:206
void DoForAllSummons(std::function< void(WorldObject *)> exec)
Definition ScriptedCreature.h:140
Definition Object.h:475
void PhaseAllAdvisorsExecute()
Definition boss_kaelthas.cpp:621

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
637 {
644 {
645 AttackStart(target);
646 }
649 {
652 me->AttackStop();
653 me->CastStop();
655 me->GetMotionMaster()->MovePoint(POINT_MIDDLE, me->GetHomePosition(), FORCED_MOVEMENT_NONE, 0.f, true, true);
656 }
657 });
658 ScheduleTimedEvent(1s, [&]
659 {
661 }, 2400ms, 7500ms);
662 ScheduleTimedEvent(15s, [&]
663 {
665 }, 30250ms, 50650ms);
666 ScheduleTimedEvent(50s, [&]
667 {
670 }, 35450ms, 41550ms);
671 ScheduleTimedEvent(20s, 23s, [&]
672 {
673 if (roll_chance_i(50))
676 scheduler.Schedule(3s, [this](TaskContext)
677 {
679 });
680 }, 23s, 26s);
681 ScheduleTimedEvent(60s, [&]
682 {
685 scheduler.DelayAll(10s);
686 scheduler.Schedule(0s, GROUP_PYROBLAST, [this](TaskContext context)
687 {
689 context.Repeat(4s);
690 }).Schedule(8500ms, GROUP_PYROBLAST, [this](TaskContext)
691 {
693 });
694 }, 50s);
695 }
@ FORCED_MOVEMENT_NONE
Definition MotionMaster.h:86
bool roll_chance_i(int chance)
Definition Random.h:63
@ SPELLVALUE_MAX_TARGETS
Definition SpellDefines.h:117
@ 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
void ScheduleHealthCheckEvent(uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
Executes a function once the creature reaches the defined health point percent.
Definition ScriptedCreature.cpp:831
TaskScheduler & CancelAll()
Definition TaskScheduler.cpp:45
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:1435
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7456
void DoResetThreatList()
Definition ScriptedCreature.cpp:473
bool _transitionSceneReached
Definition boss_kaelthas.cpp:719

References FORCED_MOVEMENT_NONE, 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 }
233 }
234 }

References DATA_TELONICUS, DATA_THALADRED, InstanceScript::GetCreature(), and BossAI::instance.

Referenced by Reset().

◆ Reset()

void boss_kaelthas::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

248 {
250 scheduler.Schedule(1s, [this](TaskContext)
251 {
253 });
254
257 _advisorsAlive = 4;
258
259 me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_HOVER, true); // hover effect 36550 - Floating Drowned
263 me->SetDisableGravity(false);
264 me->SetWalk(false);
265 }
@ GO_STATE_READY
Definition GameObjectData.h:709
@ IMMUNITY_STATE
Definition SharedDefines.h:1399
@ SPELL_AURA_HOVER
Definition SpellAuraDefines.h:169
void Reset() override
Definition ScriptedCreature.h:524
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition Unit.cpp:10469
void PrepareAdvisors()
Definition boss_kaelthas.cpp:224
uint8 _advisorsAlive
Definition boss_kaelthas.cpp:718

References _advisorsAlive, _phase, _transitionSceneReached, Unit::ApplySpellImmune(), GO_STATE_READY, IMMUNITY_STATE, ScriptedAI::me, PHASE_NONE, PrepareAdvisors(), Unit::RemoveUnitFlag(), BossAI::Reset(), TaskScheduler::Schedule(), CreatureAI::scheduler, Unit::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
237 {
238 //TODO: handle door closing
240 window->SetGoState(state);
242 window->SetGoState(state);
244 window->SetGoState(state);
245 }
Definition GameObject.h:120
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:111
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:184
@ 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

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 CreatureAI.

305 {
306 if (_phase == PHASE_SINGLE_ADVISOR && spell->Id == SPELL_KAEL_PHASE_TWO)
307 {
308 switch (caster->GetEntry())
309 {
310 case NPC_THALADRED:
312 break;
315 break;
316 case NPC_CAPERNIAN:
318 break;
319 case NPC_TELONICUS:
321 break;
322 default:
323 break;
324 }
325 }
326 else if (_phase == PHASE_ALL_ADVISORS && spell->Id == SPELL_KAEL_PHASE_TWO)
327 {
329 if (_advisorsAlive == 0)
330 {
332 }
333 }
334 }
@ 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:591
@ 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

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()

Implements UnitAI.

698 {
699 scheduler.Update(diff);
700
701 if (!UpdateVictim())
702 return;
703
705 }
bool UpdateVictim()
Definition CreatureAI.cpp:350
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40

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().


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