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

Public Member Functions

 boss_kiljaeden (Creature *creature)
 
void InitializeAI () override
 
void Reset () override
 
void ScheduleBasicAbilities ()
 
void EnterEvadeMode (EvadeReason why) override
 
void AttackStart (Unit *who) override
 
void DamageTaken (Unit *unit, uint32 &damage, DamageEffectType damageType, SpellSchoolMask schoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustDied (Unit *) override
 
void DoAction (int32 param) override
 
void KilledUnit (Unit *victim) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void JustSummoned (Creature *summon) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void EmpowerOrb (bool empowerAll)
 
- 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 (Position const *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)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (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)
 
WorldObject * GetSummoner () 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 uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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 OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
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, int32 aura=0)
 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

uint8 _phase
 

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
Creature * me
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- 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)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_kiljaeden()

boss_kiljaeden::boss_kiljaeden ( Creature *  creature)
inline
270 : BossAI(creature, DATA_KILJAEDEN)
271 {
273 }
@ REACT_PASSIVE
Definition Unit.h:574
Definition ScriptedCreature.h:496
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
Creature * me
Definition ScriptedCreature.h:292
@ DATA_KILJAEDEN
Definition sunwell_plateau.h:34

References ScriptedAI::me, REACT_PASSIVE, and Creature::SetReactState().

Member Function Documentation

◆ AttackStart()

void boss_kiljaeden::AttackStart ( Unit *  who)
inlineoverridevirtual

Reimplemented from UnitAI.

510 {
512 return;
514 }
ReactStates GetReactState() const
Definition Creature.h:100
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228

References ScriptedAI::AttackStart(), Creature::GetReactState(), ScriptedAI::me, and REACT_PASSIVE.

◆ DamageTaken()

void boss_kiljaeden::DamageTaken ( Unit *  ,
uint32 &  ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from UnitAI.

517 {
518 BossAI::DamageTaken(unit, damage, damageType, schoolMask);
519
520 if (damage >= me->GetHealth())
521 {
522 me->SetTarget();
530 events.Reset();
531 damage = 0;
533 me->KillSelf();
534 }, 1s);
535 }
536 }
@ EMOTE_ONESHOT_DROWN
Definition SharedDefines.h:1986
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
events
Definition boss_sartura.cpp:43
void DamageTaken(Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
Called at any Damage from any attacker (before damage apply)
Definition ScriptedCreature.cpp:809
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition Creature.cpp:3616
void SetRegeneratingHealth(bool enable)
Definition Creature.h:328
void AddEventAtOffset(BasicEvent *event, Milliseconds offset, uint8 eventGroup=0)
Definition EventProcessor.h:108
void ClearAllThreat()
Definition ThreatManager.cpp:617
uint32 GetHealth() const
Definition Unit.h:1122
ThreatManager & GetThreatMgr()
Definition Unit.h:965
void RemoveAllAuras()
Definition Unit.cpp:5393
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:754
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition Unit.h:1252
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2202
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition Unit.cpp:769
EventProcessor m_Events
Definition Object.h:749

References EventProcessor::AddEventAtOffset(), ThreatManager::ClearAllThreat(), BossAI::DamageTaken(), EMOTE_ONESHOT_DROWN, Unit::GetHealth(), Unit::GetThreatMgr(), Unit::HandleEmoteCommand(), Unit::KillSelf(), WorldObject::m_Events, ScriptedAI::me, REACT_PASSIVE, Unit::RemoveAllAuras(), Unit::resetAttackTimer(), Creature::SetReactState(), Creature::SetRegeneratingHealth(), Creature::SetTarget(), Unit::SetUnitFlag(), and UNIT_FLAG_NON_ATTACKABLE.

◆ DoAction()

void boss_kiljaeden::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

547 {
548 if (param == ACTION_NO_KILL_TALK)
550 }
@ ACTION_NO_KILL_TALK
Definition boss_kiljaeden.cpp:111
@ SAY_KJ_DARKNESS
Definition boss_kiljaeden.cpp:47
Talk
Definition hyjal.cpp:82

References ACTION_NO_KILL_TALK, and SAY_KJ_DARKNESS.

◆ EmpowerOrb()

void boss_kiljaeden::EmpowerOrb ( bool  empowerAll)
inline
594 {
596 {
597 if (GameObject* orb = instance->GetGameObject(i))
598 {
599 if (orb->HasGameObjectFlag(GO_FLAG_NOT_SELECTABLE))
600 {
601 orb->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
602 if (Creature* trigger = me->SummonTrigger(orb->GetPositionX(), orb->GetPositionY(), orb->GetPositionZ(), 0, 10 * MINUTE * IN_MILLISECONDS))
603 {
604 trigger->CastSpell(trigger, SPELL_RING_OF_BLUE_FLAMES, true, nullptr, nullptr, trigger->GetGUID());
606 controller->AI()->JustSummoned(trigger);
607 }
608
609 if (!empowerAll)
610 break;
611 }
612 }
613 }
614 }
constexpr auto IN_MILLISECONDS
Definition Common.h:53
constexpr auto MINUTE
Definition Common.h:47
std::uint8_t uint8
Definition Define.h:109
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1611
@ SPELL_RING_OF_BLUE_FLAMES
Definition boss_kiljaeden.cpp:95
InstanceScript *const instance
Definition ScriptedCreature.h:503
Definition Creature.h:47
Definition GameObject.h:125
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:126
GameObject * GetGameObject(uint32 type)
Definition InstanceScript.cpp:131
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition Object.cpp:2509
@ DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4
Definition sunwell_plateau.h:50
@ DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1
Definition sunwell_plateau.h:47
@ DATA_KJ_CONTROLLER
Definition sunwell_plateau.h:44

References DATA_KJ_CONTROLLER, DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1, DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4, InstanceScript::GetCreature(), InstanceScript::GetGameObject(), GO_FLAG_NOT_SELECTABLE, IN_MILLISECONDS, BossAI::instance, ScriptedAI::me, MINUTE, SPELL_RING_OF_BLUE_FLAMES, and WorldObject::SummonTrigger().

Referenced by Reset().

◆ EnterEvadeMode()

void boss_kiljaeden::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

498 {
500 return;
501
505 if (controller->IsAIEnabled)
506 controller->AI()->Reset();
507 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:235
Definition InstanceScript.h:143
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247

References DATA_KJ_CONTROLLER, CreatureAI::EnterEvadeMode(), InstanceScript::GetCreature(), WorldObject::GetInstanceScript(), Creature::GetReactState(), BossAI::instance, ScriptedAI::me, and REACT_PASSIVE.

◆ InitializeAI()

void boss_kiljaeden::InitializeAI ( )
inlineoverridevirtual

Reimplemented from UnitAI.

276 {
279 me->SetVisible(false);
280
282 me->SetVisible(true);
284 }, 1s);
285
290 }, 11s);
291 }
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:282
@ REACT_AGGRESSIVE
Definition Unit.h:576
@ SPELL_REBIRTH
Definition boss_kiljaeden.cpp:62
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2887
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:399
virtual void InitializeAI()
Definition UnitAI.h:209
void SetVisible(bool x)
Definition Unit.cpp:10916
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:755

References EventProcessor::AddEventAtOffset(), UnitAI::DoCastSelf(), UnitAI::InitializeAI(), WorldObject::m_Events, ScriptedAI::me, REACT_AGGRESSIVE, Unit::RemoveUnitFlag(), Creature::SetInCombatWithZone(), Creature::SetReactState(), Unit::SetUnitFlag(), Unit::SetVisible(), SPELL_REBIRTH, and UNIT_FLAG_NOT_SELECTABLE.

◆ JustDied()

void boss_kiljaeden::JustDied ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

