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
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 Reset() override
279 {
280 _events.Reset();
284 // immune to percent heals
287 // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints
288 me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true);
290 Initialize();
291 }
292
293 void AttackStart(Unit* /*target*/) override
294 {
295 }
296
297 void DoAction(int32 action) override
298 {
299 if (action != ACTION_ENTER_COMBAT)
300 return;
301
306 if (IsHeroic())
308 }
309
310 void HealReceived(Unit* healer, uint32& heal) override
311 {
312 if (!me->hasLootRecipient())
313 me->SetTappedBy(healer);
314
316
317 // encounter complete
318 if (me->HealthAbovePctHealed(100, heal) && !_done)
319 {
320 _done = true;
328 lichKing->AI()->EnterEvadeMode();
329 }
330 else if (!_over75PercentTalkDone && me->HealthAbovePctHealed(75, heal))
331 {
334 }
336 {
337 if (Creature* archmage = me->FindNearestCreature(NPC_RISEN_ARCHMAGE, 30.0f))
338 DoZoneInCombat(archmage); // on one of them, that will make it all start
339 }
340 }
341
342 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
343 {
344 if (me->HealthBelowPctDamaged(25, damage))
345 {
347 {
350 }
351
352 if (damage >= me->GetHealth())
353 {
354 damage = 0;
355 if (!_justDied)
356 {
357 _justDied = true;
361 trigger->AI()->DoAction(ACTION_DEATH);
362 }
363 }
364 }
365 }
366
367 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
368 {
369 if (spellInfo->Id == SPELL_DREAM_SLIP)
370 {
373 // this display id was found in sniff instead of the one on aura
374 me->SetDisplayId(11686);
375 me->SetUninteractible(true);
378 Unit::Kill(me, trigger);
379
381 lichKing->CastSpell(lichKing, SPELL_SPAWN_CHEST);
382 }
383 }
384
385 void JustSummoned(Creature* summon) override
386 {
387 if (summon->GetEntry() == NPC_DREAM_PORTAL_PRE_EFFECT)
388 {
391 }
392 else if (summon->GetEntry() == NPC_NIGHTMARE_PORTAL_PRE_EFFECT)
393 {
396 }
397 }
398
399 void SummonedCreatureDespawn(Creature* summon) override
400 {
401 if (summon->GetEntry() == NPC_DREAM_PORTAL || summon->GetEntry() == NPC_NIGHTMARE_PORTAL)
402 if (summon->AI()->GetData(MISSED_PORTALS))
404 }
405
406 void UpdateAI(uint32 diff) override
407 {
408 // does not enter combat
410 return;
411
412 _events.Update(diff);
413
415 return;
416
417 while (uint32 eventId = _events.ExecuteEvent())
418 {
419 switch (eventId)
420 {
421 case EVENT_INTRO_TALK:
423 break;
424 case EVENT_BERSERK:
426 break;
428 if (!IsHeroic())
430 for (uint32 i = 0; i < _portalCount; ++i)
433 break;
434 case EVENT_DREAM_SLIP:
436 break;
437 default:
438 break;
439 }
440
442 return;
443 }
444 }
445
446 uint32 GetData(uint32 type) const override
447 {
448 if (type == MISSED_PORTALS)
449 return _missedPortals;
450
451 return 0;
452 }
453
454private:
463 bool _done;
464};
465
467{
469
485
508
509 void JustExitedCombat() override
510 {
512
513 me->setActive(false);
514
515 // JustExitedCombat is called on death too, so if creature is dead, avoid "respawn" event
516 if (!me->IsAlive())
517 return;
519 }
520
521 void DoAction(int32 action) override
522 {
523 if (action == ACTION_DEATH)
524 {
528 lichKing->AI()->EnterEvadeMode();
529 }
530 }
531};
532
534{
535 npc_the_lich_king_controller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
536
547
548 void JustReachedHome() override
549 {
550 me->setActive(false);
551 }
552
553 void JustEngagedWith(Unit* /*target*/) override
554 {
556 me->setActive(true);
557 }
558
559 uint32 GetData(uint32 data) const override
560 {
561 if (data == DATA_SUPPRESSERS_COUNT)
562 return RAID_MODE<uint32>(4, 6, 4, 6);
563 else
564 return 0;
565 }
566
567 void JustSummoned(Creature* summon) override
568 {
569 // must not be in dream phase
570 PhasingHandler::RemovePhase(summon, 173, true);
571 DoZoneInCombat(summon);
572 if (summon->GetEntry() != NPC_SUPPRESSER)
573 if (Unit* target = me->GetCombatManager().GetAnyTarget())
574 summon->AI()->AttackStart(target);
575 }
576
577 void UpdateAI(uint32 diff) override
578 {
579 if (!UpdateVictim())
580 return;
581
582 _events.Update(diff);
583
585 return;
586
587 while (uint32 eventId = _events.ExecuteEvent())
588 {
589 switch (eventId)
590 {
593 break;
596 break;
599 break;
602 break;
605 break;
606 default:
607 break;
608 }
609
611 return;
612 }
613 }
614
615private:
618};
619
621{
622 npc_risen_archmage(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
623 {
624 Initialize();
625 }
626
628 {
629 _isInitialArchmage = false;
630 }
631
632 bool CanAIAttack(Unit const* target) const override
633 {
634 return target->GetEntry() != NPC_VALITHRIA_DREAMWALKER;
635 }
636
637 void Reset() override
638 {
639 _events.Reset();
643 Initialize();
644 }
645
646 void JustEnteredCombat(Unit* who) override
647 {
648 if (IsEngaged())
649 return;
650
652
653 EngagementStart(who);
654
656 {
658 DoZoneInCombat(lichKing);
659
661 DoZoneInCombat(trigger);
662 }
663 }
664
665 void DoAction(int32 action) override
666 {
667 if (action == ACTION_ENTER_COMBAT)
669 else if (action == ACTION_SETUP_ARCHMAGES)
670 _isInitialArchmage = true;
671 }
672
673 void JustSummoned(Creature* summon) override
674 {
675 if (summon->GetEntry() == NPC_COLUMN_OF_FROST)
676 {
677 summon->CastSpell(summon, SPELL_COLUMN_OF_FROST_AURA, true);
679 }
680 else if (summon->GetEntry() == NPC_MANA_VOID)
681 {
682 summon->CastSpell(summon, SPELL_MANA_VOID_AURA, true);
683 summon->DespawnOrUnsummon(36s);
684 }
685 }
686
687 void UpdateAI(uint32 diff) override
688 {
691
692 if (!UpdateVictim())
693 return;
694
695 _events.Update(diff);
696
698 return;
699
700 while (uint32 eventId = _events.ExecuteEvent())
701 {
702 switch (eventId)
703 {
707 break;
708 case EVENT_MANA_VOID:
710 DoCast(target, SPELL_MANA_VOID);
712 break;
714 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, -10.0f, true))
717 break;
718 default:
719 break;
720 }
721
723 return;
724 }
725 }
726
727private:
731};
732
734{
735 npc_blazing_skeleton(Creature* creature) : ScriptedAI(creature) { }
736
737 void Reset() override
738 {
739 _events.Reset();
742 }
743
744 void UpdateAI(uint32 diff) override
745 {
746 if (!UpdateVictim())
747 return;
748
749 _events.Update(diff);
750
752 return;
753
754 while (uint32 eventId = _events.ExecuteEvent())
755 {
756 switch (eventId)
757 {
758 case EVENT_FIREBALL:
762 break;
763 case EVENT_LEY_WASTE:
766 break;
767 default:
768 break;
769 }
770
772 return;
773 }
774 }
775
776private:
778};
779
781{
782 npc_suppresser(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
783
784 void Reset() override
785 {
786 _events.Reset();
787 }
788
789 void IsSummonedBy(WorldObject* /*summoner*/) override
790 {
792 {
793 me->EngageWithTarget(valithria);
794 me->GetThreatManager().FixateTarget(valithria);
795 }
796 else
798 }
799
800 void MovementInform(uint32 type, uint32 /*id*/) override
801 {
802 if (type == CHASE_MOTION_TYPE)
804 }
805
806 void UpdateAI(uint32 diff) override
807 {
808 if (!UpdateVictim())
809 return;
810
811 _events.Update(diff);
812
814 return;
815
816 while (uint32 eventId = _events.ExecuteEvent())
817 {
818 switch (eventId)
819 {
822 _events.Repeat(5s);
823 break;
824 default:
825 break;
826 }
827 }
828 }
829
830private:
833};
834
836{
837 npc_blistering_zombie(Creature* creature) : ScriptedAI(creature) { }
838
839 void JustDied(Unit* /*killer*/) override
840 {
842 }
843};
844
846{
848
849 void Reset() override
850 {
851 _events.Reset();
853 }
854
855 void JustDied(Unit* killer) override
856 {
857 if (killer && killer->GetEntry() == NPC_VALITHRIA_DREAMWALKER)
858 return;
859
861 }
862
863 void UpdateAI(uint32 diff) override
864 {
865 if (!UpdateVictim())
866 return;
867
868 _events.Update(diff);
869
871 return;
872
873 while (uint32 eventId = _events.ExecuteEvent())
874 {
875 switch (eventId)
876 {
877 case EVENT_GUT_SPRAY:
880 break;
881 default:
882 break;
883 }
884 }
885 }
886
887private:
889};
890
892{
893 npc_dream_portal(Creature* creature) : CreatureAI(creature), _used(false) { }
894
895 void OnSpellClick(Unit* /*clicker*/, bool spellClickHandled) override
896 {
897 if (!spellClickHandled)
898 return;
899
900 _used = true;
902 }
903
904 uint32 GetData(uint32 type) const override
905 {
906 return (type == MISSED_PORTALS && _used) ? 0 : 1;
907 }
908
909 void UpdateAI(uint32 /*diff*/) override
910 {
911 UpdateVictim();
912 }
913
914private:
915 bool _used;
916};
917
919{
920 npc_dream_cloud(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
921
922 void Reset() override
923 {
924 _events.Reset();
926 me->SetCorpseDelay(0); // remove corpse immediately
928 }
929
930 void UpdateAI(uint32 diff) override
931 {
932 // trigger
934 return;
935
936 _events.Update(diff);
937
938 while (uint32 eventId = _events.ExecuteEvent())
939 {
940 switch (eventId)
941 {
943 {
944 Player* player = nullptr;
946 Trinity::PlayerSearcher searcher(me, player, check);
947 Cell::VisitWorldObjects(me, searcher, 7.5f);
949 break;
950 }
951 case EVENT_EXPLODE:
953 // must use originalCaster the same for all clouds to allow stacking
956 me->DespawnOrUnsummon(100ms);
957 break;
958 default:
959 break;
960 }
961 }
962 }
963
964private:
967};
968
969// 71085 - Mana Void
971{
972 void PeriodicTick(AuraEffect const* aurEff)
973 {
974 // first 3 ticks have amplitude 1 second
975 // remaining tick every 500ms
976 if (aurEff->GetTickNumber() <= 5)
977 if (!(aurEff->GetTickNumber() & 1))
979 }
980
985};
986
987// 70912 - Summon Timer: Suppresser
988// 70913 - Summon Timer: Blazing Skeleton
989// 70915 - Summon Timer: Gluttonous Abomination
990// 70916 - Summon Timer: Risen Archmage
992{
993 bool Load() override
994 {
995 _decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000;
996 return true;
997 }
998
1000 {
1001 int32 timer = aurEff->GetPeriodicTimer();
1002 if (timer <= 5)
1003 return;
1004
1005 aurEff->SetPeriodicTimer(timer - _decayRate);
1006 }
1007
1012
1014};
1015
1016// 70921 - Summon Gluttonous Abomination
1017// 70933 - Summon Blazing Skeleton
1018// 71032 - Summon Blistering Zombie
1019// 71078 - Summon Risen Archmage
1021{
1022 bool Load() override
1023 {
1024 if (!GetCaster()->GetInstanceScript())
1025 return false;
1026 return true;
1027 }
1028
1029 void FilterTargets(std::list<WorldObject*>& targets)
1030 {
1031 targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
1032 if (targets.empty())
1033 return;
1034
1036 targets.clear();
1037 targets.push_back(target);
1038 }
1039
1041 {
1042 PreventHitDefaultEffect(effIndex);
1043 if (!GetHitUnit())
1044 return;
1045
1047 .SetOriginalCaster(GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)));
1048 }
1049
1055};
1056
1057// 70912 - Summon Timer: Suppresser
1059{
1060 bool Validate(SpellInfo const* /*spellInfo*/) override
1061 {
1063 }
1064
1065 void PeriodicTick(AuraEffect const* /*aurEff*/)
1066 {
1069 }
1070
1071 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1072 {
1074 }
1075
1076 void HandleSummon(Unit* caster)
1077 {
1078 if (!caster || !caster->IsAIEnabled())
1079 return;
1080
1081 std::list<Creature*> summoners;
1083 if (summoners.empty())
1084 return;
1085
1086 uint8 suppresserNumber = caster->GetAI()->GetData(DATA_SUPPRESSERS_COUNT);
1087 for (uint8 i = 0; i < suppresserNumber; ++i)
1089 }
1090
1096};
1097
1098// 70936 - Summon Suppresser
1100{
1101 bool Load() override
1102 {
1103 if (!GetCaster()->GetInstanceScript())
1104 return false;
1105 return true;
1106 }
1107
1109 {
1110 PreventHitDefaultEffect(effIndex);
1111 if (!GetHitUnit())
1112 return;
1113
1115 .SetOriginalCaster(GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)));
1116 }
1117
1122};
1123
1124// 72224 - Summon Dream Portal
1126{
1128 {
1129 PreventHitDefaultEffect(effIndex);
1130 if (!GetHitUnit())
1131 return;
1132
1133 uint32 spellId = RAND(71301, 72220, 72223, 72225);
1134 GetHitUnit()->CastSpell(GetHitUnit(), spellId, true);
1135 }
1136
1141};
1142
1143// 72480 - Summon Nightmare Portal
1145{
1147 {
1148 PreventHitDefaultEffect(effIndex);
1149 if (!GetHitUnit())
1150 return;
1151
1152 uint32 spellId = RAND(71977, 72481, 72482, 72483);
1153 GetHitUnit()->CastSpell(GetHitUnit(), spellId, true);
1154 }
1155
1160};
1161
1162// 71970 - Nightmare Cloud
1164{
1165public:
1167 {
1168 _instance = nullptr;
1169 }
1170
1171private:
1172 bool Load() override
1173 {
1175 return _instance != nullptr;
1176 }
1177
1183
1188
1190};
1191
1192// 71941 - Twisted Nightmares
1194{
1196 {
1197 PreventHitDefaultEffect(effIndex);
1198
1199 if (InstanceScript* instance = GetHitUnit()->GetInstanceScript())
1201 .SetOriginalCaster(instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER)));
1202 }
1203
1208};
1209
1210// 47788 - Guardian Spirit
1212{
1213 bool Validate(SpellInfo const* /*spellInfo*/) override
1214 {
1216 }
1217
1218 bool Load() override
1219 {
1221 }
1222
1229
1234};
1235
1237{
1238 public:
1239 achievement_portal_jockey() : AchievementCriteriaScript("achievement_portal_jockey") { }
1240
1241 bool OnCheck(Player* /*source*/, Unit* target) override
1242 {
1243 return target && !target->GetAI()->GetData(MISSED_PORTALS);
1244 }
1245};
1246
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
Spells
Definition PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
SpellEffIndex
@ EFFECT_0
@ EFFECT_2
@ 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.
#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:599
@ UNIT_STATE_CASTING
Definition Unit.h:276
const SummonerInfo summoners[]
#define EMERALD_VIGOR
void AddSC_boss_valithria_dreamwalker()
@ 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
#define SUMMON_PORTAL
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:174
bool hasLootRecipient() const
Definition Creature.h:306
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:228
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
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:56
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: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:162
virtual uint32 GetData(uint32 id) const
Definition UnitAI.h:74
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
void ApplySpellImmune(uint32 spellId, SpellImmunity op, uint32 type, bool apply)
Definition Unit.cpp:8242
bool IsWithinMeleeRange(Unit const *obj) const
Definition Unit.h:710
ThreatManager & GetThreatManager()
Definition Unit.h:1078
bool HealthAbovePctHealed(float pct, uint32 heal) const
Definition Unit.h:795
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3231
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
Powers GetPowerType() const
Definition Unit.h:811
bool IsAlive() const
Definition Unit.h:1185
UnitAI * GetAI() const
Definition Unit.h:668
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
bool IsAIEnabled() const
Definition Unit.h:666
uint64 GetHealth() const
Definition Unit.h:788
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
void EngageWithTarget(Unit *who)
Definition Unit.cpp:8494
Unit * GetVictim() const
Definition Unit.h:726
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
CombatManager & GetCombatManager()
Definition Unit.h:1038
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
Definition Unit.cpp:11225
bool IsInCombat() const
Definition Unit.h:1058
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1466
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:396
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
void setActive(bool isActiveObject)
Definition Object.cpp:276
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1517
EventProcessor m_Events
Definition Object.h:561
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:432
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:1507
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 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 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