TrinityCore
boss_valithria_dreamwalker.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 "icecrown_citadel.h"
19#include "CellImpl.h"
20#include "Containers.h"
21#include "GridNotifiersImpl.h"
22#include "InstanceScript.h"
23#include "MotionMaster.h"
24#include "ObjectAccessor.h"
25#include "PhasingHandler.h"
26#include "ScriptedCreature.h"
27#include "ScriptMgr.h"
28#include "SpellAuraEffects.h"
29#include "SpellScript.h"
30
32{
33 // The Lich King
35
36 // Valithria Dreamwalker
45};
46
48{
49 // Valithria Dreamwalker
67
68 // The Lich King
77
78 // Risen Archmage
84
85 // Blazing Skeleton
88
89 // Suppresser
91
92 // Blistering Zombie
94
95 // Gluttonous Abomination
98
99 // Dream Cloud
101
102 // Nightmare Cloud
104};
105
106#define SUMMON_PORTAL RAID_MODE<uint32>(SPELL_PRE_SUMMON_DREAM_PORTAL, SPELL_PRE_SUMMON_DREAM_PORTAL, \
107 SPELL_PRE_SUMMON_NIGHTMARE_PORTAL, SPELL_PRE_SUMMON_NIGHTMARE_PORTAL)
108
109#define EMERALD_VIGOR RAID_MODE<uint32>(SPELL_EMERALD_VIGOR, SPELL_EMERALD_VIGOR, \
110 SPELL_TWISTED_NIGHTMARE, SPELL_TWISTED_NIGHTMARE)
111
113{
114 // Valithria Dreamwalker
119
120 // The Lich King
126
127 // Risen Archmage
131
132 // Blazing Skeleton
135
136 // Suppresser
138
139 // Gluttonous Abomination
141
142 // Dream Cloud
143 // Nightmare Cloud
146};
147
149{
160
161Position const ValithriaSpawnPos = {4210.813f, 2484.443f, 364.9558f, 0.01745329f};
162
164{
165 explicit ValithriaManaVoidSelector(WorldObject const* source) : _source(source)
166 {
167 }
168
169 bool operator()(Unit* unit) const
170 {
171 return unit->GetPowerType() == POWER_MANA && _source->GetDistance(unit) > 15.0f;
172 }
173
175};
176
178{
179 public:
180 ValithriaDelayedCastEvent(Creature* trigger, uint32 spellId, ObjectGuid originalCaster, Milliseconds despawnTime) : _trigger(trigger), _originalCaster(originalCaster), _spellId(spellId), _despawnTime(despawnTime)
181 {
182 }
183
184 bool Execute(uint64 /*time*/, uint32 /*diff*/) override
185 {
187 .SetOriginalCaster(_originalCaster));
188 if (_despawnTime != 0s)
190 return true;
191 }
192
193 private:
198};
199
201{
202 public:
203 ValithriaAuraRemoveEvent(Creature* trigger, uint32 spellId) : _trigger(trigger), _spellId(spellId)
204 {
205 }
206
207 bool Execute(uint64 /*time*/, uint32 /*diff*/) override
208 {
210 return true;
211 }
212
213 private:
216};
217
219{
220 public:
221 explicit ValithriaDespawner(Creature* creature) : _creature(creature)
222 {
223 }
224
225 bool Execute(uint64 /*currTime*/, uint32 /*diff*/) override
226 {
228 Cell::VisitGridObjects(_creature, worker, 333.0f);
229 return true;
230 }
231
232 void operator()(Creature* creature) const
233 {
234 switch (creature->GetEntry())
235 {
237 if (InstanceScript* instance = creature->GetInstanceScript())
238 instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, creature);
239 [[fallthrough]];
241 case NPC_SUPPRESSER:
244 case NPC_MANA_VOID:
246 case NPC_ROT_WORM:
249 break;
250 default:
251 return;
252 }
253
254 creature->DespawnOrUnsummon(0s, 10s);
255 }
256
257 private:
259};
260
262{
263 boss_valithria_dreamwalker(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _portalCount(RAID_MODE<uint32>(3, 8, 3, 8))
264 {
265 Initialize();
267 }
268
270 {
271 _missedPortals = 0;
274 _justDied = false;
275 _done = false;
276 }
277
278 void InitializeAI() override
279 {
280 if (CreatureData const* data = me->GetCreatureData())
281 if (data->curhealth)
282 _spawnHealth = data->curhealth;
283
285 }
286
287 void Reset() override
288 {
289 _events.Reset();
293 // immune to percent heals
296 // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints
297 me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true);
299 Initialize();
300 }
301
302 void AttackStart(Unit* /*target*/) override
303 {
304 }
305
306 void DoAction(int32 action) override
307 {
308 if (action != ACTION_ENTER_COMBAT)
309 return;
310
315 if (IsHeroic())
317 }
318
319 void HealReceived(Unit* healer, uint32& heal) override
320 {
321 if (!me->hasLootRecipient())
322 me->SetTappedBy(healer);
323
325
326 // encounter complete
327 if (me->HealthAbovePctHealed(100, heal) && !_done)
328 {
329 _done = true;
337 lichKing->AI()->EnterEvadeMode();
338 }
339 else if (!_over75PercentTalkDone && me->HealthAbovePctHealed(75, heal))
340 {
343 }
345 {
346 if (Creature* archmage = me->FindNearestCreature(NPC_RISEN_ARCHMAGE, 30.0f))
347 DoZoneInCombat(archmage); // on one of them, that will make it all start
348 }
349 }
350
351 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
352 {
353 if (me->HealthBelowPctDamaged(25, damage))
354 {
356 {
359 }
360
361 if (damage >= me->GetHealth())
362 {
363 damage = 0;
364 if (!_justDied)
365 {
366 _justDied = true;
370 trigger->AI()->DoAction(ACTION_DEATH);
371 }
372 }
373 }
374 }
375
376 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
377 {
378 if (spellInfo->Id == SPELL_DREAM_SLIP)
379 {
382 // this display id was found in sniff instead of the one on aura
383 me->SetDisplayId(11686);
384 me->SetUninteractible(true);
387 Unit::Kill(me, trigger);
388
390 lichKing->CastSpell(lichKing, SPELL_SPAWN_CHEST);
391 }
392 }
393
394 void JustSummoned(Creature* summon) override
395 {
396 if (summon->GetEntry() == NPC_DREAM_PORTAL_PRE_EFFECT)
397 {
400 }
401 else if (summon->GetEntry() == NPC_NIGHTMARE_PORTAL_PRE_EFFECT)
402 {
405 }
406 }
407
408 void SummonedCreatureDespawn(Creature* summon) override
409 {
410 if (summon->GetEntry() == NPC_DREAM_PORTAL || summon->GetEntry() == NPC_NIGHTMARE_PORTAL)
411 if (summon->AI()->GetData(MISSED_PORTALS))
413 }
414
415 void UpdateAI(uint32 diff) override
416 {
417 // does not enter combat
419 return;
420
421 _events.Update(diff);
422
424 return;
425
426 while (uint32 eventId = _events.ExecuteEvent())
427 {
428 switch (eventId)
429 {
430 case EVENT_INTRO_TALK:
432 break;
433 case EVENT_BERSERK:
435 break;
437 if (!IsHeroic())
439 for (uint32 i = 0; i < _portalCount; ++i)
442 break;
443 case EVENT_DREAM_SLIP:
445 break;
446 default:
447 break;
448 }
449
451 return;
452 }
453 }
454
455 uint32 GetData(uint32 type) const override
456 {
457 if (type == MISSED_PORTALS)
458 return _missedPortals;
459
460 return 0;
461 }
462
463private:
472 bool _done;
473};
474
476{
478
479 void Reset() override
480 {
481 _Reset();
484 // Setup Archmages
486 if (Is25ManRaid())
488 else
490
493 }
494
495 void JustEnteredCombat(Unit* target) override
496 {
497 if (IsEngaged())
498 return;
499
501 {
504 return;
505 }
506
507 EngagementStart(target);
508
509 me->setActive(true);
513 valithria->AI()->DoAction(ACTION_ENTER_COMBAT);
516 }
517
518 void JustExitedCombat() override
519 {
521
522 me->setActive(false);
523
524 // JustExitedCombat is called on death too, so if creature is dead, avoid "respawn" event
525 if (!me->IsAlive())
526 return;
528 }
529
530 void DoAction(int32 action) override
531 {
532 if (action == ACTION_DEATH)
533 {
537 lichKing->AI()->EnterEvadeMode();
538 }
539 }
540};
541
543{
544 npc_the_lich_king_controller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
545
546 void Reset() override
547 {
548 _events.Reset();
555 }
556
557 void JustReachedHome() override
558 {
559 me->setActive(false);
560 }
561
562 void JustEngagedWith(Unit* /*target*/) override
563 {
565 me->setActive(true);
566 }
567
568 uint32 GetData(uint32 data) const override
569 {
570 if (data == DATA_SUPPRESSERS_COUNT)
571 return RAID_MODE<uint32>(4, 6, 4, 6);
572 else
573 return 0;
574 }
575
576 void JustSummoned(Creature* summon) override
577 {
578 // must not be in dream phase
579 PhasingHandler::RemovePhase(summon, 173, true);
580 DoZoneInCombat(summon);
581 if (summon->GetEntry() != NPC_SUPPRESSER)
582 if (Unit* target = me->GetCombatManager().GetAnyTarget())
583 summon->AI()->AttackStart(target);
584 }
585
586 void UpdateAI(uint32 diff) override
587 {
588 if (!UpdateVictim())
589 return;
590
591 _events.Update(diff);
592
594 return;
595
596 while (uint32 eventId = _events.ExecuteEvent())
597 {
598 switch (eventId)
599 {
602 break;
605 break;
608 break;
611 break;
614 break;
615 default:
616 break;
617 }
618
620 return;
621 }
622 }
623
624private:
627};
628
630{
631 npc_risen_archmage(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
632 {
633 Initialize();
634 }
635
637 {
638 _isInitialArchmage = false;
639 }
640
641 bool CanAIAttack(Unit const* target) const override
642 {
643 return target->GetEntry() != NPC_VALITHRIA_DREAMWALKER;
644 }
645
646 void Reset() override
647 {
648 _events.Reset();
652 Initialize();
653 }
654
655 void JustEnteredCombat(Unit* who) override
656 {
657 if (IsEngaged())
658 return;
659
661
662 EngagementStart(who);
663
665 {
667 DoZoneInCombat(lichKing);
668
670 DoZoneInCombat(trigger);
671 }
672 }
673
674 void DoAction(int32 action) override
675 {
676 if (action == ACTION_ENTER_COMBAT)
678 else if (action == ACTION_SETUP_ARCHMAGES)
679 _isInitialArchmage = true;
680 }
681
682 void JustSummoned(Creature* summon) override
683 {
684 if (summon->GetEntry() == NPC_COLUMN_OF_FROST)
685 {
686 summon->CastSpell(summon, SPELL_COLUMN_OF_FROST_AURA, true);
688 }
689 else if (summon->GetEntry() == NPC_MANA_VOID)
690 {
691 summon->CastSpell(summon, SPELL_MANA_VOID_AURA, true);
692 summon->DespawnOrUnsummon(36s);
693 }
694 }
695
696 void UpdateAI(uint32 diff) override
697 {
700
701 if (!UpdateVictim())
702 return;
703
704 _events.Update(diff);
705
707 return;
708
709 while (uint32 eventId = _events.ExecuteEvent())
710 {
711 switch (eventId)
712 {
716 break;
717 case EVENT_MANA_VOID:
719 DoCast(target, SPELL_MANA_VOID);
721 break;
723 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, -10.0f, true))
726 break;
727 default:
728 break;
729 }
730
732 return;
733 }
734 }
735
736private:
740};
741
743{
744 npc_blazing_skeleton(Creature* creature) : ScriptedAI(creature) { }
745
746 void Reset() override
747 {
748 _events.Reset();
751 }
752
753 void UpdateAI(uint32 diff) override
754 {
755 if (!UpdateVictim())
756 return;
757
758 _events.Update(diff);
759
761 return;
762
763 while (uint32 eventId = _events.ExecuteEvent())
764 {
765 switch (eventId)
766 {
767 case EVENT_FIREBALL:
771 break;
772 case EVENT_LEY_WASTE:
775 break;
776 default:
777 break;
778 }
779
781 return;
782 }
783 }
784
785private:
787};
788
790{
791 npc_suppresser(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
792
793 void Reset() override
794 {
795 _events.Reset();
796 }
797
798 void IsSummonedBy(WorldObject* /*summoner*/) override
799 {
801 {
802 me->EngageWithTarget(valithria);
803 me->GetThreatManager().FixateTarget(valithria);
804 }
805 else
807 }
808
809 void MovementInform(uint32 type, uint32 /*id*/) override
810 {
811 if (type == CHASE_MOTION_TYPE)
813 }
814
815 void UpdateAI(uint32 diff) override
816 {
817 if (!UpdateVictim())
818 return;
819
820 _events.Update(diff);
821
823 return;
824
825 while (uint32 eventId = _events.ExecuteEvent())
826 {
827 switch (eventId)
828 {
831 _events.Repeat(5s);
832 break;
833 default:
834 break;
835 }
836 }
837 }
838
839private:
842};
843
845{
846 npc_blistering_zombie(Creature* creature) : ScriptedAI(creature) { }
847
848 void JustDied(Unit* /*killer*/) override
849 {
851 }
852};
853
855{
857
858 void Reset() override
859 {
860 _events.Reset();
862 }
863
864 void JustDied(Unit* killer) override
865 {
866 if (killer && killer->GetEntry() == NPC_VALITHRIA_DREAMWALKER)
867 return;
868
870 }
871
872 void UpdateAI(uint32 diff) override
873 {
874 if (!UpdateVictim())
875 return;
876
877 _events.Update(diff);
878
880 return;
881
882 while (uint32 eventId = _events.ExecuteEvent())
883 {
884 switch (eventId)
885 {
886 case EVENT_GUT_SPRAY:
889 break;
890 default:
891 break;
892 }
893 }
894 }
895
896private:
898};
899
901{
902 npc_dream_portal(Creature* creature) : CreatureAI(creature), _used(false) { }
903
904 void OnSpellClick(Unit* /*clicker*/, bool spellClickHandled) override
905 {
906 if (!spellClickHandled)
907 return;
908
909 _used = true;
911 }
912
913 uint32 GetData(uint32 type) const override
914 {
915 return (type == MISSED_PORTALS && _used) ? 0 : 1;
916 }
917
918 void UpdateAI(uint32 /*diff*/) override
919 {
920 UpdateVictim();
921 }
922
923private:
924 bool _used;
925};
926
928{
929 npc_dream_cloud(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
930
931 void Reset() override
932 {
933 _events.Reset();
935 me->SetCorpseDelay(0); // remove corpse immediately
937 }
938
939 void UpdateAI(uint32 diff) override
940 {
941 // trigger
943 return;
944
945 _events.Update(diff);
946
947 while (uint32 eventId = _events.ExecuteEvent())
948 {
949 switch (eventId)
950 {
952 {
953 Player* player = nullptr;
956 Cell::VisitWorldObjects(me, searcher, 7.5f);
958 break;
959 }
960 case EVENT_EXPLODE:
962 // must use originalCaster the same for all clouds to allow stacking
964 .SetOriginalCaster(_instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER)));
965 me->DespawnOrUnsummon(100ms);
966 break;
967 default:
968 break;
969 }
970 }
971 }
972
973private:
976};
977
978// 71085 - Mana Void
980{
981 void PeriodicTick(AuraEffect const* aurEff)
982 {
983 // first 3 ticks have amplitude 1 second
984 // remaining tick every 500ms
985 if (aurEff->GetTickNumber() <= 5)
986 if (!(aurEff->GetTickNumber() & 1))
988 }
989
990 void Register() override
991 {
993 }
994};
995
996// 70912 - Summon Timer: Suppresser
997// 70913 - Summon Timer: Blazing Skeleton
998// 70915 - Summon Timer: Gluttonous Abomination
999// 70916 - Summon Timer: Risen Archmage
1001{
1002 bool Load() override
1003 {
1004 _decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000;
1005 return true;
1006 }
1007
1009 {
1010 int32 timer = aurEff->GetPeriodicTimer();
1011 if (timer <= 5)
1012 return;
1013
1014 aurEff->SetPeriodicTimer(timer - _decayRate);
1015 }
1016
1017 void Register() override
1018 {
1020 }
1021
1023};
1024
1025// 70921 - Summon Gluttonous Abomination
1026// 70933 - Summon Blazing Skeleton
1027// 71032 - Summon Blistering Zombie
1028// 71078 - Summon Risen Archmage
1030{
1031 bool Load() override
1032 {
1033 if (!GetCaster()->GetInstanceScript())
1034 return false;
1035 return true;
1036 }
1037
1038 void FilterTargets(std::list<WorldObject*>& targets)
1039 {
1040 targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
1041 if (targets.empty())
1042 return;
1043
1045 targets.clear();
1046 targets.push_back(target);
1047 }
1048
1050 {
1051 PreventHitDefaultEffect(effIndex);
1052 if (!GetHitUnit())
1053 return;
1054
1056 .SetOriginalCaster(GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)));
1057 }
1058
1059 void Register() override
1060 {
1063 }
1064};
1065
1066// 70912 - Summon Timer: Suppresser
1068{
1069 bool Validate(SpellInfo const* /*spellInfo*/) override
1070 {
1072 }
1073
1074 void PeriodicTick(AuraEffect const* /*aurEff*/)
1075 {
1078 }
1079
1080 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1081 {
1083 }
1084
1085 void HandleSummon(Unit* caster)
1086 {
1087 if (!caster || !caster->IsAIEnabled())
1088 return;
1089
1090 std::list<Creature*> summoners;
1092 if (summoners.empty())
1093 return;
1094
1095 uint8 suppresserNumber = caster->GetAI()->GetData(DATA_SUPPRESSERS_COUNT);
1096 for (uint8 i = 0; i < suppresserNumber; ++i)
1098 }
1099
1100 void Register() override
1101 {
1104 }
1105};
1106
1107// 70936 - Summon Suppresser
1109{
1110 bool Load() override
1111 {
1112 if (!GetCaster()->GetInstanceScript())
1113 return false;
1114 return true;
1115 }
1116
1118 {
1119 PreventHitDefaultEffect(effIndex);
1120 if (!GetHitUnit())
1121 return;
1122
1124 .SetOriginalCaster(GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)));
1125 }
1126
1127 void Register() override
1128 {
1130 }
1131};
1132
1133// 72224 - Summon Dream Portal
1135{
1137 {
1138 PreventHitDefaultEffect(effIndex);
1139 if (!GetHitUnit())
1140 return;
1141
1142 uint32 spellId = RAND(71301, 72220, 72223, 72225);
1143 GetHitUnit()->CastSpell(GetHitUnit(), spellId, true);
1144 }
1145
1146 void Register() override
1147 {
1149 }
1150};
1151
1152// 72480 - Summon Nightmare Portal
1154{
1156 {
1157 PreventHitDefaultEffect(effIndex);
1158 if (!GetHitUnit())
1159 return;
1160
1161 uint32 spellId = RAND(71977, 72481, 72482, 72483);
1162 GetHitUnit()->CastSpell(GetHitUnit(), spellId, true);
1163 }
1164
1165 void Register() override
1166 {
1168 }
1169};
1170
1171// 71970 - Nightmare Cloud
1173{
1174public:
1176 {
1177 _instance = nullptr;
1178 }
1179
1180private:
1181 bool Load() override
1182 {
1184 return _instance != nullptr;
1185 }
1186
1187 void PeriodicTick(AuraEffect const* /*aurEff*/)
1188 {
1191 }
1192
1193 void Register() override
1194 {
1196 }
1197
1199};
1200
1201// 71941 - Twisted Nightmares
1203{
1205 {
1206 PreventHitDefaultEffect(effIndex);
1207
1208 if (InstanceScript* instance = GetHitUnit()->GetInstanceScript())
1210 .SetOriginalCaster(instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER)));
1211 }
1212
1213 void Register() override
1214 {
1216 }
1217};
1218
1219// 47788 - Guardian Spirit
1221{
1222 bool Validate(SpellInfo const* /*spellInfo*/) override
1223 {
1225 }
1226
1227 bool Load() override
1228 {
1230 }
1231
1233 {
1236 return SPELL_CAST_OK;
1237 }
1238
1239 void Register() override
1240 {
1242 }
1243};
1244
1246{
1247 public:
1248 achievement_portal_jockey() : AchievementCriteriaScript("achievement_portal_jockey") { }
1249
1250 bool OnCheck(Player* /*source*/, Unit* target) override
1251 {
1252 return target && !target->GetAI()->GetData(MISSED_PORTALS);
1253 }
1254};
1255
1257{
1258 // Creatures
1269
1270 // Spells
1280
1281 // Achievements
1284}
Texts
@ NPC_WORLD_TRIGGER
TC_GAME_API bool InstanceHasScript(WorldObject const *obj, char const *scriptName)
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
@ IN_PROGRESS
@ NOT_STARTED
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ CHASE_MOTION_TYPE
Spells
Definition: PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_2
Definition: SharedDefines.h:32
@ TARGET_UNIT_SRC_AREA_ENTRY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_FORCE_CAST
@ SPELL_EFFECT_HEAL_PCT
@ IMMUNITY_STATE
@ IMMUNITY_EFFECT
@ IMMUNITY_ID
@ POWER_MANA
SpellCastResult
@ SPELL_FAILED_TARGET_AURASTATE
@ SPELL_CAST_OK
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
#define SpellCheckCastFn(F)
Definition: SpellScript.h:830
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define AuraEffectUpdatePeriodicFn(F, I, N)
Definition: SpellScript.h:2052
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
@ REACT_PASSIVE
Definition: UnitDefines.h:506
DamageEffectType
Definition: UnitDefines.h:131
@ CURRENT_CHANNELED_SPELL
Definition: Unit.h:591
@ UNIT_STATE_CASTING
Definition: Unit.h:270
const SummonerInfo summoners[]
Definition: boss_novos.cpp:70
#define EMERALD_VIGOR
void AddSC_boss_valithria_dreamwalker()
@ SPELL_SUMMON_NIGHTMARE_PORTAL
@ SPELL_NIGHTMARE_CLOUD_VISUAL
@ SPELL_SUMMON_DREAM_PORTAL
@ SPELL_TIMER_GLUTTONOUS_ABOMINATION
@ SPELL_NIGHTMARE_PORTAL_VISUAL_PRE
@ SPELL_CORRUPTION_VALITHRIA
@ SPELL_COLUMN_OF_FROST_AURA
@ SPELL_PRE_SUMMON_DREAM_PORTAL
@ SPELL_TIMER_BLAZING_SKELETON
@ SPELL_TIMER_BLISTERING_ZOMBIE
@ SPELL_PRE_SUMMON_NIGHTMARE_PORTAL
@ SPELL_COLUMN_OF_FROST_DAMAGE
@ SPELL_DREAM_PORTAL_VISUAL_PRE
@ SPELL_TIMER_RISEN_ARCHMAGE
#define SUMMON_PORTAL
@ SAY_VALITHRIA_25_PERCENT
@ SAY_VALITHRIA_PLAYER_DEATH
@ SAY_VALITHRIA_75_PERCENT
@ SAY_VALITHRIA_DREAM_PORTAL
@ SAY_VALITHRIA_ENTER_COMBAT
Position const ValithriaSpawnPos
@ EVENT_BLISTERING_ZOMBIE_SUMMONER
@ EVENT_RISEN_ARCHMAGE_SUMMONER
@ EVENT_BLAZING_SKELETON_SUMMONER
@ EVENT_GLUTTONOUS_ABOMINATION_SUMMONER
uint32 GetTickNumber() const
int32 GetPeriodicTimer() const
void SetPeriodicTimer(int32 periodicTimer)
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
WorldObject * GetOwner() const
HookList< EffectApplyHandler > AfterEffectApply
Definition: SpellScript.h:2028
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
Definition: SpellScript.h:2051
uint32 GetId() const
InstanceScript *const instance
SummonList summons
Unit * GetAnyTarget() const
void DoZoneInCombat()
Definition: CreatureAI.h:161
bool IsEngaged() const
Definition: CreatureAI.h:77
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:219
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
Definition: CreatureAI.cpp:328
void EngagementStart(Unit *who)
Definition: CreatureAI.cpp:275
Creature *const me
Definition: CreatureAI.h:61
void EngagementOver()
Definition: CreatureAI.cpp:287
bool LoadCreaturesAddon()
Definition: Creature.cpp:2749
void SetReactState(ReactStates st)
Definition: Creature.h:160
bool hasLootRecipient() const
Definition: Creature.h:284
void SetTappedBy(Unit const *unit, bool withGroup=true)
Definition: Creature.cpp:1339
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
CreatureData const * GetCreatureData() const
Definition: Creature.h:251
void SetDisplayId(uint32 displayId, bool setNative=false) override
Definition: Creature.cpp:3402
void LowerPlayerDamageReq(uint64 unDamage)
Definition: Creature.cpp:1680
void SetCorpseDelay(uint32 delay, bool ignoreCorpseDecayRatio=false)
Definition: Creature.h:104
CreatureAI * AI() const
Definition: Creature.h:214
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:52
void Reset()
Definition: EventMap.cpp:21
void AddEvent(BasicEvent *event, Milliseconds e_time, bool set_addtime=true)
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
Milliseconds CalculateTime(Milliseconds t_offset) const
virtual bool SetBossState(uint32 id, EncounterState state)
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
virtual ObjectGuid GetGuidData(uint32 type) const override
EncounterState GetBossState(uint32 id) const
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
static Player * ToPlayer(Object *o)
Definition: Object.h:213
static void RemovePhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
uint32 const Id
Definition: SpellInfo.h:325
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:829
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
Unit * GetExplTargetUnit() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
void DoAction(int32 info, Predicate &&predicate, uint16 max=0)
void FixateTarget(Unit *target)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
virtual void InitializeAI()
Definition: UnitAI.cpp:43
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:73
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
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:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void ApplySpellImmune(uint32 spellId, SpellImmunity op, uint32 type, bool apply)
Definition: Unit.cpp:7845
bool IsWithinMeleeRange(Unit const *obj) const
Definition: Unit.h:699
void SetHealth(uint64 val)
Definition: Unit.cpp:9346
ThreatManager & GetThreatManager()
Definition: Unit.h:1063
bool HealthAbovePctHealed(int32 pct, uint32 heal) const
Definition: Unit.h:783
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
Powers GetPowerType() const
Definition: Unit.h:799
bool IsAlive() const
Definition: Unit.h:1164
UnitAI * GetAI() const
Definition: Unit.h:660
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
bool IsAIEnabled() const
Definition: Unit.h:658
uint64 GetHealth() const
Definition: Unit.h:776
void EngageWithTarget(Unit *who)
Definition: Unit.cpp:8077
Unit * GetVictim() const
Definition: Unit.h:715
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
CombatManager & GetCombatManager()
Definition: Unit.h:1023
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
Definition: Unit.cpp:10591
bool IsInCombat() const
Definition: Unit.h:1043
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:1442
bool Execute(uint64, uint32) override
ValithriaAuraRemoveEvent(Creature *trigger, uint32 spellId)
ValithriaDelayedCastEvent(Creature *trigger, uint32 spellId, ObjectGuid originalCaster, Milliseconds despawnTime)
bool Execute(uint64, uint32) override
void operator()(Creature *creature) const
bool Execute(uint64, uint32) override
ValithriaDespawner(Creature *creature)
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
void setActive(bool isActiveObject)
Definition: Object.cpp:922
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
EventProcessor m_Events
Definition: Object.h:777
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1078
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition: Object.cpp:2131
bool OnCheck(Player *, Unit *target) override
void PeriodicTick(AuraEffect const *aurEff)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void HandleForceCast(SpellEffIndex effIndex)
void FilterTargets(std::list< WorldObject * > &targets)
@ SPELL_REPUTATION_BOSS_KILL
@ LIGHT_S_HAMMER_TELEPORT
#define RegisterIcecrownCitadelCreatureAI(ai_name)
#define ICCScriptName
@ DATA_VALITHRIA_LICH_KING
@ DATA_VALITHRIA_TRIGGER
@ DATA_VALITHRIA_DREAMWALKER
@ NPC_GREEN_DRAGON_COMBAT_TRIGGER
@ NPC_MANA_VOID
@ NPC_RISEN_ARCHMAGE
@ NPC_VALITHRIA_DREAMWALKER
@ NPC_SUPPRESSER
@ NPC_NIGHTMARE_PORTAL_PRE_EFFECT
@ NPC_BLAZING_SKELETON
@ NPC_NIGHTMARE_PORTAL
@ NPC_DREAM_PORTAL
@ NPC_ROT_WORM
@ NPC_GLUTTONOUS_ABOMINATION
@ NPC_COLUMN_OF_FROST
@ NPC_BLISTERING_ZOMBIE
@ NPC_DREAM_PORTAL_PRE_EFFECT
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:179
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:191
bool IsHeroic() const
T const & RAID_MODE(T const &normal10, T const &normal25) const
bool Is25ManRaid() const
ValithriaManaVoidSelector(WorldObject const *source)
void DoAction(int32 action) override
void UpdateAI(uint32 diff) override
void HealReceived(Unit *healer, uint32 &heal) override
uint32 GetData(uint32 type) const override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void JustSummoned(Creature *summon) override
void SummonedCreatureDespawn(Creature *summon) override
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void UpdateAI(uint32 diff) override
npc_blazing_skeleton(Creature *creature)
npc_blistering_zombie(Creature *creature)
void UpdateAI(uint32 diff) override
npc_dream_cloud(Creature *creature)
uint32 GetData(uint32 type) const override
void OnSpellClick(Unit *, bool spellClickHandled) override
npc_dream_portal(Creature *creature)
void UpdateAI(uint32) override
void UpdateAI(uint32 diff) override
void JustDied(Unit *killer) override
void JustEnteredCombat(Unit *target) override
void UpdateAI(uint32 diff) override
npc_risen_archmage(Creature *creature)
void JustEnteredCombat(Unit *who) override
void DoAction(int32 action) override
bool CanAIAttack(Unit const *target) const override
void JustSummoned(Creature *summon) override
void UpdateAI(uint32 diff) override
void IsSummonedBy(WorldObject *) override
void MovementInform(uint32 type, uint32) override
InstanceScript *const _instance
npc_suppresser(Creature *creature)
void JustSummoned(Creature *summon) override
uint32 GetData(uint32 data) const override