539 {
543 controller->KillSelf();
544 }
@ DONE
Definition InstanceScript.h:61
@ SAY_KJ_DEATH
Definition boss_kiljaeden.cpp:43
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:406

References DATA_KILJAEDEN, DATA_KJ_CONTROLLER, DONE, InstanceScript::GetCreature(), BossAI::instance, SAY_KJ_DEATH, and InstanceScript::SetBossState().

◆ JustEngagedWith()

void boss_kiljaeden::JustEngagedWith ( Unit *  )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

559 {
561 kalec->AI()->Talk(SAY_KALECGOS_JOIN, 26s);
562
565 }
@ SAY_KJ_EMERGE
Definition boss_kiljaeden.cpp:46
@ SAY_KALECGOS_JOIN
Definition boss_kiljaeden.cpp:41
void ScheduleBasicAbilities()
Definition boss_kiljaeden.cpp:467
@ DATA_KALECGOS_KJ
Definition sunwell_plateau.h:46

References DATA_KALECGOS_KJ, InstanceScript::GetCreature(), BossAI::instance, SAY_KALECGOS_JOIN, SAY_KJ_EMERGE, and ScheduleBasicAbilities().

◆ JustSummoned()

void boss_kiljaeden::JustSummoned ( Creature *  summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

568 {
569 BossAI::JustSummoned(summon);
570 if (summon->GetEntry() == NPC_ARMAGEDDON_TARGET)
571 {
572 summon->SetCanFly(true);
573 summon->SetDisableGravity(true);
574 summon->CastSpell(summon, SPELL_ARMAGEDDON_VISUAL, true);
575 summon->SetPosition(summon->GetPositionX(), summon->GetPositionY(), summon->GetPositionZ() + 20.0f, 0.0f);
576 summon->m_Events.AddEventAtOffset(new CastArmageddon(summon), 6s);
577 summon->DespawnOrUnsummon(randtime(8s, 10s));
578 }
579 }
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:64
@ SPELL_ARMAGEDDON_VISUAL
Definition boss_kiljaeden.cpp:73
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:729
Definition boss_kiljaeden.cpp:118
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3366
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2221
uint32 GetEntry() const
Definition Object.h:123
void SetCanFly(bool enable)
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition Unit.cpp:16268
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 SetDisableGravity(bool disable)
Definition Unit.cpp:16208
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
@ NPC_ARMAGEDDON_TARGET
Definition sunwell_plateau.h:93

References EventProcessor::AddEventAtOffset(), Unit::CastSpell(), Creature::DespawnOrUnsummon(), Object::GetEntry(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), BossAI::JustSummoned(), WorldObject::m_Events, NPC_ARMAGEDDON_TARGET, randtime(), Unit::SetCanFly(), Unit::SetDisableGravity(), Creature::SetPosition(), and SPELL_ARMAGEDDON_VISUAL.

◆ KilledUnit()

void boss_kiljaeden::KilledUnit ( Unit *  victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

553 {
554 if (victim->IsPlayer())
556 }
@ SAY_KJ_SLAY
Definition boss_kiljaeden.cpp:44
bool IsPlayer() const
Definition Object.h:207

References Object::IsPlayer(), and SAY_KJ_SLAY.

◆ Reset()

void boss_kiljaeden::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

294 {
297 DoCastSelf(SPELL_SWAT, true);
298
302 kalec->AI()->Talk(SAY_KALECGOS_AWAKEN, 21s);
303
304 if (Creature* anveena = instance->GetCreature(DATA_ANVEENA))
305 anveena->AI()->Talk(SAY_ANVEENA_IMPRISONED, 26s);
306
307 Talk(SAY_KJ_PHASE3, 32s);
308
310
312
315 kalec->AI()->Talk(SAY_KALECGOS_READY1);
316 EmpowerOrb(false);
317 }, 38s);
318
322 }, 1s);
323
324 scheduler.Schedule(1s+200ms, [this](TaskContext)
325 {
327 });
328
329 ScheduleTimedEvent(31s, [&] {
331 }, 20s);
332
333 ScheduleTimedEvent(55s, [&] {
336 }, 45s);
337 });
338
342 kalec->AI()->Talk(SAY_KALECGOS_LETGO, 18s);
343
344 if (Creature* anveena = instance->GetCreature(DATA_ANVEENA))
345 anveena->AI()->Talk(SAY_ANVEENA_LOST, 25s);
346
347 Talk(SAY_KJ_PHASE4, 32s);
348
350
353 kalec->AI()->Talk(SAY_KALECGOS_READY2);
354 EmpowerOrb(false);
355 }, 38s);
356
357 scheduler.Schedule(1s, [this](TaskContext)
358 {
361 });
362
363 scheduler.Schedule(1s + 200ms, [this](TaskContext)
364 {
367 });
368
369 ScheduleTimedEvent(28s, [&] {
371 }, 20s);
372
373 ScheduleTimedEvent(64s, [&] {
377
378 me->m_Events.AddEventAtOffset([this]() {
379 if (me->IsAlive() && me->IsInCombat())
381 }, 9s);
382 }, 45s);
383
384 ScheduleTimedEvent(10s, [&] {
386 }, 40s);
387 });
388
391
393
394 scheduler.Schedule(1s, [this](TaskContext)
395 {
396 scheduler.Schedule(1s, [this](TaskContext)
397 {
400 });
401
402 scheduler.Schedule(2s, [this](TaskContext)
403 {
405 });
406
408 {
409 kalec->AI()->Talk(SAY_KALECGOS_FOCUS, 9s);
410 kalec->AI()->Talk(SAY_KALECGOS_FATE, 22s + 200ms);
411 }
412
413 if (Creature* anveena = instance->GetCreature(DATA_ANVEENA))
414 {
415 anveena->AI()->Talk(SAY_ANVEENA_KALEC, 20s);
416 anveena->AI()->Talk(SAY_ANVEENA_GOODBYE, 29s);
417 }
418
420 if (Creature* anveena = instance->GetCreature(DATA_ANVEENA))
421 {
422 anveena->RemoveAllAuras();
423 anveena->CastSpell(anveena, SPELL_SACRIFICE_OF_ANVEENA, true);
424 anveena->DespawnOrUnsummon(1500ms);
428
432
434
435 ScheduleTimedEvent(16s, [&] {
437 }, 20s);
438
439 ScheduleTimedEvent(15s, [&] {
443
444 me->m_Events.AddEventAtOffset([this]() {
445 if (me->IsAlive() && me->IsInCombat())
447 }, 9s);
448 }, 25s);
449
450 ScheduleTimedEvent(1500ms, [&] {
452 }, 20s);
453 }, 7s);
454 }
456 }, 36s);
457
460 kalec->AI()->Talk(SAY_KALECGOS_READY_ALL);
461 EmpowerOrb(true);
462 }, 48s);
463 });
464 });
465 }
@ SPELLVALUE_MAX_TARGETS
Definition SpellDefines.h:125
@ TRIGGERED_NONE
Definition SpellDefines.h:141
@ UNIT_FLAG_PACIFIED
Definition UnitDefines.h:274
@ PHASE_SACRIFICE
Definition boss_kiljaeden.cpp:108
@ PHASE_ARMAGEDDON
Definition boss_kiljaeden.cpp:107
@ PHASE_DARKNESS
Definition boss_kiljaeden.cpp:106
@ PHASE_NORMAL
Definition boss_kiljaeden.cpp:105
@ SAY_KJ_PHASE3
Definition boss_kiljaeden.cpp:48
@ SAY_ANVEENA_GOODBYE
Definition boss_kiljaeden.cpp:56
@ SAY_KALECGOS_READY1
Definition boss_kiljaeden.cpp:33
@ SAY_KJ_PHASE5
Definition boss_kiljaeden.cpp:50
@ SAY_KALECGOS_READY_ALL
Definition boss_kiljaeden.cpp:35
@ SAY_KALECGOS_FOCUS
Definition boss_kiljaeden.cpp:38
@ SAY_KJ_REFLECTION
Definition boss_kiljaeden.cpp:45
@ SAY_KALECGOS_READY2
Definition boss_kiljaeden.cpp:34
@ SAY_ANVEENA_LOST
Definition boss_kiljaeden.cpp:54
@ SAY_KJ_PHASE4
Definition boss_kiljaeden.cpp:49
@ SAY_KALECGOS_LETGO
Definition boss_kiljaeden.cpp:37
@ SAY_ANVEENA_IMPRISONED
Definition boss_kiljaeden.cpp:53
@ SAY_ANVEENA_KALEC
Definition boss_kiljaeden.cpp:55
@ SAY_KALECGOS_AWAKEN
Definition boss_kiljaeden.cpp:36
@ EMOTE_KJ_DARKNESS
Definition boss_kiljaeden.cpp:51
@ SAY_KALECGOS_FATE
Definition boss_kiljaeden.cpp:39
@ SPELL_SHADOW_SPIKE
Definition boss_kiljaeden.cpp:66
@ SPELL_DARKNESS_OF_A_THOUSAND_SOULS
Definition boss_kiljaeden.cpp:70
@ SPELL_KNOCKBACK
Definition boss_kiljaeden.cpp:77
@ SPELL_SINISTER_REFLECTION
Definition boss_kiljaeden.cpp:67
@ SPELL_SACRIFICE_OF_ANVEENA
Definition boss_kiljaeden.cpp:99
@ SPELL_FLAME_DART
Definition boss_kiljaeden.cpp:68
@ SPELL_SWAT
Definition boss_kiljaeden.cpp:78
@ SPELL_CUSTOM_08_STATE
Definition boss_kiljaeden.cpp:75
@ SPELL_ARMAGEDDON_PERIODIC
Definition boss_kiljaeden.cpp:72
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:835
TaskScheduler scheduler
Definition CreatureAI.h:74
Definition TaskScheduler.h:422
TaskScheduler & CancelAll()
Definition TaskScheduler.cpp:45
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:233
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:282
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 IsAlive() const
Definition Unit.h:1812
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4969
bool IsInCombat() const
Definition Unit.h:949
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
Definition ScriptedCreature.cpp:349
uint8 _phase
Definition boss_kiljaeden.cpp:617
void EmpowerOrb(bool empowerAll)
Definition boss_kiljaeden.cpp:593
@ DATA_ANVEENA
Definition sunwell_plateau.h:45

