TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boss_kiljaeden::boss_kiljaedenAI Struct Reference

Public Member Functions

 boss_kiljaedenAI (Creature *creature)
 
void Initialize ()
 
void InitializeAI () override
 
void Reset () override
 
void ChangeTimers (bool status, uint32 WTimer)
 
void JustSummoned (Creature *summoned) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void EnterEvadeMode (EvadeReason why) override
 
void EnterCombat (Unit *) override
 
void EnterNextPhase ()
 
void CastSinisterReflection ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
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 DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo constSelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
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
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.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 void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
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 (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
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 sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Public Attributes

InstanceScriptinstance
 
SummonList summons
 
uint8 Phase
 
uint8 ActiveTimers
 
uint32 SpeechTimer
 
uint32 Timer [10]
 
uint32 WaitTimer
 
uint8 speechCount
 
uint8 speechPhaseEnd
 
bool IsInDarkness
 
bool TimerIsDeactivated [10]
 
bool IsWaiting
 
bool OrbActivated
 
bool SpeechBegins
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason { EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- 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 CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_kiljaeden::boss_kiljaedenAI::boss_kiljaedenAI ( Creature creature)
inline
502  : ScriptedAI(creature), summons(me)
503  {
504  Initialize();
505  instance = creature->GetInstanceScript();
506  speechPhaseEnd = 0;
507 
508  SetCombatMovement(false);
509  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * instance
Definition: boss_kiljaeden.cpp:546
Creature *const me
Definition: CreatureAI.h:71
void Initialize()
Definition: boss_kiljaeden.cpp:511
SummonList summons
Definition: boss_kiljaeden.cpp:547
void SetCombatMovement(bool allowMovement)
Definition: ScriptedCreature.cpp:382
uint8 speechPhaseEnd
Definition: boss_kiljaeden.cpp:556

+ Here is the call graph for this function:

Member Function Documentation

void boss_kiljaeden::boss_kiljaedenAI::CastSinisterReflection ( )
inline
656  {
658  for (uint8 i = 0; i < 4; ++i)
659  {
661  {
662  float x, y, z;
663  target->GetPosition(x, y, z);
664  if (Creature* pSinisterReflection = me->SummonCreature(NPC_SINISTER_REFLECTION, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0))
665  {
666  pSinisterReflection->SetDisplayId(target->GetDisplayId());
667  pSinisterReflection->AI()->AttackStart(target);
668  }
669  }
670  }
671  }
Definition: Object.h:58
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
Definition: UnitAI.h:35
G3D::int16 z
Definition: Vector3int16.h:46
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
G3D::int16 y
Definition: Vector2int16.h:38
Definition: sunwell_plateau.h:92
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_kiljaeden.cpp:141
Definition: boss_kiljaeden.cpp:52
uint8_t uint8
Definition: Define.h:152
G3D::int16 x
Definition: Vector2int16.h:37
Definition: Unit.h:1305
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::ChangeTimers ( bool  status,
uint32  WTimer 
)
inline
582  {
583  for (uint8 i = 1; i < ActiveTimers; ++i)
584  TimerIsDeactivated[i] = status;
585 
586  if (WTimer > 0)
587  {
588  IsWaiting = true;
589  WaitTimer = WTimer;
590  }
591 
592  if (OrbActivated)
594  if (Timer[TIMER_SHADOW_SPIKE] == 0)
596  if (Phase == PHASE_SACRIFICE)
598  }
uint32 WaitTimer
Definition: boss_kiljaeden.cpp:554
bool IsWaiting
Definition: boss_kiljaeden.cpp:561
uint8 ActiveTimers
Definition: boss_kiljaeden.cpp:550
Definition: boss_kiljaeden.cpp:159
Definition: boss_kiljaeden.cpp:177
bool TimerIsDeactivated[10]
Definition: boss_kiljaeden.cpp:560
Definition: boss_kiljaeden.cpp:174
Definition: boss_kiljaeden.cpp:171
uint32 Timer[10]
Definition: boss_kiljaeden.cpp:553
uint8_t uint8
Definition: Define.h:152
Phase
Definition: boss_kiljaeden.cpp:153
bool OrbActivated
Definition: boss_kiljaeden.cpp:562

+ Here is the caller graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

639  {
640  DoZoneInCombat();
641  }
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47

+ Here is the call graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

628  {
630 
632 
633  // Reset the controller
636  }
void DespawnAll()
Definition: ScriptedCreature.cpp:66
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
Definition: Creature.h:467
InstanceScript * instance
Definition: boss_kiljaeden.cpp:546
Creature *const me
Definition: CreatureAI.h:71
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
SummonList summons
Definition: boss_kiljaeden.cpp:547
void Reset() override
Definition: boss_kiljaeden.cpp:570
Definition: sunwell_plateau.h:42
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174

+ Here is the call graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::EnterNextPhase ( )
inline
644  {
645  SpeechBegins = true;
646  OrbActivated = false;
647  ChangeTimers(true, 0);//stop every cast Shadow spike will reactivate em all
649  Timer[TIMER_SHADOW_SPIKE] = 100;
650  // empowered orbs before darkness
651  Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 15000 : urand(10000, 40000);
652  Timer[TIMER_ORBS_EMPOWER] = (Phase == PHASE_SACRIFICE) ? 10000 : 5000;
653  }
Definition: boss_kiljaeden.cpp:159
void ChangeTimers(bool status, uint32 WTimer)
Definition: boss_kiljaeden.cpp:581
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: boss_kiljaeden.cpp:177
bool SpeechBegins
Definition: boss_kiljaeden.cpp:563
bool TimerIsDeactivated[10]
Definition: boss_kiljaeden.cpp:560
Definition: boss_kiljaeden.cpp:174
uint32 Timer[10]
Definition: boss_kiljaeden.cpp:553
Definition: boss_kiljaeden.cpp:176
Phase
Definition: boss_kiljaeden.cpp:153
bool OrbActivated
Definition: boss_kiljaeden.cpp:562

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::Initialize ( void  )
inline
512  {
514  Timer[TIMER_SPEECH] = 0;
515 
516  //Phase 2 Timer
517  Timer[TIMER_SOUL_FLAY] = 11000;
518  Timer[TIMER_LEGION_LIGHTNING] = 30000;
519  Timer[TIMER_FIRE_BLOOM] = 20000;
520  Timer[TIMER_SUMMON_SHILEDORB] = 35000;
521 
522  //Phase 3 Timer
523  Timer[TIMER_SHADOW_SPIKE] = 4000;
524  Timer[TIMER_FLAME_DART] = 3000;
525  Timer[TIMER_DARKNESS] = 45000;
526  Timer[TIMER_ORBS_EMPOWER] = 35000;
527 
528  //Phase 4 Timer
529  Timer[TIMER_ARMAGEDDON] = 2000;
530 
531  ActiveTimers = 5;
532  WaitTimer = 0;
533  speechCount = 0;
534  SpeechTimer = 0;
535 
537 
538  IsInDarkness = false;
539  IsWaiting = false;
540  OrbActivated = false;
541  SpeechBegins = true;
542 
543  ChangeTimers(false, 0);
544  }
uint32 WaitTimer
Definition: boss_kiljaeden.cpp:554
bool IsWaiting
Definition: boss_kiljaeden.cpp:561
uint8 ActiveTimers
Definition: boss_kiljaeden.cpp:550
bool IsInDarkness
Definition: boss_kiljaeden.cpp:559
uint8 speechCount
Definition: boss_kiljaeden.cpp:555
uint32 SpeechTimer
Definition: boss_kiljaeden.cpp:551
Definition: boss_kiljaeden.cpp:156
Definition: boss_kiljaeden.cpp:168
void ChangeTimers(bool status, uint32 WTimer)
Definition: boss_kiljaeden.cpp:581
Definition: boss_kiljaeden.cpp:180
Definition: boss_kiljaeden.cpp:177
bool SpeechBegins
Definition: boss_kiljaeden.cpp:563
Definition: boss_kiljaeden.cpp:175
bool TimerIsDeactivated[10]
Definition: boss_kiljaeden.cpp:560
Definition: boss_kiljaeden.cpp:174
Definition: boss_kiljaeden.cpp:171
uint32 Timer[10]
Definition: boss_kiljaeden.cpp:553
Definition: boss_kiljaeden.cpp:165
Definition: boss_kiljaeden.cpp:169
Definition: boss_kiljaeden.cpp:176
Definition: boss_kiljaeden.cpp:170
Phase
Definition: boss_kiljaeden.cpp:153
bool OrbActivated
Definition: boss_kiljaeden.cpp:562

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::InitializeAI ( )
inlineoverridevirtual

Reimplemented from UnitAI.

566  {
567  // Scripted_NoMovementAI::InitializeAI();
568  }
void boss_kiljaeden::boss_kiljaedenAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

616  {
620  }
void DespawnAll()
Definition: ScriptedCreature.cpp:66
Definition: inflate.h:49
InstanceScript * instance
Definition: boss_kiljaeden.cpp:546
SummonList summons
Definition: boss_kiljaeden.cpp:547
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: boss_kiljaeden.cpp:50
Definition: sunwell_plateau.h:34

+ Here is the call graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::JustSummoned ( Creature summoned)
inlineoverridevirtual

Reimplemented from ScriptedAI.

601  {
602  if (summoned->GetEntry() == NPC_ARMAGEDDON_TARGET)
603  {
606  // summoned->SetVisibility(VISIBILITY_OFF); //with this we cant see the armageddon visuals
607  }
608  else
609  summoned->SetLevel(me->getLevel());
610 
611  summoned->setFaction(me->getFaction());
612  summons.Summon(summoned);
613  }
Definition: sunwell_plateau.h:86
Definition: Unit.h:674
uint32 getFaction() const
Definition: Unit.h:1466
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:92
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
uint8 getLevel() const
Definition: Unit.h:1408
void setFaction(uint32 faction)
Definition: Unit.h:1467
Creature *const me
Definition: CreatureAI.h:71
SummonList summons
Definition: boss_kiljaeden.cpp:547
void SetLevel(uint8 lvl)
Definition: Unit.cpp:11523
Definition: UpdateFields.h:109
uint32 GetEntry() const
Definition: Object.h:107
Definition: Unit.h:698

+ Here is the call graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

623  {
624  Talk(SAY_KJ_SLAY);
625  }
Definition: boss_kiljaeden.cpp:51
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42

+ Here is the call graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

571  {
572  Initialize();
573 
575  pKalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
576 
579  }
void DespawnAll()
Definition: ScriptedCreature.cpp:66
Definition: Creature.h:467
InstanceScript * instance
Definition: boss_kiljaeden.cpp:546
Creature *const me
Definition: CreatureAI.h:71
void Initialize()
Definition: boss_kiljaeden.cpp:511
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
SummonList summons
Definition: boss_kiljaeden.cpp:547
Definition: boss_kiljaeden.cpp:143
Definition: UpdateFields.h:116
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void SetFloatValue(uint16 index, float value)
Definition: Object.cpp:1067
Definition: sunwell_plateau.h:44

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kiljaeden::boss_kiljaedenAI::UpdateAI ( uint32  diff)
inlineoverridevirtual
Todo:
Timer

Reimplemented from ScriptedAI.

674  {
675  if (!UpdateVictim() || Phase < PHASE_NORMAL)
676  return;
677 
678  if (IsWaiting)
679  {
680  if (WaitTimer <= diff)
681  {
682  IsWaiting = false;
683  ChangeTimers(false, 0);
684  } else WaitTimer -= diff;
685  }
686 
687  for (uint8 t = 0; t < ActiveTimers; ++t)
688  {
689  if (Timer[t] < diff && !TimerIsDeactivated[t])
690  {
691  switch (t)
692  {
693  case TIMER_SPEECH:
694  if (SpeechBegins)
695  {
696  SpeechBegins=false;
697  switch (Phase)
698  {
699  case PHASE_NORMAL:
700  speechPhaseEnd=1;
701  break;
702  case PHASE_DARKNESS:
703  speechPhaseEnd=4;
704  break;
705  case PHASE_ARMAGEDDON:
706  speechPhaseEnd=7;
707  break;
708  case PHASE_SACRIFICE:
709  speechPhaseEnd=12;
710  break;
711  }
712  }
713  if (Speeches[speechCount].timer < SpeechTimer)
714  {
715  SpeechTimer = 0;
717  speechCreature->AI()->Talk(Speeches[speechCount].textid);
718  if (speechCount == 12)
720  pAnveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false);
721  // ChangeTimers(true, 10000); // Kil should do an emote while screaming without attacking for 10 seconds
722  if (speechCount == speechPhaseEnd)
724  speechCount++;
725  }
726  SpeechTimer += diff;
727  break;
728  case TIMER_SOUL_FLAY:
729  if (!me->IsNonMeleeSpellCast(false))
730  {
733  Timer[TIMER_SOUL_FLAY] = 3500;
734  }
735  break;
737  if (!me->IsNonMeleeSpellCast(false))
738  {
739  Unit* pRandomPlayer = NULL;
740 
742  for (uint8 z = 0; z < 6; ++z)
743  {
744  pRandomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
745  if (!pRandomPlayer || !pRandomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT))
746  break;
747  }
748 
749  if (pRandomPlayer)
750  DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false);
751  else
752  TC_LOG_ERROR("scripts", "try to cast SPELL_LEGION_LIGHTNING on invalid target");
753 
754  Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE
755  Timer[TIMER_SOUL_FLAY] = 2500;
756  }
757  break;
758  case TIMER_FIRE_BLOOM:
759  if (!me->IsNonMeleeSpellCast(false))
760  {
762  DoCastAOE(SPELL_FIRE_BLOOM, false);
763  Timer[TIMER_FIRE_BLOOM] = (Phase == PHASE_SACRIFICE) ? 25000 : 40000; // 25 seconds in PHASE_SACRIFICE
764  Timer[TIMER_SOUL_FLAY] = 1000;
765  }
766  break;
768  for (uint8 i = 1; i < Phase; ++i)
769  {
770  float sx, sy;
771  sx = ShieldOrbLocations[0][0] + std::sin(ShieldOrbLocations[i][0]);
772  sy = ShieldOrbLocations[0][1] + std::sin(ShieldOrbLocations[i][1]);
774  }
775  Timer[TIMER_SUMMON_SHILEDORB] = urand(30000, 60000); // 30-60seconds cooldown
776  Timer[TIMER_SOUL_FLAY] = 2000;
777  break;
778  case TIMER_SHADOW_SPIKE: //Phase 3
779  if (!me->IsNonMeleeSpellCast(false))
780  {
783  ChangeTimers(true, 30000);
786  }
787  break;
788  case TIMER_FLAME_DART: //Phase 3
789  DoCastAOE(SPELL_FLAME_DART, false);
790  Timer[TIMER_FLAME_DART] = 3000;
791  break;
792  case TIMER_DARKNESS: //Phase 3
793  if (!me->IsNonMeleeSpellCast(false))
794  {
795  // Begins to channel for 8 seconds, then deals 50'000 damage to all raid members.
796  if (!IsInDarkness)
797  {
800  ChangeTimers(true, 9000);
801  Timer[TIMER_DARKNESS] = 8750;
803  if (Phase == PHASE_SACRIFICE)
805  IsInDarkness = true;
806  }
807  else
808  {
809  Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 15000 : urand(40000, 70000);
810  IsInDarkness = false;
813  }
814  Timer[TIMER_SOUL_FLAY] = 9000;
815  }
816  break;
817  case TIMER_ORBS_EMPOWER: //Phase 3
819  {
820  switch (Phase)
821  {
822  case PHASE_SACRIFICE:
823  ENSURE_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalec->AI())->EmpowerOrb(true);
824  break;
825  default:
826  ENSURE_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalec->AI())->EmpowerOrb(false);
827  break;
828  }
829  }
830  OrbActivated = true;
832  break;
833  case TIMER_ARMAGEDDON: //Phase 4
834  Unit* target = NULL;
835  for (uint8 z = 0; z < 6; ++z)
836  {
837  target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
838  if (!target || !target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT)) break;
839  }
840  if (target)
841  {
842  float x, y, z;
843  target->GetPosition(x, y, z);
845  }
846  Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding
847  break;
848  }
849  }
850  }
852  //Time runs over!
853  for (uint8 i = 0; i < ActiveTimers; ++i)
854  if (!TimerIsDeactivated[i])
855  {
856  Timer[i] -= diff;
857  if (((int32)Timer[i]) < 0) Timer[i] = 0;
858  }
859 
860  //Phase 3
861  if (Phase <= PHASE_NORMAL && !IsInDarkness)
862  {
863  if (Phase == PHASE_NORMAL && HealthBelowPct(85))
864  {
865  Phase = PHASE_DARKNESS;
866  ActiveTimers = 9;
867  EnterNextPhase();
868  }
869  else return;
870  }
871 
872  //Phase 4
873  if (Phase <= PHASE_DARKNESS && !IsInDarkness)
874  {
875  if (Phase == PHASE_DARKNESS && HealthBelowPct(55))
876  {
877  Phase = PHASE_ARMAGEDDON;
878  ActiveTimers = 10;
879  EnterNextPhase();
880  }
881  else return;
882  }
883 
884  //Phase 5 specific spells all we can
885  if (Phase <= PHASE_ARMAGEDDON && !IsInDarkness)
886  {
887  if (Phase == PHASE_ARMAGEDDON && HealthBelowPct(25))
888  {
889  Phase = PHASE_SACRIFICE;
890  EnterNextPhase();
891  }
892  else return;
893  }
894  }
Definition: sunwell_plateau.h:86
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
#define SHIELD_ORB_Z
Definition: boss_kiljaeden.cpp:151
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:167
bool UpdateVictim()
Definition: CreatureAI.cpp:233
uint32 WaitTimer
Definition: boss_kiljaeden.cpp:554
Definition: boss_kiljaeden.cpp:95
bool IsWaiting
Definition: boss_kiljaeden.cpp:561
uint8 ActiveTimers
Definition: boss_kiljaeden.cpp:550
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
uint32 creature
Definition: boss_kiljaeden.cpp:203
Definition: boss_kiljaeden.cpp:83
bool IsInDarkness
Definition: boss_kiljaeden.cpp:559
Definition: boss_kiljaeden.cpp:58
Definition: sunwell_plateau.h:87
arena_t NULL
Definition: jemalloc_internal.h:624
uint8 speechCount
Definition: boss_kiljaeden.cpp:555
Definition: Creature.h:467
InstanceScript * instance
Definition: boss_kiljaeden.cpp:546
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:2886
uint32 SpeechTimer
Definition: boss_kiljaeden.cpp:551
Definition: boss_kiljaeden.cpp:159
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_kiljaeden.cpp:94
Definition: boss_kiljaeden.cpp:242
Definition: boss_kiljaeden.cpp:113
Definition: boss_kiljaeden.cpp:156
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: boss_kiljaeden.cpp:168
Definition: UnitAI.h:35
Definition: boss_kiljaeden.cpp:157
uint8 Phase
Definition: boss_kiljaeden.cpp:549
void ChangeTimers(bool status, uint32 WTimer)
Definition: boss_kiljaeden.cpp:581
Definition: Object.h:56
G3D::int16 z
Definition: Vector3int16.h:46
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
void GetPosition(float &x, float &y) const
Definition: Position.h:109
Definition: boss_kiljaeden.cpp:180
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
int32_t int32
Definition: Define.h:146
Definition: boss_kiljaeden.cpp:158
G3D::int16 y
Definition: Vector2int16.h:38
Definition: boss_kiljaeden.cpp:177
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
bool SpeechBegins
Definition: boss_kiljaeden.cpp:563
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_kiljaeden.cpp:175
float ShieldOrbLocations[4][2]
Definition: boss_kiljaeden.cpp:192
Definition: boss_kiljaeden.cpp:141
bool TimerIsDeactivated[10]
Definition: boss_kiljaeden.cpp:560
Definition: boss_kiljaeden.cpp:174
static Speech Speeches[]
Definition: boss_kiljaeden.cpp:207
Definition: boss_kiljaeden.cpp:171
Definition: boss_kiljaeden.cpp:81
Definition: Object.h:55
uint32 Timer[10]
Definition: boss_kiljaeden.cpp:553
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: boss_kiljaeden.cpp:165
Definition: boss_kiljaeden.cpp:97
Definition: boss_kiljaeden.cpp:169
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
uint8_t uint8
Definition: Define.h:152
Definition: boss_kiljaeden.cpp:176
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: sunwell_plateau.h:43
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_kiljaeden.cpp:96
Definition: boss_kiljaeden.cpp:170
G3D::int16 x
Definition: Vector2int16.h:37
Definition: boss_kiljaeden.cpp:54
Definition: boss_kiljaeden.cpp:84
void CastSinisterReflection()
Definition: boss_kiljaeden.cpp:655
Definition: Unit.h:1305
Definition: sunwell_plateau.h:44
Phase
Definition: boss_kiljaeden.cpp:153
bool OrbActivated
Definition: boss_kiljaeden.cpp:562
Definition: boss_kiljaeden.cpp:82
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
void EnterNextPhase()
Definition: boss_kiljaeden.cpp:643
uint8 speechPhaseEnd
Definition: boss_kiljaeden.cpp:556

+ Here is the call graph for this function:

Member Data Documentation

uint8 boss_kiljaeden::boss_kiljaedenAI::ActiveTimers
InstanceScript* boss_kiljaeden::boss_kiljaedenAI::instance
bool boss_kiljaeden::boss_kiljaedenAI::IsInDarkness
bool boss_kiljaeden::boss_kiljaedenAI::IsWaiting
bool boss_kiljaeden::boss_kiljaedenAI::OrbActivated
uint8 boss_kiljaeden::boss_kiljaedenAI::Phase
bool boss_kiljaeden::boss_kiljaedenAI::SpeechBegins
uint8 boss_kiljaeden::boss_kiljaedenAI::speechCount
uint8 boss_kiljaeden::boss_kiljaedenAI::speechPhaseEnd
uint32 boss_kiljaeden::boss_kiljaedenAI::SpeechTimer
SummonList boss_kiljaeden::boss_kiljaedenAI::summons
uint32 boss_kiljaeden::boss_kiljaedenAI::Timer[10]
bool boss_kiljaeden::boss_kiljaedenAI::TimerIsDeactivated[10]
uint32 boss_kiljaeden::boss_kiljaedenAI::WaitTimer

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