TrinityCore
Loading...
Searching...
No Matches
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
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
147
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
261// 36789 - Valithria Dreamwalker
263{
264 boss_valithria_dreamwalker(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _portalCount(RAID_MODE<uint32>(3, 8, 3, 8))
265 {
266 Initialize();
268 }
269
271 {
272 _missedPortals = 0;
275 _justDied = false;
276 _done = false;
277 }
278
279 void Reset() override
280 {
281 _events.Reset();
285 // immune to percent heals
288 // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints
289 me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true);
291 Initialize();
292 }
293
294 void AttackStart(Unit* /*target*/) override
295 {
296 }
297
298 void DoAction(int32 action) override
299 {
300 if (action != ACTION_ENTER_COMBAT)
301 return;
302
307 if (IsHeroic())
309 }
310
311 void HealReceived(Unit* healer, uint32& heal) override
312 {
313 if (!me->hasLootRecipient())
314 me->SetTappedBy(healer);
315
317
318 // encounter complete
319 if (me->HealthAbovePctHealed(100, heal) && !_done)
320 {
321 _done = true;
329 lichKing->AI()->EnterEvadeMode();
330 }
331 else if (!_over75PercentTalkDone && me->HealthAbovePctHealed(75, heal))
332 {
335 }
337 {
338 if (Creature* archmage = me->FindNearestCreature(NPC_RISEN_ARCHMAGE, 30.0f))
339 DoZoneInCombat(archmage); // on one of them, that will make it all start
340 }
341 }
342
343 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
344 {
345 if (me->HealthBelowPctDamaged(25, damage))
346 {
348 {
351 }
352
353 if (damage >= me->GetHealth())
354 {
355 damage = 0;
356 if (!_justDied)
357 {
358 _justDied = true;
362 trigger->AI()->DoAction(ACTION_DEATH);
363 }
364 }
365 }
366 }
367
368 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
369 {
370 if (spellInfo->Id == SPELL_DREAM_SLIP)
371 {
374 // this display id was found in sniff instead of the one on aura
375 me->SetDisplayId(11686);
376 me->SetUninteractible(true);
379 Unit::Kill(me, trigger);
380
382 lichKing->CastSpell(lichKing, SPELL_SPAWN_CHEST);
383 }
384 }
385
386 void JustSummoned(Creature* summon) override
387 {
388 if (summon->GetEntry() == NPC_DREAM_PORTAL_PRE_EFFECT)
389 {
392 }
393 else if (summon->GetEntry() == NPC_NIGHTMARE_PORTAL_PRE_EFFECT)
394 {
397 }
398 }
399
400 void SummonedCreatureDespawn(Creature* summon) override
401 {
402 if (summon->GetEntry() == NPC_DREAM_PORTAL || summon->GetEntry() == NPC_NIGHTMARE_PORTAL)
403 if (summon->AI()->GetData(MISSED_PORTALS))
405 }
406
407 void UpdateAI(uint32 diff) override
408 {
409 // does not enter combat
411 return;
412
413 _events.Update(diff);
414
416 return;
417
418 while (uint32 eventId = _events.ExecuteEvent())
419 {
420 switch (eventId)
421 {
422 case EVENT_INTRO_TALK:
424 break;
425 case EVENT_BERSERK:
427 break;
429 if (!IsHeroic())
431 for (uint32 i = 0; i < _portalCount; ++i)
434 break;
435 case EVENT_DREAM_SLIP:
437 break;
438 default:
439 break;
440 }
441
443 return;
444 }
445 }
446
447 uint32 GetData(uint32 type) const override
448 {
449 if (type == MISSED_PORTALS)
450 return _missedPortals;
451
452 return 0;
453 }
454
455private:
464 bool _done;
465};
466
467// 38752 - Green Dragon Combat Trigger
469{
471
487
510
511 void JustExitedCombat() override
512 {
514
515 me->setActive(false);
516
517 // JustExitedCombat is called on death too, so if creature is dead, avoid "respawn" event
518 if (!me->IsAlive())
519 return;
521 }
522
523 void DoAction(int32 action) override
524 {
525 if (action == ACTION_DEATH)
526 {
530 lichKing->AI()->EnterEvadeMode();
531 }
532 }
533};
534
535// 16980 - The Lich King
537{
538 npc_the_lich_king_controller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
539
550
551 void JustReachedHome() override
552 {
553 me->setActive(false);
554 }
555
556 void JustEngagedWith(Unit* /*target*/) override
557 {
559 me->setActive(true);
560 }
561
562 uint32 GetData(uint32 data) const override
563 {
564 if (data == DATA_SUPPRESSERS_COUNT)
565 return RAID_MODE<uint32>(4, 6, 4, 6);
566 else
567 return 0;
568 }
569
570 void JustSummoned(Creature* summon) override
571 {
572 // must not be in dream phase
573 PhasingHandler::RemovePhase(summon, 173, true);
574 DoZoneInCombat(summon);
575 if (summon->GetEntry() != NPC_SUPPRESSER)
576 if (Unit* target = me->GetCombatManager().GetAnyTarget())
577 summon->AI()->AttackStart(target);
578 }
579
580 void UpdateAI(uint32 diff) override
581 {
582 if (!UpdateVictim())
583 return;
584
585 _events.Update(diff);
586
588 return;
589
590 while (uint32 eventId = _events.ExecuteEvent())
591 {
592 switch (eventId)
593 {
596 break;
599 break;
602 break;
605 break;
608 break;
609 default:
610 break;
611 }
612
614 return;
615 }
616 }
617
618private:
621};
622
623// 37868 - Risen Archmage
625{
626 npc_risen_archmage(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
627 {
628 Initialize();
629 }
630
632 {
633 _isInitialArchmage = false;
634 }
635
636 bool CanAIAttack(Unit const* target) const override
637 {
638 return target->GetEntry() != NPC_VALITHRIA_DREAMWALKER;
639 }
640
641 void Reset() override
642 {
643 _events.Reset();
647 Initialize();
648 }
649
650 void JustEnteredCombat(Unit* who) override
651 {
652 if (IsEngaged())
653 return;
654
656
657 EngagementStart(who);
658
660 {
662 DoZoneInCombat(lichKing);
663
665 DoZoneInCombat(trigger);
666 }
667 }
668
669 void DoAction(int32 action) override
670 {
671 if (action == ACTION_ENTER_COMBAT)
673 else if (action == ACTION_SETUP_ARCHMAGES)
674 _isInitialArchmage = true;
675 }
676
677 void JustSummoned(Creature* summon) override
678 {
679 if (summon->GetEntry() == NPC_COLUMN_OF_FROST)
680 {
681 summon->CastSpell(summon, SPELL_COLUMN_OF_FROST_AURA, true);
683 }
684 else if (summon->GetEntry() == NPC_MANA_VOID)
685 {
686 summon->CastSpell(summon, SPELL_MANA_VOID_AURA, true);
687 summon->DespawnOrUnsummon(36s);
688 }
689 }
690
691 void UpdateAI(uint32 diff) override
692 {
695
696 if (!UpdateVictim())
697 return;
698
699 _events.Update(diff);
700
702 return;
703
704 while (uint32 eventId = _events.ExecuteEvent())
705 {
706 switch (eventId)
707 {
711 break;
712 case EVENT_MANA_VOID:
714 DoCast(target, SPELL_MANA_VOID);
716 break;
718 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, -10.0f, true))
721 break;
722 default:
723 break;
724 }
725
727 return;
728 }
729 }
730
731private:
735};
736
737// 36791 - Blazing Skeleton
739{
740 npc_blazing_skeleton(Creature* creature) : ScriptedAI(creature) { }
741
742 void Reset() override
743 {
744 _events.Reset();
747 }
748
749 void UpdateAI(uint32 diff) override
750 {
751 if (!UpdateVictim())
752 return;
753
754 _events.Update(diff);
755
757 return;
758
759 while (uint32 eventId = _events.ExecuteEvent())
760 {
761 switch (eventId)
762 {
763 case EVENT_FIREBALL:
767 break;
768 case EVENT_LEY_WASTE:
771 break;
772 default:
773 break;
774 }
775
777 return;
778 }
779 }
780
781private:
783};
784
785// 37863 - Suppresser
787{
788 npc_suppresser(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
789
790 void Reset() override
791 {
792 _events.Reset();
793 }
794
795 void IsSummonedBy(WorldObject* /*summoner*/) override
796 {
798 {
799 me->EngageWithTarget(valithria);
800 me->GetThreatManager().FixateTarget(valithria);
801 }
802 else
804 }
805
806 void MovementInform(uint32 type, uint32 /*id*/) override
807 {
808 if (type == CHASE_MOTION_TYPE)
810 }
811
812 void UpdateAI(uint32 diff) override
813 {
814 if (!UpdateVictim())
815 return;
816
817 _events.Update(diff);
818
820 return;
821
822 while (uint32 eventId = _events.ExecuteEvent())
823 {
824 switch (eventId)
825 {
828 _events.Repeat(5s);
829 break;
830 default:
831 break;
832 }
833 }
834 }
835
836private:
839};
840
841// 37934 - Blistering Zombie
843{
844 npc_blistering_zombie(Creature* creature) : ScriptedAI(creature) { }
845
846 void JustDied(Unit* /*killer*/) override
847 {
849 }
850};
851
852// 37886 - Gluttonous Abomination
854{
856
857 void Reset() override
858 {
859 _events.Reset();
861 }
862
863 void JustDied(Unit* killer) override
864 {
865 if (killer && killer->GetEntry() == NPC_VALITHRIA_DREAMWALKER)
866 return;
867
869 }
870
871 void UpdateAI(uint32 diff) override
872 {
873 if (!UpdateVictim())
874 return;
875
876 _events.Update(diff);
877
879 return;
880
881 while (uint32 eventId = _events.ExecuteEvent())
882 {
883 switch (eventId)
884 {
885 case EVENT_GUT_SPRAY:
888 break;
889 default:
890 break;
891 }
892 }
893 }
894
895private:
897};
898
899// 37945 - Dream Portal
900// 38430 - Nightmare Portal
902{
903 npc_dream_portal(Creature* creature) : CreatureAI(creature), _used(false) { }
904
905 void OnSpellClick(Unit* /*clicker*/, bool spellClickHandled) override
906 {
907 if (!spellClickHandled)
908 return;
909
910 _used = true;
912 }
913
914 uint32 GetData(uint32 type) const override
915 {
916 return (type == MISSED_PORTALS && _used) ? 0 : 1;
917 }
918
919 void UpdateAI(uint32 /*diff*/) override
920 {
921 UpdateVictim();
922 }
923
924private:
925 bool _used;
926};
927
928// 37985 - Dream Cloud
929// 38421 - Nightmare Cloud
931{
932 npc_dream_cloud(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
933
934 void Reset() override
935 {
936 _events.Reset();
938 me->SetCorpseDelay(0); // remove corpse immediately
940 }
941
942 void UpdateAI(uint32 diff) override
943 {
944 // trigger
946 return;
947
948 _events.Update(diff);
949
950 while (uint32 eventId = _events.ExecuteEvent())
951 {
952 switch (eventId)
953 {
955 {
956 Player* player = nullptr;
958 Trinity::PlayerSearcher searcher(me, player, check);
959 Cell::VisitWorldObjects(me, searcher, 7.5f);
961 break;
962 }
963 case EVENT_EXPLODE:
965 // must use originalCaster the same for all clouds to allow stacking
968 me->DespawnOrUnsummon(100ms);
969 break;
970 default:
971 break;
972 }
973 }
974 }
975
976private:
979};
980
981// 71085 - Mana Void
983{
984 void PeriodicTick(AuraEffect const* aurEff)
985 {
986 // first 3 ticks have amplitude 1 second
987 // remaining tick every 500ms
988 if (aurEff->GetTickNumber() <= 5)
989 if (!(aurEff->GetTickNumber() & 1))
991 }
992
997};
998
999// 70912 - Summon Timer: Suppresser
1000// 70913 - Summon Timer: Blazing Skeleton
1001// 70915 - Summon Timer: Gluttonous Abomination
1002// 70916 - Summon Timer: Risen Archmage
1004{
1005 bool Load() override
1006 {
1007 _decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000;
1008 return true;
1009 }
1010
1012 {
1013 int32 timer = aurEff->GetPeriodicTimer();
1014 if (timer <= 5)
1015 return;
1016
1017 aurEff->SetPeriodicTimer(timer - _decayRate);
1018 }
1019
1024
1026};
1027
1028// 70921 - Summon Gluttonous Abomination
1029// 70933 - Summon Blazing Skeleton
1030// 71032 - Summon Blistering Zombie
1031// 71078 - Summon Risen Archmage
1033{
1034 bool Load() override
1035 {
1036 if (!GetCaster()->GetInstanceScript())
1037 return false;
1038 return true;
1039 }
1040
1041 void FilterTargets(std::list<WorldObject*>& targets)
1042 {
1043 targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
1044 if (targets.empty())
1045 return;
1046
1048 targets.clear();
1049 targets.push_back(target);
1050 }
1051
1053 {
1054 PreventHitDefaultEffect(effIndex);
1055 if (!GetHitUnit())
1056 return;
1057
1059 .SetOriginalCaster(GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)));
1060 }
1061
1067};
1068
1069// 70912 - Summon Timer: Suppresser
1071{
1072 bool Validate(SpellInfo const* /*spellInfo*/) override
1073 {
1075 }
1076
1077 void PeriodicTick(AuraEffect const* /*aurEff*/)
1078 {
1081 }
1082
1083 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1084 {
1086 }
1087
1088 void HandleSummon(Unit* caster)
1089 {
1090 if (!caster || !caster->IsAIEnabled())
1091 return;
1092
1093 std::list<Creature*> summoners;
1095 if (summoners.empty())
1096 return;
1097
1098 uint8 suppresserNumber = caster->GetAI()->GetData(DATA_SUPPRESSERS_COUNT);
1099 for (uint8 i = 0; i < suppresserNumber; ++i)
1101 }
1102
1108};
1109
1110// 70936 - Summon Suppresser
1112{
1113 bool Load() override
1114 {
1115 if (!GetCaster()->GetInstanceScript())
1116 return false;
1117 return true;
1118 }
1119
1121 {
1122 PreventHitDefaultEffect(effIndex);
1123 if (!GetHitUnit())
1124 return;
1125
1127 .SetOriginalCaster(GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)));
1128 }
1129
1134};
1135
1136// 72224 - Summon Dream Portal
1138{
1140 {
1141 PreventHitDefaultEffect(effIndex);
1142 if (!GetHitUnit())
1143 return;
1144
1145 uint32 spellId = RAND(71301, 72220, 72223, 72225);
1146 GetHitUnit()->CastSpell(GetHitUnit(), spellId, true);
1147 }
1148
1153};
1154
1155// 72480 - Summon Nightmare Portal
1157{
1159 {
1160 PreventHitDefaultEffect(effIndex);
1161 if (!GetHitUnit())
1162 return;
1163
1164 uint32 spellId = RAND(71977, 72481, 72482, 72483);
1165 GetHitUnit()->CastSpell(GetHitUnit(), spellId, true);
1166 }
1167
1172};
1173
1174// 71970 - Nightmare Cloud
1176{
1177public:
1179 {
1180 _instance = nullptr;
1181 }
1182
1183private:
1184 bool Load() override
1185 {
1187 return _instance != nullptr;
1188 }
1189
1195
1200
1202};
1203
1204// 71941 - Twisted Nightmares
1206{
1208 {
1209 PreventHitDefaultEffect(effIndex);
1210
1211 if (InstanceScript* instance = GetHitUnit()->GetInstanceScript())
1213 .SetOriginalCaster(instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER)));
1214 }
1215
1220};
1221
1222// 47788 - Guardian Spirit
1224{
1225 bool Validate(SpellInfo const* /*spellInfo*/) override
1226 {
1228 }
1229
1230 bool Load() override
1231 {
1233 }
1234
1241
1246};
1247
1249{
1250 public:
1251 achievement_portal_jockey() : AchievementCriteriaScript("achievement_portal_jockey") { }
1252
1253 bool OnCheck(Player* /*source*/, Unit* target) override
1254 {
1255 return target && !target->GetAI()->GetData(MISSED_PORTALS);
1256 }
1257};
1258
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:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
@ IN_PROGRESS
@ NOT_STARTED
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ CHASE_MOTION_TYPE
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
SpellEffIndex
@ EFFECT_0
@ EFFECT_2
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_FORCE_CAST
@ SPELL_EFFECT_HEAL_PCT
@ TARGET_UNIT_SRC_AREA_ENTRY
@ 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.
#define SpellCheckCastFn(F)
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectUpdatePeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
@ REACT_PASSIVE
DamageEffectType
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:611
@ UNIT_STATE_CASTING
Definition Unit.h:290
const SummonerInfo summoners[]
#define EMERALD_VIGOR
void AddSC_boss_valithria_dreamwalker()
#define SUMMON_PORTAL
@ SPELL_SUMMON_NIGHTMARE_PORTAL
@ SPELL_NIGHTMARE_CLOUD_VISUAL
@ SPELL_TIMER_GLUTTONOUS_ABOMINATION
@ SPELL_NIGHTMARE_PORTAL_VISUAL_PRE
@ 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
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
WorldObject * GetOwner() const
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
uint32 GetId() const
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
InstanceScript *const instance
SummonList summons
Unit * GetAnyTarget() const
void DoZoneInCombat()
Definition CreatureAI.h:169
bool IsEngaged() const
Definition CreatureAI.h:79
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool UpdateVictim()
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
void EngagementStart(Unit *who)
Creature *const me
Definition CreatureAI.h:63
void EngagementOver()
bool LoadCreaturesAddon()
void SetReactState(ReactStates st)
Definition Creature.h:180
bool hasLootRecipient() const
Definition Creature.h:314
void SetTappedBy(Unit const *unit, bool withGroup=true)
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetSpawnHealth()
void SetDisplayId(uint32 displayId, bool setNative=false) override
void LowerPlayerDamageReq(uint64 unDamage)
void SetCorpseDelay(uint32 delay, bool ignoreCorpseDecayRatio=false)
Definition Creature.h:118
CreatureAI * AI() const
Definition Creature.h:235
void Update(uint32 time)
Definition EventMap.h:77
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
EventId ExecuteEvent()
Definition EventMap.cpp:77
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:56
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
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:314
Player * ToPlayer()
Definition Object.h:126
uint32 GetEntry() const
Definition Object.h:89
static void RemovePhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
HookList< CheckCastHandler > OnCheckCast
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Unit * GetExplTargetUnit() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void DoAction(int32 info, Predicate &&predicate, uint16 max=0)
void FixateTarget(Unit *target)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
virtual uint32 GetData(uint32 id) const
Definition UnitAI.h:74
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
void ApplySpellImmune(uint32 spellId, SpellImmunity op, uint32 type, bool apply)
Definition Unit.cpp:8261
bool IsWithinMeleeRange(Unit const *obj) const
Definition Unit.h:722
ThreatManager & GetThreatManager()
Definition Unit.h:1093
bool HealthAbovePctHealed(float pct, uint32 heal) const
Definition Unit.h:807
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3253
MotionMaster * GetMotionMaster()
Definition Unit.h:1750
Powers GetPowerType() const
Definition Unit.h:823
bool IsAlive() const
Definition Unit.h:1205
UnitAI * GetAI() const
Definition Unit.h:680
void SetUninteractible(bool apply)
Definition Unit.cpp:8583
bool IsAIEnabled() const
Definition Unit.h:678
uint64 GetHealth() const
Definition Unit.h:800
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:805
void EngageWithTarget(Unit *who)
Definition Unit.cpp:8513
Unit * GetVictim() const
Definition Unit.h:738
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
CombatManager & GetCombatManager()
Definition Unit.h:1053
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3992
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
Definition Unit.cpp:11311
bool IsInCombat() const
Definition Unit.h:1073
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1490
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:394
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
void setActive(bool isActiveObject)
Definition Object.cpp:274
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1522
EventProcessor m_Events
Definition Object.h:561
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:430
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:1512
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) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
CastSpellExtraArgs & SetOriginalCaster(ObjectGuid const &guid)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:150
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:140
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 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 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 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