References _phase, EventProcessor::AddEventAtOffset(), TaskScheduler::CancelAll(), Unit::CastCustomSpell(), DATA_ANVEENA, DATA_KALECGOS_KJ, UnitAI::DoCastAOE(), UnitAI::DoCastSelf(), EMOTE_KJ_DARKNESS, EmpowerOrb(), InstanceScript::GetCreature(), BossAI::instance, Unit::IsAlive(), Unit::IsInCombat(), WorldObject::m_Events, ScriptedAI::me, PHASE_ARMAGEDDON, PHASE_DARKNESS, PHASE_NORMAL, PHASE_SACRIFICE, Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), SAY_ANVEENA_GOODBYE, SAY_ANVEENA_IMPRISONED, SAY_ANVEENA_KALEC, SAY_ANVEENA_LOST, SAY_KALECGOS_AWAKEN, SAY_KALECGOS_FATE, SAY_KALECGOS_FOCUS, SAY_KALECGOS_LETGO, SAY_KALECGOS_READY1, SAY_KALECGOS_READY2, SAY_KALECGOS_READY_ALL, SAY_KJ_PHASE3, SAY_KJ_PHASE4, SAY_KJ_PHASE5, SAY_KJ_REFLECTION, TaskScheduler::Schedule(), ScheduleBasicAbilities(), BossAI::ScheduleHealthCheckEvent(), CreatureAI::scheduler, ScriptedAI::ScheduleTimedEvent(), Unit::SetUnitFlag(), SPELL_ARMAGEDDON_PERIODIC, SPELL_CUSTOM_08_STATE, SPELL_DARKNESS_OF_A_THOUSAND_SOULS, SPELL_FLAME_DART, SPELL_KNOCKBACK, SPELL_SACRIFICE_OF_ANVEENA, SPELL_SHADOW_SPIKE, SPELL_SINISTER_REFLECTION, SPELL_SWAT, SPELLVALUE_MAX_TARGETS, TRIGGERED_NONE, and UNIT_FLAG_PACIFIED.

