TrinityCore
boss_malygos.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/* Script Data Start
19SDName: Boss Malygos
20Script Data End */
21
22#include "ScriptMgr.h"
23#include "CombatAI.h"
24#include "Containers.h"
25#include "eye_of_eternity.h"
26#include "GameObject.h"
27#include "GridNotifiers.h"
28#include "InstanceScript.h"
29#include "Map.h"
30#include "MotionMaster.h"
31#include "ObjectAccessor.h"
32#include "Player.h"
33#include "ScriptedCreature.h"
34#include "SpellInfo.h"
35#include "SpellScript.h"
36#include "TemporarySummon.h"
37#include "Vehicle.h"
38
40{
41 // =========== INTRO BEFORE WE START ENCOUNTER ===============
46
47 // =========== PHASE ONE ===============
52
53 // =========== PHASE TWO ===============
63
64 // =========== PHASE THREE =============
68
69 // ========== MISC MECHANICS ===========
71 EVENT_MOVE_TO_VORTEX_POINT = 22, // This should be fixed someday in core, we can't call new movement from MovementInform
72 EVENT_START_FIRST_RANDOM_PORTAL = 23, // There is something that is still loading when we first enter instance and it breaks
73 // first visual cast of intro portal beam mechanic, so we need short delay from the event.
74 EVENT_DELAY_MOVE_TO_DESTROY_P = 24, // If Malygos is too close to destroy platform point and transition from II to III is hit,
75 // this event will be sheduled to start after 5 seconds so there is enough time for "dimension change".
76
77 // ============ NEXUS LORDS ============
81
82 // ======== SCIONS OF ETERNITY =========
84
85 // ======== WYRMREST SKYTALON ==========
87};
88
90{
94 PHASE_THREE = 4
95};
96
98{
99 // Intro
101 SPELL_PORTAL_BEAM = 56046, // Malygos cast on portal to activate it during PHASE_NOT_STARTED
102
103 // Phase I
105 SPELL_MALYGOS_BERSERK = 47008, // it's the berserk spell that will hit only Malygos after 10 min of 60670
112 SPELL_VORTEX_1 = 56237, // seems that frezze object animation
113 SPELL_VORTEX_2 = 55873, // visual effect
114 SPELL_VORTEX_3 = 56105, // this spell must handle all the script - cast by the boss and to himself
115 SPELL_VORTEX_6 = 73040, // teleport - (cast to all raid), caster vortex bunnies, targets players.
116
117 // Phase II
118 SPELL_TELEPORT_VISUAL_ONLY = 41232, // Light blue animation cast by arcane NPCs when spawned on Hover Disks
125 SPELL_ARCANE_OVERLOAD_1 = 56432, // cast by npc Arcane Overload ID: 30282
126 // SPELL_ARCANE_OVERLOAD_2 = 56435, // Triggered by 56432 - resizing target
127 // SPELL_ARCANE_OVERLOAD_3 = 56438, // Triggered by 56432 - damage reduction
129 // SPELL_SURGE_OF_POWER_TRIGGERED = 56548,
130 SPELL_ARCANE_SHOCK = 57058, // used by Nexus Lords
131 SPELL_HASTE = 57060, // used by Nexus Lords
132 SPELL_ARCANE_BARRAGE = 56397, // used by Scions of Eternity
133 SPELL_ARCANE_BARRAGE_DAMAGE = 63934, // the actual damage - cast by affected player by script spell
134
135 // Transition /II-III/
137 SPELL_SUMMON_RED_DRAGON_BUDDY_F_CAST = 58846, // After implicitly hit player targets they will force cast 56070 on self
141
142 // Phase III
149 SPELL_SURGE_OF_POWER_WARNING_SELECTOR_25 = 60939, // used in 25 player mode for selecting targets for warnings and then sends to actual spell
151
152 // Phase I and III
154
155 // Outro
158
160{
171};
172
174{
175 SEAT_0 = 0
177
179{
180 // Malygos
187
188 // Caster hover disk despawn action
190
191 // Nexus Lord's action used to shedule casting spell that determine disk's target to chase
194
196{
197 // Malygos
203 // SAY_START_P_TWO = 5, // Unused by Blizzard for some reason on any version
209 // SAY_START_P_THREE = 11, // Unused by Blizzard for some reason on any version
218
219 // Alexstrasza
224
225 // Power Sparks
228
229#define MAX_SUMMONS_PHASE_TWO_10MAN 6
230#define MAX_SUMMONS_PHASE_TWO_25MAN 12
231
232#define MAX_RANGE_HOVER_DISK_SPAWNPOINTS 8
234{
235 { 782.9821f, 1296.652f, 282.1114f, 0.0f },
236 { 764.3126f, 1328.871f, 282.3091f, 0.0f },
237 { 725.8506f, 1306.749f, 282.2698f, 0.0f },
238 { 744.5175f, 1274.396f, 282.3402f, 0.0f },
239 { 764.3936f, 1274.371f, 282.6011f, 0.0f },
240 { 779.3761f, 1316.166f, 282.1653f, 0.0f },
241 { 744.4915f, 1328.901f, 282.2112f, 0.0f },
242 { 729.2364f, 1287.328f, 282.4173f, 0.0f }
243};
244
245#define MAX_MELEE_HOVER_DISK_SPAWNPOINTS 4
247{
248 { 754.4617f, 1283.859f, 285.0522f, 0.0f },
249 { 771.7864f, 1301.853f, 285.0522f, 0.0f },
250 { 753.9635f, 1319.003f, 285.0522f, 0.0f },
251 { 736.4914f, 1301.683f, 285.0522f, 0.0f }
252};
253
254#define MAX_MELEE_HOVER_DISK_WAYPOINTS 16
256{
257 // First melee hover disk wps
258 { 766.2931f, 1312.904f, 277.0551f, 0.0f },
259 { 754.3397f, 1319.759f, 274.0536f, 0.0f },
260 { 742.1018f, 1312.714f, 270.1367f, 0.0f },
261 { 735.6851f, 1301.422f, 266.7208f, 0.0f },
262 // Second melee hover disk wps
263 { 742.6257f, 1313.471f, 275.9713f, 0.0f },
264 { 736.8845f, 1301.921f, 274.0264f, 0.0f },
265 { 742.6632f, 1289.951f, 269.8603f, 0.0f },
266 { 754.3682f, 1283.942f, 266.6098f, 0.0f },
267 // Third melee hover disk wps
268 { 742.2078f, 1290.518f, 276.2484f, 0.0f },
269 { 754.5398f, 1284.311f, 273.5815f, 0.0f },
270 { 766.5588f, 1290.345f, 269.6655f, 0.0f },
271 { 773.4768f, 1301.474f, 266.5821f, 0.0f },
272 // Forth melee hover disk wps
273 { 766.1189f, 1290.197f, 276.9436f, 0.0f },
274 { 771.9507f, 1301.602f, 273.9712f, 0.0f },
275 { 766.1253f, 1313.451f, 270.4991f, 0.0f },
276 { 754.5378f, 1319.399f, 266.6653f, 0.0f }
277};
278
279#define MAX_MALYGOS_POS 10
281{
282 { 754.544f, 1301.71f, 320.01f, 0.0f }, // Point destroy platform
283 { 754.393f, 1301.27f, 292.91f, 0.0f }, // Point Vortex
284 { 754.362f, 1301.61f, 266.17f, 0.0f }, // Point land after Vortex
285 { 754.695f, 1301.66f, 316.65f, 0.0f }, // Point Surge of Power phase II
286 { 755.681f, 1298.41f, 220.06f, 0.0f } // Point idle phase III
287};
288
289Position const AlexstraszaSpawnPos = { 854.551f, 1225.31f, 300.901f, 0.0f }; // Alexstrasza's spawn position
290Position const HeartOfMagicSpawnPos = { 755.351f, 1298.31f, 223.909f, 0.0f }; // Heart of Magic spawn position
291
292#define TEN_MINUTES (10*MINUTE*IN_MILLISECONDS)
293
295{
298
300{
303
305{
306 // Lights
312
313 // Data (setters/getters)
314 DATA_SUMMON_DEATHS = 0, // phase 2
316
317 // Target guids
318 DATA_LAST_OVERLOAD_GUID = 13, // used to store last Arcane Overload guid
320 // DATA_SECOND_SURGE_TARGET_GUID = 15,
321 // DATA_THIRD_SURGE_TARGET_GUID = 16,
323
325};
326
327// Used to check if summons guids come from vehicles
329{
330 public:
331 bool operator()(ObjectGuid guid) { return guid.IsVehicle(); }
332};
333
334struct boss_malygos : public BossAI
335{
337 {
338 Initialize();
340 _flySpeed = me->GetSpeed(MOVE_FLIGHT); // Get initial fly speed, otherwise on each wipe fly speed would add up if we get it
342 }
343
345 {
346 _summonDeaths = 0;
350 for (ObjectGuid& guid : _surgeTargetGUID)
351 guid.Clear();
352
353 _killSpamFilter = false;
354 _executingVortex = false;
356 _flyingOutOfPlatform = false;
360 }
361
362 void Reset() override
363 {
364 // EnterEvadeMode and Reset() links are cut for the sake of properly functioning despawner.
365 if (!_despawned)
366 _Reset();
367
368 Initialize();
369
370 me->SetDisableGravity(true);
371 me->SetImmuneToAll(true);
372 me->SetUninteractible(false);
373 // TO DO: find what in core is making boss slower than in retail (when correct speed data) or find missing movement flag update or forced spline change
375 if (_despawned)
377
381 }
382
383 uint32 GetData(uint32 data) const override
384 {
385 switch (data)
386 {
388 return _summonDeaths;
389 case DATA_PHASE:
390 return _phase;
391 }
392
393 return 0;
394 }
395
396 void SetData(uint32 data, uint32 value) override
397 {
398 if (data == DATA_SUMMON_DEATHS && _phase == PHASE_TWO && !_despawned)
399 {
400 _summonDeaths = value;
401
403 {
405 {
408 }
409 }
410 else if (GetDifficulty() == DIFFICULTY_25_N)
411 {
413 {
416 }
417 }
418 }
419 }
420
421 ObjectGuid GetGUID(int32 type) const override
422 {
425 else if (type == DATA_LAST_TARGET_BARRAGE_GUID)
427
428 return ObjectGuid::Empty;
429 }
430
431 void SetGUID(ObjectGuid const& guid, int32 id) override
432 {
433 switch (id)
434 {
436 _arcaneOverloadGUID = guid;
437 break;
442 break;
445 break;
446 }
447 }
448
449 void DoAction(int32 action) override
450 {
451 switch (action)
452 {
456 {
457 Position pos;
458 pos.m_positionZ = alexstraszaBunny->GetPositionZ();
459 alexstraszaBunny->GetNearPoint2D(nullptr, pos.m_positionX, pos.m_positionY, 30.0f, alexstraszaBunny->GetAbsoluteAngle(me));
461 me->SetImmuneToAll(false);
464 }
465 break;
467 DoCast(me, SPELL_VORTEX_1, true);
468 DoCast(me, SPELL_VORTEX_2, true);
469 // the vortex execution continues in the dummy effect of this spell (see it's script)
470 DoCast(me, SPELL_VORTEX_3, true);
471 break;
473 {
474 Position _zToLift = me->GetPosition();
475 if (_phase == PHASE_ONE)
476 {
477 _zToLift.m_positionZ += 20.0f;
479 }
480 else if (_phase == PHASE_TWO)
481 {
482 _zToLift.m_positionZ = 300.1f;
484 }
485 break;
486 }
491 // Vehicles shouldn't be despawned with 0 delay if the call comes from virtual function that overrides PassengerBoarded.
492 // Aside from that he doesn't despawn both vehicles and arcane overloads right away, but with some delay.
497 me->StopMoving();
498 if (me->GetPositionZ() > 300.0f)
500 else
502
504 break;
506 // Teleport to spawn position, we can't use normal relocate
507 float x, y, z, o;
508 me->GetRespawnPosition(x, y, z, &o);
509 me->NearTeleportTo(x, y, z, o);
510 // Respawn Iris
512 _despawned = false;
513 break;
515 me->GetMotionMaster()->MoveCirclePath(MalygosPositions[3].GetPositionX(), MalygosPositions[3].GetPositionY(), 283.2763f, 120.0f, true, 16);
516 break;
517 }
518 }
519
520 void SetPhase(uint8 phase, bool setEvents = false)
521 {
522 events.Reset();
523 events.SetPhase(phase);
524 _phase = phase;
525 me->SetCanMelee(phase != PHASE_THREE);
526 if (setEvents)
528 }
529
531 {
532 switch (_phase)
533 {
537 break;
538 case PHASE_ONE:
543 break;
544 case PHASE_TWO:
547 break;
548 case PHASE_THREE:
553 break;
554 }
555 }
556
557 void JustEngagedWith(Unit* /*who*/) override
558 {
559 // We can't call full function here since it includes DoZoneInCombat(),
560 // if someone does it will be returned with a warning.
561 me->setActive(true);
563 {
565 return;
566 }
567
569
571 DoCast(SPELL_BERSERK); // periodic aura, first tick in 10 minutes
573 }
574
575 void EnterEvadeMode(EvadeReason /*why*/) override
576 {
578
580
581 if (!summons.empty())
582 {
583 if (_phase == PHASE_TWO)
584 {
587 summons.DespawnIf(pred);
589 }
590 else if (_phase == PHASE_THREE)
592 }
593
594 me->DespawnOrUnsummon(0s, 30s);
595 }
596
597 void KilledUnit(Unit* victim) override
598 {
599 if (victim->GetTypeId() != TYPEID_PLAYER)
600 return;
601
602 if (!_killSpamFilter)
603 {
604 switch (_phase)
605 {
606 case PHASE_ONE:
609 _killSpamFilter = true;
610 break;
611 case PHASE_TWO:
614 _killSpamFilter = true;
615 break;
616 case PHASE_THREE:
619 _killSpamFilter = true;
620 break;
621 }
622 }
623 }
624
625 void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
626 {
627 if (spellInfo->Id == SPELL_POWER_SPARK_MALYGOS)
628 {
629 if (Creature* creature = caster->ToCreature())
630 creature->DespawnOrUnsummon();
631
633 }
634 else if (spellInfo->Id == SPELL_MALYGOS_BERSERK)
636 }
637
638 void MoveInLineOfSight(Unit* who) override
639
640 {
641 if (!me->IsInCombat() || _phase != PHASE_ONE)
642 return;
643
644 if (who->GetEntry() == NPC_POWER_SPARK)
645 if (who->GetDistance(me) <= 2.5f)
647 }
648
649 void MovementInform(uint32 type, uint32 id) override
650 {
651 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
652 return;
653
654 switch (id)
655 {
657 if (Creature* portal = me->FindNearestCreature(NPC_PORTAL_TRIGGER, 31.0f, true))
658 {
661 DoCast(portal, SPELL_PORTAL_BEAM);
662 }
663 break;
664 case POINT_LAND_P_ONE:
665 me->SetDisableGravity(false);
666 break;
670 break;
672 me->SetDisableGravity(false);
673 _executingVortex = false;
675 break;
677 me->SetDisableGravity(true);
679 break;
682 {
684 me->SetUninteractible(true);
686 me->SetFacingToObject(alexstraszaBunny);
688 }
689 _flyingOutOfPlatform = false;
692 break;
694 me->SetDisableGravity(true);
696 me->SetFacingToObject(alexstraszaBunny);
699 break;
702 {
706 }
707 break;
712 break;
716 break;
717 }
718 }
719
720 void DamageTaken(Unit* /*cause*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
721 {
722 if (damage > me->GetHealth() && _phase != PHASE_THREE)
723 damage = me->GetHealth() - 1;
724 }
725
726 void UpdateAI(uint32 diff) override
727 {
729 return;
730
731 events.Update(diff);
732
733 // we can't cast if we are casting already unless in PHASE_NOT_STARTED channeling PORTAL_BEAM
735 return;
736
737 // at 50% hp Malygos switchs to phase 2 and removes hovering until reset or end of encounter
738 if (_phase == PHASE_ONE && me->GetHealthPct() <= 50.0f)
739 {
740 SetPhase(PHASE_TWO, true);
742 me->AttackStop();
744 }
745
746 while (uint32 eventId = events.ExecuteEvent())
747 {
748 switch (eventId)
749 {
753 break;
756 break;
759 {
760 me->SetFacingToObject(iris);
761 iris->Delete(); // this is not the best way.
762 }
764 SetPhase(PHASE_ONE, true);
765 break;
766 case EVENT_SAY_INTRO:
769 break;
770 case EVENT_VORTEX:
771 _executingVortex = true;
774 break;
777 me->AttackStop();
779 break;
783 break;
786 {
788 break;
789 }
790
793 break;
795 if (_phase == PHASE_ONE)
796 {
798 {
800 break;
801 }
802
805 }
806 else if (_phase == PHASE_THREE)
807 {
810 }
811 break;
814 {
816 {
817 Position randomPosOnRadius;
818 // Hardcodded retail value, reason is Z getters can fail... (TO DO: Change to getter when height calculation works on 100%!)
819 randomPosOnRadius.m_positionZ = 283.0521f;
820 alexstraszaBunny->GetNearPoint2D(nullptr, randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 120.0f, alexstraszaBunny->GetAbsoluteAngle(me));
823 }
824 }
825
827 {
828 for (uint8 rangeDisks = 0; rangeDisks < (GetDifficulty() == DIFFICULTY_10_N ? 4 : 5); rangeDisks++)
829 {
831
832 if (casterDiskSummon->IsAIEnabled())
833 casterDiskSummon->AI()->DoAction(rangeDisks);
834 }
835
836 for (uint8 meleeDisks = 0; meleeDisks < 2; meleeDisks++)
837 {
840 }
841
842 _arcaneReinforcements = false;
843
846 }
847 break;
849 for (uint8 rangeDisks = 5; rangeDisks < 8; rangeDisks++)
850 {
852
853 if (casterDiskSummon->IsAIEnabled())
854 casterDiskSummon->AI()->DoAction(rangeDisks);
855 }
856
857 for (uint8 meleeDisks = 2; meleeDisks < 4; meleeDisks++)
858 {
861 }
862 break;
866 break;
869 {
874 }
875 break;
878 {
879 me->StopMoving();
881 }
882
884 {
886 if (Creature* lastArcaneOverloadBunny = ObjectAccessor::GetCreature(*me, _arcaneOverloadGUID))
887 DoCast(lastArcaneOverloadBunny, SPELL_ARCANE_BOMB_TRIGGER, true);
888 }
890 break;
893 {
897 }
898 else
899 {
902 }
903 break;
906 break;
909 break;
913 break;
918 me->SetUninteractible(false);
921 SetPhase(PHASE_THREE, true);
922 break;
925 {
926 if (Unit* tempSurgeTarget = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, false, true, SPELL_RIDE_RED_DRAGON_BUDDY))
927 {
928 if (Vehicle* drakeVehicle = tempSurgeTarget->GetVehicleKit())
929 {
930 if (Unit* passenger = drakeVehicle->GetPassenger(0))
931 {
932 if (passenger->GetTypeId() == TYPEID_PLAYER)
933 {
935 DoCast(tempSurgeTarget, SPELL_SURGE_OF_POWER_PHASE_3_10, true);
936 }
937 }
938 }
939 }
940 }
941 else if (GetDifficulty() == DIFFICULTY_25_N)
942 {
943 for (ObjectGuid& guid : _surgeTargetGUID)
944 guid.Clear();
945
947 }
948
950 break;
952 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, false, true, SPELL_RIDE_RED_DRAGON_BUDDY))
953 DoCast(target, SPELL_STATIC_FIELD_MISSLE, true);
954
956 break;
958 _killSpamFilter = false;
959 break;
960 default:
961 break;
962 }
963
965 return;
966 }
967 }
968
969 void JustDied(Unit* /*killer*/) override
970 {
971 _JustDied();
974 alexstraszaGiftBoxBunny->SummonGameObject(RAID_MODE(GO_HEART_OF_MAGIC_10, GO_HEART_OF_MAGIC_25), HeartOfMagicSpawnPos, QuaternionData(), 0s);
975
978 }
979
980private:
981 uint8 _phase; // Counter for phases used with a getter.
982 uint8 _summonDeaths; // Keeps count of arcane trash.
983 uint8 _preparingPulsesChecker; // In retail they use 2 preparing pulses with 7 sec CD, after they pass 2 seconds.
984 ObjectGuid _arcaneOverloadGUID; // Last Arcane Overload summoned to know to which should visual be cast to (the purple ball, not bubble).
985 ObjectGuid _lastHitByArcaneBarrageGUID; // Last hit player by Arcane Barrage, will be removed if targets > 1.
986 ObjectGuid _surgeTargetGUID[3]; // All these three are used to keep current tagets to which warning should be sent.
987
988 bool _killSpamFilter; // Prevent text spamming on killed player by helping implement a CD.
989 bool _despawned; // Checks if boss pass through evade on reset.
990 bool _executingVortex; // Prevents some events being sheduled during Vortex takeoff/land.
991 bool _arcaneReinforcements; // Checks if 10 or 25 man arcane trash will be spawned.
992 bool _flyingOutOfPlatform; // Used to prevent Malygos casting Arcane Overload shields while leaving platform.
993 bool _firstCyclicMovementStarted; // At first movement start he throws one shield asap, so this check is needed for it only.
994 bool _performingSurgeOfPower; // Used to prevent starting Cyclic Movement called in Arcane Bomb event.
995 bool _performingDestroyPlatform; // Used to prevent starting some movements right when Destroy Platfrom event starts.
996
997 float _flySpeed; // Used to store base fly speed to prevent stacking on each evade.
998};
999
1001{
1002 npc_portal_eoe(Creature* creature) : ScriptedAI(creature)
1003 {
1004 _instance = creature->GetInstanceScript();
1005 }
1006
1007 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
1008 {
1009 if (spellInfo->Id == SPELL_PORTAL_OPENED)
1010 {
1012 {
1013 if (malygos->AI()->GetData(DATA_PHASE) == PHASE_ONE)
1015 }
1016 }
1017 }
1018
1019 void UpdateAI(uint32 /*diff*/) override
1020 {
1021 // When duration of opened riff visual ends, closed one should be cast
1024
1026 {
1027 if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE && me->HasAura(SPELL_PORTAL_OPENED))
1028 {
1031 }
1032 }
1033 }
1034
1035private:
1037};
1038
1040{
1041 npc_power_spark(Creature* creature) : ScriptedAI(creature)
1042 {
1043 _instance = creature->GetInstanceScript();
1045 MoveToMalygos();
1046 }
1047
1049 {
1051
1053 me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f);
1054 }
1055
1056 void UpdateAI(uint32 /*diff*/) override
1057 {
1058 if (!_instance)
1059 return;
1060
1062 {
1063 if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE || _instance->GetBossState(DATA_MALYGOS_EVENT) == FAIL)
1064 {
1066 return;
1067 }
1068
1069 if (malygos->HasAura(SPELL_VORTEX_1))
1070 {
1072 return;
1073 }
1074
1076 me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f);
1077 }
1078 }
1079
1080 void JustDied(Unit* /*killer*/) override
1081 {
1082 me->CastSpell(me, SPELL_POWER_SPARK_DEATH, true); // not supposed to hide the fact it's there by not selectable
1083 }
1084
1085private:
1087};
1088
1090{
1092 {
1093 Initialize();
1094 _instance = creature->GetInstanceScript();
1096 // TO DO: These were a bit faster than what they should be. Not sure what is the reason.
1097 me->SetSpeedRate(MOVE_FLIGHT, 1.25f);
1098 }
1099
1101 {
1102 _wpCount = 0;
1103 }
1104
1105 void Reset() override
1106 {
1108
1109 Initialize();
1110 }
1111
1112 void PassengerBoarded(Unit* unit, int8 /*seat*/, bool apply) override
1113 {
1114 if (apply)
1115 {
1116 if (unit->GetTypeId() == TYPEID_UNIT)
1117 {
1119 DoZoneInCombat(unit->ToCreature());
1120 }
1121 else if (unit->GetTypeId() == TYPEID_PLAYER)
1122 me->SetDisableGravity(true);
1123 }
1124 else
1125 {
1126 if (unit->GetTypeId() != TYPEID_PLAYER)
1127 {
1128
1130 me->SetUninteractible(false);
1131 me->SetDisableGravity(false);
1132 me->SetCanFly(false);
1133 }
1134 else if (unit->GetTypeId() == TYPEID_PLAYER)
1135 {
1136 me->SetDisableGravity(false);
1137 me->SetCanFly(false);
1138 }
1139
1141 me->RemoveAllAuras();
1142 }
1143 }
1144
1145 void UpdateAI(uint32 diff) override
1146 {
1147 _events.Update(diff);
1148
1149 while (uint32 eventId = _events.ExecuteEvent())
1151 }
1152
1153 void DoAction(int32 /*action*/) override
1154 {
1155 if (Vehicle* vehicleTemp = me->GetVehicleKit())
1156 {
1157 if (vehicleTemp->GetPassenger(0) && vehicleTemp->GetPassenger(0)->GetTypeId() == TYPEID_PLAYER)
1158 {
1159 vehicleTemp->RemoveAllPassengers();
1160 me->SetUninteractible(true);
1161 }
1162 }
1163
1164 me->DespawnOrUnsummon(3s);
1165 }
1166
1167 void MovementInform(uint32 type, uint32 id) override
1168 {
1169 if (type != POINT_MOTION_TYPE)
1170 return;
1171
1172 if (_wpCount < 3)
1173 {
1174 _events.ScheduleEvent(id + 1, 1ms);
1175 ++_wpCount;
1176 }
1177 else if (Vehicle* hoverDisk = me->GetVehicleKit())
1178 if (Unit* passenger = hoverDisk->GetPassenger(0))
1179 if (Creature* lordPassenger = passenger->ToCreature())
1180 lordPassenger->AI()->DoAction(ACTION_SET_DISK_VICTIM_CHASE);
1181 }
1182
1183private:
1184 uint8 _wpCount; // how many points are triggered
1187};
1188
1190{
1192 {
1193 _instance = creature->GetInstanceScript();
1195 // TO DO: Something is wrong with calculations for flying creatures that are on WP/Cyclic path.
1196 // They should get the same difference as to when at ground from run creature switch to walk.
1197 me->SetSpeedRate(MOVE_FLIGHT, 0.45f);
1198 }
1199
1200 void Reset() override
1201 {
1203 }
1204
1205 void EnterEvadeMode(EvadeReason /*why*/) override
1206 {
1207 }
1208
1209 void PassengerBoarded(Unit* unit, int8 /*seat*/, bool apply) override
1210 {
1211 if (apply)
1212 {
1213 if (unit->GetTypeId() == TYPEID_UNIT)
1215 }
1216 else
1217 {
1218 me->StopMoving();
1219 me->SetDisableGravity(false);
1220 me->SetCanFly(false);
1221 me->RemoveAllAuras();
1222 }
1223 }
1224
1225 void DoAction(int32 action) override
1226 {
1227 if (action < ACTION_DELAYED_DESPAWN)
1228 {
1229 me->GetMotionMaster()->MoveCirclePath(MalygosPositions[3].GetPositionX(), MalygosPositions[3].GetPositionY(), 282.3402f, 35.0f, true, 16);
1230 }
1231 else
1232 {
1233 me->DespawnOrUnsummon(3s);
1234 }
1235 }
1236
1237private:
1239};
1240
1242{
1243 npc_nexus_lord(Creature* creature) : ScriptedAI(creature)
1244 {
1245 _instance = creature->GetInstanceScript();
1246 }
1247
1248 void Reset() override
1249 {
1250 _events.Reset();
1251 }
1252
1253 void EnterEvadeMode(EvadeReason /*why*/) override
1254 {
1255 }
1256
1257 void DoAction(int32 /*action*/) override
1258 {
1262 }
1263
1264 void UpdateAI(uint32 diff) override
1265 {
1266 if (!UpdateVictim())
1267 return;
1268
1269 _events.Update(diff);
1270
1271 while (uint32 eventId = _events.ExecuteEvent())
1272 {
1273 switch (eventId)
1274 {
1275 case EVENT_ARCANE_SHOCK:
1276 if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0, 5.0f, true))
1277 DoCast(victim, SPELL_ARCANE_SHOCK);
1279 break;
1280 case EVENT_HASTE_BUFF:
1283 break;
1284 case EVENT_NUKE_DUMMY:
1288 break;
1289 }
1290 }
1291 }
1292
1293 void JustDied(Unit* /*killer*/) override
1294 {
1296 malygos->AI()->SetData(DATA_SUMMON_DEATHS, malygos->AI()->GetData(DATA_SUMMON_DEATHS) + 1);
1297 }
1298
1299private:
1302};
1303
1305{
1307 {
1308 _instance = creature->GetInstanceScript();
1309 }
1310
1311 void Reset() override
1312 {
1313 _events.Reset();
1314 }
1315
1316 void IsSummonedBy(WorldObject* /*summoner*/) override
1317 {
1319 }
1320
1321 void JustEngagedWith(Unit* /*who*/) override
1322 {
1323 }
1324
1325 void AttackStart(Unit* /*target*/) override
1326 {
1327 }
1328
1329 void EnterEvadeMode(EvadeReason /*why*/) override
1330 {
1331 }
1332
1333 void UpdateAI(uint32 diff) override
1334 {
1335 _events.Update(diff);
1336
1337 while (uint32 eventId = _events.ExecuteEvent())
1338 {
1339 switch (eventId)
1340 {
1344 break;
1345 }
1346 }
1347 }
1348
1349 void JustDied(Unit* /*killer*/) override
1350 {
1352 malygos->AI()->SetData(DATA_SUMMON_DEATHS, malygos->AI()->GetData(DATA_SUMMON_DEATHS) + 1);
1353 }
1354
1355private:
1358};
1359
1361{
1363 {
1364 _instance = creature->GetInstanceScript();
1366 }
1367
1368 void IsSummonedBy(WorldObject* summoner) override
1369 {
1370 if (Creature* creature = summoner->ToCreature())
1371 creature->AI()->SetGUID(me->GetGUID(), DATA_LAST_OVERLOAD_GUID);
1372 }
1373
1374 void UpdateAI(uint32 /*diff*/) override
1375 {
1376 }
1377
1378 void DoAction(int32 /*action*/) override
1379 {
1381 {
1382 if (malygos->AI()->GetData(DATA_PHASE) == PHASE_TWO)
1383 me->DespawnOrUnsummon(6s);
1384 // If evade is hit during phase II shields should disappear with no delay
1385 else if (malygos->AI()->GetData(DATA_PHASE) == 0)
1387 }
1388 }
1389
1390 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
1391 {
1392 if (spellInfo->Id == SPELL_ARCANE_BOMB_TRIGGER)
1393 {
1396 }
1397 }
1398
1399private:
1401};
1402
1403// SmartAI does not work correctly for vehicles
1405{
1407 {
1408 }
1409
1410 void IsSummonedBy(WorldObject* summoner) override
1411 {
1412 _summoner.Clear();
1413 if (Player* player = summoner->ToPlayer())
1414 {
1415 _summoner = player->GetGUID();
1417 }
1418 }
1419
1420 void UpdateAI(uint32 diff) override
1421 {
1422 VehicleAI::UpdateAI(diff);
1423 _events.Update(diff);
1424
1425 while (uint32 eventId = _events.ExecuteEvent())
1426 {
1427 switch (eventId)
1428 {
1432 break;
1433 }
1434 }
1435 }
1436
1437 void PassengerBoarded(Unit* /*unit*/, int8 /*seat*/, bool apply) override
1438 {
1439 if (!apply)
1440 {
1441 me->DespawnOrUnsummon(2050ms);
1442 me->SetOrientation(2.5f);
1443 me->SetSpeedRate(MOVE_FLIGHT, 1.0f);
1444 Position pos = me->GetPosition();
1445 pos.m_positionX += 10.0f;
1446 pos.m_positionY += 10.0f;
1447 pos.m_positionZ += 12.0f;
1448 me->GetMotionMaster()->MovePoint(1, pos);
1449 }
1450 }
1451
1452private:
1455};
1456
1457// We shouldn't use SAI for stuff that aren't within boss main mechanic
1458// and SAI type of despawn can cause problems here.
1460{
1461 npc_static_field(Creature* creature) : ScriptedAI(creature)
1462 {
1463 }
1464
1465 void IsSummonedBy(WorldObject* /*summoner*/) override
1466 {
1467 // For some great reason the spell doesn't time it...
1468 me->DespawnOrUnsummon(30s);
1469 }
1470};
1471
1472// 56046 - Portal Beam
1474{
1475 bool Load() override
1476 {
1477 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1478 }
1479
1480 bool Validate(SpellInfo const* /*spell*/) override
1481 {
1483 }
1484
1485 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1486 {
1487 if (Creature* target = GetTarget()->ToCreature())
1488 target->CastSpell(target, SPELL_PORTAL_OPENED);
1489 }
1490
1491 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1492 {
1493 if (Creature* target = GetTarget()->ToCreature())
1494 target->RemoveAura(SPELL_PORTAL_OPENED);
1495 }
1496
1497 void Register() override
1498 {
1501 }
1502};
1503
1504// 56047 - Random Portal
1506{
1507 bool Load() override
1508 {
1509 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1510 }
1511
1512 void HandleDummy(SpellEffIndex /*effIndex*/)
1513 {
1514 Creature* malygos = GetCaster()->ToCreature();
1515 if (Creature* target = GetHitCreature())
1516 {
1517 Position pos;
1518 pos.m_positionZ = target->GetPositionZ();
1519 target->GetNearPoint2D(nullptr, pos.m_positionX, pos.m_positionY, frand(29.1f, 30.0f), target->GetAbsoluteAngle(malygos));
1521 }
1522 }
1523
1524 void Register() override
1525 {
1527 }
1528};
1529
1531{
1532 public:
1533 IsCreatureVehicleCheck(bool isVehicle) : _isVehicle(isVehicle) { }
1534
1536 {
1537 if (Unit* unit = obj->ToUnit())
1538 if (unit->GetTypeId() == TYPEID_UNIT && unit->GetVehicleKit())
1539 return _isVehicle;
1540
1541 return !_isVehicle;
1542 }
1543
1544 private:
1546};
1547
1548// 57459, 61693, 61694 - Arcane Storm
1550{
1551 bool Load() override
1552 {
1553 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1554 }
1555
1556 bool Validate(SpellInfo const* /*spell*/) override
1557 {
1559 }
1560
1561 void FilterTargets(std::list<WorldObject*>& targets)
1562 {
1563 if (targets.empty())
1564 return;
1565
1566 Creature* malygos = GetCaster()->ToCreature();
1568 {
1569 // Resize list only to objects that are vehicles.
1570 IsCreatureVehicleCheck check(true);
1571 Trinity::Containers::RandomResize(targets, check, (malygos->GetMap()->GetDifficultyID() == DIFFICULTY_10_N ? 4 : 10));
1572 }
1573 else
1574 Trinity::Containers::RandomResize(targets, (malygos->GetMap()->GetDifficultyID() == DIFFICULTY_10_N ? 4 : 10));
1575 }
1576
1577 void HandleVisual(SpellEffIndex /*effIndex*/)
1578 {
1579 // Both missiles should start approx at same time (with SPELL_ARCANE_STORM_EXTRA_VISUAL having advantage - it should lead)
1580 if (!GetHitUnit())
1581 return;
1582
1584 }
1585
1586 void Register() override
1587 {
1590 }
1591};
1592
1593// 56105 - Vortex
1595{
1596 bool Load() override
1597 {
1598 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1599 }
1600
1601 void HandleScript(SpellEffIndex /*effIndex*/)
1602 {
1603 Creature* caster = GetCaster()->ToCreature();
1604 // Each player will enter to the trigger vehicle (entry 30090) which is already spawned (each one can hold up to 5 players, it has 5 seats,
1605 // the players enter the vehicles casting SPELL_VORTEX_4 or SPELL_VORTEX_5.
1606 if (InstanceScript* instance = caster->GetInstanceScript())
1607 instance->SetData(DATA_VORTEX_HANDLING, 0);
1608
1609 // the rest of the vortex execution continues when SPELL_VORTEX_2 is removed.
1610 }
1611
1612 void Register() override
1613 {
1615 }
1616};
1617
1618// 55873 - Vortex
1620{
1621 bool Load() override
1622 {
1623 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1624 }
1625
1626 bool Validate(SpellInfo const* /*spell*/) override
1627 {
1629 }
1630
1631 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1632 {
1633 if (Creature* caster = GetCaster()->ToCreature())
1634 {
1635 for (ThreatReference const* ref : caster->GetThreatManager().GetUnsortedThreatList())
1636 {
1637 if (Player* targetPlayer = ref->GetVictim()->ToPlayer())
1638 {
1639 if (targetPlayer->IsGameMaster())
1640 continue;
1641
1642 if (InstanceScript* instance = caster->GetInstanceScript())
1643 {
1644 // Teleport spell - I'm not sure but might be it must be cast by each vehicle when it's passenger leaves it.
1645 if (Creature* trigger = ObjectAccessor::GetCreature(*caster, instance->GetGuidData(DATA_TRIGGER)))
1646 trigger->CastSpell(targetPlayer, SPELL_VORTEX_6, true);
1647 }
1648 }
1649 }
1650
1651 if (Creature* malygos = caster->ToCreature())
1652 {
1653 malygos->GetMotionMaster()->MoveLand(POINT_LAND_AFTER_VORTEX_P_ONE, MalygosPositions[2]);
1654 malygos->RemoveAura(SPELL_VORTEX_1);
1655 }
1656 }
1657 }
1658
1659 void Register() override
1660 {
1662 }
1663};
1664
1666{
1667 public:
1668 ExactDistanceCheck(Unit* source, float dist) : _source(source), _dist(dist) { }
1669
1671 {
1672 return _source->GetExactDist2d(unit) > _dist;
1673 }
1674
1675 private:
1676 Unit* _source;
1677 float _dist;
1678};
1679
1680// 56438 - Arcane Overload
1682{
1683 bool Load() override
1684 {
1685 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1686 }
1687
1688 void ResizeEffectRadiusTargetChecker(std::list<WorldObject*>& targets)
1689 {
1690 Creature* arcaneOverload = GetCaster()->ToCreature();
1691 targets.remove_if(ExactDistanceCheck(arcaneOverload,
1692 GetEffectInfo(EFFECT_0).CalcRadius(arcaneOverload) * arcaneOverload->GetObjectScale()));
1693 }
1694
1695 void Register() override
1696 {
1698 }
1699};
1700
1701// 61210 - Align Disk Aggro
1703{
1704 bool Load() override
1705 {
1706 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1707 }
1708
1709 void HandleScript(SpellEffIndex /*effIndex*/)
1710 {
1711 Creature* caster = GetCaster()->ToCreature();
1712 if (Creature* target = GetHitCreature())
1713 target->GetMotionMaster()->MoveChase(caster->GetVictim());
1714 }
1715
1716 void Register() override
1717 {
1719 }
1720};
1721
1723{
1724 public:
1725 IsPlayerOnHoverDisk(bool isOnHoverDisk) : _isOnHoverDisk(isOnHoverDisk) { }
1726
1728 {
1729 if (Unit* passenger = obj->ToUnit())
1730 if (passenger->GetVehicleBase() && passenger->GetVehicleBase()->GetEntry() == NPC_HOVER_DISK_MELEE)
1731 return _isOnHoverDisk;
1732
1733 return !_isOnHoverDisk;
1734 }
1735
1736 private:
1738};
1739
1740// 56397 - Arcane Barrage
1742{
1743 bool Load() override
1744 {
1745 return GetCaster()->GetTypeId() == TYPEID_UNIT && GetCaster()->GetInstanceScript() != nullptr;
1746 }
1747
1748 void FilterMeleeHoverDiskPassangers(std::list<WorldObject*>& targets)
1749 {
1750 if (targets.empty())
1751 return;
1752
1753 Creature* caster = GetCaster()->ToCreature();
1754 InstanceScript* instance = caster->GetInstanceScript();
1755 Creature* malygos = ObjectAccessor::GetCreature(*caster, instance->GetGuidData(DATA_MALYGOS));
1756
1757 // If max possible targets are more than 1 then Scions wouldn't select previosly selected target,
1758 // in longer terms this means if spell picks target X then 2nd cast of this spell will pick smth else
1759 // and if 3rd picks X again 4th will pick smth else (by not limiting the cast to certain caster).
1760 if (targets.size() > 1)
1761 if (malygos && !malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID).IsEmpty())
1762 targets.remove_if(Trinity::ObjectGUIDCheck(malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID)));
1763
1764 // Remove players not on Hover Disk from second list
1765 std::list<WorldObject*> playersWithoutDisk;
1766 IsPlayerOnHoverDisk check(false);
1767 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
1768 if (check(*itr))
1769 playersWithoutDisk.push_back(*itr);
1770
1771 // if it's empty than we can have player on Hover disk as target.
1772 if (!playersWithoutDisk.empty())
1773 targets = playersWithoutDisk;
1774
1775 // Finally here we remove all targets that have been damaged by Arcane Barrage
1776 // and have 2 seconds long aura still lasting. Used to give healers some time.
1777 if (!targets.empty())
1778 targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_ARCANE_BARRAGE_DAMAGE));
1779
1780 // Now we resize the list to max output targets which can be only 1
1781 // to take it's guid and send/store it to DATA_LAST_TARGET_BARRAGE_GUID.
1782 // Same target is never picked until next pick pass. This doesn't mean
1783 // that it can't be hit more than once. In fact all is chance and raid speed.
1784 if (!targets.empty())
1785 {
1786 if (targets.size() > 1)
1788
1789 if (WorldObject* filteredTarget = targets.front())
1790 if (malygos)
1791 malygos->AI()->SetGUID(filteredTarget->GetGUID(), DATA_LAST_TARGET_BARRAGE_GUID);
1792 }
1793 }
1794
1796 {
1797 if (Player* hitTarget = GetHitPlayer())
1799 .SetOriginalCaster(GetCaster()->GetGUID()));
1800 }
1801
1802 void Register() override
1803 {
1806 }
1807};
1808
1809// 58842 - Destroy Platform Channel
1811{
1812 bool Load() override
1813 {
1814 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1815 }
1816
1817 bool Validate(SpellInfo const* /*spell*/) override
1818 {
1820 }
1821
1822 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1823 {
1824 if (Creature* target = GetTarget()->ToCreature())
1825 if (InstanceScript* instance = target->GetInstanceScript())
1826 if (Creature* platformTrigger = target->GetMap()->GetCreature(instance->GetGuidData(DATA_ALEXSTRASZA_BUNNY_GUID)))
1827 platformTrigger->CastSpell(platformTrigger, SPELL_DESTROY_PLATFORM_BOOM_VISUAL);
1828 }
1829
1830 void Register() override
1831 {
1833 }
1834};
1835
1836// 59084 - Destroy Platform Boom Visual
1838{
1839 bool Load() override
1840 {
1841 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1842 }
1843
1844 bool Validate(SpellInfo const* /*spell*/) override
1845 {
1847 }
1848
1849 void HandleDummy(SpellEffIndex /*effIndex*/)
1850 {
1851 if (Creature* target = GetHitCreature())
1852 target->CastSpell(target, SPELL_DESTROY_PLATFORM_EVENT);
1853 }
1854
1855 void Register() override
1856 {
1858 }
1859};
1860
1861// 59099 - Destroy Platform Event
1863{
1864 bool Load() override
1865 {
1866 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1867 }
1868
1870 {
1871 Creature* caster = GetCaster()->ToCreature();
1872 if (InstanceScript* instance = caster->GetInstanceScript())
1873 if (GameObject* platform = caster->GetMap()->GetGameObject(instance->GetGuidData(DATA_PLATFORM)))
1874 platform->SetFlag(GO_FLAG_DESTROYED);
1875 }
1876
1877 void HandleScript(SpellEffIndex /*effIndex*/)
1878 {
1880 }
1881
1882 void Register() override
1883 {
1886 }
1887};
1888
1889// 56070 - Summon Red Dragon Buddy
1891{
1892 bool Load() override
1893 {
1894 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1895 }
1896
1898 {
1899 // Adjust effect summon position to lower Z
1900 Position const offset = { 0.0f, 0.0f, -80.0f, 0.0f };
1901 dest.RelocateOffset(offset);
1902 }
1903
1904 void Register() override
1905 {
1907 }
1908};
1909
1910// 56072 - Ride Red Dragon Buddy
1912{
1913 bool Load() override
1914 {
1915 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1916 }
1917
1918 void HandleScript(SpellEffIndex /*effIndex*/)
1919 {
1920 if (Unit* target = GetHitUnit())
1921 target->CastSpell(GetCaster(), GetEffectValue(), true);
1922 }
1923
1924 void Register() override
1925 {
1927 }
1928};
1929
1930// 60939 - Surge of Power
1932{
1933 bool Load() override
1934 {
1935 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1936 }
1937
1938 bool Validate(SpellInfo const* /*spell*/) override
1939 {
1941 }
1942
1943 void SendThreeTargets(std::list<WorldObject*>& targets)
1944 {
1945 // This spell hits only vehicles (SMSG_SPELL_GO target)
1946 Creature* caster = GetCaster()->ToCreature();
1947 // Remove all objects that aren't* vehicles.
1948 targets.remove_if(IsCreatureVehicleCheck(false));
1949 if (targets.empty())
1950 return;
1951
1952 // But in fact it selects 3 targets (SMSG_SPELL_GO target are not filtered)
1953 std::list<WorldObject*> selectedTargets = targets;
1954
1955 uint8 guidDataSlot = DATA_FIRST_SURGE_TARGET_GUID; // SetGuid in Malygos AI is reserved for 14th, 15th and 16th Id for the three targets
1956 Trinity::Containers::RandomResize(selectedTargets, 3);
1957 for (std::list<WorldObject*>::const_iterator itr = selectedTargets.begin(); itr != selectedTargets.end(); ++itr)
1958 {
1959 Creature* target = (*itr)->ToCreature();
1960 caster->AI()->SetGUID(target->GetGUID(), guidDataSlot++);
1961
1962 if (Vehicle* vehicle = target->GetVehicleKit())
1963 if (Unit* passenger = vehicle->GetPassenger(0))
1964 if (passenger->GetTypeId() == TYPEID_PLAYER)
1965 caster->AI()->Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, passenger);
1966 }
1967 }
1968
1970 {
1972 }
1973
1974 void Register() override
1975 {
1978 }
1979};
1980
1981// 60936 - Surge of Power
1983{
1984 bool Load() override
1985 {
1986 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1987 }
1988
1989 void FilterTargets(std::list<WorldObject*>& targets)
1990 {
1991 Creature* caster = GetCaster()->ToCreature();
1992
1993 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();)
1994 {
1995 bool found = false;
1996 WorldObject* target = *itr;
1997
1999 {
2000 if (target->GetGUID() == caster->AI()->GetGUID(guidSlot))
2001 {
2002 found = true;
2003 break;
2004 }
2005 }
2006
2007 if (!found)
2008 targets.erase(itr++);
2009 else
2010 ++itr;
2011 }
2012 }
2013
2014 void Register() override
2015 {
2017 }
2018};
2019
2020// 61028 - Alexstrasza's Gift Beam
2022{
2023 bool Load() override
2024 {
2025 return GetCaster()->GetTypeId() == TYPEID_UNIT;
2026 }
2027
2028 bool Validate(SpellInfo const* /*spell*/) override
2029 {
2031 }
2032
2033 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2034 {
2035 if (Creature* target = GetTarget()->ToCreature())
2036 target->CastSpell(target, SPELL_ALEXSTRASZAS_GIFT_BEAM_VISUAL);
2037 }
2038
2039 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2040 {
2041 if (Creature* target = GetTarget()->ToCreature())
2042 target->RemoveAura(SPELL_ALEXSTRASZAS_GIFT_BEAM_VISUAL);
2043 }
2044
2045 void Register() override
2046 {
2049 }
2050};
2051
2052// 61023 - Alexstrasza's Gift Visual
2054{
2055public:
2057 {
2058 _alexstraszaGift = nullptr;
2059 }
2060
2061private:
2062 bool Load() override
2063 {
2064 return GetCaster()->GetTypeId() == TYPEID_UNIT;
2065 }
2066
2067 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2068 {
2069 if (Creature* target = GetTarget()->ToCreature())
2070 {
2071 if (target->GetMap()->GetDifficultyID() == DIFFICULTY_10_N)
2072 _alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_10, *target, QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.0f, 0.0f), 0s);
2073 else if (target->GetMap()->GetDifficultyID() == DIFFICULTY_25_N)
2074 _alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_25, *target, QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.0f, 0.0f), 0s);
2075 }
2076 }
2077
2078 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2079 {
2080 if (Creature* target = GetTarget()->ToCreature())
2081 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
2082 {
2084 if (GameObject* heartMagic = target->GetMap()->GetGameObject(instance->GetGuidData(DATA_HEART_OF_MAGIC_GUID)))
2085 {
2086 heartMagic->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
2087 // TO DO: This is hack, core doesn't have support for these flags,
2088 // remove line below if it ever gets supported otherwise object won't be accessible.
2089 heartMagic->RemoveFlag(GO_FLAG_INTERACT_COND);
2090 }
2091 }
2092 }
2093
2094 void Register() override
2095 {
2098 }
2099
2101};
2102
2104{
2105 public:
2106 achievement_denyin_the_scion() : AchievementCriteriaScript("achievement_denyin_the_scion") { }
2107
2108 bool OnCheck(Player* source, Unit* /*target*/) override
2109 {
2110 // Only melee disks can be used
2111 if (Unit* disk = source->GetVehicleBase())
2112 if (disk->GetEntry() == NPC_HOVER_DISK_MELEE)
2113 return true;
2114
2115 return false;
2116 }
2117};
2118
2120{
2131
2149
2151}
Texts
Actions
@ DIFFICULTY_10_N
Definition: DBCEnums.h:877
@ DIFFICULTY_25_N
Definition: DBCEnums.h:878
uint8_t uint8
Definition: Define.h:144
int8_t int8
Definition: Define.h:140
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
@ IN_PROGRESS
@ FAIL
@ NOT_STARTED
@ CHASE_MOTION_TYPE
@ POINT_MOTION_TYPE
@ EFFECT_MOTION_TYPE
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: ObjectDefines.h:70
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
float frand(float min, float max)
Definition: Random.cpp:55
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_2
Definition: SharedDefines.h:32
@ TARGET_DEST_CASTER_RADIUS
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_SEND_EVENT
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ GO_FLAG_INTERACT_COND
@ GO_FLAG_NOT_SELECTABLE
@ GO_FLAG_DESTROYED
@ FACTION_FRIENDLY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:230
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define SpellDestinationTargetSelectFn(F, I, N)
Definition: SpellScript.h:874
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
#define SpellHitFn(F)
Definition: SpellScript.h:854
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
EvadeReason
Definition: UnitAICommon.h:30
@ MOVE_FLIGHT
Definition: UnitDefines.h:123
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
DamageEffectType
Definition: UnitDefines.h:131
@ UNIT_STATE_ROOT
Definition: Unit.h:265
@ UNIT_STATE_CASTING
Definition: Unit.h:270
MiscData
Movements
Position const AlexstraszaSpawnPos
#define MAX_RANGE_HOVER_DISK_SPAWNPOINTS
@ LIGHT_CHANGE_DIMENSIONS
@ LIGHT_OBSCURE_ARCANE_RUNES
@ LIGHT_OBSCURE_SPACE
@ DATA_LAST_TARGET_BARRAGE_GUID
@ DATA_FIRST_SURGE_TARGET_GUID
@ NUM_MAX_SURGE_TARGETS
@ LIGHT_DEFAULT
@ DATA_SUMMON_DEATHS
@ DATA_PHASE
@ DATA_LAST_OVERLOAD_GUID
@ LIGHT_ARCANE_RUNES
@ ACTION_HANDLE_P_THREE_INTRO
@ ACTION_LAND_ENCOUNTER_START
@ ACTION_SET_DISK_VICTIM_CHASE
@ ACTION_CYCLIC_MOVEMENT
@ ACTION_DELAYED_DESPAWN
@ ACTION_EXECUTE_VORTEX
@ ACTION_HANDLE_RESPAWN
@ ACTION_LIFT_IN_AIR
void AddSC_boss_malygos()
@ SEAT_0
@ SPELL_PORTAL_BEAM
@ SPELL_CLEAR_ALL_DEBUFFS
@ SPELL_ARCANE_STORM_EXTRA_VISUAL
@ SPELL_VORTEX_1
@ SPELL_RIDE_HOVER_DISK
@ SPELL_ARCANE_PULSE
@ SPELL_POWER_SPARK_MALYGOS
@ SPELL_POWER_SPARK_DEATH
@ SPELL_PORTAL_VISUAL_CLOSED
@ SPELL_SUMMON_ARCANE_BOMB
@ SPELL_ARCANE_BARRAGE
@ SPELL_ARCANE_STORM_P_I
@ SPELL_SUMMON_RED_DRAGON_BUDDY_F_CAST
@ SPELL_HASTE
@ SPELL_RIDE_RED_DRAGON_BUDDY
@ SPELL_ARCANE_BOMB_TRIGGER
@ SPELL_DESTROY_PLATFORM_BOOM_VISUAL
@ SPELL_ARCANE_BARRAGE_DAMAGE
@ SPELL_ARCANE_BREATH
@ SPELL_ARCANE_SHOCK
@ SPELL_VORTEX_2
@ SPELL_DUMMY_NUKE
@ SPELL_DESTROY_PLATFORM_CHANNEL
@ SPELL_RANDOM_PORTAL
@ SPELL_VORTEX_3
@ SPELL_SURGE_OF_POWER_PHASE_3_10
@ SPELL_ARCANE_OVERLOAD_1
@ SPELL_ARCANE_BOMB_KNOCKBACK_DAMAGE
@ SPELL_MALYGOS_BERSERK
@ SPELL_ALEXSTRASZAS_GIFT_BEAM_VISUAL
@ SPELL_SURGE_OF_POWER_PHASE_3_25
@ SPELL_IMMUNE_CURSES
@ SPELL_ALIGN_DISK_AGGRO
@ SPELL_DESTROY_PLATFORM_EVENT
@ SPELL_STATIC_FIELD_MISSLE
@ SPELL_BERSERK
@ SPELL_SURGE_OF_POWER_WARNING_SELECTOR_25
@ SPELL_SUMMON_POWER_PARK
@ SPELL_TELEPORT_VISUAL_ONLY
@ SPELL_SURGE_OF_POWER_P_II
@ SPELL_VORTEX_6
@ SPELL_ARCANE_STORM_P_III
@ PHASE_ONE
@ PHASE_NOT_STARTED
@ PHASE_THREE
@ PHASE_TWO
Position const RangeHoverDisksSpawnPositions[MAX_RANGE_HOVER_DISK_SPAWNPOINTS]
#define MAX_SUMMONS_PHASE_TWO_25MAN
@ SAY_DEATH
@ SAY_START_P_THREE
@ SAY_END_P_ONE
@ SAY_ANTI_MAGIC_SHELL
@ SAY_ONE
@ SAY_TWO
@ EMOTE_POWER_SPARK_SUMMONED
@ SAY_DEEP_BREATH
@ SAY_KILLED_PLAYER_P_THREE
@ SAY_KILLED_PLAYER_P_TWO
@ EMOTE_SURGE_OF_POWER_WARNING_P3
@ SAY_SURGE_OF_POWER
@ SAY_END_P_TWO
@ SAY_MAGIC_BLAST
@ SAY_INTRO_EVENT
@ SAY_FOUR
@ SAY_SPELL_CASTING_P_THREE
@ SAY_THREE
@ EMOTE_SURGE_OF_POWER_WARNING_P2
@ SAY_START_P_ONE
@ SAY_KILLED_PLAYER_P_ONE
@ EMOTE_HIT_BERSERKER_TIMER
@ SAY_BUFF_SPARK
Position const MalygosPositions[MAX_MALYGOS_POS]
Position const HeartOfMagicSpawnPos
Position const MeleeHoverDisksSpawnPositions[MAX_RANGE_HOVER_DISK_SPAWNPOINTS]
Position const MeleeHoverDisksWaypoints[MAX_MELEE_HOVER_DISK_WAYPOINTS]
#define MAX_MELEE_HOVER_DISK_SPAWNPOINTS
#define MAX_MALYGOS_POS
@ POINT_DESTROY_PLATFORM_P_TWO
@ POINT_NEAR_RANDOM_PORTAL_P_NONE
@ POINT_LIFT_IN_AIR_P_ONE
@ POINT_LAND_AFTER_VORTEX_P_ONE
@ POINT_PHASE_ONE_TO_TWO_TRANSITION
@ POINT_LAND_P_ONE
@ POINT_SURGE_OF_POWER_P_TWO
@ POINT_FLY_OUT_OF_PLATFORM_P_TWO
@ POINT_VORTEX_P_ONE
@ POINT_IDLE_P_THREE
#define MAX_SUMMONS_PHASE_TWO_10MAN
Achievements
@ ACHIEV_TIMED_START_EVENT
#define MAX_MELEE_HOVER_DISK_WAYPOINTS
AreaIds
@ AREA_EYE_OF_ETERNITY
@ EVENT_LAND_START_ENCOUNTER
@ EVENT_STOP_PORTAL_BEAM
@ EVENT_ARCANE_SHOCK
@ EVENT_START_P_THREE
@ EVENT_VORTEX
@ EVENT_SUMMON_ARCANE_BOMB
@ EVENT_MOVE_TO_POINT_SURGE_P_TWO
@ EVENT_ARCANE_STORM
@ EVENT_DELAYED_REINFORCEMENTS
@ EVENT_HASTE_BUFF
@ EVENT_STATIC_FIELD
@ EVENT_SURGE_OF_POWER_P_THREE
@ EVENT_POWER_SPARKS
@ EVENT_MOVE_TO_P_THREE_POINT
@ EVENT_LIGHT_DIMENSION_CHANGE
@ EVENT_SAY_INTRO
@ EVENT_SURGE_OF_POWER_P_TWO
@ EVENT_CAST_RIDE_SPELL
@ EVENT_ARCANE_BARRAGE
@ EVENT_PATHING_AROUND_PLATFORM
@ EVENT_ARCANE_PULSE
@ EVENT_PREVENT_SAY_SPAM_ON_KILL
@ EVENT_FLY_OUT_OF_PLATFORM
@ EVENT_NUKE_DUMMY
@ EVENT_DELAY_MOVE_TO_DESTROY_P
@ EVENT_START_FIRST_RANDOM_PORTAL
@ EVENT_RANDOM_PORTAL
@ EVENT_MOVE_TO_VORTEX_POINT
@ EVENT_ARCANE_BREATH
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
Unit * GetCaster() const
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
InstanceScript *const instance
SummonList summons
EventMap events
void _JustDied()
void DoZoneInCombat()
Definition: CreatureAI.h:161
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:371
void SetCanMelee(bool canMelee, bool fleeFromMelee=false)
Definition: Creature.cpp:2822
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
Definition: Creature.cpp:2882
void SetReactState(ReactStates st)
Definition: Creature.h:160
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
void SetImmuneToAll(bool apply) override
Definition: Creature.h:167
CreatureAI * AI() const
Definition: Creature.h:214
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void CancelEventGroup(uint32 group)
Definition: EventMap.cpp:153
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void SetPhase(uint8 phase)
Definition: EventMap.cpp:28
void Reset()
Definition: EventMap.cpp:21
ExactDistanceCheck(Unit *source, float dist)
bool operator()(WorldObject *unit)
void RemoveFlag(GameObjectFlags flags)
Definition: GameObject.h:275
virtual bool SetBossState(uint32 id, EncounterState state)
virtual ObjectGuid GetGuidData(uint32 type) const override
EncounterState GetBossState(uint32 id) const
void TriggerGameEvent(uint32 gameEventId, WorldObject *source=nullptr, WorldObject *target=nullptr) override
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
IsCreatureVehicleCheck(bool isVehicle)
bool operator()(WorldObject *obj)
IsPlayerOnHoverDisk(bool isOnHoverDisk)
bool operator()(WorldObject *obj)
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3489
void SetZoneOverrideLight(uint32 zoneId, uint32 areaLightId, uint32 overrideLightId, Milliseconds transitionTime)
Definition: Map.cpp:3981
Difficulty GetDifficultyID() const
Definition: Map.h:324
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3479
MovementGeneratorType GetCurrentMovementGeneratorType() const
void MoveChase(Unit *target, Optional< ChaseRange > dist={}, Optional< ChaseAngle > angle={})
void MoveTakeoff(uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void MoveLand(uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
void MoveFollow(Unit *target, float dist, ChaseAngle angle, Optional< Milliseconds > duration={}, MovementSlot slot=MOTION_SLOT_ACTIVE)
void MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
bool IsEmpty() const
Definition: ObjectGuid.h:319
bool IsVehicle() const
Definition: ObjectGuid.h:322
void Clear()
Definition: ObjectGuid.h:286
static Creature * ToCreature(Object *o)
Definition: Object.h:219
float GetObjectScale() const
Definition: Object.h:164
static Unit * ToUnit(Object *o)
Definition: Object.h:225
TypeID GetTypeId() const
Definition: Object.h:173
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
uint32 const Id
Definition: SpellInfo.h:325
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
Creature * GetHitCreature() const
Player * GetHitPlayer() const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Definition: SpellScript.h:852
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
Definition: SpellScript.h:873
HookList< HitHandler > OnHit
Definition: SpellScript.h:850
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:839
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
HookList< EffectHandler > OnEffectLaunchTarget
Definition: SpellScript.h:838
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
bool empty() const
void DespawnIf(T const &predicate)
void DoAction(int32 info, Predicate &&predicate, uint16 max=0)
virtual void DoAction(int32)
Definition: UnitAI.h:72
virtual void Reset()
Definition: UnitAI.h:63
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
virtual ObjectGuid GetGUID(int32=0) const
Definition: UnitAI.h:76
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
virtual void SetGUID(ObjectGuid const &, int32=0)
Definition: UnitAI.h:75
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
float GetHealthPct() const
Definition: Unit.h:784
float GetSpeed(UnitMoveType mtype) const
Definition: Unit.cpp:8515
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3685
void SetControlled(bool apply, UnitState state)
Definition: Unit.cpp:10911
void SetFaction(uint32 faction) override
Definition: Unit.h:859
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
Unit * GetVehicleBase() const
Definition: Unit.cpp:11480
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
void SetFacingToObject(WorldObject const *object, bool force=true)
Definition: Unit.cpp:12671
void StopMoving()
Definition: Unit.cpp:10049
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition: Unit.cpp:12725
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
bool IsAIEnabled() const
Definition: Unit.h:658
bool SetCanFly(bool enable)
Definition: Unit.cpp:12820
uint64 GetHealth() const
Definition: Unit.h:776
void NearTeleportTo(Position const &pos, bool casting=false)
Definition: Unit.cpp:12327
Unit * GetVictim() const
Definition: Unit.h:715
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition: Unit.cpp:8525
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
void RemoveAllAuras()
Definition: Unit.cpp:4242
Vehicle * GetVehicleKit() const
Definition: Unit.h:1711
bool AttackStop()
Definition: Unit.cpp:5781
bool IsInCombat() const
Definition: Unit.h:1043
bool operator()(ObjectGuid guid)
Map * GetMap() const
Definition: Object.h:624
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
void setActive(bool isActiveObject)
Definition: Object.cpp:922
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2065
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1078
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
bool OnCheck(Player *source, Unit *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
void ResizeEffectRadiusTargetChecker(std::list< WorldObject * > &targets)
bool Load() override
void HandleVisual(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleDummy(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void SendThreeTargets(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void FilterMeleeHoverDiskPassangers(std::list< WorldObject * > &targets)
@ DATA_VORTEX_HANDLING
@ DATA_RESPAWN_IRIS
@ DATA_POWER_SPARKS_HANDLING
@ DATA_MALYGOS_EVENT
@ GO_HEART_OF_MAGIC_10
@ GO_HEART_OF_MAGIC_25
@ GO_ALEXSTRASZA_S_GIFT_10
@ GO_ALEXSTRASZA_S_GIFT_25
@ NPC_PORTAL_TRIGGER
@ NPC_POWER_SPARK
@ NPC_HOVER_DISK_CASTER
@ NPC_ALEXSTRASZA
@ NPC_HOVER_DISK_MELEE
#define RegisterEyeOfEternityCreatureAI(ai_name)
@ SPELL_RIDE_RED_DRAGON_TRIGGERED
@ SPELL_PORTAL_OPENED
@ DATA_HEART_OF_MAGIC_GUID
@ DATA_TRIGGER
@ DATA_MALYGOS
@ DATA_ALEXSTRASZA_BUNNY_GUID
@ DATA_FOCUSING_IRIS_GUID
@ DATA_PLATFORM
@ DATA_GIFT_BOX_BUNNY_GUID
void apply(T *val)
Definition: ByteConverter.h:41
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
constexpr void SetOrientation(float orientation)
Definition: Position.h:71
constexpr float GetPositionX() const
Definition: Position.h:76
float m_positionZ
Definition: Position.h:55
constexpr float GetPositionY() const
Definition: Position.h:77
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:106
float m_positionX
Definition: Position.h:53
float m_positionY
Definition: Position.h:54
constexpr void GetPosition(float &x, float &y) const
Definition: Position.h:81
constexpr float GetOrientation() const
Definition: Position.h:79
constexpr float GetPositionZ() const
Definition: Position.h:78
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X)
Definition: GameObject.cpp:118
T const & RAID_MODE(T const &normal10, T const &normal25) const
Difficulty GetDifficulty() const
void RelocateOffset(Position const &offset)
Definition: Spell.cpp:122
void UpdateAI(uint32 diff) override
Definition: CombatAI.cpp:238
void MoveInLineOfSight(Unit *who) override
void Reset() override
bool _flyingOutOfPlatform
void JustEngagedWith(Unit *) override
ObjectGuid _surgeTargetGUID[3]
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
uint8 _preparingPulsesChecker
void SetData(uint32 data, uint32 value) override
ObjectGuid GetGUID(int32 type) const override
bool _arcaneReinforcements
void JustDied(Unit *) override
void DoAction(int32 action) override
bool _performingSurgeOfPower
void SetPhaseEvents()
void UpdateAI(uint32 diff) override
uint32 GetData(uint32 data) const override
void MovementInform(uint32 type, uint32 id) override
void SpellHit(WorldObject *caster, SpellInfo const *spellInfo) override
void EnterEvadeMode(EvadeReason) override
void SetPhase(uint8 phase, bool setEvents=false)
bool _performingDestroyPlatform
ObjectGuid _arcaneOverloadGUID
boss_malygos(Creature *creature)
void KilledUnit(Unit *victim) override
void SetGUID(ObjectGuid const &guid, int32 id) override
ObjectGuid _lastHitByArcaneBarrageGUID
bool _firstCyclicMovementStarted
void IsSummonedBy(WorldObject *summoner) override
void UpdateAI(uint32) override
void DoAction(int32) override
InstanceScript * _instance
npc_arcane_overload(Creature *creature)
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void DoAction(int32 action) override
npc_caster_hover_disk(Creature *creature)
InstanceScript * _instance
void PassengerBoarded(Unit *unit, int8, bool apply) override
== Fields =======================================
void Reset() override
void EnterEvadeMode(EvadeReason) override
void MovementInform(uint32 type, uint32 id) override
void Reset() override
npc_melee_hover_disk(Creature *creature)
void DoAction(int32) override
void PassengerBoarded(Unit *unit, int8, bool apply) override
== Fields =======================================
void UpdateAI(uint32 diff) override
InstanceScript * _instance
void Reset() override
void DoAction(int32) override
InstanceScript * _instance
void EnterEvadeMode(EvadeReason) override
npc_nexus_lord(Creature *creature)
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
npc_portal_eoe(Creature *creature)
InstanceScript * _instance
void UpdateAI(uint32) override
InstanceScript * _instance
npc_power_spark(Creature *creature)
void UpdateAI(uint32) override
void JustDied(Unit *) override
InstanceScript * _instance
void UpdateAI(uint32 diff) override
void EnterEvadeMode(EvadeReason) override
void JustDied(Unit *) override
void JustEngagedWith(Unit *) override
void IsSummonedBy(WorldObject *) override
void Reset() override
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
npc_scion_of_eternity(Creature *creature)
npc_static_field(Creature *creature)
void IsSummonedBy(WorldObject *) override
npc_wyrmrest_skytalon(Creature *creature)
void IsSummonedBy(WorldObject *summoner) override
void PassengerBoarded(Unit *, int8, bool apply) override
== Fields =======================================
void UpdateAI(uint32 diff) override