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

Public Member Functions

 boss_kaelthasAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void JustReachedHome () override
 
void DoAction (int32 action) override
 
void MoveInLineOfSight (Unit *who) override
 
void DamageTaken (Unit *attacker, uint32 &damage) override
 
void MovementInform (uint32 type, uint32 point) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *summoned) override
 
void JustDied (Unit *killer) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
virtual ~BossAI ()
 
void SummonedCreatureDespawn (Creature *summon) override
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void EnterCombat (Unit *) override
 
bool CanAIAttack (Unit const *target) const override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
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 EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
void OnCharmed (bool apply) override
 
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 void InitializeAI ()
 
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)
 

Private Attributes

uint8 _advisorCounter
 
uint8 _phase
 
uint8 _pyrosCast
 
uint8 _scaleStage
 
uint8 _netherbeamsCast
 
bool _hasFullPower
 
ObjectGuid _advisorGuid [MAX_ADVISORS]
 

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 ()
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _EnterCombat ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _DespawnAtEvade ()
 
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 CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_kaelthas::boss_kaelthasAI::boss_kaelthasAI ( Creature creature)
inline
434  : BossAI(creature, DATA_KAELTHAS)
435  {
436  Initialize();
437  }
Definition: magisters_terrace.h:31
void Initialize()
Definition: boss_kaelthas.cpp:439
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:444

+ Here is the call graph for this function:

Member Function Documentation

