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 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)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
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=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, 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=0s)
 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 ()
 
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)
 
- 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, 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
148 {}
Definition ScriptedCreature.h:467
@ BOSS_KELTHUZAD
Definition naxxramas.h:41
Creature * me
Definition ScriptedCreature.h:280
SummonList summons
Definition boss_kelthuzad.cpp:151

Member Function Documentation

◆ EnterEvadeMode()

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

Reimplemented from CreatureAI.

242 {
245 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:251
@ UNIT_FLAG_DISABLE_MOVE
Definition UnitDefines.h:252
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:208
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:720

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.

257 {
258 BossAI::JustDied(killer);
261 {
262 guardian->AI()->Talk(EMOTE_GUARDIAN_FLEE);
263 }
265 }
@ ACTION_GUARDIANS_OFF
Definition boss_kelthuzad.cpp:75
@ NPC_GUARDIAN_OF_ICECROWN
Definition boss_kelthuzad.cpp:70
@ SAY_DEATH
Definition boss_kelthuzad.cpp:31
@ EMOTE_GUARDIAN_FLEE
Definition boss_kelthuzad.cpp:39
void JustDied(Unit *) override
Definition ScriptedCreature.h:505
Definition Creature.h:43
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.

274 {
279 me->SetTarget();
282 events.ScheduleEvent(EVENT_SPAWN_POOL, 5s);
283 events.ScheduleEvent(EVENT_SUMMON_SOLDIER, 6400ms);
285 events.ScheduleEvent(EVENT_SUMMON_SOUL_WEAVER, 12s);
286 events.ScheduleEvent(EVENT_PHASE_2, 228s);
287 events.ScheduleEvent(EVENT_ENRAGE, 15min);
288
290 {
291 events.ScheduleEvent(EVENT_FLOOR_CHANGE, 15s);
292 go->SetGoState(GO_STATE_ACTIVE);
293 }
294 }
@ GO_STATE_ACTIVE
Definition GameObjectData.h:689
@ REACT_PASSIVE
Definition Unit.h:548
@ SAY_SUMMON_MINIONS
Definition boss_kelthuzad.cpp:36
@ EVENT_SPAWN_POOL
Definition boss_kelthuzad.cpp:96
@ EVENT_ENRAGE
Definition boss_kelthuzad.cpp:95
@ EVENT_SUMMON_SOUL_WEAVER
Definition boss_kelthuzad.cpp:83
@ EVENT_FLOOR_CHANGE
Definition boss_kelthuzad.cpp:94
@ EVENT_SUMMON_SOLDIER
Definition boss_kelthuzad.cpp:81
@ EVENT_PHASE_2
Definition boss_kelthuzad.cpp:84
@ EVENT_SUMMON_UNSTOPPABLE_ABOMINATION
Definition boss_kelthuzad.cpp:82
@ SPELL_KELTHUZAD_CHANNEL
Definition boss_kelthuzad.cpp:57
events
Definition boss_sartura.cpp:43
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition ScriptedCreature.h:503
InstanceScript *const instance
Definition ScriptedCreature.h:474
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition Creature.cpp:3562
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:95
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:1178
void RemoveAllAttackers()
Remove all units in m_attackers list and send them AttackStop()
Definition Unit.cpp:10529
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:719
@ 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.

297 {
298 summons.Summon(cr);
299 if (!cr->IsInCombat())
300 {
301 cr->GetMotionMaster()->MoveRandom(5);
302 }
304 {
306 }
307 }
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:340
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:242
uint32 GetEntry() const
Definition Object.h:115
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
MotionMaster * GetMotionMaster()
Definition Unit.h:1673
bool IsInCombat() const
Definition Unit.h:893
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.

248 {
249 if (!who->IsPlayer())
250 return;
251
252 Talk(SAY_SLAY);
254 }
@ SAY_SLAY
Definition boss_kelthuzad.cpp:30
void StorePersistentData(uint32 index, uint32 data)
Definition InstanceScript.cpp:422
bool IsPlayer() const
Definition Object.h:200
@ 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.

268 {
269 if (!me->IsInCombat() && who->IsPlayer() && who->IsAlive() && me->GetDistance(who) <= 50.0f)
270 AttackStart(who);
271 }
bool IsAlive() const
Definition Unit.h:1707
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1256
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
154 {
155 return std::fmod(o, 2.0f * static_cast<float>(M_PI)); // Only positive values will be passed
156 }

◆ Reset()

void boss_kelthuzad::boss_kelthuzadAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

216 {
218 events.Reset();
223 {
224 go->SetPhaseMask(1, true);
225 go->SetGoState(GO_STATE_READY);
226 }
227
229 go->SetGoState(GO_STATE_READY);
230
232 go->SetGoState(GO_STATE_READY);
233
235 go->SetGoState(GO_STATE_READY);
236
238 go->SetGoState(GO_STATE_READY);
239 }
@ GO_STATE_READY
Definition GameObjectData.h:690
@ REACT_AGGRESSIVE
Definition Unit.h:550
void Reset() override
Definition ScriptedCreature.h:502
void DespawnAll(uint32 delay=0)
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
159 {
160 // spawn at gate
161 me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, 3656.19f, -5093.78f, 143.33f, 6.08, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);// abo center
162 me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, 3657.94f, -5087.68f, 143.60f, 6.08, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);// abo left
163 me->SummonCreature(NPC_UNSTOPPABLE_ABOMINATION, 3655.48f, -5100.05f, 143.53f, 6.08, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);// abo right
164 me->SummonCreature(NPC_SOUL_WEAVER, 3651.73f, -5092.62f, 143.38f, 6.05, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // soul behind
165 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3660.17f, -5092.45f, 143.37f, 6.07, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske front left
166 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3659.39f, -5096.21f, 143.29f, 6.07, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske front right
167 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3659.29f, -5090.19f, 143.48f, 6.07, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske left left
168 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3657.43f, -5098.03f, 143.41f, 6.07, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske right right
169 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3654.36f, -5090.51f, 143.48f, 6.09, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske behind left
170 me->SummonCreature(NPC_SOLDIER_OF_THE_FROZEN_WASTES, 3653.35f, -5095.91f, 143.41f, 6.09, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); // ske right right
171
172 // 6 rooms, 8 soldiers, 3 abominations and 1 weaver in each room | middle positions in table starts from 6
173 for (uint8 i = 6; i < 12; ++i)
174 {
175 for (uint8 j = 0; j < 8; ++j)
176 {
177 float angle = M_PI * 2 / 8 * j;
178 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);
179 }
180 }
181 for (uint8 i = 6; i < 12; ++i)
182 {
183 for (uint8 j = 1; j < 4; ++j)
184 {
185 float dist = j == 2 ? 0.0f : 8.0f; // second in middle
186 float angle = SummonGroups[i].GetOrientation() + M_PI * 2 / 4 * j;
187 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);
188 }
189 }
190 for (uint8 i = 6; i < 12; ++i)
191 {
192 for (uint8 j = 0; j < 1; ++j)
193 {
194 float angle = SummonGroups[i].GetOrientation() + M_PI;
195 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);
196 }
197 }
198 }
std::uint8_t uint8
Definition Define.h:109
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:51
SummonGroups
Definition boss_jedoga_shadowseeker.cpp:93
@ NPC_SOLDIER_OF_THE_FROZEN_WASTES
Definition boss_kelthuzad.cpp:67
@ NPC_SOUL_WEAVER
Definition boss_kelthuzad.cpp:69
@ NPC_UNSTOPPABLE_ABOMINATION
Definition boss_kelthuzad.cpp:68
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:2368

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
201 {
202 for (uint8 i = 0; i < count; ++i)
203 {
205 {
206 if (Unit* target = SelectTargetFromPlayerList(100.0f))
207 {
208 cr->AI()->DoAction(ACTION_CALL_HELP_OFF);
209 cr->AI()->AttackStart(target);
210 }
211 }
212 }
213 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ ACTION_CALL_HELP_OFF
Definition boss_kelthuzad.cpp:73
const Position SpawnPool[7]
Definition boss_kelthuzad.cpp:123
Definition Unit.h:636
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:571

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.

310 {
311 if (!UpdateVictim())
312 return;
313
314 events.Update(diff);
316 {
318 return;
319 }
320
321 switch (events.ExecuteEvent())
322 {
325 {
326 events.ScheduleEvent(EVENT_FLOOR_CHANGE, 15s);
327 go->SetGoState(GO_STATE_READY);
328 go->SetPhaseMask(2, true);
329 }
330 break;
331 case EVENT_SPAWN_POOL:
332 SpawnHelpers();
333 break;
336 events.Repeat(3100ms);
337 break;
340 events.Repeat(18s + 500ms);
341 break;
344 events.Repeat(30s);
345 break;
346 case EVENT_PHASE_2:
349 events.Reset();
355 events.ScheduleEvent(EVENT_FROST_BOLT_SINGLE, 2s, 10s);
356 events.ScheduleEvent(EVENT_FROST_BOLT_MULTI, 15s, 30s);
357 events.ScheduleEvent(EVENT_DETONATE_MANA, 30s);
358 events.ScheduleEvent(EVENT_PHASE_3, 1s);
359 events.ScheduleEvent(EVENT_SHADOW_FISSURE, 25s);
360 events.ScheduleEvent(EVENT_FROST_BLAST, 45s);
361 if (Is25ManRaid())
362 {
363 events.ScheduleEvent(EVENT_CHAINS, 90s);
364 }
365 break;
366 case EVENT_ENRAGE:
367 me->CastSpell(me, SPELL_BERSERK, true);
368 break;
371 events.Repeat(2s, 10s);
372 break;
375 events.Repeat(15s, 30s);
376 break;
378 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
379 {
380 me->CastSpell(target, SPELL_SHADOW_FISURE, false);
381 }
382 events.Repeat(25s);
383 break;
385 if (Unit* target = SelectTarget(SelectTargetMethod::Random, RAID_MODE(1, 0), 0, true))
386 {
387 me->CastSpell(target, SPELL_FROST_BLAST, false);
388 }
390 events.Repeat(45s);
391 break;
392 case EVENT_CHAINS:
393 for (uint8 i = 0; i < 3; ++i)
394 {
395 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 200, true, true, -SPELL_CHAINS_OF_KELTHUZAD))
396 {
397 me->CastSpell(target, SPELL_CHAINS_OF_KELTHUZAD, true);
398 }
399 }
401 events.Repeat(90s);
402 break;
404 {
405 std::vector<Unit*> unitList;
407 for (auto itr : threatList)
408 {
409 if (itr->getTarget()->IsPlayer()
410 && itr->getTarget()->getPowerType() == POWER_MANA
411 && itr->getTarget()->GetPower(POWER_MANA))
412 {
413 unitList.push_back(itr->getTarget());
414 }
415 }
416 if (!unitList.empty())
417 {
418 auto itr = unitList.begin();
419 advance(itr, urand(0, unitList.size() - 1));
420 me->CastSpell(*itr, SPELL_DETONATE_MANA, false);
422 }
423 events.Repeat(30s);
424 break;
425 }
426 case EVENT_PHASE_3:
427 if (me->HealthBelowPct(45))
428 {
430 events.DelayEvents(5500ms);
431 events.ScheduleEvent(EVENT_P3_LICH_KING_SAY, 5s);
433 go->SetGoState(GO_STATE_ACTIVE);
434
436 go->SetGoState(GO_STATE_ACTIVE);
437
439 go->SetGoState(GO_STATE_ACTIVE);
440
442 go->SetGoState(GO_STATE_ACTIVE);
443
444 break;
445 }
446 events.Repeat(1s);
447 break;
449 {
451 cr->AI()->Talk(SAY_ANSWER_REQUEST);
452
453 for (uint8 i = 0 ; i < RAID_MODE(2, 4); ++i)
454 events.ScheduleEvent(EVENT_SUMMON_GUARDIAN_OF_ICECROWN, 10000 + (i * 5000));
455
456 break;
457 }
460 {
461 cr->AI()->Talk(EMOTE_GUARDIAN_APPEAR);
462 cr->AI()->AttackStart(me->GetVictim());
463 }
464 break;
465 }
468 }
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition CreatureAIImpl.h:25
@ POWER_MANA
Definition SharedDefines.h:269
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ ACTION_SECOND_PHASE
Definition boss_kelthuzad.cpp:74
@ 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:92
@ EVENT_FROST_BOLT_MULTI
Definition boss_kelthuzad.cpp:86
@ EVENT_SUMMON_GUARDIAN_OF_ICECROWN
Definition boss_kelthuzad.cpp:93
@ EVENT_P3_LICH_KING_SAY
Definition boss_kelthuzad.cpp:89
@ EVENT_FROST_BLAST
Definition boss_kelthuzad.cpp:91
@ EVENT_DETONATE_MANA
Definition boss_kelthuzad.cpp:87
@ EVENT_FROST_BOLT_SINGLE
Definition boss_kelthuzad.cpp:85
@ EVENT_SHADOW_FISSURE
Definition boss_kelthuzad.cpp:90
@ EVENT_PHASE_3
Definition boss_kelthuzad.cpp:88
@ SPELL_FROST_BOLT_SINGLE_10
Definition boss_kelthuzad.cpp:46
@ SPELL_SHADOW_FISURE
Definition boss_kelthuzad.cpp:50
@ SPELL_CHAINS_OF_KELTHUZAD
Definition boss_kelthuzad.cpp:55
@ SPELL_FROST_BLAST
Definition boss_kelthuzad.cpp:54
@ SPELL_DETONATE_MANA
Definition boss_kelthuzad.cpp:52
@ SPELL_FROST_BOLT_SINGLE_25
Definition boss_kelthuzad.cpp:47
@ SPELL_FROST_BOLT_MULTI_10
Definition boss_kelthuzad.cpp:48
@ SPELL_BERSERK
Definition boss_kelthuzad.cpp:56
@ SPELL_FROST_BOLT_MULTI_25
Definition boss_kelthuzad.cpp:49
bool UpdateVictim()
Definition CreatureAI.cpp:280
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:313
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:4808
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:718
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5753
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1046
Unit * GetVictim() const
Definition Unit.h:862
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
ThreatMgr & GetThreatMgr()
Definition Unit.h:912
@ 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:200
void SpawnHelpers()
Definition boss_kelthuzad.cpp:158

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_10, SPELL_FROST_BOLT_MULTI_25, SPELL_FROST_BOLT_SINGLE_10, SPELL_FROST_BOLT_SINGLE_25, 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: