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

Public Member Functions

 boss_kelthuzadAI (Creature *c)
 
float NormalizeOrientation (float o)
 
void SpawnHelpers ()
 
void SummonHelper (uint32 entry, uint32 count)
 
void Reset () override
 
void EnterEvadeMode (EvadeReason why) override
 
void KilledUnit (Unit *who) override
 
void JustDied (Unit *killer) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged.
 
void JustSummoned (Creature *cr) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void OnSpellCastFinished (SpellInfo const *spell, SpellFinishReason reason) 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.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=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 >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (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 *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

EventMap events
 
SummonList summons
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

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 ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_kelthuzadAI()

boss_kelthuzad::boss_kelthuzadAI::boss_kelthuzadAI ( Creature c)
inlineexplicit
146 {}
Definition ScriptedCreature.h:481
@ BOSS_KELTHUZAD
Definition naxxramas.h:41
Creature * me
Definition ScriptedCreature.h:280
SummonList summons
Definition boss_kelthuzad.cpp:149

Member Function Documentation

◆ EnterEvadeMode()

void boss_kelthuzad::boss_kelthuzadAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

240 {
243 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:255
@ UNIT_FLAG_DISABLE_MOVE
Definition UnitDefines.h:256
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:215
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:734

References CreatureAI::EnterEvadeMode(), ScriptedAI::me, Unit::RemoveUnitFlag(), UNIT_FLAG_DISABLE_MOVE, and UNIT_FLAG_NON_ATTACKABLE.

◆ JustDied()

void boss_kelthuzad::boss_kelthuzadAI::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from CreatureAI.

255 {
256 BossAI::JustDied(killer);
259 {
260 guardian->AI()->Talk(EMOTE_GUARDIAN_FLEE);
261 }
263 }
@ ACTION_GUARDIANS_OFF
Definition boss_kelthuzad.cpp:73
@ NPC_GUARDIAN_OF_ICECROWN
Definition boss_kelthuzad.cpp:68
@ SAY_DEATH
Definition boss_kelthuzad.cpp:31
@ EMOTE_GUARDIAN_FLEE
Definition boss_kelthuzad.cpp:39
void JustDied(Unit *) override
Definition ScriptedCreature.h:521
Definition Creature.h:47
Creature * GetCreatureWithEntry(uint32 entry) const
Definition ScriptedCreature.cpp:132
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:102
Talk
Definition hyjal.cpp:82

References ACTION_GUARDIANS_OFF, SummonList::DoAction(), EMOTE_GUARDIAN_FLEE, SummonList::GetCreatureWithEntry(), BossAI::JustDied(), NPC_GUARDIAN_OF_ICECROWN, SAY_DEATH, and summons.

◆ JustEngagedWith()

void boss_kelthuzad::boss_kelthuzadAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

272 {
277 me->SetTarget();
280 events.ScheduleEvent(EVENT_SPAWN_POOL, 5s);
281 events.ScheduleEvent(EVENT_SUMMON_SOLDIER, 6400ms);
283 events.ScheduleEvent(EVENT_SUMMON_SOUL_WEAVER, 12s);
284 events.ScheduleEvent(EVENT_PHASE_2, 228s);
285 events.ScheduleEvent(EVENT_ENRAGE, 15min);
286
288 {
289 events.ScheduleEvent(EVENT_FLOOR_CHANGE, 15s);
290 go->SetGoState(GO_STATE_ACTIVE);
291 }
292 }
@ GO_STATE_ACTIVE
Definition GameObjectData.h:691
@ REACT_PASSIVE
Definition Unit.h:550
@ SAY_SUMMON_MINIONS
Definition boss_kelthuzad.cpp:36
@ EVENT_SPAWN_POOL
Definition boss_kelthuzad.cpp:94
@ EVENT_ENRAGE
Definition boss_kelthuzad.cpp:93
@ EVENT_SUMMON_SOUL_WEAVER
Definition boss_kelthuzad.cpp:81
@ EVENT_FLOOR_CHANGE
Definition boss_kelthuzad.cpp:92
@ EVENT_SUMMON_SOLDIER
Definition boss_kelthuzad.cpp:79
@ EVENT_PHASE_2
Definition boss_kelthuzad.cpp:82
@ EVENT_SUMMON_UNSTOPPABLE_ABOMINATION
Definition boss_kelthuzad.cpp:80
@ SPELL_KELTHUZAD_CHANNEL
Definition boss_kelthuzad.cpp:55
events
Definition boss_sartura.cpp:43
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition ScriptedCreature.h:519
InstanceScript *const instance
Definition ScriptedCreature.h:488
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition Creature.cpp:3439
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
Definition GameObject.h:120
GameObject * GetGameObject(uint32 type)
Definition InstanceScript.cpp:120
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:1194
void RemoveAllAttackers()
Remove all units in m_attackers list and send them AttackStop()
Definition Unit.cpp:10560
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:733
@ DATA_KELTHUZAD_FLOOR
Definition naxxramas.h:68

References Unit::CastSpell(), DATA_KELTHUZAD_FLOOR, EVENT_ENRAGE, EVENT_FLOOR_CHANGE, EVENT_PHASE_2, EVENT_SPAWN_POOL, EVENT_SUMMON_SOLDIER, EVENT_SUMMON_SOUL_WEAVER, EVENT_SUMMON_UNSTOPPABLE_ABOMINATION, InstanceScript::GetGameObject(), GO_STATE_ACTIVE, BossAI::instance, BossAI::JustEngagedWith(), ScriptedAI::me, REACT_PASSIVE, Unit::RemoveAllAttackers(), SAY_SUMMON_MINIONS, Creature::SetReactState(), Creature::SetTarget(), Unit::SetUnitFlag(), SPELL_KELTHUZAD_CHANNEL, UNIT_FLAG_DISABLE_MOVE, and UNIT_FLAG_NON_ATTACKABLE.

◆ JustSummoned()

void boss_kelthuzad::boss_kelthuzadAI::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from CreatureAI.

295 {
296 summons.Summon(cr);
297 if (!cr->IsInCombat())
298 {
299 cr->GetMotionMaster()->MoveRandom(5);
300 }
302 {
304 }
305 }
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:339
void MoveRandom(float wanderDistance=0.0f)
Enable a random movement in desired range around the unit. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:243
uint32 GetEntry() const
Definition Object.h:116
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
MotionMaster * GetMotionMaster()
Definition Unit.h:1713
bool IsInCombat() const
Definition Unit.h:917
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References Object::GetEntry(), Unit::GetMotionMaster(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::IsInCombat(), MotionMaster::MoveRandom(), NPC_GUARDIAN_OF_ICECROWN, Creature::SetHomePosition(), SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_kelthuzad::boss_kelthuzadAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

246 {
247 if (!who->IsPlayer())
248 return;
249
250 Talk(SAY_SLAY);
252 }
@ SAY_SLAY
Definition boss_kelthuzad.cpp:30
void StorePersistentData(uint32 index, uint32 data)
Definition InstanceScript.cpp:422
bool IsPlayer() const
Definition Object.h:201
@ PERSISTENT_DATA_IMMORTAL_FAIL
Definition naxxramas.h:88

References BossAI::instance, Object::IsPlayer(), PERSISTENT_DATA_IMMORTAL_FAIL, SAY_SLAY, and InstanceScript::StorePersistentData().

◆ MoveInLineOfSight()

void boss_kelthuzad::boss_kelthuzadAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

266 {
267 if (!me->IsInCombat() && who->IsPlayer() && who->IsAlive() && me->GetDistance(who) <= 50.0f)
268 AttackStart(who);
269 }
bool IsAlive() const
Definition Unit.h:1748
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1278
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:210

References ScriptedAI::AttackStart(), WorldObject::GetDistance(), Unit::IsAlive(), Unit::IsInCombat(), Object::IsPlayer(), and ScriptedAI::me.

◆ NormalizeOrientation()

float boss_kelthuzad::boss_kelthuzadAI::NormalizeOrientation ( float  o)
inline
152 {
153 return std::fmod(o, 2.0f * static_cast<float>(M_PI)); // Only positive values will be passed
154 }

◆ Reset()

void boss_kelthuzad::boss_kelthuzadAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

214 {
216 events.Reset();
221 {
222 go->SetPhaseMask(1, true);
223 go->SetGoState(GO_STATE_READY);
224 }
225
227 go->SetGoState(GO_STATE_READY);
228
230 go->SetGoState(GO_STATE_READY);
231
233 go->SetGoState(GO_STATE_READY);
234
236 go->SetGoState(GO_STATE_READY);
237 }
@ GO_STATE_READY
Definition GameObjectData.h:692
@ REACT_AGGRESSIVE
Definition Unit.h:552
void Reset() override
Definition ScriptedCreature.h:518
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:71
@ DATA_KELTHUZAD_PORTAL_3
Definition naxxramas.h:71
@ DATA_KELTHUZAD_PORTAL_2
Definition naxxramas.h:70
@ DATA_KELTHUZAD_PORTAL_1
Definition naxxramas.h:69
@ DATA_KELTHUZAD_PORTAL_4
Definition naxxramas.h:72

References DATA_KELTHUZAD_FLOOR, DATA_KELTHUZAD_PORTAL_1, DATA_KELTHUZAD_PORTAL_2, DATA_KELTHUZAD_PORTAL_3, DATA_KELTHUZAD_PORTAL_4, SummonList::DespawnAll(), InstanceScript::GetGameObject(), GO_STATE_READY, BossAI::instance, ScriptedAI::me, REACT_AGGRESSIVE, Unit::RemoveUnitFlag(), BossAI::Reset(), Creature::SetReactState(), summons, UNIT_FLAG_DISABLE_MOVE, and UNIT_FLAG_NON_ATTACKABLE.

◆ SpawnHelpers()

void boss_kelthuzad::boss_kelthuzadAI::SpawnHelpers ( )
inline
157 {
158 // spawn at gate
159 me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, 3656.19f, -5093.78f, 143.33f, 6.08, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);// abo center
160 me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, 3657.94f, -5087.68f, 143.60f, 6.08, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);// abo left
161 me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, 3655.48f, -5100.05f, 143.53f, 6.08, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);// abo right
162 me->SummonCreature(NPC_SOUL_WEAVER, 3651.73f, -5092.62f, 143.38f, 6.05, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // soul behind
163 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3660.17f, -5092.45f, 143.37f, 6.07, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske front left
164 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3659.39f, -5096.21f, 143.29f, 6.07, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske front right
165 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3659.29f, -5090.19f, 143.48f, 6.07, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske left left
166 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3657.43f, -5098.03f, 143.41f, 6.07, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske right right
167 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3654.36f, -5090.51f, 143.48f, 6.09, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske behind left
168 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3653.35f, -5095.91f, 143.41f, 6.09, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske right right
169
170 // 6 rooms, 8 soldiers, 3 abominations and 1 weaver in each room | middle positions in table starts from 6
171 for (uint8 i = 6; i < 12; ++i)
172 {
173 for (uint8 j = 0; j < 8; ++j)
174 {
175 float angle = M_PI * 2 / 8 * j;
176 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, SummonGroups[i].GetPositionX() + 6 * cos(angle), SummonGroups[i].GetPositionY() + 6 * std::sin(angle), SummonGroups[i].GetPositionZ(), SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
177 }
178 }
179 for (uint8 i = 6; i < 12; ++i)
180 {
181 for (uint8 j = 1; j < 4; ++j)
182 {
183 float dist = j == 2 ? 0.0f : 8.0f; // second in middle
184 float angle = SummonGroups[i].GetOrientation() + M_PI * 2 / 4 * j;
185 me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, SummonGroups[i].GetPositionX() + dist * cos(angle), SummonGroups[i].GetPositionY() + dist * std::sin(angle), SummonGroups[i].GetPositionZ(), SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
186 }
187 }
188 for (uint8 i = 6; i < 12; ++i)
189 {
190 for (uint8 j = 0; j < 1; ++j)
191 {
192 float angle = SummonGroups[i].GetOrientation() + M_PI;
193 me->SummonCreature(NPC_SOUL_WEAVER, SummonGroups[i].GetPositionX() + 6 * cos(angle), SummonGroups[i].GetPositionY() + 6 * std::sin(angle), SummonGroups[i].GetPositionZ() + 0.5f, SummonGroups[i].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
194 }
195 }
196 }
std::uint8_t uint8
Definition Define.h:109
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:53
SummonGroups
Definition boss_jedoga_shadowseeker.cpp:90
@ NPC_SOLDIER_OF_THE_FROZEN_WASTES
Definition boss_kelthuzad.cpp:65
@ NPC_SOUL_WEAVER
Definition boss_kelthuzad.cpp:67
@ NPC_UNSTOPPABLE_ABOMINATION
Definition boss_kelthuzad.cpp:66
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2359

References Position::GetOrientation(), ScriptedAI::me, NPC_SOLDIER_OF_THE_FROZEN_WASTES, NPC_SOUL_WEAVER, NPC_UNSTOPPABLE_ABOMINATION, WorldObject::SummonCreature(), and TEMPSUMMON_CORPSE_TIMED_DESPAWN.

Referenced by UpdateAI().

◆ SummonHelper()

void boss_kelthuzad::boss_kelthuzadAI::SummonHelper ( uint32  entry,
uint32  count 
)
inline
199 {
200 for (uint8 i = 0; i < count; ++i)
201 {
203 {
204 if (Unit* target = SelectTargetFromPlayerList(100.0f))
205 {
206 cr->AI()->DoAction(ACTION_CALL_HELP_OFF);
207 cr->AI()->AttackStart(target);
208 }
209 }
210 }
211 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ ACTION_CALL_HELP_OFF
Definition boss_kelthuzad.cpp:71
const Position SpawnPool[7]
Definition boss_kelthuzad.cpp:121
Definition Unit.h:650
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:563

References ACTION_CALL_HELP_OFF, ScriptedAI::me, ScriptedAI::SelectTargetFromPlayerList(), SpawnPool, WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, and urand().

Referenced by UpdateAI().

◆ UpdateAI()

void boss_kelthuzad::boss_kelthuzadAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

308 {
309 if (!UpdateVictim())
310 return;
311
312 events.Update(diff);
314 {
316 return;
317 }
318
319 switch (events.ExecuteEvent())
320 {
323 {
324 events.ScheduleEvent(EVENT_FLOOR_CHANGE, 15s);
325 go->SetGoState(GO_STATE_READY);
326 go->SetPhaseMask(2, true);
327 }
328 break;
329 case EVENT_SPAWN_POOL:
330 SpawnHelpers();
331 break;
334 events.Repeat(3100ms);
335 break;
338 events.Repeat(18s + 500ms);
339 break;
342 events.Repeat(30s);
343 break;
344 case EVENT_PHASE_2:
347 events.Reset();
353 events.ScheduleEvent(EVENT_FROST_BOLT_SINGLE, 2s, 10s);
354 events.ScheduleEvent(EVENT_FROST_BOLT_MULTI, 15s, 30s);
355 events.ScheduleEvent(EVENT_DETONATE_MANA, 30s);
356 events.ScheduleEvent(EVENT_PHASE_3, 1s);
357 events.ScheduleEvent(EVENT_SHADOW_FISSURE, 25s);
358 events.ScheduleEvent(EVENT_FROST_BLAST, 45s);
359 if (Is25ManRaid())
360 {
361 events.ScheduleEvent(EVENT_CHAINS, 90s);
362 }
363 break;
364 case EVENT_ENRAGE:
365 me->CastSpell(me, SPELL_BERSERK, true);
366 break;
369 events.Repeat(2s, 10s);
370 break;
373 events.Repeat(15s, 30s);
374 break;
376 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
377 {
378 me->CastSpell(target, SPELL_SHADOW_FISURE, false);
379 }
380 events.Repeat(25s);
381 break;
383 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0, true, RAID_MODE(false, true)))
384 {
385 me->CastSpell(target, SPELL_FROST_BLAST, false);
386 }
388 events.Repeat(45s);
389 break;
390 case EVENT_CHAINS:
391 for (uint8 i = 0; i < 3; ++i)
392 {
393 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200, true, false, -SPELL_CHAINS_OF_KELTHUZAD))
394 {
395 me->CastSpell(target, SPELL_CHAINS_OF_KELTHUZAD, true);
396 }
397 }
399 events.Repeat(90s);
400 break;
402 {
403 std::vector<Unit*> unitList;
405 for (auto itr : threatList)
406 {
407 if (itr->getTarget()->IsPlayer()
408 && itr->getTarget()->getPowerType() == POWER_MANA
409 && itr->getTarget()->GetPower(POWER_MANA))
410 {
411 unitList.push_back(itr->getTarget());
412 }
413 }
414 if (!unitList.empty())
415 {
416 auto itr = unitList.begin();
417 advance(itr, urand(0, unitList.size() - 1));
418 me->CastSpell(*itr, SPELL_DETONATE_MANA, false);
420 }
421 events.Repeat(30s);
422 break;
423 }
424 case EVENT_PHASE_3:
425 if (me->HealthBelowPct(45))
426 {
428 events.DelayEvents(5500ms);
429 events.ScheduleEvent(EVENT_P3_LICH_KING_SAY, 5s);
431 go->SetGoState(GO_STATE_ACTIVE);
432
434 go->SetGoState(GO_STATE_ACTIVE);
435
437 go->SetGoState(GO_STATE_ACTIVE);
438
440 go->SetGoState(GO_STATE_ACTIVE);
441
442 break;
443 }
444 events.Repeat(1s);
445 break;
447 {
449 cr->AI()->Talk(SAY_ANSWER_REQUEST);
450
451 for (uint8 i = 0 ; i < RAID_MODE(2, 4); ++i)
452 events.ScheduleEvent(EVENT_SUMMON_GUARDIAN_OF_ICECROWN, Milliseconds(10000 + (i * 5000)));
453
454 break;
455 }
458 {
459 cr->AI()->Talk(EMOTE_GUARDIAN_APPEAR);
460 cr->AI()->AttackStart(me->GetVictim());
461 }
462 break;
463 }
466 }
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition CreatureAIImpl.h:25
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
@ POWER_MANA
Definition SharedDefines.h:280
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ ACTION_SECOND_PHASE
Definition boss_kelthuzad.cpp:72
@ SAY_FROST_BLAST
Definition boss_kelthuzad.cpp:33
@ SAY_CHAIN
Definition boss_kelthuzad.cpp:32
@ SAY_AGGRO
Definition boss_kelthuzad.cpp:29
@ SAY_SPECIAL
Definition boss_kelthuzad.cpp:37
@ EMOTE_GUARDIAN_APPEAR
Definition boss_kelthuzad.cpp:40
@ SAY_ANSWER_REQUEST
Definition boss_kelthuzad.cpp:27
@ EMOTE_PHASE_TWO
Definition boss_kelthuzad.cpp:35
@ SAY_REQUEST_AID
Definition boss_kelthuzad.cpp:34
@ EVENT_CHAINS
Definition boss_kelthuzad.cpp:90
@ EVENT_FROST_BOLT_MULTI
Definition boss_kelthuzad.cpp:84
@ EVENT_SUMMON_GUARDIAN_OF_ICECROWN
Definition boss_kelthuzad.cpp:91
@ EVENT_P3_LICH_KING_SAY
Definition boss_kelthuzad.cpp:87
@ EVENT_FROST_BLAST
Definition boss_kelthuzad.cpp:89
@ EVENT_DETONATE_MANA
Definition boss_kelthuzad.cpp:85
@ EVENT_FROST_BOLT_SINGLE
Definition boss_kelthuzad.cpp:83
@ EVENT_SHADOW_FISSURE
Definition boss_kelthuzad.cpp:88
@ EVENT_PHASE_3
Definition boss_kelthuzad.cpp:86
@ SPELL_SHADOW_FISURE
Definition boss_kelthuzad.cpp:48
@ SPELL_CHAINS_OF_KELTHUZAD
Definition boss_kelthuzad.cpp:53
@ SPELL_FROST_BOLT_MULTI
Definition boss_kelthuzad.cpp:47
@ SPELL_FROST_BOLT_SINGLE
Definition boss_kelthuzad.cpp:46
@ SPELL_FROST_BLAST
Definition boss_kelthuzad.cpp:52
@ SPELL_DETONATE_MANA
Definition boss_kelthuzad.cpp:50
@ SPELL_BERSERK
Definition boss_kelthuzad.cpp:54
bool UpdateVictim()
Definition CreatureAI.cpp:287
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:115
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:314
std::list< HostileReference * > StorageType
Definition ThreatMgr.h:147
ThreatContainer::StorageType const & GetThreatList() const
Definition ThreatMgr.h:273
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:110
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4844
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:732
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5789
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1078
Unit * GetVictim() const
Definition Unit.h:886
bool HasUnitState(const uint32 f) const
Definition Unit.h:721
ThreatMgr & GetThreatMgr()
Definition Unit.h:936
@ DATA_LICH_KING_BOSS
Definition naxxramas.h:59
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition ScriptedCreature.h:404
bool Is25ManRaid() const
Definition ScriptedCreature.h:385
void SummonHelper(uint32 entry, uint32 count)
Definition boss_kelthuzad.cpp:198
void SpawnHelpers()
Definition boss_kelthuzad.cpp:156