void boss_kaelthas::boss_kaelthasAI::DamageTaken ( Unit attacker,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

566  {
567  if (_phase == PHASE_NONE)
568  {
570  me->SetTarget(attacker->GetGUID());
571  }
572 
573  if (!_hasFullPower && me->HealthBelowPctDamaged(50, damage))
574  {
575  _hasFullPower = true;
576  me->AttackStop();
577  me->InterruptNonMeleeSpells(false);
583  }
584  }
bool AttackStop()
Definition: Unit.cpp:7337
Definition: boss_kaelthas.cpp:181
void CancelEventGroup(uint32 group)
Definition: EventMap.cpp:103
void SetPhase(uint8 phase)
Definition: EventMap.cpp:27
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1431
Definition: Unit.h:1129
Definition: boss_kaelthas.cpp:238
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: boss_kaelthas.cpp:248
void DoAction(int32 action) override
Definition: boss_kaelthas.cpp:476
bool _hasFullPower
Definition: boss_kaelthas.cpp:857
Position const TransitionPos[6]
Definition: boss_kaelthas.cpp:301
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: boss_kaelthas.cpp:239
uint8 _phase
Definition: boss_kaelthas.cpp:853
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
Definition: boss_kaelthas.cpp:253
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_kaelthas.cpp:244
void SetReactState(ReactStates st)
Definition: Creature.h:502
void SetTarget(ObjectGuid const &guid) override
Definition: Creature.cpp:2675

+ Here is the call graph for this function:

void boss_kaelthas::boss_kaelthasAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

477  {
478  switch (action)
479  {
481  Talk(SAY_INTRO);
483 
488 
492  break;
494  for (uint8 i = 0; i < MAX_ADVISORS; ++i)
495  {
496  if (Creature* creature = ObjectAccessor::GetCreature(*me, _advisorGuid[i]))
497  {
498  creature->Respawn(true);
499  creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
500  creature->AI()->EnterEvadeMode();
501  }
502  }
503  break;
505  // They have already been active, so we are not handling new ones, just counting their death.
507  ++_advisorCounter;
508 
509  switch (_advisorCounter)
510  {
511  case ADVISOR_THALADRED:
514  break;
515  case ADVISOR_SANGUINAR:
518  break;
519  case ADVISOR_CAPERNIAN:
522  break;
523  case ADVISOR_TELONICUS:
526  break;
528  // Every advisor defeated - Phase 2 starts.
531  break;
532  case MAX_KILLED_ADVISORS:
533  // Every advisor killed - Phase 3 starts.
535  break;
536  default:
537  break;
538  }
539  break;
548  break;
549  default:
550  break;
551  }
552  }
Definition: boss_kaelthas.cpp:209
Definition: boss_kaelthas.cpp:181
Definition: boss_kaelthas.cpp:194
Definition: the_eye.h:37
Definition: boss_kaelthas.cpp:202
Definition: Unit.h:674
Definition: the_eye.h:36
Definition: boss_kaelthas.cpp:247
void SetPhase(uint8 phase)
Definition: EventMap.cpp:27
Definition: boss_kaelthas.cpp:238
Definition: magisters_terrace.h:31
Definition: boss_kaelthas.cpp:203
Definition: boss_kaelthas.cpp:196
uint8 _advisorCounter
Definition: boss_kaelthas.cpp:852
Definition: boss_kaelthas.cpp:191
Definition: boss_kaelthas.cpp:40
Definition: boss_kaelthas.cpp:206
Definition: boss_kaelthas.cpp:184
Definition: boss_kaelthas.cpp:36
Definition: Creature.h:467
Definition: boss_kaelthas.cpp:193
Definition: boss_kaelthas.cpp:246
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: boss_kaelthas.cpp:38
Definition: boss_kaelthas.cpp:212
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: the_eye.h:35
Definition: boss_kaelthas.cpp:208
Definition: boss_kaelthas.cpp:183
Definition: InstanceScript.h:59
Definition: boss_kaelthas.cpp:245
Definition: boss_kaelthas.cpp:185
Definition: boss_kaelthas.cpp:204
Definition: boss_kaelthas.cpp:197
Definition: boss_kaelthas.cpp:39
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: boss_kaelthas.cpp:37
Definition: the_eye.h:38
Definition: UpdateFields.h:109
uint8 _phase
Definition: boss_kaelthas.cpp:853
Definition: boss_kaelthas.cpp:210
Definition: boss_kaelthas.cpp:190
Definition: boss_kaelthas.cpp:211
uint8_t uint8
Definition: Define.h:152
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_kaelthas.cpp:35
ObjectGuid _advisorGuid[MAX_ADVISORS]
Definition: boss_kaelthas.cpp:858
Definition: Unit.h:698
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: boss_kaelthas.cpp:192

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kaelthas::boss_kaelthasAI::Initialize ( void  )
inline
440  {
441  _advisorCounter = 0;
442  _pyrosCast = 0;
443  _netherbeamsCast = 0;
444  _phase = PHASE_NONE;
445  _scaleStage = 0;
446  _hasFullPower = false;
447  }
uint8 _advisorCounter
Definition: boss_kaelthas.cpp:852
uint8 _netherbeamsCast
Definition: boss_kaelthas.cpp:856
uint8 _scaleStage
Definition: boss_kaelthas.cpp:855
bool _hasFullPower
Definition: boss_kaelthas.cpp:857
uint8 _pyrosCast
Definition: boss_kaelthas.cpp:854
uint8 _phase
Definition: boss_kaelthas.cpp:853
Definition: boss_kaelthas.cpp:244

+ Here is the caller graph for this function:

void boss_kaelthas::boss_kaelthasAI::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from BossAI.

650  {
651  Talk(SAY_DEATH);
652  BossAI::JustDied(killer);
653  }
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_kaelthas.cpp:48
void JustDied(Unit *) override
Definition: ScriptedCreature.h:357

+ Here is the call graph for this function:

void boss_kaelthas::boss_kaelthasAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from BossAI.

462  {
464 
465  // Rebuild the surrounding environment.
467  statue->ResetDoorOrButton();
468 
470  statue->ResetDoorOrButton();
471 
473  window->ResetDoorOrButton();
474  }
void JustReachedHome() override
Definition: ScriptedCreature.h:358
Definition: the_eye.h:43
GameObject * GetGameObject(uint32 type)
Definition: InstanceScript.h:184
Definition: GameObject.h:880
Definition: magisters_terrace.h:34
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: magisters_terrace.h:33

+ Here is the call graph for this function:

void boss_kaelthas::boss_kaelthasAI::JustSummoned ( Creature summoned)
inlineoverridevirtual

Reimplemented from BossAI.

638  {
639  // if not phoenix, then it's one of the 7 weapons
640  if (summoned->GetEntry() != NPC_PHOENIX)
641  {
642  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
643  summoned->AI()->AttackStart(target);
644 
645  summons.Summon(summoned);
646  }
647  }
Definition: boss_kaelthas.cpp:168
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:92
Definition: UnitAI.h:35
CreatureAI * AI() const
Definition: Creature.h:525
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
SummonList summons
Definition: ScriptedCreature.h:372
uint32 GetEntry() const
Definition: Object.h:107
Definition: Unit.h:1305
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29

+ Here is the call graph for this function:

void boss_kaelthas::boss_kaelthasAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

633  {
634  Talk(SAY_SLAY);
635  }
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_kaelthas.cpp:44

+ Here is the call graph for this function:

void boss_kaelthas::boss_kaelthasAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

555  {
556  if (_phase == PHASE_NONE && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 30.0f))
557  {
559  who->SetInCombatWith(me);
560  me->AddThreat(who, 0.0f);
561  me->SetTarget(who->GetGUID());
562  }
563  }
Definition: boss_kaelthas.cpp:181
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: Unit.cpp:10691
bool IsValidAttackTarget(Unit const *target) const
Definition: Unit.cpp:10002
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
Creature *const me
Definition: CreatureAI.h:71
void DoAction(int32 action) override
Definition: boss_kaelthas.cpp:476
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint8 _phase
Definition: boss_kaelthas.cpp:853
Definition: boss_kaelthas.cpp:244
void SetTarget(ObjectGuid const &guid) override
Definition: Creature.cpp:2675
void SetInCombatWith(Unit *enemy)
Definition: Unit.cpp:9840

+ Here is the call graph for this function:

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

Reimplemented from CreatureAI.

587  {
588  if (type != POINT_MOTION_TYPE)
589  return;
590 
591  switch (point)
592  {
595  break;
597  me->SetFacingTo(float(M_PI));
600  me->SetDisableGravity(true);
601  //me->SetHover(true); -- Set in sniffs, but breaks his visual.
604  break;
608  break;
611  break;
614  break;
617  me->InterruptNonMeleeSpells(false);
620 
621  if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0))
622  AttackStart(target);
623 
626  break;
627  default:
628  break;
629  }
630  }
Definition: UnitAI.h:36
Definition: Unit.h:1131
Definition: boss_kaelthas.cpp:222
Definition: boss_kaelthas.cpp:247
Definition: boss_kaelthas.cpp:230
Definition: boss_kaelthas.cpp:43
#define M_PI
Definition: Common.h:163
Definition: boss_kaelthas.cpp:238
Definition: boss_kaelthas.cpp:257
Definition: boss_kaelthas.cpp:224
Definition: boss_kaelthas.cpp:110
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: boss_kaelthas.cpp:218
Creature *const me
Definition: CreatureAI.h:71
void DoAction(int32 action) override
Definition: boss_kaelthas.cpp:476
Definition: boss_kaelthas.cpp:223
Definition: boss_kaelthas.cpp:254
Definition: boss_kaelthas.cpp:255
Definition: boss_kaelthas.cpp:185
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void SetFacingTo(float ori)
Definition: Unit.cpp:15777
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117
Definition: UpdateFields.h:109
Definition: boss_kaelthas.cpp:231
Definition: boss_kaelthas.cpp:226
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
Definition: boss_kaelthas.cpp:258
Definition: boss_kaelthas.cpp:253
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_kaelthas.cpp:256
Definition: Unit.h:1305
void SetReactState(ReactStates st)
Definition: Creature.h:502
Definition: MotionMaster.h:46
Definition: Unit.h:698
Definition: boss_kaelthas.cpp:102

+ Here is the call graph for this function:

void boss_kaelthas::boss_kaelthasAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

450  {
451  Initialize();
455  me->SetDisableGravity(false);
457  me->SetObjectScale(1.0f);
458  BossAI::Reset();
459  }
Definition: UpdateFields.h:136
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
void Initialize()
Definition: boss_kaelthas.cpp:439
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
void SetObjectScale(float scale) override
Definition: Creature.cpp:2653
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_kaelthas.cpp:183
void DoAction(int32 action) override
Definition: boss_kaelthas.cpp:476
void Reset() override
Definition: ScriptedCreature.h:355
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: UpdateFields.h:109
Definition: SharedDefines.h:2412
Definition: Unit.h:698
void SetTarget(ObjectGuid const &guid) override
Definition: Creature.cpp:2675

+ Here is the call graph for this function:

void boss_kaelthas::boss_kaelthasAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

