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 "naxxramas.h"
19#include "CommonHelpers.h"
20#include "GameObject.h"
21#include "InstanceScript.h"
22#include "MotionMaster.h"
23#include "ObjectAccessor.h"
24#include "Player.h"
25#include "PlayerAI.h"
26#include "ScriptedCreature.h"
27#include "ScriptMgr.h"
28#include "SpellAuraEffects.h"
29#include "SpellScript.h"
30#include "TemporarySummon.h"
31
33{
38 SAY_REQUEST_AID = 12, //start of phase 3
40 SAY_SUMMON_MINIONS = 14, //start of phase 1
42
43 // The Lich King
45
46 // Guardian of Icecrown
49};
50
71
79
85
87{
88 // Kel'thuzad - Phase one
89 SPELL_VISUAL_CHANNEL = 29423, // channeled throughout phase one
90
91 // Kel'thuzad - Phase two
99 SPELL_CHAINS = 28410,
100 SPELL_CHAINS_DUMMY = 28408, // this holds the category cooldown - the main chains spell can't have one as it is cast multiple times
101
103
104 // Unstoppable Abomination
106
107 // Guardian of Icecrown
109
110 // Shadow Fissure
111 SPELL_VOID_BLAST = 27812
113
114static const uint8 nGuardianSpawns = 4;
115static const uint8 nMinionGroups = 7;
122
124{
126 PHASE_TWO = 2 // "phase three" is not actually a phase in events, as timers from phase two carry over
128
133
135{
136 NPC_SKELETON1 = 16427, // Soldiers of the Frozen Wastes
138 NPC_ABOMINATION1 = 16428, // Unstoppable Abominations
140 NPC_BANSHEE1 = 16429, // Soul Weavers
142 NPC_GUARDIAN = 16441 // Guardians of Icecrown
144
145static const uint8 nMinionSpawnPoints = 7;
147 { 3768.40f, -5072.00f, 143.65f }, // summon group 5
148 { 3729.30f, -5044.10f, 143.65f }, // summon group 6
149 { 3683.00f, -5054.05f, 143.65f }, // summon group 7
150 { 3654.15f, -5093.48f, 143.65f }, // summon group 8
151 { 3664.55f, -5140.50f, 143.65f }, // summon group 9
152 { 3704.00f, -5170.00f, 143.65f }, // summon group 10
153 { 3751.95f, -5158.90f, 143.65f } // summon group 11
154};
156{
158}
159
160// uniformly distribute on the circle
161static Position GetRandomPositionOnCircle(Position const& center, float radius)
162{
163 double angle = rand_norm() * 2.0 * M_PI;
164 double relDistance = rand_norm() + rand_norm();
165 if (relDistance > 1)
166 relDistance = 1 - relDistance;
167 return Position(center.GetPositionX() + std::sin(angle)*relDistance*radius, center.GetPositionY() + std::cos(angle)*relDistance*radius, center.GetPositionZ());
168}
169
171{
172 public:
174
176 {
177 bool operator()(Unit const* target) const
178 {
179 Player const* pTarget = target->ToPlayer();
180 if (!pTarget)
181 return false;
182 if (pTarget->HasAura(SPELL_CHAINS))
183 return false;
185 return false;
186 // We _really_ dislike healers. So we hit them in the face. Repeatedly. Exclusively.
188 }
189 };
190
191 Unit* SelectAttackTarget() const override
192 {
193 if (Creature* charmer = GetCharmer())
194 {
195 if (Unit* target = charmer->AI()->SelectTarget(SelectTargetMethod::Random, 0, CharmedPlayerTargetSelectPred()))
196 return target;
197 if (Unit* target = charmer->AI()->SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_CHAINS))
198 return target;
199 }
200 return nullptr;
201 }
202};
203
205{
206 bool operator()(Unit const* target) const
207 {
208 return target->GetTypeId() == TYPEID_PLAYER && target->GetPowerType() == POWER_MANA;
209 }
210};
211
212struct boss_kelthuzad : public BossAI
213{
214 public:
220
221 void Reset() override
222 {
223 if (!me->IsAlive())
224 return;
225 _Reset();
228 me->SetImmuneToPC(true);
229 _skeletonCount = 0;
230 _bansheeCount = 0;
233 _phaseThree = false;
234 }
235
236 void EnterEvadeMode(EvadeReason /*why*/) override
237 {
238 if (!me->IsAlive())
239 return;
240
241 for (NAXData64 portalData : portalList)
242 if (GameObject* portal = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(portalData)))
243 portal->SetGoState(GO_STATE_READY);
244
245 Reset();
247 }
248
249 void JustSummoned (Creature* summon) override
250 { // prevent DoZoneInCombat
251 summons.Summon(summon);
252 }
253
254 void KilledUnit(Unit* victim) override
255 {
256 if (victim->GetTypeId() == TYPEID_PLAYER)
257 Talk(SAY_SLAY);
258 }
259
260 void JustDied(Unit* /*killer*/) override
261 {
263 while (it != summons.end())
264 if (Creature* cSummon = ObjectAccessor::GetCreature(*me, *it))
265 {
266 if (cSummon->IsAlive() && cSummon->GetEntry() == NPC_GUARDIAN)
267 {
268 cSummon->AI()->DoAction(ACTION_KELTHUZAD_DIED);
269 it = summons.erase(it); // prevent them from being despawned by _JustDied
270 }
271 else
272 ++it;
273 }
274
275 _JustDied();
277 }
278
279 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
280 {
282 damage = 0;
283 }
284
285 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
286 {
287 if (spellInfo->Id == SPELL_CHAINS_DUMMY)
288 {
290 std::list<Unit*> targets;
291 SelectTargetList(targets, 3, SelectTargetMethod::Random, 0, 0.0f, true, false);
292 for (Unit* target : targets)
293 DoCast(target, SPELL_CHAINS);
294 }
295 }
296
297 void UpdateAI(uint32 diff) override
298 {
299 if (!UpdateVictim())
300 return;
301
302 events.Update(diff);
303
304 if (_frostboltCooldown < diff)
306 else
307 _frostboltCooldown -= diff;
308
310 return;
311
312 if (!_phaseThree && HealthBelowPct(45))
313 {
314 _phaseThree = true;
315 _guardianCount = 0;
320 if (Is25ManRaid())
321 {
324 }
325 }
326
327 while (uint32 eventId = events.ExecuteEvent())
328 {
329 if (_frostboltCooldown <= 4 * IN_MILLISECONDS) // stop casting bolts for 4 seconds after doing another action
331 switch (eventId)
332 {
333 case EVENT_SKELETON:
334 {
336 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
337 {
338 std::list<Creature*> skeletons;
340 if (skeletons.empty())
341 { // prevent UB
343 return;
344 }
345 std::list<Creature*>::iterator it = skeletons.begin();
346 std::advance(it, urand(0, skeletons.size() - 1));
347 (*it)->SetReactState(REACT_AGGRESSIVE);
348 (*it)->AI()->DoZoneInCombat(); // will select a player on our threat list as we are the summoner
349 }
350 else
351 {
352 // retail uses server-side spell 28421 for this
354 summon->AI()->DoZoneInCombat();
355 }
356
357 uint8 nextTime = 0;
358 if (_skeletonCount < 10)
359 nextTime = 5;
360 else if (_skeletonCount < 19)
361 nextTime = 4;
362 else if (_skeletonCount < 31)
363 nextTime = 3;
364 else if (_skeletonCount == 31)
365 nextTime = 4;
366 else if (_skeletonCount < 72)
367 nextTime = 2;
368
369 if (nextTime)
371 break;
372 }
373
374 case EVENT_BANSHEE:
375 {
377 // retail uses server-side spell 28423 for this
379 summon->AI()->DoZoneInCombat();
380
381 uint8 nextTime = 0;
382 if (_bansheeCount < 3)
383 nextTime = 30;
384 else if (_bansheeCount < 7)
385 nextTime = 20;
386 else if (_bansheeCount < 9)
387 nextTime = 15;
388
389 if (nextTime)
391 break;
392 }
393
395 {
397 // retail uses server-side spell 28422 for this
399 summon->AI()->DoZoneInCombat();
400
401 uint8 nextTime = 0;
402 if (_abominationCount < 3)
403 nextTime = 30;
404 else if (_abominationCount < 7)
405 nextTime = 20;
406 else if (_abominationCount < 9)
407 nextTime = 15;
408
409 if (nextTime)
411 break;
412 }
413
415 {
416 // we need a temp vector, as we can't modify summons while iterating (this would cause UB)
417 std::vector<Creature*> toDespawn;
418 toDespawn.reserve(summons.size());
419 for (ObjectGuid sGuid : summons)
420 if (Creature* summon = ObjectAccessor::GetCreature(*me, sGuid))
421 if (!summon->IsInCombat())
422 toDespawn.push_back(summon);
423 for (Creature* summon : toDespawn)
424 summon->DespawnOrUnsummon();
426 break;
427 }
428
429 case EVENT_PHASE_TWO:
430 me->CastStop();
433 me->SetImmuneToPC(false);
437
443 if (Is25ManRaid())
445 break;
446
450 break;
451
453 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
456 break;
457
459 {
461 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, pred))
464 break;
465 }
466
468 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
469 DoCast(target, SPELL_FROST_BLAST);
471 break;
472
473 case EVENT_CHAINS:
474 {
477 break;
478 }
479
482 lichKing->AI()->Talk(SAY_ANSWER_REQUEST);
483 for (NAXData64 portalData : portalList)
484 if (GameObject* portal = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(portalData)))
485 portal->SetGoState(GO_STATE_ACTIVE);
486 break;
487
489 {
490 uint8 selected = urand(_guardianCount, nGuardianSpawns - 1);
491 if (selected != _guardianCount)
492 std::swap(_guardianGroups[selected], _guardianGroups[_guardianCount]);
493
494 std::list<TempSummon*> summoned;
495 // server-side spell 28454 is used on retail - no point replicating this in spell_dbc
497 for (TempSummon* guardian : summoned)
498 guardian->AI()->DoAction(ACTION_JUST_SUMMONED);
499 break;
500 }
501 }
502
504 return;
505 }
506
508 {
511 }
512 else
514 }
515
516 uint32 GetData(uint32 data) const override
517 {
520 return 0;
521 }
522
523 void DoAction(int32 action) override
524 {
525 switch (action)
526 {
529 return;
530 me->SetImmuneToPC(false);
536
538 {
539 std::list<TempSummon*> summoned;
540 me->SummonCreatureGroup(group, &summoned);
541 for (TempSummon* summon : summoned)
542 {
543 summon->SetReactState(REACT_PASSIVE);
544 summon->AI()->SetData(DATA_MINION_POCKET_ID, group);
545 }
546 }
547
553 break;
554
557 break;
558
559 default:
560 break;
561 }
562 }
563
565 {
566 return new KelThuzadCharmedPlayerAI(player);
567 }
568
569 private:
577 std::array<uint32, nGuardianSpawns> _guardianGroups;
578};
579
580static const float MINION_AGGRO_DISTANCE = 20.0f;
581// @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).
582// As of the time of writing, RMG sometimes selects positions on the "floor" below the room, causing Abominations to path wildly through the room.
583// This custom movement code prevents this by simply ignoring z coord calculation (the floor of the minion coves is flat anyway).
584// 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!
586{
587 public:
588 npc_kelthuzad_minionAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), pocketId(0), _movementTimer(urandms(4,12)), _home(me->GetPosition()) { }
589
590 void Reset() override
591 {
592 }
593
594 void EnterEvadeMode(EvadeReason why) override
595 {
598 kelThuzad->AI()->EnterEvadeMode(EVADE_REASON_OTHER);
599 }
600
601 void JustEngagedWith(Unit* who) override
602 {
603 _movementTimer = 0; // once it's zero, it'll never get checked again
605 {
607 return;
608 }
609
610 if (!pocketId)
611 return;
612
613 std::list<Creature*> others;
614 me->GetCreatureListWithEntryInGrid(others, me->GetEntry(), 80.0f);
615 for (Creature* other : others)
616 if (other->AI()->GetData(DATA_MINION_POCKET_ID) == pocketId)
617 {
618 other->SetReactState(REACT_AGGRESSIVE);
619 other->AI()->AttackStart(who);
620 }
622 AttackStart(who);
624 }
625
626 void AttackStart(Unit* who) override
627 {
629 }
630
631 void MoveInLineOfSight(Unit* who) override
632 {
634 {
636 return;
637 }
638
639 if (me->CanStartAttack(who, false) && me->GetDistance2d(who) <= MINION_AGGRO_DISTANCE)
640 JustEngagedWith(who);
641 }
642
643 void SetData(uint32 data, uint32 value) override
644 {
645 if (data == DATA_MINION_POCKET_ID)
646 pocketId = value;
647 }
648
649 uint32 GetData(uint32 data) const override
650 {
651 if (data == DATA_MINION_POCKET_ID)
652 return pocketId;
653 return 0;
654 }
655
656 void MovementInform(uint32 /*type*/, uint32 id) override
657 {
658 if (id == MOVEMENT_MINION_RANDOM)
659 _movementTimer = urandms(2, 10) + urandms(2, 10);
660 }
661
663 {
664 if (!_movementTimer)
665 return;
666
667 if (_movementTimer <= diff)
668 {
669 _movementTimer = 0;
671 }
672 else
673 _movementTimer -= diff;
674 }
675
676 protected:
679
680 private:
683};
684
686{
688
689 void UpdateAI(uint32 diff) override
690 {
692
693 if (!UpdateVictim())
694 return;
695
697 }
698};
699
701{
703
704 void UpdateAI(uint32 diff) override
705 {
707
708 if (!UpdateVictim())
709 return;
710
712 }
713};
714
716{
718
719 void UpdateAI(uint32 diff) override
720 {
722
723 if (!UpdateVictim())
724 return;
725
726 if (_woundTimer <= diff)
727 {
728 _woundTimer = urandms(14, 18);
730 }
731 else
732 _woundTimer -= diff;
733
735 }
736
737 void JustDied(Unit* killer) override
738 {
740 kelThuzad->AI()->DoAction(ACTION_ABOMINATION_DIED);
742 }
743
745};
746
748{
749 public:
750 npc_kelthuzad_guardian(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), _visibilityTimer(0), _bloodTapTimer(0) { }
751
752 void DoAction(int32 action) override
753 {
754 switch (action)
755 {
757 me->SetVisible(false);
763 break;
768 me->CombatStop();
769 me->StopMoving();
770 me->SetImmuneToPC(true);
771 me->DespawnOrUnsummon(30s); // just in case anything interrupts the movement
773 break;
774 default:
775 break;
776 }
777 }
778
779 void EnterEvadeMode(EvadeReason why) override
780 {
782 kelthuzad->AI()->EnterEvadeMode();
784 }
785
786 void JustReachedHome() override
787 {
789 }
790
791 void Reset() override
792 {
795 }
796
797 void UpdateAI(uint32 diff) override
798 {
800 {
801 if (diff > _visibilityTimer)
802 _visibilityTimer -= diff;
803 else
804 {
805 me->SetVisible(true);
808 }
809 }
810
811 if (!UpdateVictim())
812 return;
813
814 if (_bloodTapTimer <= diff)
815 {
817 _bloodTapTimer = urandms(18, 26);
818 }
819 else
820 _bloodTapTimer -= diff;
821
823 }
824
825 private:
829};
830
832{
834
835 void InitializeAI() override
836 {
838 }
839
840 void JustAppeared() override
841 {
842 _scheduler.Schedule(5s, [this](TaskContext /*task*/)
843 {
845 });
846 }
847
848 void UpdateAI(uint32 diff) override
849 {
850 _scheduler.Update(diff);
851 }
852
853private:
855};
856
857// 28410 - Chains of Kel'Thuzad
878
879// 27819 - Detonate Mana
881{
883
884 bool Validate(SpellInfo const* /*spell*/) override
885 {
887 }
888
889 void HandleScript(AuraEffect const* aurEff)
890 {
892
893 Unit* target = GetTarget();
894 if (int32 mana = int32(target->GetMaxPower(POWER_MANA) / 10))
895 {
896 mana = target->ModifyPower(POWER_MANA, -mana);
897 CastSpellExtraArgs args(aurEff);
898 args.AddSpellBP0(-mana * 10);
899 target->CastSpell(target, SPELL_MANA_DETONATION_DAMAGE, args);
900 }
901 }
902
907};
908
909// 27808 - Frost Blast
911{
913
914 bool Validate(SpellInfo const* /*spellInfo*/) override
915 {
917 }
918
919 void PeriodicTick(AuraEffect const* aurEff)
920 {
922
923 // Stuns the target, dealing 26% of the target's maximum health in Frost damage every second for 4 sec.
924 if (Unit* caster = GetCaster())
925 {
926 CastSpellExtraArgs args(aurEff);
927 args.AddSpellBP0(GetTarget()->CountPctFromMaxHealth(26));
928 caster->CastSpell(GetTarget(), SPELL_FROST_BLAST_DMG, args);
929 }
930 }
931
936};
937
939{
940public:
941 at_kelthuzad_center() : AreaTriggerScript("at_kelthuzad_center") { }
942
943 bool OnTrigger(Player* player, AreaTriggerEntry const* /*at*/) override
944 {
945 InstanceScript* instance = player->GetInstanceScript();
946 if (!instance || instance->GetBossState(BOSS_KELTHUZAD) != NOT_STARTED)
947 return true;
948
949 if (player->IsGameMaster())
950 return true;
951
952 Creature* kelThuzad = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_KELTHUZAD));
953 if (!kelThuzad)
954 return true;
955
956 kelThuzad->AI()->DoAction(ACTION_BEGIN_ENCOUNTER);
957
958 return true;
959 }
960};
961
963{
964 public:
965 achievement_just_cant_get_enough() : AchievementCriteriaScript("achievement_just_cant_get_enough") { }
966
967 bool OnCheck(Player* /*player*/, Unit* target) override
968 {
969 if (!target)
970 return false;
971
972 if (InstanceScript* instance = target->GetInstanceScript())
973 if (Creature* kelThuzad = ObjectAccessor::GetCreature(*target, instance->GetGuidData(DATA_KELTHUZAD)))
974 if (kelThuzad->AI()->GetData(DATA_ABOMINATION_DEATH_COUNT) >= 18)
975 return true;
976
977 return false;
978 }
979};
980
Actions
@ IN_MILLISECONDS
Definition Common.h:35
#define M_PI
Definition Common.h:72
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:27
std::chrono::minutes Minutes
Minutes shorthand typedef.
Definition Duration.h:30
@ IN_PROGRESS
@ NOT_STARTED
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
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
double rand_norm()
Definition Random.cpp:75
uint32 urandms(uint32 min, uint32 max)
Definition Random.cpp:49
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ 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)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_FLAG_UNINTERACTIBLE
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
Creatures
SummonGroups
Movements
static Position GetRandomPositionOnCircle(Position const &center, float radius)
@ 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
static const std::initializer_list< NAXData64 > portalList
@ 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()
@ 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
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
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:127
@ EVADE_REASON_OTHER
Definition CreatureAI.h:98
virtual void JustDied(Unit *)
Definition CreatureAI.h:130
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
void SetCombatPulseDelay(uint32 delay)
Definition Creature.h:269
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:293
void SetImmuneToPC(bool apply) override
Definition Creature.h:129
bool HasReactState(ReactStates state) const
Definition Creature.h:121
void SetReactState(ReactStates st)
Definition Creature.h:119
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
CreatureAI * AI() const
Definition Creature.h:154
bool CanStartAttack(Unit const *u, bool force) const
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
bool IsInPhase(PhaseIndex phase) const
Definition EventMap.h:236
void SetPhase(PhaseIndex phase)
Definition EventMap.cpp:28
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
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={})
void MoveTargetedHome()
TypeID GetTypeId() const
Definition Object.h:93
uint32 GetEntry() const
Definition Object.h:81
static Player * ToPlayer(Object *o)
Definition Object.h:180
Creature * GetCharmer() const
Definition PlayerAI.cpp:402
bool IsGameMaster() const
Definition Player.h:998
uint32 Id
Definition SpellInfo.h:289
iterator erase(iterator i)
iterator begin()
void Summon(Creature const *summon)
iterator end()
size_type size() const
StorageType::iterator iterator
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
TaskScheduler & Update(success_t const &callback=EmptyCallback)
virtual void DoAction(int32)
Definition UnitAI.h:154
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
virtual void Reset()
Definition UnitAI.h:145
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
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:101
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:8439
void CastStop(uint32 except_spellid=0)
Definition Unit.cpp:988
void SetVisible(bool x)
Definition Unit.cpp:8513
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=nullptr) const
Definition Unit.cpp:693
void StopMoving(bool force=false)
Definition Unit.cpp:10312
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
Powers GetPowerType() const
Definition Unit.h:931
bool IsAlive() const
Definition Unit.h:1234
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
uint32 GetMaxPower(Powers power) const
Definition Unit.h:936
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void RemoveAllAuras()
Definition Unit.cpp:4157
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:5691
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:954
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:955
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
Definition Object.cpp:3153
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
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:1992
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:1141
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2082
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool OnCheck(Player *, Unit *target) override
bool OnTrigger(Player *player, AreaTriggerEntry const *) override
void HandleRemove(AuraEffect const *aurEff, AuraEffectHandleModes mode)
PrepareAuraScript(spell_kelthuzad_chains)
void HandleApply(AuraEffect const *aurEff, AuraEffectHandleModes mode)
PrepareAuraScript(spell_kelthuzad_detonate_mana)
bool Validate(SpellInfo const *) override
void HandleScript(AuraEffect const *aurEff)
PrepareAuraScript(spell_kelthuzad_frost_blast)
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)
TC_GAME_API bool IsPlayerHealer(Player const *who)
@ 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(int32 val)
bool operator()(Unit const *target) const
float GetPositionZ() const
Definition Position.h:81
float GetPositionX() const
Definition Position.h:79
void GetPosition(float &x, float &y) const
Definition Position.h:84
float GetPositionY() const
Definition Position.h:80
void AttackStart(Unit *) override
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
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