◆ ScheduleBasicAbilities()

void boss_kiljaeden::ScheduleBasicAbilities ( )
inline
468 {
469 ScheduleTimedEvent(1s, [&] {
471 }, 4s, 5s);
472
473 ScheduleTimedEvent(7s, [&] {
475 }, _phase == PHASE_SACRIFICE ? 15s : 30s);
476
477 ScheduleTimedEvent(9s, [&] {
480 }, _phase == PHASE_SACRIFICE ? 20s : 40s);
481
482 if (_phase != PHASE_SACRIFICE)
483 {
484 ScheduleTimedEvent(10s, [&] {
485 for (uint8 i = 1; i < _phase; ++i)
486 {
487 float x = me->GetPositionX() + 18.0f * cos((i * 2.0f - 1.0f) * M_PI / 3.0f);
488 float y = me->GetPositionY() + 18.0f * std::sin((i * 2.0f - 1.0f) * M_PI / 3.0f);
490 orb->GetMotionMaster()->MoveCirclePath(me->GetPositionX(), me->GetPositionY(), 40.0f, 18.0f,
491 false, 20, FORCED_MOVEMENT_FLY);
492 }
493 }, 40s);
494 }
495 }
@ FORCED_MOVEMENT_FLY
Definition MotionMaster.h:89
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:54
@ SPELL_FIRE_BLOOM
Definition boss_kiljaeden.cpp:65
@ SPELL_LEGION_LIGHTNING
Definition boss_kiljaeden.cpp:64
@ SPELL_SOUL_FLAY
Definition boss_kiljaeden.cpp:63
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
Cast the spell on a random unit from the threat list.
Definition UnitAI.cpp:297
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:274
Unit * GetVictim() const
Definition Unit.h:910
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2460
@ NPC_SHIELD_ORB
Definition sunwell_plateau.h:91