656  {
657  if (_phase == PHASE_COMBAT)
658  if (!UpdateVictim())
659  return;
660 
661  events.Update(diff);
662 
663  // SPELL_KAEL_GAINING_POWER and SPELL_KAEL_STUNNED are channeling spells that need to be interrupted during his transition.
665  return;
666 
667  while (uint32 eventId = events.ExecuteEvent())
668  {
669  switch (eventId)
670  {
674  break;
677  {
678  advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
679 
680  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
681  advisor->AI()->AttackStart(target);
682  }
683  ++_advisorCounter;
684  break;
686  {
687  DoCast(me, SPELL_SUMMON_WEAPONS, false);
688 
689  uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon) / sizeof(uint32);
690 
691  for (uint32 i = 0; i < uiMaxWeapon; ++i)
692  DoCast(me, m_auiSpellSummonWeapon[i], true);
693 
695  break;
696  }
701  break;
702  case EVENT_ENGAGE_COMBAT:
704 
705  // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael.
706  DoResetThreat();
707 
709 
710  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
711  AttackStart(target);
712 
715  break;
716  case EVENT_FIREBALL:
719  break;
723  break;
724  case EVENT_FLAMESTRIKE:
725  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
726  DoCast(target, SPELL_FLAME_STRIKE);
727 
729  break;
730  case EVENT_MIND_CONTROL:
734  break;
739  break;
744  break;
745  case EVENT_PYROBLAST:
746  _pyrosCast = 0;
751  break;
753  if (_pyrosCast < 3)
754  {
757  _pyrosCast++;
758  }
759  else
761  break;
762  case EVENT_GRAVITY_LAPSE:
770  break;
771  case EVENT_NETHER_BEAM:
772  if (_netherbeamsCast <= 8)
773  {
774  if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0))
775  DoCast(unit, SPELL_NETHER_BEAM);
776 
779  }
780  else
781  _netherbeamsCast = 0;
782  break;
783  case EVENT_TRANSITION_1:
785  break;
786  case EVENT_TRANSITION_2:
788  me->GetMotionMaster()->Clear();
791  break;
792  case EVENT_TRANSITION_3:
794  break;
795  case EVENT_TRANSITION_4:
797  break;
798  case EVENT_TRANSITION_5:
800  break;
801  case EVENT_EXPLODE:
802  me->InterruptNonMeleeSpells(false);
805  DoCast(me, SPELL_KAEL_STUNNED); // Core doesn't handle the emote properly while flying.
807 
808  // Destroy the surrounding environment.
810  statue->UseDoorOrButton();
811 
813  statue->UseDoorOrButton();
814 
816  window->UseDoorOrButton();
817 
819  break;
820  case EVENT_SIZE_INCREASE:
821  switch (_scaleStage)
822  {
823  case 0:
824  me->SetObjectScale(1.4f);
826  break;
827  case 1:
828  me->SetObjectScale(1.8f);
830  break;
831  case 2:
832  me->SetObjectScale(2.0f);
834  break;
835  case 3:
836  me->SetObjectScale(2.2f);
837  break;
838  default:
839  break;
840  }
841  ++_scaleStage;
842  break;
843  default:
844  break;
845  }
846  }
847 
850  }
Definition: boss_kaelthas.cpp:90
Definition: boss_kaelthas.cpp:219
Definition: boss_kaelthas.cpp:209
uint32 m_auiSpellSummonWeapon[]
Definition: boss_kaelthas.cpp:261
Definition: boss_kaelthas.cpp:202
Definition: UpdateFields.h:136
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:167
Definition: boss_kaelthas.cpp:47
Definition: Unit.h:674
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
Definition: Unit.cpp:2931
Definition: boss_kaelthas.cpp:222
Definition: boss_kaelthas.cpp:247
Definition: boss_kaelthas.cpp:213
Definition: Unit.h:565
void Clear(bool reset=true)
Definition: MotionMaster.h:138
Definition: boss_kaelthas.cpp:230
Definition: boss_kaelthas.cpp:238
Definition: boss_kaelthas.cpp:83
Definition: boss_kaelthas.cpp:203
uint8 _advisorCounter
Definition: boss_kaelthas.cpp:852
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: boss_kaelthas.cpp:72
Definition: boss_kaelthas.cpp:42
Definition: boss_kaelthas.cpp:215
Definition: the_eye.h:43
Definition: boss_kaelthas.cpp:257
Definition: boss_kaelthas.cpp:206
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
Definition: boss_kaelthas.cpp:99
Definition: boss_kaelthas.cpp:113
Definition: boss_kaelthas.cpp:184
Definition: boss_kaelthas.cpp:224
uint8 _netherbeamsCast
Definition: boss_kaelthas.cpp:856
Definition: Creature.h:467
Definition: boss_kaelthas.cpp:110
Definition: boss_kaelthas.cpp:246
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void SetObjectScale(float scale) override
Definition: Creature.cpp:2653
Definition: boss_kaelthas.cpp:159
Definition: boss_kaelthas.cpp:103
bool IsInPhase(uint8 phase) const
Definition: EventMap.h:290
Definition: boss_kaelthas.cpp:217
Definition: boss_kaelthas.cpp:101
Definition: boss_kaelthas.cpp:218
Definition: boss_kaelthas.cpp:49
Definition: boss_kaelthas.cpp:88
Definition: boss_kaelthas.cpp:212
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: Unit.h:690
Definition: boss_kaelthas.cpp:208
void DoAction(int32 action) override
Definition: boss_kaelthas.cpp:476
Definition: UnitAI.h:35
Definition: boss_kaelthas.cpp:92
Definition: boss_kaelthas.cpp:223
uint8 _scaleStage
Definition: boss_kaelthas.cpp:855
Definition: boss_kaelthas.cpp:85
Definition: boss_kaelthas.cpp:254
Definition: boss_kaelthas.cpp:255
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: boss_kaelthas.cpp:185
Definition: boss_kaelthas.cpp:41
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
GameObject * GetGameObject(uint32 type)
Definition: InstanceScript.h:184
uint32_t uint32
Definition: Define.h:150
uint8 _pyrosCast
Definition: boss_kaelthas.cpp:854
Definition: boss_kaelthas.cpp:204
Definition: boss_kaelthas.cpp:46
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: GameObject.h:880
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Position const TransitionPos[6]
Definition: boss_kaelthas.cpp:301
Definition: boss_kaelthas.cpp:80
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: boss_kaelthas.cpp:214
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:2108
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void Update(uint32 time)
Definition: EventMap.h:54
Definition: magisters_terrace.h:34
Definition: boss_kaelthas.cpp:205
Definition: boss_kaelthas.cpp:45
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
void DoResetThreat()
Definition: ScriptedCreature.cpp:248
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117
Definition: boss_kaelthas.cpp:239
Definition: UpdateFields.h:109
Definition: boss_kaelthas.cpp:231
uint8 _phase
Definition: boss_kaelthas.cpp:853
Definition: boss_kaelthas.cpp:210
Definition: boss_kaelthas.cpp:225
Definition: boss_kaelthas.cpp:226
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
Definition: boss_kaelthas.cpp:258
Definition: boss_kaelthas.cpp:211
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
uint8_t uint8
Definition: Define.h:152
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_kaelthas.cpp:96
Definition: boss_kaelthas.cpp:256
Definition: SharedDefines.h:2496
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_kaelthas.cpp:84
Definition: Unit.h:786
Definition: Unit.h:1305
Definition: SharedDefines.h:2412
ObjectGuid _advisorGuid[MAX_ADVISORS]
Definition: boss_kaelthas.cpp:858
Definition: Unit.h:698
Definition: boss_kaelthas.cpp:89
void DelayEvents(Milliseconds const &delay)
Definition: EventMap.h:219
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: magisters_terrace.h:33
Definition: boss_kaelthas.cpp:102

+ Here is the call graph for this function:

Member Data Documentation

uint8 boss_kaelthas::boss_kaelthasAI::_advisorCounter
private
ObjectGuid boss_kaelthas::boss_kaelthasAI::_advisorGuid[MAX_ADVISORS]
private
bool boss_kaelthas::boss_kaelthasAI::_hasFullPower
private
uint8 boss_kaelthas::boss_kaelthasAI::_netherbeamsCast
private
uint8 boss_kaelthas::boss_kaelthasAI::_phase
private
uint8 boss_kaelthas::boss_kaelthasAI::_pyrosCast
private
uint8 boss_kaelthas::boss_kaelthasAI::_scaleStage
private

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