TrinityCore
Loading...
Searching...
No Matches
boss_kelthuzad.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "GameObject.h"
20#include "InstanceScript.h"
21#include "MotionMaster.h"
22#include "naxxramas.h"
23#include "ObjectAccessor.h"
24#include "Player.h"
25#include "PlayerAI.h"
26#include "ScriptedCreature.h"
27#include "SpellAuraEffects.h"
28#include "SpellScript.h"
29#include "TemporarySummon.h"
30
32{
37 SAY_REQUEST_AID = 12, //start of phase 3
39 SAY_SUMMON_MINIONS = 14, //start of phase 1
41
42 // The Lich King
44
45 // Guardian of Icecrown
48};
49
70
78
84
86{
87 // Kel'thuzad - Phase one
88 SPELL_VISUAL_CHANNEL = 29423, // channeled throughout phase one
89
90 // Kel'thuzad - Phase two
98 SPELL_CHAINS = 28410,
99 SPELL_CHAINS_DUMMY = 28408, // this holds the category cooldown - the main chains spell can't have one as it is cast multiple times
100
102
103 // Unstoppable Abomination
105
106 // Guardian of Icecrown
108
109 // Shadow Fissure
110 SPELL_VOID_BLAST = 27812
112
113static const uint8 nGuardianSpawns = 4;
114static const uint8 nMinionGroups = 7;
121
123{
125 PHASE_TWO = 2 // "phase three" is not actually a phase in events, as timers from phase two carry over
127
132
134{
135 NPC_SKELETON1 = 16427, // Soldiers of the Frozen Wastes
137 NPC_ABOMINATION1 = 16428, // Unstoppable Abominations
139 NPC_BANSHEE1 = 16429, // Soul Weavers
141 NPC_GUARDIAN = 16441 // Guardians of Icecrown
143
144static const uint8 nMinionSpawnPoints = 7;
146 { 3768.40f, -5072.00f, 143.65f }, // summon group 5
147 { 3729.30f, -5044.10f, 143.65f }, // summon group 6
148 { 3683.00f, -5054.05f, 143.65f }, // summon group 7
149 { 3654.15f, -5093.48f, 143.65f }, // summon group 8
150 { 3664.55f, -5140.50f, 143.65f }, // summon group 9
151 { 3704.00f, -5170.00f, 143.65f }, // summon group 10
152 { 3751.95f, -5158.90f, 143.65f } // summon group 11
153};
155{
157}
158
160{
161 public:
163
165 {
166 bool operator()(Unit const* target) const
167 {
168 Player const* pTarget = target->ToPlayer();
169 if (!pTarget)
170 return false;
171 if (pTarget->HasAura(SPELL_CHAINS))
172 return false;
174 return false;
175 // We _really_ dislike healers. So we hit them in the face. Repeatedly. Exclusively.
176 return PlayerAI::IsPlayerHealer(pTarget);
177 }
178 };
179
180 Unit* SelectAttackTarget() const override
181 {
182 if (Creature* charmer = GetCharmer())
183 {
184 if (Unit* target = charmer->AI()->SelectTarget(SelectTargetMethod::Random, 0, CharmedPlayerTargetSelectPred()))
185 return target;
186 if (Unit* target = charmer->AI()->SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_CHAINS))
187 return target;
188 }
189 return nullptr;
190 }
191};
192
194{
195 bool operator()(Unit const* target) const
196 {
197 return target->GetTypeId() == TYPEID_PLAYER && target->GetPowerType() == POWER_MANA;
198 }
199};
200
201struct boss_kelthuzad : public BossAI
202{
203 public:
209
210 void Reset() override
211 {
212 if (!me->IsAlive())
213 return;
214 _Reset();
216 me->SetUninteractible(true);
217 me->SetImmuneToPC(true);
218 _skeletonCount = 0;
219 _bansheeCount = 0;
222 _phaseThree = false;
223 }
224
225 void EnterEvadeMode(EvadeReason /*why*/) override
226 {
227 if (!me->IsAlive())
228 return;
229
230 for (NAXData64 portalData : portalList)
231 if (GameObject* portal = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(portalData)))
232 portal->SetGoState(GO_STATE_READY);
233
234 Reset();
236 }
237
238 void JustSummoned (Creature* summon) override
239 { // prevent DoZoneInCombat
240 summons.Summon(summon);
241 }
242
243 void KilledUnit(Unit* victim) override
244 {
245 if (victim->GetTypeId() == TYPEID_PLAYER)
246 Talk(SAY_SLAY);
247 }
248
249 void JustDied(Unit* /*killer*/) override
250 {
252 while (it != summons.end())
253 if (Creature* cSummon = ObjectAccessor::GetCreature(*me, *it))
254 {
255 if (cSummon->IsAlive() && cSummon->GetEntry() == NPC_GUARDIAN)
256 {
257 cSummon->AI()->DoAction(ACTION_KELTHUZAD_DIED);
258 it = summons.erase(it); // prevent them from being despawned by _JustDied
259 }
260 else
261 ++it;
262 }
263
264 _JustDied();
266 }
267
268 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
269 {
271 damage = 0;
272 }
273
274 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
275 {
276 if (spellInfo->Id == SPELL_CHAINS_DUMMY)
277 {
279 std::list<Unit*> targets;
280 SelectTargetList(targets, 3, SelectTargetMethod::Random, 0, 0.0f, true, false);
281 for (Unit* target : targets)
282 DoCast(target, SPELL_CHAINS);
283 }
284 }
285
286 void UpdateAI(uint32 diff) override
287 {
288 if (!UpdateVictim())
289 return;
290
291 events.Update(diff);
292
293 if (_frostboltCooldown < diff)
295 else
296 _frostboltCooldown -= diff;
297
299 return;
300
301 if (!_phaseThree && HealthBelowPct(45))
302 {
303 _phaseThree = true;
304 _guardianCount = 0;
309 if (Is25ManRaid())
310 {
313 }
314 }
315
316 while (uint32 eventId = events.ExecuteEvent())
317 {
318 if (_frostboltCooldown <= 4 * IN_MILLISECONDS) // stop casting bolts for 4 seconds after doing another action
320 switch (eventId)
321 {
322 case EVENT_SKELETON:
323 {
325 if (_skeletonCount == 1) // the first skeleton is actually one of the pre-existing ones - I'm not sure why, but that's what the sniffs say
326 {
327 std::list<Creature*> skeletons;
329 if (skeletons.empty())
330 { // prevent UB
332 return;
333 }
334 std::list<Creature*>::iterator it = skeletons.begin();
335 std::advance(it, urand(0, skeletons.size() - 1));
336 (*it)->SetReactState(REACT_AGGRESSIVE);
337 (*it)->AI()->DoZoneInCombat(); // will select a player on our threat list as we are the summoner
338 }
339 else
340 {
341 // retail uses server-side spell 28421 for this
343 summon->AI()->DoZoneInCombat();
344 }
345
346 uint8 nextTime = 0;
347 if (_skeletonCount < 10)
348 nextTime = 5;
349 else if (_skeletonCount < 19)
350 nextTime = 4;
351 else if (_skeletonCount < 31)
352 nextTime = 3;
353 else if (_skeletonCount == 31)
354 nextTime = 4;
355 else if (_skeletonCount < 72)
356 nextTime = 2;
357
358 if (nextTime)
360 break;
361 }
362
363 case EVENT_BANSHEE:
364 {
366 // retail uses server-side spell 28423 for this
368 summon->AI()->DoZoneInCombat();
369
370 uint8 nextTime = 0;
371 if (_bansheeCount < 3)
372 nextTime = 30;
373 else if (_bansheeCount < 7)
374 nextTime = 20;
375 else if (_bansheeCount < 9)
376 nextTime = 15;
377
378 if (nextTime)
380 break;
381 }
382
384 {
386 // retail uses server-side spell 28422 for this
388 summon->AI()->DoZoneInCombat();
389
390 uint8 nextTime = 0;
391 if (_abominationCount < 3)
392 nextTime = 30;
393 else if (_abominationCount < 7)
394 nextTime = 20;
395 else if (_abominationCount < 9)
396 nextTime = 15;
397
398 if (nextTime)
400 break;
401 }
402
404 {
405 // we need a temp vector, as we can't modify summons while iterating (this would cause UB)
406 std::vector<Creature*> toDespawn;
407 toDespawn.reserve(summons.size());
408 for (ObjectGuid sGuid : summons)
409 if (Creature* summon = ObjectAccessor::GetCreature(*me, sGuid))
410 if (!summon->IsInCombat())
411 toDespawn.push_back(summon);
412 for (Creature* summon : toDespawn)
413 summon->DespawnOrUnsummon();
415 break;
416 }
417
418 case EVENT_PHASE_TWO:
419 me->CastStop();
421 me->SetUninteractible(false);
422 me->SetImmuneToPC(false);
426
432 if (Is25ManRaid())
434 break;
435
439 break;
440
442 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
445 break;
446
448 {
450 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, pred))
453 break;
454 }
455
457 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
458 DoCast(target, SPELL_FROST_BLAST);
460 break;
461
462 case EVENT_CHAINS:
463 {
466 break;
467 }
468
471 lichKing->AI()->Talk(SAY_ANSWER_REQUEST);
472 for (NAXData64 portalData : portalList)
473 if (GameObject* portal = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(portalData)))
474 portal->SetGoState(GO_STATE_ACTIVE);
475 break;
476
478 {
479 uint8 selected = urand(_guardianCount, nGuardianSpawns - 1);
480 if (selected != _guardianCount)
481 std::swap(_guardianGroups[selected], _guardianGroups[_guardianCount]);
482
483 std::list<TempSummon*> summoned;
484 // server-side spell 28454 is used on retail - no point replicating this in spell_dbc
486 for (TempSummon* guardian : summoned)
487 guardian->AI()->DoAction(ACTION_JUST_SUMMONED);
488 break;
489 }
490 }
491
493 return;
494 }
495
497 {
500 }
501 }
502
503 uint32 GetData(uint32 data) const override
504 {
507 return 0;
508 }
509
510 void DoAction(int32 action) override
511 {
512 switch (action)
513 {
516 return;
517 me->SetImmuneToPC(false);
523
525 {
526 std::list<TempSummon*> summoned;
527 me->SummonCreatureGroup(group, &summoned);
528 for (TempSummon* summon : summoned)
529 {
530 summon->SetReactState(REACT_PASSIVE);
531 summon->AI()->SetData(DATA_MINION_POCKET_ID, group);
532 }
533 }
534
540 break;
541
544 break;
545
546 default:
547 break;
548 }
549 }
550
552 {
553 return new KelThuzadCharmedPlayerAI(player);
554 }
555
556 private:
564 std::array<uint32, nGuardianSpawns> _guardianGroups;
565};
566
567static const float MINION_AGGRO_DISTANCE = 20.0f;
568// @hack the entire _movementTimer logic only exists because RandomMovementGenerator gets really confused due to the unique map geography of KT's room (it's placed on top of a copy of Winterspring).
569// As of the time of writing, RMG sometimes selects positions on the "floor" below the room, causing Abominations to path wildly through the room.
570// This custom movement code prevents this by simply ignoring z coord calculation (the floor of the minion coves is flat anyway).
571// Dev from the future that is reading this, if RMG has been fixed on the current core revision, please get rid of this hack. Thank you!
573{
574 public:
575 npc_kelthuzad_minionAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), pocketId(0), _movementTimer(urandms(4,12)), _home(me->GetPosition()) { }
576
577 void Reset() override
578 {
579 }
580
581 void EnterEvadeMode(EvadeReason why) override
582 {
585 kelThuzad->AI()->EnterEvadeMode(EvadeReason::Other);
586 }
587
588 void JustEngagedWith(Unit* who) override
589 {
590 _movementTimer = 0; // once it's zero, it'll never get checked again
592 {
594 return;
595 }
596
597 if (!pocketId)
598 return;
599
600 std::list<Creature*> others;
601 me->GetCreatureListWithEntryInGrid(others, me->GetEntry(), 80.0f);
602 for (Creature* other : others)
603 if (other->AI()->GetData(DATA_MINION_POCKET_ID) == pocketId)
604 {
605 other->SetReactState(REACT_AGGRESSIVE);
606 other->AI()->AttackStart(who);
607 }
609 AttackStart(who);
611 }
612
613 void AttackStart(Unit* who) override
614 {
616 }
617
618 void MoveInLineOfSight(Unit* who) override
619 {
621 {
623 return;
624 }
625
626 if (me->CanStartAttack(who, false) && me->GetDistance2d(who) <= MINION_AGGRO_DISTANCE)
627 JustEngagedWith(who);
628 }
629
630 void SetData(uint32 data, uint32 value) override
631 {
632 if (data == DATA_MINION_POCKET_ID)
633 pocketId = value;
634 }
635
636 uint32 GetData(uint32 data) const override
637 {
638 if (data == DATA_MINION_POCKET_ID)
639 return pocketId;
640 return 0;
641 }
642
643 void MovementInform(uint32 /*type*/, uint32 id) override
644 {
645 if (id == MOVEMENT_MINION_RANDOM)
646 _movementTimer = urandms(2, 10) + urandms(2, 10);
647 }
648
650 {
651 if (!_movementTimer)
652 return;
653
654 if (_movementTimer <= diff)
655 {
656 _movementTimer = 0;
658 }
659 else
660 _movementTimer -= diff;
661 }
662
663 protected:
666
667 private:
670};
671
673{
675
676 void UpdateAI(uint32 diff) override
677 {
679
680 if (!UpdateVictim())
681 return;
682 }
683};
684
686{
688
689 void UpdateAI(uint32 diff) override
690 {
692
693 if (!UpdateVictim())
694 return;
695 }
696};
697
699{
701
702 void UpdateAI(uint32 diff) override
703 {
705
706 if (!UpdateVictim())
707 return;
708
709 if (_woundTimer <= diff)
710 {
711 _woundTimer = urandms(14, 18);
713 }
714 else
715 _woundTimer -= diff;
716 }
717
718 void JustDied(Unit* killer) override
719 {
721 kelThuzad->AI()->DoAction(ACTION_ABOMINATION_DIED);
723 }
724
726};
727
729{
730 public:
731 npc_kelthuzad_guardian(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), _visibilityTimer(0), _bloodTapTimer(0) { }
732
733 void DoAction(int32 action) override
734 {
735 switch (action)
736 {
738 me->SetVisible(false);
743 break;
748 me->CombatStop();
749 me->StopMoving();
750 me->SetImmuneToPC(true);
751 me->DespawnOrUnsummon(30s); // just in case anything interrupts the movement
753 break;
754 default:
755 break;
756 }
757 }
758
759 void EnterEvadeMode(EvadeReason why) override
760 {
762 kelthuzad->AI()->EnterEvadeMode();
764 }
765
766 void JustReachedHome() override
767 {
769 }
770
771 void Reset() override
772 {
774 }
775
776 void UpdateAI(uint32 diff) override
777 {
779 {
780 if (diff > _visibilityTimer)
781 _visibilityTimer -= diff;
782 else
783 {
784 me->SetVisible(true);
787 }
788 }
789
790 if (!UpdateVictim())
791 return;
792
793 if (_bloodTapTimer <= diff)
794 {
796 _bloodTapTimer = urandms(18, 26);
797 }
798 else
799 _bloodTapTimer -= diff;
800 }
801
802 private:
806};
807
809{
811
812 void InitializeAI() override
813 {
815 }
816
817 void JustAppeared() override
818 {
819 _scheduler.Schedule(5s, [this](TaskContext const& /*task*/)
820 {
822 });
823 }
824
825 void UpdateAI(uint32 diff) override
826 {
827 _scheduler.Update(diff);
828 }
829
830private:
832};
833
834// 28410 - Chains of Kel'Thuzad
853
854// 27819 - Detonate Mana
856{
857 bool Validate(SpellInfo const* /*spell*/) override
858 {
860 }
861
862 void HandleScript(AuraEffect const* aurEff)
863 {
865
866 Unit* target = GetTarget();
867 if (int32 mana = int32(target->GetMaxPower(POWER_MANA) / 10))
868 {
869 mana = target->ModifyPower(POWER_MANA, -mana);
870 CastSpellExtraArgs args(aurEff);
871 args.AddSpellBP0(-mana * 10);
872 target->CastSpell(target, SPELL_MANA_DETONATION_DAMAGE, args);
873 }
874 }
875
880};
881
882// 27808 - Frost Blast
884{
885 bool Validate(SpellInfo const* /*spellInfo*/) override
886 {
888 }
889
890 void PeriodicTick(AuraEffect const* aurEff)
891 {
893
894 // Stuns the target, dealing 26% of the target's maximum health in Frost damage every second for 4 sec.
895 if (Unit* caster = GetCaster())
896 {
897 CastSpellExtraArgs args(aurEff);
898 args.AddSpellBP0(GetTarget()->CountPctFromMaxHealth(26));
899 caster->CastSpell(GetTarget(), SPELL_FROST_BLAST_DMG, args);
900 }
901 }
902
907};
908
910{
911public:
912 at_kelthuzad_center() : AreaTriggerScript("at_kelthuzad_center") { }
913
914 bool OnTrigger(Player* player, AreaTriggerEntry const* /*at*/) override
915 {
916 InstanceScript* instance = player->GetInstanceScript();
917 if (!instance || instance->GetBossState(BOSS_KELTHUZAD) != NOT_STARTED)
918 return true;
919
920 if (player->IsGameMaster())
921 return true;
922
923 Creature* kelThuzad = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_KELTHUZAD));
924 if (!kelThuzad)
925 return true;
926
927 kelThuzad->AI()->DoAction(ACTION_BEGIN_ENCOUNTER);
928
929 return true;
930 }
931};
932
934{
935 public:
936 achievement_just_cant_get_enough() : AchievementCriteriaScript("achievement_just_cant_get_enough") { }
937
938 bool OnCheck(Player* /*player*/, Unit* target) override
939 {
940 if (!target)
941 return false;
942
943 if (InstanceScript* instance = target->GetInstanceScript())
944 if (Creature* kelThuzad = ObjectAccessor::GetCreature(*target, instance->GetGuidData(DATA_KELTHUZAD)))
945 if (kelThuzad->AI()->GetData(DATA_ABOMINATION_DEATH_COUNT) >= 18)
946 return true;
947
948 return false;
949 }
950};
951
@ IN_MILLISECONDS
Definition Common.h:38
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:28
std::chrono::minutes Minutes
Minutes shorthand typedef.
Definition Duration.h:32
@ IN_PROGRESS
@ NOT_STARTED
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:62
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
uint32 urandms(uint32 min, uint32 max)
Definition Random.cpp:49
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_1
@ EFFECT_0
@ POWER_MANA
@ GO_STATE_READY
@ GO_STATE_ACTIVE
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
EvadeReason
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
@ UNIT_STATE_CASTING
Definition Unit.h:276
Creatures
Movements
@ SUMMON_GROUP_GUARDIAN_FIRST
@ SUMMON_GROUP_MINION_FIRST
@ ACTION_JUST_SUMMONED
@ ACTION_KELTHUZAD_DIED
@ ACTION_ABOMINATION_DIED
@ ACTION_BEGIN_ENCOUNTER
@ NPC_ABOMINATION1
@ NPC_BANSHEE2
@ NPC_GUARDIAN
@ NPC_SKELETON1
@ NPC_BANSHEE1
@ NPC_SKELETON2
@ NPC_ABOMINATION2
static const uint8 nGuardianSpawns
static const uint8 nMinionGroups
static const Position minionSpawnPoints[nMinionSpawnPoints]
void AddSC_boss_kelthuzad()
@ SPELL_MANA_DETONATION_DAMAGE
@ SPELL_FROST_BLAST_DMG
@ SPELL_SHADOW_FISSURE
@ SPELL_VOID_BLAST
@ SPELL_CHAINS
@ SPELL_VISUAL_CHANNEL
@ SPELL_FROSTBOLT_VOLLEY
@ SPELL_FROST_BLAST
@ SPELL_DETONATE_MANA
@ SPELL_FROSTBOLT_SINGLE
@ SPELL_CHAINS_DUMMY
@ SPELL_BERSERK
@ SPELL_MORTAL_WOUND
@ SPELL_BLOOD_TAP
@ PHASE_ONE
@ PHASE_TWO
@ SAY_DEATH
@ SAY_AGGRO
@ EMOTE_GUARDIAN_FLEE
@ SAY_SPECIAL
@ EMOTE_GUARDIAN_APPEAR
@ SAY_ANSWER_REQUEST
@ EMOTE_PHASE_TWO
@ SAY_SLAY
@ SAY_CHAINS
@ SAY_SUMMON_MINIONS
@ SAY_REQUEST_AID
@ DATA_MINION_POCKET_ID
@ DATA_ABOMINATION_DEATH_COUNT
static const uint8 nMinionSpawnPoints
static const float MINION_AGGRO_DISTANCE
static Position const & GetRandomMinionSpawnPoint()
static NAXData64 const portalList[]
@ MOVEMENT_MINION_RANDOM
@ EVENT_PHASE_TWO
@ EVENT_CHAINS
@ EVENT_ABOMINATION
@ EVENT_FROSTBOLT_VOLLEY
@ EVENT_FROST_BLAST
@ EVENT_SKELETON
@ EVENT_DETONATE_MANA
@ EVENT_BANSHEE
@ EVENT_TRANSITION_SUMMON
@ EVENT_SHADOW_FISSURE
@ EVENT_DESPAWN_MINIONS
@ EVENT_TRANSITION_REPLY
SummonGroups
void HandleAuraModScale(AuraApplication const *aurApp, uint8 mode, bool apply) const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetCaster() const
Unit * GetTarget() const
TypeID GetTypeId() const
Definition BaseEntity.h:166
InstanceScript *const instance
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
SummonList summons
EventMap events
virtual void MoveInLineOfSight(Unit *)
virtual void JustEngagedWith(Unit *)
Definition CreatureAI.h:101
void DoZoneInCombat()
Definition CreatureAI.h:169
virtual void JustDied(Unit *)
Definition CreatureAI.h:107
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:386
void SetImmuneToPC(bool apply) override
Definition Creature.h:184
bool HasReactState(ReactStates state) const
Definition Creature.h:176
void SetReactState(ReactStates st)
Definition Creature.h:174
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
CreatureAI * AI() const
Definition Creature.h:228
bool CanStartAttack(Unit const *u, bool force) const
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
bool IsInPhase(uint8 phase) const
Definition EventMap.h:222
void SetPhase(uint8 phase)
Definition EventMap.cpp:32
virtual bool SetBossState(uint32 id, EncounterState state)
virtual ObjectGuid GetGuidData(uint32 type) const override
EncounterState GetBossState(uint32 id) const
Unit * SelectAttackTarget() const override
KelThuzadCharmedPlayerAI(Player *player)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void MoveTargetedHome()
Player * ToPlayer()
Definition Object.h:126
uint32 GetEntry() const
Definition Object.h:89
static bool IsPlayerHealer(Player const *who)
Definition PlayerAI.cpp:414
Creature * GetCharmer() const
Definition PlayerAI.cpp:402
bool IsGameMaster() const
Definition Player.h:1309
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
iterator erase(iterator i)
iterator begin()
void Summon(Creature const *summon)
iterator end()
size_type size() const
StorageType::iterator iterator
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
virtual void Reset()
Definition UnitAI.h:64
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
virtual void DoAction(int32 param)
Definition UnitAI.h:73
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
void SelectTargetList(std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:84
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:79
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:8697
void CastStop(uint32 except_spellid=0)
Definition Unit.cpp:1186
void SetVisible(bool x)
Definition Unit.cpp:8768
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
Definition Unit.cpp:6012
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
Powers GetPowerType() const
Definition Unit.h:811
bool IsAlive() const
Definition Unit.h:1185
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:10037
void StopMoving()
Definition Unit.cpp:10680
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
void RemoveAllAuras()
Definition Unit.cpp:4382
bool HasBreakableByDamageCrowdControlAura(Unit const *excludeCasterChannel=nullptr) const
Definition Unit.cpp:778
Position GetRandomPoint(Position const &srcPos, float distance, float minDistance=0.0f) const
Definition Object.cpp:680
InstanceScript * GetInstanceScript() const
Definition Object.cpp:396
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
Definition Object.cpp:2658
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1398
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:450
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:1507
bool OnCheck(Player *, Unit *target) override
bool OnTrigger(Player *player, AreaTriggerEntry const *) override
void HandleRemove(AuraEffect const *aurEff, AuraEffectHandleModes mode)
void HandleApply(AuraEffect const *aurEff, AuraEffectHandleModes mode)
bool Validate(SpellInfo const *) override
void HandleScript(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void PeriodicTick(AuraEffect const *aurEff)
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
@ BOSS_KELTHUZAD
Definition naxxramas.h:44
NAXData64
Definition naxxramas.h:62
@ DATA_KELTHUZAD
Definition naxxramas.h:77
@ DATA_KELTHUZAD_PORTAL02
Definition naxxramas.h:79
@ DATA_KELTHUZAD_PORTAL01
Definition naxxramas.h:78
@ DATA_KELTHUZAD_PORTAL04
Definition naxxramas.h:81
@ DATA_KELTHUZAD_PORTAL03
Definition naxxramas.h:80
#define RegisterNaxxramasCreatureAI(ai_name)
Definition naxxramas.h:221
CastSpellExtraArgs & AddSpellBP0(SpellEffectValue val)
bool operator()(Unit const *target) const
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
bool HealthBelowPct(uint32 pct) const
bool Is25ManRaid() const
void ResetThreatList(Unit *who=nullptr)
std::array< uint32, nGuardianSpawns > _guardianGroups
void DoAction(int32 action) override
void Reset() override
boss_kelthuzad(Creature *creature)
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void EnterEvadeMode(EvadeReason) override
void JustSummoned(Creature *summon) override
void KilledUnit(Unit *victim) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
uint32 GetData(uint32 data) const override
void UpdateAI(uint32 diff) override
PlayerAI * GetAIForCharmedPlayer(Player *player) override
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
npc_kelthuzad_abomination(Creature *creature)
void JustDied(Unit *killer) override
npc_kelthuzad_banshee(Creature *creature)
void UpdateAI(uint32 diff) override
void JustReachedHome() override
void EnterEvadeMode(EvadeReason why) override
InstanceScript *const instance
void DoAction(int32 action) override
void UpdateAI(uint32 diff) override
npc_kelthuzad_guardian(Creature *creature)
void EnterEvadeMode(EvadeReason why) override
npc_kelthuzad_minionAI(Creature *creature)
void MovementInform(uint32, uint32 id) override
uint32 GetData(uint32 data) const override
void UpdateRandomMovement(uint32 diff)
void SetData(uint32 data, uint32 value) override
InstanceScript *const instance
void MoveInLineOfSight(Unit *who) override
void AttackStart(Unit *who) override
== Triggered Actions Requested ==================
void JustEngagedWith(Unit *who) override
npc_kelthuzad_shadow_fissure(Creature *creature)
void UpdateAI(uint32 diff) override
npc_kelthuzad_skeleton(Creature *creature)
void UpdateAI(uint32 diff) override
@ DATA_LICH_KING