References _phase, Unit::CastCustomSpell(), UnitAI::DoCastRandomTarget(), UnitAI::DoCastVictim(), FORCED_MOVEMENT_FLY, Object::GetGUID(), Position::GetPositionX(), Position::GetPositionY(), Unit::GetVictim(), ScriptedAI::me, NPC_SHIELD_ORB, PHASE_SACRIFICE, ScriptedAI::ScheduleTimedEvent(), Creature::SetTarget(), SPELL_FIRE_BLOOM, SPELL_LEGION_LIGHTNING, SPELL_SOUL_FLAY, SPELLVALUE_MAX_TARGETS, WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_DESPAWN, and TRIGGERED_NONE.

Referenced by JustEngagedWith(), and Reset().

◆ UpdateAI()

void boss_kiljaeden::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

582 {
584 return;
585
586 if (!UpdateVictim())
587 return;
588
589 scheduler.Update(diff,
590 std::bind(&BossAI::DoMeleeAttackIfReady, this));
591 }
bool UpdateVictim()
Definition CreatureAI.cpp:350
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41

References UnitAI::DoMeleeAttackIfReady(), Creature::GetReactState(), ScriptedAI::me, REACT_AGGRESSIVE, CreatureAI::scheduler, TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _phase

uint8 boss_kiljaeden::_phase
private

Referenced by Reset(), and ScheduleBasicAbilities().


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