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 "ScriptedCreature.h"
26#include "ScriptMgr.h"
27#include "SpellAuraEffects.h"
28#include "SpellScript.h"
29
45
47{
48 // Valithria Dreamwalker
65
66 // The Lich King
75
76 // Risen Archmage
82
83 // Blazing Skeleton
86
87 // Suppresser
89
90 // Blistering Zombie
92
93 // Gluttonous Abomination
96
97 // Dream Cloud
99
100 // Nightmare Cloud
102};
103
104#define SUMMON_PORTAL RAID_MODE<uint32>(SPELL_PRE_SUMMON_DREAM_PORTAL, SPELL_PRE_SUMMON_DREAM_PORTAL, \
105 SPELL_PRE_SUMMON_NIGHTMARE_PORTAL, SPELL_PRE_SUMMON_NIGHTMARE_PORTAL)
106
107#define EMERALD_VIGOR RAID_MODE<uint32>(SPELL_EMERALD_VIGOR, SPELL_EMERALD_VIGOR, \
108 SPELL_TWISTED_NIGHTMARE, SPELL_TWISTED_NIGHTMARE)
109
145
158
159Position const ValithriaSpawnPos = {4210.813f, 2484.443f, 364.9558f, 0.01745329f};
160
162{
163 explicit ValithriaManaVoidSelector(WorldObject const* source) : _source(source)
164 {
165 }
166
167 bool operator()(Unit* unit) const
168 {
169 return unit->GetPowerType() == POWER_MANA && _source->GetDistance(unit) > 15.0f;
170 }
171
173};
174
176{
177 public:
178 ValithriaDelayedCastEvent(Creature* trigger, uint32 spellId, ObjectGuid originalCaster, Milliseconds despawnTime) : _trigger(trigger), _originalCaster(originalCaster), _spellId(spellId), _despawnTime(despawnTime)
179 {
180 }
181
182 bool Execute(uint64 /*time*/, uint32 /*diff*/) override
183 {
185 if (_despawnTime != 0s)
187 return true;
188 }
189
190 private:
195};
196
198{
199 public:
200 ValithriaAuraRemoveEvent(Creature* trigger, uint32 spellId) : _trigger(trigger), _spellId(spellId)
201 {
202 }
203
204 bool Execute(uint64 /*time*/, uint32 /*diff*/) override
205 {
207 return true;
208 }
209
210 private:
213};
214
216{
217 public:
218 explicit ValithriaDespawner(Creature* creature) : _creature(creature)
219 {
220 }
221
222 bool Execute(uint64 /*currTime*/, uint32 /*diff*/) override
223 {
225 Cell::VisitGridObjects(_creature, worker, 333.0f);
226 return true;
227 }
228
229 void operator()(Creature* creature) const
230 {
231 switch (creature->GetEntry())
232 {
234 if (InstanceScript* instance = creature->GetInstanceScript())
235 instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, creature);
236 [[fallthrough]];
238 case NPC_SUPPRESSER:
241 case NPC_MANA_VOID:
243 case NPC_ROT_WORM:
246 break;
247 default:
248 return;
249 }
250
251 creature->DespawnOrUnsummon(0s, 10s);
252 }
253
254 private:
256};
257
258// 36789 - Valithria Dreamwalker
260{
261 boss_valithria_dreamwalker(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _portalCount(RAID_MODE<uint32>(3, 8, 3, 8))
262 {
263 Initialize();
265 }
266
268 {
269 _missedPortals = 0;
272 _justDied = false;
273 _done = false;
274 }
275
276 void InitializeAI() override
277 {
278 if (CreatureData const* data = me->GetCreatureData())
279 if (data->curhealth)
280 _spawnHealth = data->curhealth;
281
283 }
284
285 void Reset() override
286 {
287 _events.Reset();
291 // immune to percent heals
294 // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints
295 me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true);
297 Initialize();
298 }
299
300 void AttackStart(Unit* /*target*/) override
301 {
302 }
303
304 void DoAction(int32 action) override
305 {
306 if (action != ACTION_ENTER_COMBAT)
307 return;
308
313 if (IsHeroic())
315 }
316
317 void HealReceived(Unit* healer, uint32& heal) override
318 {
319 if (!me->hasLootRecipient())
320 me->SetLootRecipient(healer);
321
323
324 // encounter complete
325 if (me->HealthAbovePctHealed(100, heal) && !_done)
326 {
327 _done = true;
335 lichKing->AI()->EnterEvadeMode();
336 }
337 else if (!_over75PercentTalkDone && me->HealthAbovePctHealed(75, heal))
338 {
341 }
343 {
344 if (Creature* archmage = me->FindNearestCreature(NPC_RISEN_ARCHMAGE, 30.0f))
345 DoZoneInCombat(archmage); // on one of them, that will make it all start
346 }
347 }
348
349 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
350 {
351 if (me->HealthBelowPctDamaged(25, damage))
352 {
354 {
357 }
358
359 if (damage >= me->GetHealth())
360 {
361 damage = 0;
362 if (!_justDied)
363 {
364 _justDied = true;
368 trigger->AI()->DoAction(ACTION_DEATH);
369 }
370 }
371 }
372 }
373
374 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
375 {
376 if (spellInfo->Id == SPELL_DREAM_SLIP)
377 {
380 // this display id was found in sniff instead of the one on aura
381 me->SetDisplayId(11686);
385 Unit::Kill(me, trigger);
386
388 lichKing->CastSpell(lichKing, SPELL_SPAWN_CHEST);
389 }
390 }
391
392 void JustSummoned(Creature* summon) override
393 {
394 if (summon->GetEntry() == NPC_DREAM_PORTAL_PRE_EFFECT)
395 {
398 }
399 else if (summon->GetEntry() == NPC_NIGHTMARE_PORTAL_PRE_EFFECT)
400 {
403 }
404 }
405
406 void SummonedCreatureDespawn(Creature* summon) override
407 {
408 if (summon->GetEntry() == NPC_DREAM_PORTAL || summon->GetEntry() == NPC_NIGHTMARE_PORTAL)
409 if (summon->AI()->GetData(MISSED_PORTALS))
411 }
412
413 void UpdateAI(uint32 diff) override
414 {
415 // does not enter combat
417 return;
418
419 _events.Update(diff);
420
422 return;
423
424 while (uint32 eventId = _events.ExecuteEvent())
425 {
426 switch (eventId)
427 {
428 case EVENT_INTRO_TALK:
430 break;
431 case EVENT_BERSERK:
433 break;
435 if (!IsHeroic())
437 for (uint32 i = 0; i < _portalCount; ++i)
440 break;
441 case EVENT_DREAM_SLIP:
443 break;
444 default:
445 break;
446 }
447
449 return;
450 }
451 }
452
453 uint32 GetData(uint32 type) const override
454 {
455 if (type == MISSED_PORTALS)
456 return _missedPortals;
457
458 return 0;
459 }
460
461private:
470 bool _done;
471};
472
473// 38752 - Green Dragon Combat Trigger
475{
477
493
516
517 void JustExitedCombat() override
518 {
520
521 me->setActive(false);
522
523 // JustExitedCombat is called on death too, so if creature is dead, avoid "respawn" event
524 if (!me->IsAlive())
525 return;
527 }
528
529 void DoAction(int32 action) override
530 {
531 if (action == ACTION_DEATH)
532 {
536 lichKing->AI()->EnterEvadeMode();
537 }
538 }
539};
540
541// 16980 - The Lich King
543{
544 npc_the_lich_king_controller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
545
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 summon->SetPhaseMask((summon->GetPhaseMask() & ~0x10), 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
629// 37868 - Risen Archmage
631{
632 npc_risen_archmage(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
633 {
634 Initialize();
635 }
636
638 {
639 _isInitialArchmage = false;
640 }
641
642 bool CanAIAttack(Unit const* target) const override
643 {
644 return target->GetEntry() != NPC_VALITHRIA_DREAMWALKER;
645 }
646
647 void Reset() override
648 {
649 _events.Reset();
653 Initialize();
654 }
655
656 void JustEnteredCombat(Unit* who) override
657 {
658 if (IsEngaged())
659 return;
660
662
663 EngagementStart(who);
664
666 {
668 DoZoneInCombat(lichKing);
669
671 DoZoneInCombat(trigger);
672 }
673 }
674
675 void DoAction(int32 action) override
676 {
677 if (action == ACTION_ENTER_COMBAT)
679 else if (action == ACTION_SETUP_ARCHMAGES)
680 _isInitialArchmage = true;
681 }
682
683 void JustSummoned(Creature* summon) override
684 {
685 if (summon->GetEntry() == NPC_COLUMN_OF_FROST)
686 {
687 summon->CastSpell(summon, SPELL_COLUMN_OF_FROST_AURA, true);
689 }
690 else if (summon->GetEntry() == NPC_MANA_VOID)
691 {
692 summon->CastSpell(summon, SPELL_MANA_VOID_AURA, true);
693 summon->DespawnOrUnsummon(36s);
694 }
695 }
696
697 void UpdateAI(uint32 diff) override
698 {
701
702 if (!UpdateVictim())
703 return;
704
705 _events.Update(diff);
706
708 return;
709
710 while (uint32 eventId = _events.ExecuteEvent())
711 {
712 switch (eventId)
713 {
717 break;
718 case EVENT_MANA_VOID:
720 DoCast(target, SPELL_MANA_VOID);
722 break;
724 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, -10.0f, true))
727 break;
728 default:
729 break;
730 }
731
733 return;
734 }
735
737 }
738
739private:
743};
744
745// 36791 - Blazing Skeleton
747{
748 npc_blazing_skeleton(Creature* creature) : ScriptedAI(creature) { }
749
750 void Reset() override
751 {
752 _events.Reset();
755 }
756
757 void UpdateAI(uint32 diff) override
758 {
759 if (!UpdateVictim())
760 return;
761
762 _events.Update(diff);
763
765 return;
766
767 while (uint32 eventId = _events.ExecuteEvent())
768 {
769 switch (eventId)
770 {
771 case EVENT_FIREBALL:
775 break;
776 case EVENT_LEY_WASTE:
779 break;
780 default:
781 break;
782 }
783
785 return;
786 }
787
789 }
790
791private:
793};
794
795// 37863 - Suppresser
797{
798 npc_suppresser(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
799
800 void Reset() override
801 {
802 _events.Reset();
803 }
804
805 void IsSummonedBy(WorldObject* /*summoner*/) override
806 {
808 {
809 me->EngageWithTarget(valithria);
810 me->GetThreatManager().FixateTarget(valithria);
811 }
812 else
814 }
815
816 void MovementInform(uint32 type, uint32 /*id*/) override
817 {
818 if (type == CHASE_MOTION_TYPE)
820 }
821
822 void UpdateAI(uint32 diff) override
823 {
824 if (!UpdateVictim())
825 return;
826
827 _events.Update(diff);
828
830 return;
831
832 while (uint32 eventId = _events.ExecuteEvent())
833 {
834 switch (eventId)
835 {
838 _events.Repeat(5s);
839 break;
840 default:
841 break;
842 }
843 }
844
846 }
847
848private:
851};
852
853// 37934 - Blistering Zombie
855{
856 npc_blistering_zombie(Creature* creature) : ScriptedAI(creature) { }
857
858 void JustDied(Unit* /*killer*/) override
859 {
861 }
862
863 void UpdateAI(uint32 /*diff*/) override
864 {
865 if (!UpdateVictim())
866 return;
867
869 }
870};
871
872// 37886 - Gluttonous Abomination
874{
876
877 void Reset() override
878 {
879 _events.Reset();
881 }
882
883 void JustDied(Unit* killer) override
884 {
885 if (killer && killer->GetEntry() == NPC_VALITHRIA_DREAMWALKER)
886 return;
887
889 }
890
891 void UpdateAI(uint32 diff) override
892 {
893 if (!UpdateVictim())
894 return;
895
896 _events.Update(diff);
897
899 return;
900
901 while (uint32 eventId = _events.ExecuteEvent())
902 {
903 switch (eventId)
904 {
905 case EVENT_GUT_SPRAY:
908 break;
909 default:
910 break;
911 }
912 }
913
915 }
916
917private:
919};
920
921// 37945 - Dream Portal
922// 38430 - Nightmare Portal
924{
925 npc_dream_portal(Creature* creature) : CreatureAI(creature), _used(false) { }
926
927 void OnSpellClick(Unit* /*clicker*/, bool spellClickHandled) override
928 {
929 if (!spellClickHandled)
930 return;
931
932 _used = true;
934 }
935
936 uint32 GetData(uint32 type) const override
937 {
938 return (type == MISSED_PORTALS && _used) ? 0 : 1;
939 }
940
941 void UpdateAI(uint32 /*diff*/) override
942 {
943 UpdateVictim();
944 }
945
946private:
947 bool _used;
948};
949
950// 37985 - Dream Cloud
951// 38421 - Nightmare Cloud
953{
954 npc_dream_cloud(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
955
956 void Reset() override
957 {
958 _events.Reset();
960 me->SetCorpseDelay(0); // remove corpse immediately
962 }
963
964 void UpdateAI(uint32 diff) override
965 {
966 // trigger
968 return;
969
970 _events.Update(diff);
971
972 while (uint32 eventId = _events.ExecuteEvent())
973 {
974 switch (eventId)
975 {
977 {
978 Player* player = nullptr;
981 Cell::VisitWorldObjects(me, searcher, 7.5f);
983 break;
984 }
985 case EVENT_EXPLODE:
987 // must use originalCaster the same for all clouds to allow stacking
989 me->DespawnOrUnsummon(100ms);
990 break;
991 default:
992 break;
993 }
994 }
995 }
996
997private:
1000};
1001
1002// 71085 - Mana Void
1004{
1006
1007 void PeriodicTick(AuraEffect const* aurEff)
1008 {
1009 // first 3 ticks have amplitude 1 second
1010 // remaining tick every 500ms
1011 if (aurEff->GetTickNumber() <= 5)
1012 if (!(aurEff->GetTickNumber() & 1))
1014 }
1015
1020};
1021
1022// 70912 - Summon Timer: Suppresser
1023// 70913 - Summon Timer: Blazing Skeleton
1024// 70915 - Summon Timer: Gluttonous Abomination
1025// 70916 - Summon Timer: Risen Archmage
1027{
1029
1030 bool Load() override
1031 {
1032 _decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000;
1033 return true;
1034 }
1035
1037 {
1038 int32 timer = aurEff->GetPeriodicTimer();
1039 if (timer <= 5)
1040 return;
1041
1042 aurEff->SetPeriodicTimer(timer - _decayRate);
1043 }
1044
1049
1051};
1052
1053// 70921 - Summon Gluttonous Abomination
1054// 70933 - Summon Blazing Skeleton
1055// 71032 - Summon Blistering Zombie
1056// 71078 - Summon Risen Archmage
1058{
1060
1061 bool Load() override
1062 {
1063 if (!GetCaster()->GetInstanceScript())
1064 return false;
1065 return true;
1066 }
1067
1068 void FilterTargets(std::list<WorldObject*>& targets)
1069 {
1070 targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
1071 if (targets.empty())
1072 return;
1073
1075 targets.clear();
1076 targets.push_back(target);
1077 }
1078
1080 {
1081 PreventHitDefaultEffect(effIndex);
1082 if (!GetHitUnit())
1083 return;
1084
1085 GetHitUnit()->CastSpell(GetCaster(), GetEffectInfo().TriggerSpell, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING));
1086 }
1087
1093};
1094
1095// 70912 - Summon Timer: Suppresser
1097{
1099
1100 bool Validate(SpellInfo const* /*spellInfo*/) override
1101 {
1103 }
1104
1105 void PeriodicTick(AuraEffect const* /*aurEff*/)
1106 {
1109 }
1110
1111 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1112 {
1114 }
1115
1116 void HandleSummon(Unit* caster)
1117 {
1118 if (!caster || !caster->IsAIEnabled())
1119 return;
1120
1121 std::list<Creature*> summoners;
1123 if (summoners.empty())
1124 return;
1125
1126 uint8 suppresserNumber = caster->GetAI()->GetData(DATA_SUPPRESSERS_COUNT);
1127 for (uint8 i = 0; i < suppresserNumber; ++i)
1129 }
1130
1136};
1137
1138// 70936 - Summon Suppresser
1140{
1142
1143 bool Load() override
1144 {
1145 if (!GetCaster()->GetInstanceScript())
1146 return false;
1147 return true;
1148 }
1149
1151 {
1152 PreventHitDefaultEffect(effIndex);
1153 if (!GetHitUnit())
1154 return;
1155
1156 GetHitUnit()->CastSpell(GetCaster(), GetEffectInfo().TriggerSpell, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING));
1157 }
1158
1163};
1164
1165// 72224 - Summon Dream Portal
1167{
1169
1171 {
1172 PreventHitDefaultEffect(effIndex);
1173 if (!GetHitUnit())
1174 return;
1175
1176 uint32 spellId = RAND(71301, 72220, 72223, 72225);
1177 GetHitUnit()->CastSpell(GetHitUnit(), spellId, true);
1178 }
1179
1184};
1185
1186// 72480 - Summon Nightmare Portal
1188{
1190
1192 {
1193 PreventHitDefaultEffect(effIndex);
1194 if (!GetHitUnit())
1195 return;
1196
1197 uint32 spellId = RAND(71977, 72481, 72482, 72483);
1198 GetHitUnit()->CastSpell(GetHitUnit(), spellId, true);
1199 }
1200
1205};
1206
1207// 71970 - Nightmare Cloud
1238
1239// 71941 - Twisted Nightmares
1241{
1243
1245 {
1246 PreventHitDefaultEffect(effIndex);
1247
1248 if (InstanceScript* instance = GetHitUnit()->GetInstanceScript())
1249 GetHitUnit()->CastSpell(nullptr, GetEffectInfo().TriggerSpell, instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER));
1250 }
1251
1256};
1257
1259{
1260 public:
1261 achievement_portal_jockey() : AchievementCriteriaScript("achievement_portal_jockey") { }
1262
1263 bool OnCheck(Player* /*source*/, Unit* target) override
1264 {
1265 return target && !target->GetAI()->GetData(MISSED_PORTALS);
1266 }
1267};
1268
@ NPC_WORLD_TRIGGER
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint64_t uint64
Definition Define.h:132
uint32_t uint32
Definition Define.h:133
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:1128
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
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#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
@ UNIT_FLAG_UNINTERACTIBLE
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:608
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
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
InstanceScript *const instance
SummonList summons
Unit * GetAnyTarget() const
bool IsEngaged() const
Definition CreatureAI.h:105
@ EVADE_REASON_SEQUENCE_BREAK
Definition CreatureAI.h:97
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
void EngagementStart(Unit *who)
Creature *const me
Definition CreatureAI.h:82
void EngagementOver()
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
bool LoadCreaturesAddon()
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition Creature.cpp:652
void SetDisplayId(uint32 modelId) override
void SetLootRecipient(Unit *unit, bool withGroup=true)
void SetReactState(ReactStates st)
Definition Creature.h:119
bool hasLootRecipient() const
Definition Creature.h:216
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
CreatureData const * GetCreatureData() const
Definition Creature.h:187
void SetCorpseDelay(uint32 delay, bool ignoreCorpseDecayRatio=false)
Definition Creature.h:89
CreatureAI * AI() const
Definition Creature.h:154
void LowerPlayerDamageReq(uint32 unDamage)
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:52
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
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=nullptr, uint8 param1=0, uint8 param2=0)
static ObjectGuid const Empty
Definition ObjectGuid.h:140
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
static Player * ToPlayer(Object *o)
Definition Object.h:180
uint32 Id
Definition SpellInfo.h:289
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void DoAction(int32 info, Predicate &&predicate, uint16 max=0)
void FixateTarget(Unit *target)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
virtual void InitializeAI()
Definition UnitAI.cpp:36
virtual uint32 GetData(uint32) const
Definition UnitAI.h:155
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:30
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool IsWithinMeleeRange(Unit const *obj) const
Definition Unit.h:844
ThreatManager & GetThreatManager()
Definition Unit.h:1155
bool HealthAbovePctHealed(int32 pct, uint32 heal) const
Definition Unit.h:920
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3093
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
Powers GetPowerType() const
Definition Unit.h:931
bool IsAlive() const
Definition Unit.h:1234
void SetHealth(uint32 val)
Definition Unit.cpp:9361
UnitAI * GetAI() const
Definition Unit.h:800
bool IsAIEnabled() const
Definition Unit.h:798
uint32 GetHealth() const
Definition Unit.h:913
void EngageWithTarget(Unit *who)
Definition Unit.cpp:8292
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
Unit * GetVictim() const
Definition Unit.h:859
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition Unit.cpp:8142
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:918
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true)
Definition Unit.cpp:10930
CombatManager & GetCombatManager()
Definition Unit.h:1130
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:954
bool IsInCombat() const
Definition Unit.h:1144
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1476
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)
uint32 GetPhaseMask() const
Definition Object.h:368
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
void setActive(bool isActiveObject)
Definition Object.cpp:991
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2099
EventProcessor m_Events
Definition Object.h:591
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1123
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
PrepareAuraScript(spell_dreamwalker_decay_periodic_timer)
PrepareAuraScript(spell_dreamwalker_mana_void)
void PeriodicTick(AuraEffect const *aurEff)
PrepareAuraScript(spell_dreamwalker_nightmare_cloud)
PrepareSpellScript(spell_dreamwalker_summon_dream_portal)
PrepareSpellScript(spell_dreamwalker_summon_nightmare_portal)
PrepareSpellScript(spell_dreamwalker_summon_suppresser_effect)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_dreamwalker_summon_suppresser)
PrepareSpellScript(spell_dreamwalker_summoner)
void HandleForceCast(SpellEffIndex effIndex)
void FilterTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_dreamwalker_twisted_nightmares)
@ SPELL_REPUTATION_BOSS_KILL
@ LIGHT_S_HAMMER_TELEPORT
#define RegisterIcecrownCitadelCreatureAI(ai_name)
@ 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:108
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:168
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:180
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