References ACTION_SECOND_PHASE, Unit::CastSpell(), DATA_KELTHUZAD_FLOOR, DATA_KELTHUZAD_PORTAL_1, DATA_KELTHUZAD_PORTAL_2, DATA_KELTHUZAD_PORTAL_3, DATA_KELTHUZAD_PORTAL_4, DATA_LICH_KING_BOSS, SummonList::DoAction(), UnitAI::DoMeleeAttackIfReady(), EMOTE_GUARDIAN_APPEAR, EMOTE_PHASE_TWO, EVENT_CHAINS, EVENT_DETONATE_MANA, EVENT_ENRAGE, EVENT_FLOOR_CHANGE, EVENT_FROST_BLAST, EVENT_FROST_BOLT_MULTI, EVENT_FROST_BOLT_SINGLE, EVENT_P3_LICH_KING_SAY, EVENT_PHASE_2, EVENT_PHASE_3, EVENT_SHADOW_FISSURE, EVENT_SPAWN_POOL, EVENT_SUMMON_GUARDIAN_OF_ICECROWN, EVENT_SUMMON_SOLDIER, EVENT_SUMMON_SOUL_WEAVER, EVENT_SUMMON_UNSTOPPABLE_ABOMINATION, InstanceScript::GetCreature(), InstanceScript::GetGameObject(), Unit::GetMotionMaster(), ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), Unit::GetVictim(), GO_STATE_ACTIVE, GO_STATE_READY, Unit::HasAura(), Unit::HasUnitFlag(), Unit::HasUnitState(), Unit::HealthBelowPct(), BossAI::instance, ScriptedAI::Is25ManRaid(), ScriptedAI::me, MotionMaster::MoveChase(), NPC_GUARDIAN_OF_ICECROWN, NPC_SOLDIER_OF_THE_FROZEN_WASTES, NPC_SOUL_WEAVER, NPC_UNSTOPPABLE_ABOMINATION, POWER_MANA, ScriptedAI::RAID_MODE(), RAND(), Random, REACT_AGGRESSIVE, Unit::RemoveAura(), Unit::RemoveUnitFlag(), SAY_AGGRO, SAY_ANSWER_REQUEST, SAY_CHAIN, SAY_FROST_BLAST, SAY_REQUEST_AID, SAY_SPECIAL, UnitAI::SelectTarget(), Creature::SetReactState(), SpawnHelpers(), SpawnPool, SPELL_BERSERK, SPELL_CHAINS_OF_KELTHUZAD, SPELL_DETONATE_MANA, SPELL_FROST_BLAST, SPELL_FROST_BOLT_MULTI, SPELL_FROST_BOLT_SINGLE, SPELL_KELTHUZAD_CHANNEL, SPELL_SHADOW_FISURE, WorldObject::SummonCreature(), SummonHelper(), summons, UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_NON_ATTACKABLE, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ events

EventMap boss_kelthuzad::boss_kelthuzadAI::events

◆ summons

SummonList boss_kelthuzad::boss_kelthuzadAI::summons

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