Scripts/Black Morass: Rewrite dungeon (#31873)

Credit for multiple things goes to CMaNGOS

Closes #27603
Closes #29957

(cherry picked from commit 259f4b84c60fdba9d6648666186614d8ac753efb)
This commit is contained in:
offl
2026-07-26 00:55:06 +02:00
committed by Shauren
parent cf2fdc14e7
commit 4e96f5a573
7 changed files with 1533 additions and 642 deletions
@@ -0,0 +1,575 @@
--
SET @CGUID := 147466; -- 24
SET @SPAWN_GROUP_ID := 377; -- 4
-- Medivh
DELETE FROM `areatrigger_scripts` WHERE `entry` = 4288;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(4288, 'at_black_morass_medivh');
UPDATE `creature_template` SET `unit_flags` = 768 WHERE `entry` = 15608;
DELETE FROM `creature_text` WHERE `CreatureID` = 15608;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(15608,0,0,"The time has come! Gul'dan, order your warlocks to double their efforts! Moments from now the gateway will open and your Horde will be released upon this ripe, unsuspecting world!",14,0,100,0,0,10435,16787,0,"Medivh SAY_ENTER"),
(15608,1,0,"Champions! My shield grows weak!",14,0,100,0,0,10437,16792,0,"Medivh SAY_SHIELD_75"),
(15608,2,0,"My powers must be concentrated on the portal! I do not have time to hold the shield!",14,0,100,0,0,10438,16794,0,"Medivh SAY_SHIELD_50"),
(15608,3,0,"The shield is nearly gone! All that I have worked for is in danger!",14,0,100,0,0,10439,16795,0,"Medivh SAY_SHIELD_25"),
(15608,4,0,"I am grateful for your aid, champions. Now, Gul'dan's Horde will sweep across this world like a locust swarm, and all my designs, all my carefully-laid plans will at last fall into place.",14,0,100,0,0,10440,16796,0,"Medivh SAY_WIN"),
(15608,5,0,"No! Damn this feeble, mortal coil!",14,0,100,0,0,10441,16790,0,"Medivh SAY_DEATH"),
(15608,6,0,"Orcs of the Horde! This portal is the gateway to your new destiny! Azeroth lies before you, ripe for the taking!",14,0,100,5,0,0,19909,0,"Medivh SAY_ORCS");
-- Shadow Council Enforcer
UPDATE `creature_template` SET `unit_flags` = 33536, `flags_extra` = `flags_extra` &~ 2 WHERE `entry` = 17023;
DELETE FROM `creature_text` WHERE `CreatureID` = 17023;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(17023,0,0,"Gul'dan speaks the truth! We should return at once to tell our brothers of the news! Retreat back through the portal!",14,0,100,5,0,0,19911,0,"Shadow Council Enforcer");
DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+00 AND @CGUID+23;
INSERT INTO `creature` (`guid`,`id`,`map`,`zoneId`,`areaId`,`spawnDifficulties`,`phaseId`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`wander_distance`,`currentwaypoint`,`MovementType`,`ScriptName`,`StringId`,`VerifiedBuild`) VALUES
(@CGUID+00,17023,269,0,0,'1,2',0,0,1,-2086.84765625,7132.72216796875,34.67148208618164062,6.126105785369873046,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300001490A4
(@CGUID+01,17023,269,0,0,'1,2',0,0,1,-2087.194580078125,7129.96923828125,34.671478271484375,6.143558979034423828,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300001490A5
(@CGUID+02,17023,269,0,0,'1,2',0,0,1,-2087.479736328125,7127.2734375,34.67148208618164062,6.161012172698974609,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300009490A5
(@CGUID+03,17023,269,0,0,'1,2',0,0,1,-2087.80126953125,7124.51025390625,34.67148208618164062,6.17846536636352539,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300011490A5
(@CGUID+04,17023,269,0,0,'1,2',0,0,1,-2088.08203125,7121.8876953125,34.671478271484375,6.195918560028076171,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300019490A5
(@CGUID+05,17023,269,0,0,'1,2',0,0,1,-2088.386474609375,7119.37890625,34.67148208618164062,6.213372230529785156,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300021490A5
(@CGUID+06,17023,269,0,0,'1,2',0,0,1,-2086.572265625,7132.634765625,34.671478271484375,6.126105785369873046,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300001490A7
(@CGUID+07,17023,269,0,0,'1,2',0,0,1,-2086.98486328125,7129.9677734375,34.671478271484375,6.143558979034423828,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300009490A7
(@CGUID+08,17023,269,0,0,'1,2',0,0,1,-2087.408935546875,7127.20263671875,34.67148208618164062,6.161012172698974609,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300011490A7
(@CGUID+09,17023,269,0,0,'1,2',0,0,1,-2087.88330078125,7124.3759765625,34.67148208618164062,6.17846536636352539,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300019490A7
(@CGUID+10,17023,269,0,0,'1,2',0,0,1,-2088.224853515625,7121.990234375,34.67147445678710937,6.195918560028076171,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300021490A7
(@CGUID+11,17023,269,0,0,'1,2',0,0,1,-2088.598876953125,7119.2431640625,34.671478271484375,6.213372230529785156,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300029490A7
(@CGUID+12,17023,269,0,0,'1,2',0,0,1,-2086.509033203125,7132.677734375,34.671478271484375,6.126105785369873046,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300001490A9
(@CGUID+13,17023,269,0,0,'1,2',0,0,1,-2086.95361328125,7129.98681640625,34.67148208618164062,6.143558979034423828,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300009490A9
(@CGUID+14,17023,269,0,0,'1,2',0,0,1,-2087.310302734375,7127.18994140625,34.67148208618164062,6.161012172698974609,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300011490A9
(@CGUID+15,17023,269,0,0,'1,2',0,0,1,-2087.646240234375,7124.35791015625,34.671478271484375,6.17846536636352539,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300019490A9
(@CGUID+16,17023,269,0,0,'1,2',0,0,1,-2088.01318359375,7121.8740234375,34.671478271484375,6.195918560028076171,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300021490A9
(@CGUID+17,17023,269,0,0,'1,2',0,0,1,-2088.5009765625,7119.22119140625,34.671478271484375,6.213372230529785156,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300029490A9
(@CGUID+18,17023,269,0,0,'1,2',0,0,1,-2086.458740234375,7132.609375,34.67148208618164062,6.149602890014648437,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300001490AB
(@CGUID+19,17023,269,0,0,'1,2',0,0,1,-2086.878173828125,7129.966796875,34.671478271484375,6.097349166870117187,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300009490AB
(@CGUID+20,17023,269,0,0,'1,2',0,0,1,-2087.14892578125,7127.20458984375,34.671478271484375,6.089331626892089843,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300011490AB
(@CGUID+21,17023,269,0,0,'1,2',0,0,1,-2087.487548828125,7124.41357421875,34.671478271484375,6.143567562103271484,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300019490AB
(@CGUID+22,17023,269,0,0,'1,2',0,0,1,-2087.891845703125,7121.91796875,34.671478271484375,6.13900613784790039,300,0,0,0,'',NULL,24742), -- 0x203B0821A0109FC0001CE300021490AB
(@CGUID+23,17023,269,0,0,'1,2',0,0,1,-2088.388427734375,7119.2041015625,34.671478271484375,6.178112030029296875,300,0,0,0,'',NULL,24742); -- 0x203B0821A0109FC0001CE300029490AB
DELETE FROM `spawn_group_template` WHERE `groupId` BETWEEN @SPAWN_GROUP_ID+0 AND @SPAWN_GROUP_ID+3;
INSERT INTO `spawn_group_template` (`groupId`, `groupName`, `groupFlags`) VALUES
(@SPAWN_GROUP_ID+0,"Black Morass - Shadow Council Enforcer Group 1",4),
(@SPAWN_GROUP_ID+1,"Black Morass - Shadow Council Enforcer Group 2",4),
(@SPAWN_GROUP_ID+2,"Black Morass - Shadow Council Enforcer Group 3",4),
(@SPAWN_GROUP_ID+3,"Black Morass - Shadow Council Enforcer Group 4",4);
DELETE FROM `spawn_group` WHERE `spawnId` BETWEEN @CGUID+00 AND @CGUID+23 AND `spawnType` = 0;
INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) VALUES
(@SPAWN_GROUP_ID+0,0,@CGUID+00),
(@SPAWN_GROUP_ID+0,0,@CGUID+01),
(@SPAWN_GROUP_ID+0,0,@CGUID+02),
(@SPAWN_GROUP_ID+0,0,@CGUID+03),
(@SPAWN_GROUP_ID+0,0,@CGUID+04),
(@SPAWN_GROUP_ID+0,0,@CGUID+05),
(@SPAWN_GROUP_ID+1,0,@CGUID+06),
(@SPAWN_GROUP_ID+1,0,@CGUID+07),
(@SPAWN_GROUP_ID+1,0,@CGUID+08),
(@SPAWN_GROUP_ID+1,0,@CGUID+09),
(@SPAWN_GROUP_ID+1,0,@CGUID+10),
(@SPAWN_GROUP_ID+1,0,@CGUID+11),
(@SPAWN_GROUP_ID+2,0,@CGUID+12),
(@SPAWN_GROUP_ID+2,0,@CGUID+13),
(@SPAWN_GROUP_ID+2,0,@CGUID+14),
(@SPAWN_GROUP_ID+2,0,@CGUID+15),
(@SPAWN_GROUP_ID+2,0,@CGUID+16),
(@SPAWN_GROUP_ID+2,0,@CGUID+17),
(@SPAWN_GROUP_ID+3,0,@CGUID+18),
(@SPAWN_GROUP_ID+3,0,@CGUID+19),
(@SPAWN_GROUP_ID+3,0,@CGUID+20),
(@SPAWN_GROUP_ID+3,0,@CGUID+21),
(@SPAWN_GROUP_ID+3,0,@CGUID+22),
(@SPAWN_GROUP_ID+3,0,@CGUID+23);
-- Chrono Lord Deja / Infinite Chrono-Lord
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.42857142857 WHERE `entry` = 17879;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.42857142857, `BaseAttackTime` = 2000 WHERE `entry` = 20738;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2, `DamageModifier` = 7.5, `LootID` = 17879, `GoldMin` = 3902, `GoldMax` = 5100 WHERE `Entry` = 17879 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2 WHERE `Entry` = 17879 AND `DifficultyID` = 2;
UPDATE `creature_template` SET `speed_run` = 1.42857142857, `AIName` = '', `ScriptName` = 'boss_chrono_lord_deja' WHERE `entry` = 21697;
UPDATE `creature_template` SET `speed_run` = 1.42857142857 WHERE `entry` = 21712;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2, `DamageModifier` = 7.5 WHERE `Entry` = 21697 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2 WHERE `Entry` = 21697 AND `DifficultyID` = 2;
DELETE FROM `smart_scripts` WHERE `entryorguid` = 21697 AND `source_type` = 0;
DELETE FROM `creature_text` WHERE `CreatureID` IN (17879,21697);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(17879,0,0,"Why do you aid the Magus? Just think of how many lives could be saved if the portal is never opened, if the resulting wars could be erased....",14,0,100,0,0,10412,16814,0,"Chrono Lord Deja SAY_ENTER"),
(17879,1,0,"You have outstayed your welcome, Keeper. Be gone!",14,0,100,0,0,10413,16817,0,"Chrono Lord Deja SAY_BANISH"),
(17879,2,0,"If you will not cease this foolish quest, then you will die!",14,0,100,0,0,10414,16815,0,"Chrono Lord Deja SAY_AGGRO"),
(17879,3,0,"I told you it was a fool's quest!",14,0,100,0,0,10415,16818,0,"Chrono Lord Deja SAY_SLAY_1"),
(17879,3,1,"Leaving so soon?",14,0,100,0,0,10416,16819,0,"Chrono Lord Deja SAY_SLAY_2"),
(17879,4,0,"Time... is on our side.",14,0,100,0,0,10417,16816,0,"Chrono Lord Deja SAY_DEATH"),
(21697,0,0,"Why do you aid the Magus? Just think of how many lives could be saved if the portal is never opened, if the resulting wars could be erased....",14,0,100,0,0,10412,16814,0,"Infinite Chrono-Lord SAY_ENTER"),
(21697,1,0,"You have outstayed your welcome, Keeper. Be gone!",14,0,100,0,0,10413,16817,0,"Infinite Chrono-Lord SAY_BANISH"),
(21697,2,0,"If you will not cease this foolish quest, then you will die!",14,0,100,0,0,10414,16815,0,"Infinite Chrono-Lord SAY_AGGRO"),
(21697,3,0,"I told you it was a fool's quest!",14,0,100,0,0,10415,16818,0,"Infinite Chrono-Lord SAY_SLAY_1"),
(21697,3,1,"Leaving so soon?",14,0,100,0,0,10416,16819,0,"Infinite Chrono-Lord SAY_SLAY_2"),
(21697,4,0,"Time... is on our side.",14,0,100,0,0,10417,16816,0,"Infinite Chrono-Lord SAY_DEATH");
-- Temporus / Infinite Timereaver
UPDATE `creature_template` SET /*`minlevel` = 72, `maxlevel` = 72,*/ `speed_walk` = 1, `speed_run` = 1.42857142857 WHERE `entry` = 17880;
UPDATE `creature_template` SET /*`minlevel` = 72, `maxlevel` = 72,*/ `speed_walk` = 1, `speed_run` = 1.42857142857, `BaseAttackTime` = 2000 WHERE `entry` = 20745;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2, `DamageModifier` = 7.5, `LootID` = 17880, `GoldMin` = 6266, `GoldMax` = 5100 WHERE `Entry` = 17880 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2 WHERE `Entry` = 17880 AND `DifficultyID` = 2;
UPDATE `creature_template` SET `speed_run` = 1.42857142857, `ScriptName` = 'boss_temporus' WHERE `entry` = 21698;
UPDATE `creature_template` SET `speed_run` = 1.42857142857 WHERE `entry` = 22167;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2, `DamageModifier` = 7.5 WHERE `Entry` = 21698 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2 WHERE `Entry` = 21698 AND `DifficultyID` = 2;
DELETE FROM `creature_text` WHERE `CreatureID` IN (17880,21698);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(17880,0,0,"Why do you persist? Surely you can see the futility of it all. It is not too late! You may still leave with your lives...",14,0,100,0,0,10442,16821,0,"Temporus SAY_ENTER"),
(17880,1,0,"Keeper! The sands of time have run out for you.",14,0,100,0,0,10443,16824,0,"Temporus SAY_BANISH"),
(17880,2,0,"So be it... you have been warned.",14,0,100,0,0,10444,16822,0,"Temporus SAY_AGGRO"),
(17880,3,0,"You should have left when you had the chance.",14,0,100,0,0,10445,16825,0,"Temporus SAY_SLAY_1"),
(17880,3,1,"Your days are done.",14,0,100,0,0,10446,16826,0,"Temporus SAY_SLAY_2"),
(17880,4,0,"My death means... little.",14,0,100,0,0,10447,16823,0,"Temporus SAY_DEATH"),
(21698,0,0,"Why do you persist? Surely you can see the futility of it all. It is not too late! You may still leave with your lives...",14,0,100,0,0,10442,16821,0,"Infinite Timereaver SAY_ENTER"),
(21698,1,0,"Keeper! The sands of time have run out for you.",14,0,100,0,0,10443,16824,0,"Infinite Timereaver SAY_BANISH"),
(21698,2,0,"So be it... you have been warned.",14,0,100,0,0,10444,16822,0,"Infinite Timereaver SAY_AGGRO"),
(21698,3,0,"You should have left when you had the chance.",14,0,100,0,0,10445,16825,0,"Infinite Timereaver SAY_SLAY_1"),
(21698,3,1,"Your days are done.",14,0,100,0,0,10446,16826,0,"Infinite Timereaver SAY_SLAY_2"),
(21698,4,0,"My death means... little.",14,0,100,0,0,10447,16823,0,"Infinite Timereaver SAY_DEATH");
-- Aeonus
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.71429, `BaseAttackTime` = 2000 WHERE `entry` = 20737;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2, `DamageModifier` = 7.5, `LootID` = 17881, `GoldMin` = 6494, `GoldMax` = 8486 WHERE `Entry` = 17881 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 2, `LevelScalingDeltaMax` = 2 WHERE `Entry` = 17881 AND `DifficultyID` = 2;
DELETE FROM `creature_text` WHERE `CreatureID` = 17881;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(17881,0,0,"The time has come to shatter this clockwork universe forever! Let us no longer be slaves of the hourglass! I warn you: those who do not embrace this greater path shall become victims of its passing!",14,0,100,0,0,10400,16827,0,"Aeonus SAY_ENTER"),
(17881,1,0,"Your time is up, slave of the past.",14,0,100,0,0,10401,16829,0,"Aeonus SAY_BANISH"),
(17881,2,0,"Let us see what fate has in store....",14,0,100,0,0,10402,16828,0,"Aeonus SAY_AGGRO"),
(17881,3,0,"One less obstacle in our way!",14,0,100,0,0,10403,16831,0,"Aeonus SAY_SLAY_1"),
(17881,3,1,"No one will stop us!",14,0,100,0,0,10404,16832,0,"Aeonus SAY_SLAY_2"),
(17881,4,0,"We will triumph. It is only a matter... of time.",14,0,100,0,0,10405,16830,0,"Aeonus SAY_DEATH"),
(17881,5,0,"%s becomes enraged!",16,0,100,0,0,0,10677,0,"Aeonus EMOTE_ENRAGE");
-- Time Keeper
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.71428571429 WHERE `entry` IN (17918,20746);
DELETE FROM `creature_text` WHERE `CreatureID` = 17918;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(17918,0,0,"There is no time to waste!",12,0,100,0,0,0,15190,0,"Time Keeper - On Spawn"),
(17918,0,1,"We must hurry!",12,0,100,0,0,0,15191,0,"Time Keeper - On Spawn"),
(17918,0,2,"We must use this time wisely!",12,0,100,0,0,0,15192,0,"Time Keeper - On Spawn"),
(17918,1,0,"One less threat to the timeways!",12,0,100,0,0,0,15193,0,"Time Keeper - On Kill"),
(17918,1,1,"Victory will be ours!",12,0,100,0,0,0,15194,0,"Time Keeper - On Kill"),
(17918,2,0,"Carry on! Victory at all costs!",14,0,100,0,0,0,15195,0,"Time Keeper - On Despawn"),
(17918,2,1,"Continue the fight! Do not falter!",14,0,100,0,0,0,15196,0,"Time Keeper - On Despawn");
DELETE FROM `smart_scripts` WHERE `entryorguid` = 17918 AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(17918,0,0,0,11,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Time Keeper - On Spawn - Say Line 0"),
(17918,0,1,0,11,0,100,0,0,0,0,0,0,11,12980,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Time Keeper - On Spawn - Cast 'Simple Teleport'"),
(17918,0,2,0,0,0,100,0,0,5000,5000,10000,0,11,31478,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Time Keeper - In Combat - Cast 'Sand Breath'"),
(17918,0,3,0,5,0,100,0,20000,20000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Time Keeper - On Killed Unit - Say Line 1"),
(17918,0,4,0,8,0,100,0,31483,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Time Keeper - On Spellhit 'Dragon Helper Effect' - Say Line 2"),
(17918,0,5,0,8,0,100,0,31483,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Time Keeper - On Spellhit 'Dragon Helper Effect' - Despawn Instant");
-- Rift Lord
-- UPDATE `creature_template` SET `difficulty_entry_1` = 20744, `minlevel` = 71, `maxlevel` = 71 WHERE `entry` = 17839;
UPDATE `creature_template` SET `faction` = 1720, `speed_walk` = 1, `speed_run` = 1.42857 WHERE `entry` = 20744;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 1, `LevelScalingDeltaMax` = 1, `DamageModifier` = 7.5, `LootID` = 17839, `GoldMin` = 2880, `GoldMax` = 3766 WHERE `Entry` = 17839 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 1, `LevelScalingDeltaMax` = 1 WHERE `Entry` = 17839 AND `DifficultyID` = 2;
UPDATE `creature_template` SET /*`difficulty_entry_1` = 22172,*/ `AIName` = 'SmartAI' WHERE `entry` = 21140;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.42857 WHERE `entry` = 22172;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 1, `LevelScalingDeltaMax` = 1, `DamageModifier` = 7.5 WHERE `Entry` = 21140 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 1, `LevelScalingDeltaMax` = 1 WHERE `Entry` = 21140 AND `DifficultyID` = 2;
DELETE FROM `creature_text` WHERE `CreatureID` IN (17839,21140);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(17839,0,0,"The sands of time shall be scattered to the winds!",14,0,100,0,0,0,15179,0,"Rift Lord - On Spawn"),
(17839,0,1,"History is about to be rewritten!",14,0,100,0,0,0,15180,0,"Rift Lord - On Spawn"),
(17839,0,2,"Let the siege begin!",14,0,100,0,0,0,15181,0,"Rift Lord - On Spawn"),
(17839,1,0,"The rift must be protected!",12,0,100,0,0,0,15182,0,"Rift Lord - On Aggro"),
(17839,1,1,"You are running out of time!",12,0,100,0,0,0,15183,0,"Rift Lord - On Aggro"),
(17839,1,2,"Victory or death!",12,0,100,0,0,0,15184,0,"Rift Lord - On Aggro"),
(17839,2,0,"You will never defeat us all!",14,0,100,0,0,0,15185,0,"Rift Lord - On Death"),
(17839,2,1,"You will accomplish nothing!",14,0,100,0,0,0,15186,0,"Rift Lord - On Death"),
(17839,2,2,"No! The rift...",14,0,100,0,0,0,15187,0,"Rift Lord - On Death"),
(17839,3,0,"The end is at hand!",12,0,100,0,0,0,15188,0,"Rift Lord - On Slay"),
(17839,3,1,"One step closer...",12,0,100,0,0,0,15189,0,"Rift Lord - On Slay"),
(21140,0,0,"The sands of time shall be scattered to the winds!",14,0,100,0,0,0,15179,0,"Rift Lord - On Spawn"),
(21140,0,1,"History is about to be rewritten!",14,0,100,0,0,0,15180,0,"Rift Lord - On Spawn"),
(21140,0,2,"Let the siege begin!",14,0,100,0,0,0,15181,0,"Rift Lord - On Spawn"),
(21140,1,0,"The rift must be protected!",12,0,100,0,0,0,15182,0,"Rift Lord - On Aggro"),
(21140,1,1,"You are running out of time!",12,0,100,0,0,0,15183,0,"Rift Lord - On Aggro"),
(21140,1,2,"Victory or death!",12,0,100,0,0,0,15184,0,"Rift Lord - On Aggro"),
(21140,2,0,"You will never defeat us all!",14,0,100,0,0,0,15185,0,"Rift Lord - On Death"),
(21140,2,1,"You will accomplish nothing!",14,0,100,0,0,0,15186,0,"Rift Lord - On Death"),
(21140,2,2,"No! The rift...",14,0,100,0,0,0,15187,0,"Rift Lord - On Death"),
(21140,3,0,"The end is at hand!",12,0,100,0,0,0,15188,0,"Rift Lord - On Slay"),
(21140,3,1,"One step closer...",12,0,100,0,0,0,15189,0,"Rift Lord - On Slay");
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (17839,21140) AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`Difficulties`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(17839,0,0,0,'',11,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Spawn - Say Line 0"),
(17839,0,1,0,'',11,0,100,0,0,0,0,0,0,89,10,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Spawn - Start Random Movement"),
(17839,0,2,0,'',11,0,100,0,0,0,0,0,0,11,31388,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Spawn - Cast 'Time Rift Channel Trigger'"),
(17839,0,3,0,'',4,0,20,0,0,0,0,0,0,1,1,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Rift Lord - On Aggro - Say Line 1"),
(17839,0,4,0,'1',0,0,100,0,10000,20000,15000,20000,0,11,9080,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Hamstring' (Normal)"),
(17839,0,5,0,'2',0,0,100,0,10000,20000,15000,20000,0,11,9080,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Hamstring' (Heroic)"),
(17839,0,6,0,'1',0,0,100,0,10000,20000,15000,25000,0,11,11428,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Knockdown' (Normal)"),
(17839,0,7,0,'2',0,0,100,0,10000,20000,15000,25000,0,11,11428,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Knockdown' (Heroic)"),
(17839,0,8,0,'1',0,0,100,0,5000,15000,10000,20000,0,11,15708,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Mortal Strike' (Normal)"),
(17839,0,9,0,'2',0,0,100,0,5000,15000,10000,20000,0,11,35054,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Mortal Strike' (Heroic)"),
(17839,0,10,0,'',2,0,100,1,0,30,0,0,0,11,8269,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - Between 0-30% Health - Cast 'Frenzy' (No Repeat)"),
(17839,0,11,0,'',5,0,100,0,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Killed Unit - Say Line 3"),
(17839,0,12,0,'',6,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Death - Say Line 2"),
(17839,0,13,0,'',6,0,100,0,0,0,0,0,0,11,31322,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Death - Cast 'Close Time Rift Trigger'"),
(21140,0,0,0,'',11,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Spawn - Say Line 0"),
(21140,0,1,0,'',11,0,100,0,0,0,0,0,0,89,10,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Spawn - Start Random Movement"),
(21140,0,2,0,'',11,0,100,0,0,0,0,0,0,11,31388,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Spawn - Cast 'Time Rift Channel Trigger'"),
(21140,0,3,0,'',4,0,20,0,0,0,0,0,0,1,1,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Rift Lord - On Aggro - Say Line 1"),
(21140,0,4,0,'1',0,0,100,0,6000,16000,6000,12000,0,11,16145,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Sunder Armor' (Normal)"),
(21140,0,5,0,'2',0,0,100,0,6000,16000,6000,12000,0,11,16145,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Sunder Armor' (Heroic)"),
(21140,0,6,0,'1',0,0,100,0,10000,20000,15000,25000,0,11,36214,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Thunderclap' (Normal)"),
(21140,0,7,0,'2',0,0,100,0,10000,20000,15000,25000,0,11,38537,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - In Combat - Cast 'Thunderclap' (Heroic)"),
(21140,0,8,0,'',2,0,100,1,0,30,0,0,0,11,8269,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - Between 0-30% Health - Cast 'Frenzy' (No Repeat)"),
(21140,0,9,0,'',5,0,100,0,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Killed Unit - Say Line 3"),
(21140,0,10,0,'',6,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Death - Say Line 2"),
(21140,0,11,0,'',6,0,100,0,0,0,0,0,0,11,31322,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Lord - On Death - Cast 'Close Time Rift Trigger'");
-- Rift Keeper
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 21148;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.42857 WHERE `entry` = 22170;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.42857 WHERE `entry` = 22171;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 1, `LevelScalingDeltaMax` = 1, `DamageModifier` = 7.5 WHERE `Entry` = 21148 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 1, `LevelScalingDeltaMax` = 1, `LootID` = 21104 WHERE `Entry` = 21148 AND `DifficultyID` = 2;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 1, `LevelScalingDeltaMax` = 1, `DamageModifier` = 7.5, `LootID` = 21104, `GoldMin` = 2285, `GoldMax` = 2989 WHERE `Entry` = 21104 AND `DifficultyID` = 0;
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin` = 1, `LevelScalingDeltaMax` = 1 WHERE `Entry` = 21104 AND `DifficultyID` = 2;
DELETE FROM `creature_text` WHERE `CreatureID` IN (21104,21148);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(21104,0,0,"The sands of time shall be scattered to the winds!",14,0,100,0,0,0,15179,0,"Rift Keeper - On Spawn"),
(21104,0,1,"History is about to be rewritten!",14,0,100,0,0,0,15180,0,"Rift Keeper - On Spawn"),
(21104,0,2,"Let the siege begin!",14,0,100,0,0,0,15181,0,"Rift Keeper - On Spawn"),
(21104,1,0,"The rift must be protected!",12,0,100,0,0,0,15182,0,"Rift Keeper - On Aggro"),
(21104,1,1,"You are running out of time!",12,0,100,0,0,0,15183,0,"Rift Keeper - On Aggro"),
(21104,1,2,"Victory or death!",12,0,100,0,0,0,15184,0,"Rift Keeper - On Aggro"),
(21104,2,0,"You will never defeat us all!",14,0,100,0,0,0,15185,0,"Rift Keeper - On Death"),
(21104,2,1,"You will accomplish nothing!",14,0,100,0,0,0,15186,0,"Rift Keeper - On Death"),
(21104,2,2,"No! The rift...",14,0,100,0,0,0,15187,0,"Rift Keeper - On Death"),
(21104,3,0,"The end is at hand!",12,0,100,0,0,0,15188,0,"Rift Keeper - On Slay"),
(21104,3,1,"One step closer...",12,0,100,0,0,0,15189,0,"Rift Keeper - On Slay"),
(21148,0,0,"The sands of time shall be scattered to the winds!",14,0,100,0,0,0,15179,0,"Rift Keeper - On Spawn"),
(21148,0,1,"History is about to be rewritten!",14,0,100,0,0,0,15180,0,"Rift Keeper - On Spawn"),
(21148,0,2,"Let the siege begin!",14,0,100,0,0,0,15181,0,"Rift Keeper - On Spawn"),
(21148,1,0,"The rift must be protected!",12,0,100,0,0,0,15182,0,"Rift Keeper - On Aggro"),
(21148,1,1,"You are running out of time!",12,0,100,0,0,0,15183,0,"Rift Keeper - On Aggro"),
(21148,1,2,"Victory or death!",12,0,100,0,0,0,15184,0,"Rift Keeper - On Aggro"),
(21148,2,0,"You will never defeat us all!",14,0,100,0,0,0,15185,0,"Rift Keeper - On Death"),
(21148,2,1,"You will accomplish nothing!",14,0,100,0,0,0,15186,0,"Rift Keeper - On Death"),
(21148,2,2,"No! The rift...",14,0,100,0,0,0,15187,0,"Rift Keeper - On Death"),
(21148,3,0,"The end is at hand!",12,0,100,0,0,0,15188,0,"Rift Keeper - On Slay"),
(21148,3,1,"One step closer...",12,0,100,0,0,0,15189,0,"Rift Keeper - On Slay");
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (21104,21148) AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`Difficulties`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(21104,0,0,0,'',11,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Spawn - Say Line 0"),
(21104,0,1,0,'',11,0,100,0,0,0,0,0,0,89,10,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Spawn - Start Random Movement"),
(21104,0,2,0,'',11,0,100,0,0,0,0,0,0,11,31388,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Spawn - Cast 'Time Rift Channel Trigger'"),
(21104,0,3,0,'',4,0,20,0,0,0,0,0,0,1,1,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Rift Keeper - On Aggro - Say Line 1"),
(21104,0,4,0,'1',0,0,100,0,5000,15000,10000,20000,0,11,36275,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Shadow Bolt Volley' (Normal)"),
(21104,0,5,0,'2',0,0,100,0,5000,15000,10000,20000,0,11,38533,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Shadow Bolt Volley' (Heroic)"),
(21104,0,6,0,'1',0,0,100,0,10000,20000,10000,20000,0,11,36276,32,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Curse of Vulnerability' (Normal)"),
(21104,0,7,0,'2',0,0,100,0,10000,20000,10000,20000,0,11,36276,32,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Curse of Vulnerability' (Heroic)"),
(21104,0,8,0,'',0,0,100,0,15000,20000,15000,25000,0,11,12542,0,0,0,0,0,5,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Fear'"),
(21104,0,9,0,'',2,0,100,1,0,30,0,0,0,11,8269,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - Between 0-30% Health - Cast 'Frenzy' (No Repeat)"),
(21104,0,10,0,'',5,0,100,0,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Killed Unit - Say Line 3"),
(21104,0,11,0,'',6,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Death - Say Line 2"),
(21104,0,12,0,'',6,0,100,0,0,0,0,0,0,11,31322,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Death - Cast 'Close Time Rift Trigger'"),
(21148,0,0,0,'',11,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Spawn - Say Line 0"),
(21148,0,1,0,'',11,0,100,0,0,0,0,0,0,89,10,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Spawn - Start Random Movement"),
(21148,0,2,0,'',11,0,100,0,0,0,0,0,0,11,31388,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Spawn - Cast 'Time Rift Channel Trigger'"),
(21148,0,3,0,'',4,0,20,0,0,0,0,0,0,1,1,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Rift Keeper - On Aggro - Say Line 1"),
(21148,0,4,0,'1',0,0,100,0,0,0,2400,3600,0,11,36279,64,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat CMC - Cast 'Frostbolt' (Normal)"),
(21148,0,5,0,'2',0,0,100,0,0,0,2400,3600,0,11,38534,64,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat CMC - Cast 'Frostbolt' (Heroic)"),
(21148,0,6,0,'1',0,0,100,0,5000,10000,15000,25000,0,11,36277,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Pyroblast' (Normal)"),
(21148,0,7,0,'2',0,0,100,0,5000,10000,15000,25000,0,11,38535,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Pyroblast' (Heroic)"),
(21148,0,8,0,'1',0,0,100,0,10000,20000,15000,25000,0,11,36278,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Blast Wave' (Normal)"),
(21148,0,9,0,'2',0,0,100,0,10000,20000,15000,25000,0,11,38536,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Blast Wave' (Heroic)"),
(21148,0,10,0,'',0,0,100,0,15000,25000,20000,30000,0,11,13323,0,0,0,0,0,6,0,0,0,0,0,0,0,0,"Rift Keeper - In Combat - Cast 'Polymorph'"),
(21148,0,11,0,'',2,0,100,1,0,30,0,0,0,11,8269,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - Between 0-30% Health - Cast 'Frenzy' (No Repeat)"),
(21148,0,12,0,'',5,0,100,0,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Killed Unit - Say Line 3"),
(21148,0,13,0,'',6,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Death - Say Line 2"),
(21148,0,14,0,'',6,0,100,0,0,0,0,0,0,11,31322,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Rift Keeper - On Death - Cast 'Close Time Rift Trigger'");
-- Infinite Whelp
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.42857 WHERE `entry` = 22169;
DELETE FROM `smart_scripts` WHERE `entryorguid` = 21818 AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
-- Actually not sure if all trash creatures are defensive
(21818,0,0,0,37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Whelp - On AI Initialize - Set Reactstate Defensive"),
(21818,0,1,0,37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Whelp - On AI Initialize - Set Corpse Delay"),
(21818,0,2,0,11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Whelp - On Spawn - Move To Closest Creature 'Medivh'"),
(21818,0,3,0,4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Whelp - On Aggro - Remove Aura 'Corrupt Medivh'"),
(21818,0,4,0,34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Whelp - On Movement Inform - Cast 'Corrupt Medivh'");
-- Infinite Assassin
-- UPDATE `creature_template` SET `difficulty_entry_1` = 20740 WHERE `entry` = 17835;
UPDATE `creature_template` SET `faction` = 1720, `speed_walk` = 2, `speed_run` = 1.42857, `flags_extra` = `flags_extra`|64 WHERE `entry` = 20740;
UPDATE `creature_template` SET /*`difficulty_entry_1` = 22164,*/ `AIName` = 'SmartAI' WHERE `entry` = 21137;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.42857 WHERE `entry` = 22164;
DELETE FROM `creature_text` WHERE `CreatureID` IN (17835,21137);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
-- Not sure if these are grouped correctly
(17835,0,0,"Our time has come!",12,0,100,0,0,0,15163,0,"Infinite Assassin - On Aggro"),
(17835,0,1,"The wizard will fall!",12,0,100,0,0,0,15164,0,"Infinite Assassin - On Aggro"),
(17835,0,2,"Enforcers! Kill them all!",12,0,100,0,0,0,15165,0,"Infinite Assassin - On Aggro"),
(17835,0,3,"We will not be stopped!",12,0,100,0,0,0,15166,0,"Infinite Assassin - On Aggro"),
(17835,1,0,"More will take my place.",12,0,100,0,0,0,15167,0,"Infinite Assassin - On Death"),
(17835,1,1,"Your efforts... are in vain.",12,0,100,0,0,0,15168,0,"Infinite Assassin - On Death"),
(17835,1,2,"You will not save him!",12,0,100,0,0,0,15169,0,"Infinite Assassin - On Death"),
(17835,1,3,"We control the timeways now!",12,0,100,0,0,0,15170,0,"Infinite Assassin - On Death"),
(21137,0,0,"Our time has come!",12,0,100,0,0,0,15163,0,"Infinite Assassin - On Aggro"),
(21137,0,1,"The wizard will fall!",12,0,100,0,0,0,15164,0,"Infinite Assassin - On Aggro"),
(21137,0,2,"Enforcers! Kill them all!",12,0,100,0,0,0,15165,0,"Infinite Assassin - On Aggro"),
(21137,0,3,"We will not be stopped!",12,0,100,0,0,0,15166,0,"Infinite Assassin - On Aggro"),
(21137,1,0,"More will take my place.",12,0,100,0,0,0,15167,0,"Infinite Assassin - On Death"),
(21137,1,1,"Your efforts... are in vain.",12,0,100,0,0,0,15168,0,"Infinite Assassin - On Death"),
(21137,1,2,"You will not save him!",12,0,100,0,0,0,15169,0,"Infinite Assassin - On Death"),
(21137,1,3,"We control the timeways now!",12,0,100,0,0,0,15170,0,"Infinite Assassin - On Death");
DELETE FROM `creature_template_addon` WHERE `entry` IN (20740,22164);
INSERT INTO `creature_template_addon` (`entry`, `PathId`, `mount`, `MountCreatureID`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvPFlags`, `emote`, `visibilityDistanceType`, `auras`) VALUES
(20740,0,0,0,0,0,0,1,0,0,0,'38519'),
(22164,0,0,0,0,0,0,1,0,0,0,'30982');
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (17835,21137) AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`Difficulties`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(17835,0,0,0,'',37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On AI Initialize - Set Reactstate Defensive"),
(17835,0,1,0,'',37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On AI Initialize - Set Corpse Delay"),
(17835,0,2,0,'',11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Assassin - On Spawn - Move To Closest Creature 'Medivh'"),
(17835,0,3,0,'',4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On Aggro - Remove Aura 'Corrupt Medivh'"),
(17835,0,4,0,'',4,0,10,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Infinite Assassin - On Aggro - Say Line 0"),
(17835,0,5,0,'',34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On Movement Inform - Cast 'Corrupt Medivh'"),
(17835,0,6,0,'1',0,0,100,0,5000,10000,5000,10000,0,11,7159,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Assassin - In Combat - Cast 'Backstab' (Normal)"),
(17835,0,7,0,'2',0,0,100,0,5000,10000,5000,10000,0,11,15657,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Assassin - In Combat - Cast 'Backstab' (Heroic)"),
(17835,0,8,0,'',0,0,100,0,5000,15000,20000,25000,0,11,30832,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Assassin - In Combat - Cast 'Kidney Shot'"),
(17835,0,9,0,'',6,0,10,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On Death - Say Line 1"),
(21137,0,0,0,'',37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On AI Initialize - Set Reactstate Defensive"),
(21137,0,1,0,'',37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On AI Initialize - Set Corpse Delay"),
(21137,0,2,0,'',11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Assassin - On Spawn - Move To Closest Creature 'Medivh'"),
(21137,0,3,0,'',4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On Aggro - Remove Aura 'Corrupt Medivh'"),
(21137,0,4,0,'',4,0,10,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Infinite Assassin - On Aggro - Say Line 0"),
(21137,0,5,0,'',34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On Movement Inform - Cast 'Corrupt Medivh'"),
(21137,0,6,0,'1',0,0,100,0,5000,10000,5000,15000,0,11,14873,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Assassin - In Combat - Cast 'Sinister Strike' (Normal)"),
(21137,0,7,0,'2',0,0,100,0,5000,10000,5000,15000,0,11,15667,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Assassin - In Combat - Cast 'Sinister Strike' (Heroic)"),
(21137,0,8,0,'1',0,0,100,0,5000,10000,10000,20000,0,11,14874,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Assassin - In Combat - Cast 'Rupture' (Normal)"),
(21137,0,9,0,'2',0,0,100,0,5000,10000,10000,20000,0,11,15583,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Assassin - In Combat - Cast 'Rupture' (Heroic)"),
(21137,0,10,0,'',6,0,10,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Assassin - On Death - Say Line 1");
-- Infinite Chronomancer
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 21136;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.42857 WHERE `entry` = 20741;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.42857 WHERE `entry` = 22165;
DELETE FROM `creature_text` WHERE `CreatureID` IN (17892,21136);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
-- Not sure if these are grouped correctly
(17892,0,0,"Death to the Last Guardian!",12,0,100,0,0,0,15171,0,"Infinite Chronomancer - On Aggro"),
(17892,0,1,"You will not stand in our way!",12,0,100,0,0,0,15172,0,"Infinite Chronomancer - On Aggro"),
(17892,0,2,"Magna Medivh dies today!",12,0,100,0,0,0,15173,0,"Infinite Chronomancer - On Aggro"),
(17892,1,0,"We are not finished!",12,0,100,0,0,0,15174,0,"Infinite Chronomancer - On Death"),
(17892,1,1,"A minor victory...",12,0,100,0,0,0,15175,0,"Infinite Chronomancer - On Death"),
(17892,1,2,"We will not fail!",12,0,100,0,0,0,15176,0,"Infinite Chronomancer - On Death"),
(17892,2,0,"The end is at hand!",12,0,100,0,0,0,15177,0,"Infinite Chronomancer - On Slay"),
(17892,2,1,"One step closer...",12,0,100,0,0,0,15178,0,"Infinite Chronomancer - On Slay"),
(21136,0,0,"Death to the Last Guardian!",12,0,100,0,0,0,15171,0,"Infinite Chronomancer - On Aggro"),
(21136,0,1,"You will not stand in our way!",12,0,100,0,0,0,15172,0,"Infinite Chronomancer - On Aggro"),
(21136,0,2,"Magna Medivh dies today!",12,0,100,0,0,0,15173,0,"Infinite Chronomancer - On Aggro"),
(21136,1,0,"We are not finished!",12,0,100,0,0,0,15174,0,"Infinite Chronomancer - On Death"),
(21136,1,1,"A minor victory...",12,0,100,0,0,0,15175,0,"Infinite Chronomancer - On Death"),
(21136,1,2,"We will not fail!",12,0,100,0,0,0,15176,0,"Infinite Chronomancer - On Death"),
(21136,2,0,"The end is at hand!",12,0,100,0,0,0,15177,0,"Infinite Chronomancer - On Slay"),
(21136,2,1,"One step closer...",12,0,100,0,0,0,15178,0,"Infinite Chronomancer - On Slay");
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (17892,21136) AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`Difficulties`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(17892,0,0,0,'',37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On AI Initialize - Set Reactstate Defensive"),
(17892,0,1,0,'',37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On AI Initialize - Set Corpse Delay"),
(17892,0,2,0,'',11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Chronomancer - On Spawn - Move To Closest Creature 'Medivh'"),
(17892,0,3,0,'',4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Aggro - Remove Aura 'Corrupt Medivh'"),
(17892,0,4,0,'',4,0,10,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Aggro - Say Line 0"),
(17892,0,5,0,'',34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Movement Inform - Cast 'Corrupt Medivh'"),
(17892,0,6,0,'1',0,0,100,0,0,0,1200,3600,0,11,15124,64,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Chronomancer - In Combat CMC - Cast 'Arcane Bolt' (Normal)"),
(17892,0,7,0,'2',0,0,100,0,0,0,1200,3600,0,11,15230,64,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Chronomancer - In Combat CMC - Cast 'Arcane Bolt' (Heroic)"),
(17892,0,8,0,'1',0,0,100,0,5000,10000,10000,15000,0,11,33860,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - In Combat - Cast 'Arcane Explosion' (Normal)"),
(17892,0,9,0,'2',0,0,100,0,5000,10000,10000,15000,0,11,33623,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - In Combat - Cast 'Arcane Explosion' (Heroic)"),
(17892,0,10,0,'',5,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Killed Unit - Say Line 2"),
(17892,0,11,0,'',6,0,10,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Death - Say Line 1"),
(21136,0,0,0,'',37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On AI Initialize - Set Reactstate Defensive"),
(21136,0,1,0,'',37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On AI Initialize - Set Corpse Delay"),
(21136,0,2,0,'',11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Chronomancer - On Spawn - Move To Closest Creature 'Medivh'"),
(21136,0,3,0,'',4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Aggro - Remove Aura 'Corrupt Medivh'"),
(21136,0,4,0,'',4,0,10,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Aggro - Say Line 0"),
(21136,0,5,0,'',34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Movement Inform - Cast 'Corrupt Medivh'"),
(21136,0,6,0,'1',0,0,100,0,0,0,3200,5400,0,11,15497,64,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Chronomancer - In Combat CMC - Cast 'Frostbolt' (Normal)"),
(21136,0,7,0,'2',0,0,100,0,0,0,3200,5400,0,11,12675,64,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Chronomancer - In Combat CMC - Cast 'Frostbolt' (Heroic)"),
(21136,0,8,0,'1',0,0,100,0,5000,10000,10000,20000,0,11,15063,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - In Combat - Cast 'Frost Nova' (Normal)"),
(21136,0,9,0,'2',0,0,100,0,5000,10000,10000,20000,0,11,15531,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - In Combat - Cast 'Frost Nova' (Heroic)"),
(21136,0,10,0,'',5,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Killed Unit - Say Line 2"),
(21136,0,11,0,'',6,0,10,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Chronomancer - On Death - Say Line 1");
-- Infinite Executioner
UPDATE `creature_template` SET /*`difficulty_entry_1` = 20742,*/ `speed_walk` = 2, `speed_run` = 1.42857 WHERE `entry` = 18994;
UPDATE `creature_template` SET `faction` = 1720, `speed_walk` = 2, `speed_run` = 1.42857, `flags_extra` = `flags_extra`|64 WHERE `entry` = 20742;
UPDATE `creature_template` SET /*`difficulty_entry_1` = 22166,*/ `speed_walk` = 2, `speed_run` = 1.42857, `AIName` = 'SmartAI' WHERE `entry` = 21138;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.42857, `BaseAttackTime` = 2000 WHERE `entry` = 22166;
DELETE FROM `creature_text` WHERE `CreatureID` IN (18994,21138);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
-- Not sure if these are grouped correctly
(18994,0,0,"Our time has come!",12,0,100,0,0,0,15163,0,"Infinite Executioner - On Aggro"),
(18994,0,1,"The wizard will fall!",12,0,100,0,0,0,15164,0,"Infinite Executioner - On Aggro"),
(18994,0,2,"Enforcers! Kill them all!",12,0,100,0,0,0,15165,0,"Infinite Executioner - On Aggro"),
(18994,0,3,"We will not be stopped!",12,0,100,0,0,0,15166,0,"Infinite Executioner - On Aggro"),
(18994,1,0,"More will take my place.",12,0,100,0,0,0,15167,0,"Infinite Executioner - On Death"),
(18994,1,1,"Your efforts... are in vain.",12,0,100,0,0,0,15168,0,"Infinite Executioner - On Death"),
(18994,1,2,"You will not save him!",12,0,100,0,0,0,15169,0,"Infinite Executioner - On Death"),
(18994,1,3,"We control the timeways now!",12,0,100,0,0,0,15170,0,"Infinite Executioner - On Death"),
(21138,0,0,"Our time has come!",12,0,100,0,0,0,15163,0,"Infinite Executioner - On Aggro"),
(21138,0,1,"The wizard will fall!",12,0,100,0,0,0,15164,0,"Infinite Executioner - On Aggro"),
(21138,0,2,"Enforcers! Kill them all!",12,0,100,0,0,0,15165,0,"Infinite Executioner - On Aggro"),
(21138,0,3,"We will not be stopped!",12,0,100,0,0,0,15166,0,"Infinite Executioner - On Aggro"),
(21138,1,0,"More will take my place.",12,0,100,0,0,0,15167,0,"Infinite Executioner - On Death"),
(21138,1,1,"Your efforts... are in vain.",12,0,100,0,0,0,15168,0,"Infinite Executioner - On Death"),
(21138,1,2,"You will not save him!",12,0,100,0,0,0,15169,0,"Infinite Executioner - On Death"),
(21138,1,3,"We control the timeways now!",12,0,100,0,0,0,15170,0,"Infinite Executioner - On Death");
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18994,21138) AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`Difficulties`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(18994,0,0,0,'',37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On AI Initialize - Set Reactstate Defensive"),
(18994,0,1,0,'',37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On AI Initialize - Set Corpse Delay"),
(18994,0,2,0,'',11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Executioner - On Spawn - Move To Closest Creature 'Medivh'"),
(18994,0,3,0,'',4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On Aggro - Remove Aura 'Corrupt Medivh'"),
(18994,0,4,0,'',4,0,10,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Infinite Executioner - On Aggro - Say Line 0"),
(18994,0,5,0,'',34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On Movement Inform - Cast 'Corrupt Medivh'"),
(18994,0,6,0,'1',0,0,100,0,5000,10000,5000,10000,0,11,15580,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Executioner - In Combat - Cast 'Strike' (Normal)"),
(18994,0,7,0,'2',0,0,100,0,5000,10000,5000,10000,0,11,34920,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Executioner - In Combat - Cast 'Strike' (Heroic)"),
(18994,0,8,0,'1',0,0,100,0,5000,10000,5000,10000,0,11,17198,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Executioner - In Combat - Cast 'Overpower' (Normal)"),
(18994,0,9,0,'2',0,0,100,0,5000,10000,5000,10000,0,11,37321,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Executioner - In Combat - Cast 'Overpower' (Heroic)"),
(18994,0,10,0,'',6,0,10,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On Death - Say Line 1"),
(21138,0,0,0,'',37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On AI Initialize - Set Reactstate Defensive"),
(21138,0,1,0,'',37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On AI Initialize - Set Corpse Delay"),
(21138,0,2,0,'',11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Executioner - On Spawn - Move To Closest Creature 'Medivh'"),
(21138,0,3,0,'',4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On Aggro - Remove Aura 'Corrupt Medivh'"),
(21138,0,4,0,'',4,0,10,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Infinite Executioner - On Aggro - Say Line 0"),
(21138,0,5,0,'',34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On Movement Inform - Cast 'Corrupt Medivh'"),
(21138,0,6,0,'1',0,0,100,0,5000,10000,10000,15000,0,11,9080,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Executioner - In Combat - Cast 'Hamstring' (Normal)"),
(21138,0,7,0,'2',0,0,100,0,5000,10000,10000,15000,0,11,9080,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Executioner - In Combat - Cast 'Hamstring' (Heroic)"),
(21138,0,8,0,'1',0,0,100,0,5000,10000,10000,15000,0,11,15496,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Executioner - In Combat - Cast 'Cleave' (Normal)"),
(21138,0,9,0,'2',0,0,100,0,5000,10000,10000,15000,0,11,15496,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Executioner - In Combat - Cast 'Cleave' (Heroic)"),
(21138,0,10,0,'',6,0,10,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Executioner - On Death - Say Line 1");
-- Infinite Vanquisher
UPDATE `creature_template` SET /*`difficulty_entry_1` = 20743,*/ `speed_walk` = 2, `speed_run` = 1.42857 WHERE `entry` = 18995;
UPDATE `creature_template` SET `faction` = 1720, `speed_walk` = 2, `speed_run` = 1.42857, `flags_extra` = `flags_extra`|64 WHERE `entry` = 20743;
UPDATE `creature_template` SET /*`difficulty_entry_1` = 22168,*/ `speed_walk` = 2, `speed_run` = 1.42857, `AIName` = 'SmartAI' WHERE `entry` = 21139;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.42857, `BaseAttackTime` = 2000 WHERE `entry` = 22168;
DELETE FROM `creature_text` WHERE `CreatureID` IN (18995,21139);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
-- Not sure if these are grouped correctly
(18995,0,0,"Death to the Last Guardian!",12,0,100,0,0,0,15171,0,"Infinite Vanquisher - On Aggro"),
(18995,0,1,"You will not stand in our way!",12,0,100,0,0,0,15172,0,"Infinite Vanquisher - On Aggro"),
(18995,0,2,"Magna Medivh dies today!",12,0,100,0,0,0,15173,0,"Infinite Vanquisher - On Aggro"),
(18995,1,0,"We are not finished!",12,0,100,0,0,0,15174,0,"Infinite Vanquisher - On Death"),
(18995,1,1,"A minor victory...",12,0,100,0,0,0,15175,0,"Infinite Vanquisher - On Death"),
(18995,1,2,"We will not fail!",12,0,100,0,0,0,15176,0,"Infinite Vanquisher - On Death"),
(18995,2,0,"The end is at hand!",12,0,100,0,0,0,15177,0,"Infinite Vanquisher - On Slay"),
(18995,2,1,"One step closer...",12,0,100,0,0,0,15178,0,"Infinite Vanquisher - On Slay"),
(21139,0,0,"Death to the Last Guardian!",12,0,100,0,0,0,15171,0,"Infinite Vanquisher - On Aggro"),
(21139,0,1,"You will not stand in our way!",12,0,100,0,0,0,15172,0,"Infinite Vanquisher - On Aggro"),
(21139,0,2,"Magna Medivh dies today!",12,0,100,0,0,0,15173,0,"Infinite Vanquisher - On Aggro"),
(21139,1,0,"We are not finished!",12,0,100,0,0,0,15174,0,"Infinite Vanquisher - On Death"),
(21139,1,1,"A minor victory...",12,0,100,0,0,0,15175,0,"Infinite Vanquisher - On Death"),
(21139,1,2,"We will not fail!",12,0,100,0,0,0,15176,0,"Infinite Vanquisher - On Death"),
(21139,2,0,"The end is at hand!",12,0,100,0,0,0,15177,0,"Infinite Vanquisher - On Slay"),
(21139,2,1,"One step closer...",12,0,100,0,0,0,15178,0,"Infinite Vanquisher - On Slay");
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18995,21139) AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`Difficulties`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(18995,0,0,0,'',37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On AI Initialize - Set Reactstate Defensive"),
(18995,0,1,0,'',37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On AI Initialize - Set Corpse Delay"),
(18995,0,2,0,'',11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Vanquisher - On Spawn - Move To Closest Creature 'Medivh'"),
(18995,0,3,0,'',4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Aggro - Remove Aura 'Corrupt Medivh'"),
(18995,0,4,0,'',4,0,10,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Aggro - Say Line 0"),
(18995,0,5,0,'',34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Movement Inform - Cast 'Corrupt Medivh'"),
(18995,0,6,0,'1',0,0,100,0,5000,10000,5000,10000,0,11,13341,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Vanquisher - In Combat - Cast 'Fire Blast' (Normal)"),
(18995,0,7,0,'2',0,0,100,0,5000,10000,5000,10000,0,11,38526,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Vanquisher - In Combat - Cast 'Fire Blast' (Heroic)"),
(18995,0,8,0,'1',0,0,100,0,1600,4800,1600,4800,0,11,15241,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Vanquisher - In Combat - Cast 'Scorch' (Normal)"),
(18995,0,9,0,'2',0,0,100,0,1600,4800,1600,4800,0,11,36807,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Vanquisher - In Combat - Cast 'Scorch' (Heroic)"),
(18995,0,10,0,'',5,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Killed Unit - Say Line 2"),
(18995,0,11,0,'',6,0,10,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Death - Say Line 1"),
(21139,0,0,0,'',37,0,100,0,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On AI Initialize - Set Reactstate Defensive"),
(21139,0,1,0,'',37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On AI Initialize - Set Corpse Delay"),
(21139,0,2,0,'',11,0,100,0,0,0,0,0,0,69,1,0,0,20,0,0,19,15608,200,0,0,0,0,0,0,"Infinite Vanquisher - On Spawn - Move To Closest Creature 'Medivh'"),
(21139,0,3,0,'',4,0,100,0,0,0,0,0,0,28,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Aggro - Remove Aura 'Corrupt Medivh'"),
(21139,0,4,0,'',4,0,10,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Aggro - Say Line 0"),
(21139,0,5,0,'',34,0,100,0,8,1,0,0,0,11,31326,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Movement Inform - Cast 'Corrupt Medivh'"),
(21139,0,6,0,'1',0,0,100,0,0,0,3200,4800,0,11,12739,64,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Vanquisher - In Combat CMC - Cast 'Shadow Bolt' (Normal)"),
(21139,0,7,0,'2',0,0,100,0,0,0,3200,4800,0,11,15472,64,0,0,0,0,2,0,0,0,0,0,0,0,0,"Infinite Vanquisher - In Combat CMC - Cast 'Shadow Bolt' (Heroic)"),
(21139,0,8,0,'1',0,0,100,0,5000,10000,10000,15000,0,11,32063,0,0,0,0,0,5,0,0,0,0,0,0,0,0,"Infinite Vanquisher - In Combat - Cast 'Corruption' (Normal)"),
(21139,0,9,0,'2',0,0,100,0,5000,10000,10000,15000,0,11,32197,0,0,0,0,0,5,0,0,0,0,0,0,0,0,"Infinite Vanquisher - In Combat - Cast 'Corruption' (Heroic)"),
(21139,0,10,0,'',5,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Killed Unit - Say Line 2"),
(21139,0,11,0,'',6,0,10,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Infinite Vanquisher - On Death - Say Line 1");
-- Spell scripts
DELETE FROM `spell_script_names` WHERE `ScriptName` IN (
'spell_black_morass_corrupt_medivh',
'spell_black_morass_corrupt_medivh_aeonus',
'spell_black_morass_time_rift_channel_trigger',
'spell_black_morass_banish_dragon_helper',
'spell_black_morass_close_time_rift_trigger',
'spell_black_morass_close_time_rift_effect',
'spell_black_morass_time_rift_periodic');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(31326, 'spell_black_morass_corrupt_medivh'),
(37853, 'spell_black_morass_corrupt_medivh_aeonus'),
(31388, 'spell_black_morass_time_rift_channel_trigger'),
(31550, 'spell_black_morass_banish_dragon_helper'),
(31322, 'spell_black_morass_close_time_rift_trigger'),
(31323, 'spell_black_morass_close_time_rift_effect'),
(31320, 'spell_black_morass_time_rift_periodic');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` = 31550;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,31550,0,0,31,0,3,17918,0,0,0,0,"","Group 0: Spell 'Banish Dragon Helper' (Effect 0) targets creature 'Time Keeper'");
UPDATE `serverside_spell_effect` SET `Effect`=28, `EffectMiscValue2`=64 WHERE `SpellID` IN (31321,36234,36235,36236,37606,31318,36229,31421,36231,33363,36232,33364,36233,31391,31392,31393,37177,37178) AND `EffectIndex`=0;
@@ -15,79 +15,137 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/*
* Combat timers requires to be revisited
*/
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "InstanceScript.h" #include "InstanceScript.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "the_black_morass.h" #include "the_black_morass.h"
enum AeonusTexts enum AeonusTexts
{ {
SAY_ENTER = 0, SAY_ENTER = 0,
SAY_AGGRO = 1, SAY_BANISH = 1,
SAY_BANISH = 2, SAY_AGGRO = 2,
SAY_SLAY = 3, SAY_SLAY = 3,
SAY_DEATH = 4, SAY_DEATH = 4,
EMOTE_FRENZY = 5 EMOTE_ENRAGE = 5
}; };
enum AeonusSpells enum AeonusSpells
{ {
// Initial
SPELL_THRASH = 8876,
SPELL_DOUBLE_ATTACK = 19818,
// Combat
SPELL_CLEAVE = 40504, SPELL_CLEAVE = 40504,
SPELL_TIME_STOP = 31422, SPELL_TIME_STOP = 31422,
SPELL_SAND_BREATH = 31473,
SPELL_ENRAGE = 37605, SPELL_ENRAGE = 37605,
SPELL_SAND_BREATH = 31473 SPELL_BANISH_HELPER = 31550,
// Misc
SPELL_CORRUPT_MEDIVH = 37853,
SPELL_CLOSE_TIME_RIFT = 31322
}; };
enum AeonusEvents enum AeonusEvents
{ {
EVENT_SANDBREATH = 1, EVENT_CLEAVE = 1,
EVENT_TIMESTOP, EVENT_TIME_STOP,
EVENT_FRENZY EVENT_SAND_BREATH,
EVENT_ENRAGE,
EVENT_BANISH_HELPER
};
enum AeonusMisc
{
POINT_MEDIVH = 0
}; };
// 17881 - Aeonus // 17881 - Aeonus
struct boss_aeonus : public BossAI struct boss_aeonus : public BossAI
{ {
boss_aeonus(Creature* creature) : BossAI(creature, TYPE_AEONUS) { } boss_aeonus(Creature* creature) : BossAI(creature, DATA_AEONUS) { }
void Reset() override { } void JustAppeared() override
void JustEngagedWith(Unit* /*who*/) override
{ {
events.ScheduleEvent(EVENT_SANDBREATH, 15s, 30s); Talk(SAY_ENTER);
events.ScheduleEvent(EVENT_TIMESTOP, 10s, 15s);
events.ScheduleEvent(EVENT_FRENZY, 30s, 45s); DoCastSelf(IsHeroic() ? SPELL_DOUBLE_ATTACK : SPELL_THRASH);
me->SetReactState(REACT_DEFENSIVE);
if (Creature* medivh = instance->GetCreature(DATA_MEDIVH))
{
float x, y, z;
medivh->GetContactPoint(me, x, y, z, 20.0f);
me->GetMotionMaster()->MovePoint(POINT_MEDIVH, x, y, z);
}
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO); Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_CLEAVE, 10s, 25s);
events.ScheduleEvent(EVENT_TIME_STOP, 10s, 20s);
events.ScheduleEvent(EVENT_SAND_BREATH, 10s, 25s);
events.ScheduleEvent(EVENT_ENRAGE, 20s, 25s);
events.ScheduleEvent(EVENT_BANISH_HELPER, 1s);
} }
void MoveInLineOfSight(Unit* who) override void OnSpellCast(SpellInfo const* spellInfo) override
{ {
//Despawn Time Keeper switch (spellInfo->Id)
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
{
if (me->IsWithinDistInMap(who, 20.0f))
{ {
case SPELL_BANISH_HELPER:
Talk(SAY_BANISH); Talk(SAY_BANISH);
Unit::DealDamage(me, who, who->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); break;
case SPELL_ENRAGE:
Talk(EMOTE_ENRAGE);
break;
default:
break;
} }
} }
ScriptedAI::MoveInLineOfSight(who); void MovementInform(uint32 type, uint32 id) override
{
if (type == POINT_MOTION_TYPE && id == POINT_MEDIVH)
DoCastSelf(SPELL_CORRUPT_MEDIVH);
}
void JustReachedHome() override
{
BossAI::JustReachedHome();
if (Creature* medivh = instance->GetCreature(DATA_MEDIVH))
{
float x, y, z;
medivh->GetContactPoint(me, x, y, z, 20.0f);
me->GetMotionMaster()->MovePoint(POINT_MEDIVH, x, y, z);
}
}
void KilledUnit(Unit* /*who*/) override
{
Talk(SAY_SLAY);
} }
void JustDied(Unit* /*killer*/) override void JustDied(Unit* /*killer*/) override
{ {
_JustDied();
Talk(SAY_DEATH); Talk(SAY_DEATH);
instance->SetData(TYPE_RIFT, DONE); DoCastSelf(SPELL_CLOSE_TIME_RIFT, true);
instance->SetData(TYPE_MEDIVH, DONE); // FIXME: later should be removed
}
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_SLAY);
} }
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
@@ -104,18 +162,26 @@ struct boss_aeonus : public BossAI
{ {
switch (eventId) switch (eventId)
{ {
case EVENT_SANDBREATH: case EVENT_CLEAVE:
DoCastVictim(SPELL_SAND_BREATH); DoCastVictim(SPELL_CLEAVE);
events.Repeat(15s, 25s); events.Repeat(15s, 20s);
break; break;
case EVENT_TIMESTOP: case EVENT_TIME_STOP:
DoCastSelf(SPELL_TIME_STOP); DoCastSelf(SPELL_TIME_STOP);
events.Repeat(20s, 35s); events.Repeat(10s, 30s);
break; break;
case EVENT_FRENZY: case EVENT_SAND_BREATH:
Talk(EMOTE_FRENZY); DoCastVictim(SPELL_SAND_BREATH);
events.Repeat(10s, 30s);
break;
case EVENT_ENRAGE:
DoCastSelf(SPELL_ENRAGE); DoCastSelf(SPELL_ENRAGE);
events.Repeat(20s, 35s); events.Repeat(30s, 35s);
break;
case EVENT_BANISH_HELPER:
if (me->FindNearestCreature(NPC_TIME_KEEPER, 30.0f, true))
DoCastSelf(SPELL_BANISH_HELPER);
events.Repeat(1s);
break; break;
default: default:
break; break;
@@ -15,26 +15,36 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/*
* Combat timers requires to be revisited
*/
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "InstanceScript.h"
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "the_black_morass.h" #include "the_black_morass.h"
enum DejaTexts enum DejaTexts
{ {
SAY_ENTER = 0, SAY_ENTER = 0,
SAY_AGGRO = 1, SAY_BANISH = 1,
SAY_BANISH = 2, SAY_AGGRO = 2,
SAY_SLAY = 3, SAY_SLAY = 3,
SAY_DEATH = 4 SAY_DEATH = 4
}; };
enum DejaSpells enum DejaSpells
{ {
// Combat
SPELL_ARCANE_BLAST = 31457, SPELL_ARCANE_BLAST = 31457,
SPELL_ARCANE_DISCHARGE = 31472,
SPELL_TIME_LAPSE = 31467, SPELL_TIME_LAPSE = 31467,
SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode) SPELL_ARCANE_DISCHARGE = 31472,
SPELL_BANISH_HELPER = 31550,
SPELL_ATTRACTION = 38540,
// Misc
SPELL_CHANNEL_TRIGGER = 31388,
SPELL_CLOSE_TIME_RIFT = 31322
}; };
enum DejaEvents enum DejaEvents
@@ -42,40 +52,40 @@ enum DejaEvents
EVENT_ARCANE_BLAST = 1, EVENT_ARCANE_BLAST = 1,
EVENT_TIME_LAPSE, EVENT_TIME_LAPSE,
EVENT_ARCANE_DISCHARGE, EVENT_ARCANE_DISCHARGE,
EVENT_BANISH_HELPER,
EVENT_ATTRACTION EVENT_ATTRACTION
}; };
// 17879 - Chrono Lord Deja // 17879 - Chrono Lord Deja
// 21697 - Infinite Chrono-Lord
struct boss_chrono_lord_deja : public BossAI struct boss_chrono_lord_deja : public BossAI
{ {
boss_chrono_lord_deja(Creature* creature) : BossAI(creature, TYPE_CRONO_LORD_DEJA) { } boss_chrono_lord_deja(Creature* creature) : BossAI(creature, DATA_DEJA) { }
void Reset() override { } void JustAppeared() override
void JustEngagedWith(Unit* /*who*/) override
{ {
events.ScheduleEvent(EVENT_ARCANE_BLAST, 18s, 23s); Talk(SAY_ENTER);
events.ScheduleEvent(EVENT_TIME_LAPSE, 10s, 15s); DoCastSelf(SPELL_CHANNEL_TRIGGER);
events.ScheduleEvent(EVENT_ARCANE_DISCHARGE, 20s, 30s); }
if (IsHeroic())
events.ScheduleEvent(EVENT_ATTRACTION, 25s, 35s); void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO); Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_ARCANE_BLAST, 15s, 25s);
events.ScheduleEvent(EVENT_TIME_LAPSE, 10s, 15s);
events.ScheduleEvent(EVENT_ARCANE_DISCHARGE, 15s, 25s);
events.ScheduleEvent(EVENT_BANISH_HELPER, 1s);
if (IsHeroic())
events.ScheduleEvent(EVENT_ATTRACTION, 20s, 30s);
} }
void MoveInLineOfSight(Unit* who) override void OnSpellCast(SpellInfo const* spellInfo) override
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
{
if (me->IsWithinDistInMap(who, 20.0f))
{ {
if (spellInfo->Id == SPELL_BANISH_HELPER)
Talk(SAY_BANISH); Talk(SAY_BANISH);
Unit::DealDamage(me, who, who->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
} }
void KilledUnit(Unit* /*victim*/) override void KilledUnit(Unit* /*victim*/) override
@@ -85,9 +95,10 @@ struct boss_chrono_lord_deja : public BossAI
void JustDied(Unit* /*killer*/) override void JustDied(Unit* /*killer*/) override
{ {
_JustDied();
Talk(SAY_DEATH); Talk(SAY_DEATH);
instance->SetData(TYPE_RIFT, SPECIAL); DoCastSelf(SPELL_CLOSE_TIME_RIFT, true);
} }
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
@@ -106,20 +117,24 @@ struct boss_chrono_lord_deja : public BossAI
{ {
case EVENT_ARCANE_BLAST: case EVENT_ARCANE_BLAST:
DoCastVictim(SPELL_ARCANE_BLAST); DoCastVictim(SPELL_ARCANE_BLAST);
events.Repeat(15s, 25s); events.Repeat(20s, 30s);
break; break;
case EVENT_TIME_LAPSE: case EVENT_TIME_LAPSE:
Talk(SAY_BANISH);
DoCastSelf(SPELL_TIME_LAPSE); DoCastSelf(SPELL_TIME_LAPSE);
events.Repeat(15s, 25s); events.Repeat(20s, 30s);
break; break;
case EVENT_ARCANE_DISCHARGE: case EVENT_ARCANE_DISCHARGE:
DoCastSelf(SPELL_ARCANE_DISCHARGE); DoCastSelf(SPELL_ARCANE_DISCHARGE);
events.Repeat(20s, 30s); events.Repeat(15s, 25s);
break;
case EVENT_BANISH_HELPER:
if (me->FindNearestCreature(NPC_TIME_KEEPER, 30.0f, true))
DoCastSelf(SPELL_BANISH_HELPER);
events.Repeat(1s);
break; break;
case EVENT_ATTRACTION: case EVENT_ATTRACTION:
DoCastSelf(SPELL_ATTRACTION); DoCastSelf(SPELL_ATTRACTION);
events.Repeat(25s, 35s); events.Repeat(20s, 30s);
break; break;
default: default:
break; break;
@@ -15,52 +15,77 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/*
* Combat timers requires to be revisited
*/
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "InstanceScript.h"
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "the_black_morass.h" #include "the_black_morass.h"
enum TemporusTexts enum TemporusTexts
{ {
SAY_ENTER = 0, SAY_ENTER = 0,
SAY_AGGRO = 1, SAY_BANISH = 1,
SAY_BANISH = 2, SAY_AGGRO = 2,
SAY_SLAY = 3, SAY_SLAY = 3,
SAY_DEATH = 4 SAY_DEATH = 4
}; };
enum TemporusSpells enum TemporusSpells
{ {
SPELL_HASTE = 31458, // Combat
SPELL_HASTEN = 31458,
SPELL_MORTAL_WOUND = 31464, SPELL_MORTAL_WOUND = 31464,
SPELL_WING_BUFFET = 31475, SPELL_WING_BUFFET = 31475,
SPELL_REFLECT = 38592 SPELL_BANISH_HELPER = 31550,
SPELL_SPELL_REFLECTION = 38592,
// Misc
SPELL_CHANNEL_TRIGGER = 31388,
SPELL_CLOSE_TIME_RIFT = 31322
}; };
enum TemporusEvents enum TemporusEvents
{ {
EVENT_HASTE = 1, EVENT_HASTEN = 1,
EVENT_MORTAL_WOUND, EVENT_MORTAL_WOUND,
EVENT_WING_BUFFET, EVENT_WING_BUFFET,
EVENT_BANISH_HELPER,
EVENT_SPELL_REFLECTION EVENT_SPELL_REFLECTION
}; };
// 17880 - Temporus // 17880 - Temporus
// 21698 - Infinite Timereaver
struct boss_temporus : public BossAI struct boss_temporus : public BossAI
{ {
boss_temporus(Creature* creature) : BossAI(creature, TYPE_TEMPORUS) { } boss_temporus(Creature* creature) : BossAI(creature, DATA_TEMPORUS) { }
void Reset() override { } void JustAppeared() override
void JustEngagedWith(Unit* /*who*/) override
{ {
events.ScheduleEvent(EVENT_HASTE, 15s, 23s); Talk(SAY_ENTER);
events.ScheduleEvent(EVENT_MORTAL_WOUND, 8s); DoCastSelf(SPELL_CHANNEL_TRIGGER);
events.ScheduleEvent(EVENT_WING_BUFFET, 25s, 35s); }
if (IsHeroic())
events.ScheduleEvent(EVENT_SPELL_REFLECTION, 30s); void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO); Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_HASTEN, 15s, 20s);
events.ScheduleEvent(EVENT_MORTAL_WOUND, 6s, 8s);
events.ScheduleEvent(EVENT_WING_BUFFET, 15s, 20s);
events.ScheduleEvent(EVENT_BANISH_HELPER, 1s);
if (IsHeroic())
events.ScheduleEvent(EVENT_SPELL_REFLECTION, 10s, 20s);
}
void OnSpellCast(SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_BANISH_HELPER)
Talk(SAY_BANISH);
} }
void KilledUnit(Unit* /*victim*/) override void KilledUnit(Unit* /*victim*/) override
@@ -70,25 +95,10 @@ struct boss_temporus : public BossAI
void JustDied(Unit* /*killer*/) override void JustDied(Unit* /*killer*/) override
{ {
_JustDied();
Talk(SAY_DEATH); Talk(SAY_DEATH);
instance->SetData(TYPE_RIFT, SPECIAL); DoCastSelf(SPELL_CLOSE_TIME_RIFT, true);
}
void MoveInLineOfSight(Unit* who) override
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
{
if (me->IsWithinDistInMap(who, 20.0f))
{
Talk(SAY_BANISH);
Unit::DealDamage(me, who, who->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
} }
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
@@ -105,20 +115,25 @@ struct boss_temporus : public BossAI
{ {
switch (eventId) switch (eventId)
{ {
case EVENT_HASTE: case EVENT_HASTEN:
DoCastSelf(SPELL_HASTE); DoCastSelf(SPELL_HASTEN);
events.Repeat(20s, 25s); events.Repeat(15s, 20s);
break; break;
case EVENT_MORTAL_WOUND: case EVENT_MORTAL_WOUND:
DoCastVictim(SPELL_MORTAL_WOUND); DoCastVictim(SPELL_MORTAL_WOUND);
events.Repeat(10s, 20s); events.Repeat(6s, 8s);
break; break;
case EVENT_WING_BUFFET: case EVENT_WING_BUFFET:
DoCastSelf(SPELL_WING_BUFFET); DoCastSelf(SPELL_WING_BUFFET);
events.Repeat(20s, 30s); events.Repeat(20s, 30s);
break; break;
case EVENT_BANISH_HELPER:
if (me->FindNearestCreature(NPC_TIME_KEEPER, 30.0f, true))
DoCastSelf(SPELL_BANISH_HELPER);
events.Repeat(1s);
break;
case EVENT_SPELL_REFLECTION: case EVENT_SPELL_REFLECTION:
DoCastSelf(SPELL_REFLECT); DoCastSelf(SPELL_SPELL_REFLECTION);
events.Repeat(25s, 35s); events.Repeat(25s, 35s);
break; break;
default: default:
@@ -15,58 +15,25 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/*
Name: Instance_The_Black_Morass
%Complete: 50
Comment: Quest support: 9836, 10297. Currently in progress.
Category: Caverns of Time, The Black Morass
*/
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "Creature.h"
#include "CreatureAI.h"
#include "Containers.h"
#include "EventMap.h" #include "EventMap.h"
#include "InstanceScript.h" #include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
#include "Player.h" #include "Player.h"
#include "the_black_morass.h" #include "the_black_morass.h"
#include "TemporarySummon.h"
enum Misc static constexpr ObjectData creatureData[] =
{ {
SPELL_RIFT_CHANNEL = 31387, { NPC_MEDIVH, DATA_MEDIVH },
RIFT_BOSS = 1 { NPC_SAAT, DATA_SAAT }
}; };
inline uint32 RandRiftBoss() { return ((rand32() % 2) ? NPC_RIFT_KEEPER : NPC_RIFT_LORD); } static Position const PortalPosition1 = { -2030.832f, 7024.944f, 23.07182f, 3.141593f };
static Position const PortalPosition2 = { -1961.734f, 7029.528f, 21.8114f, 2.129302f };
float PortalLocation[4][4]= static Position const PortalPosition3 = { -1887.695f, 7106.557f, 22.0495f, 4.956735f };
{ static Position const PortalPosition4 = { -1930.911f, 7183.597f, 23.00764f, 3.595378f };
{-2041.06f, 7042.08f, 29.99f, 1.30f},
{-1968.18f, 7042.11f, 21.93f, 2.12f},
{-1885.82f, 7107.36f, 22.32f, 3.07f},
{-1928.11f, 7175.95f, 22.11f, 3.44f}
};
struct Wave
{
uint32 PortalBoss; //protector of current portal
Milliseconds NextPortalTime; //time to next portal, or 0 if portal boss need to be killed
};
static Wave RiftWaves[]=
{
{ RIFT_BOSS, 0s },
{ NPC_CRONO_LORD_DEJA, 0s },
{ RIFT_BOSS, 120s },
{ NPC_TEMPORUS, 140s },
{ RIFT_BOSS, 120s },
{ NPC_AEONUS, 0s }
};
enum EventIds
{
EVENT_NEXT_PORTAL = 1
};
class instance_the_black_morass : public InstanceMapScript class instance_the_black_morass : public InstanceMapScript
{ {
@@ -83,138 +50,131 @@ public:
instance_the_black_morass_InstanceMapScript(InstanceMap* map) : InstanceScript(map) instance_the_black_morass_InstanceMapScript(InstanceMap* map) : InstanceScript(map)
{ {
SetHeaders(DataHeader); SetHeaders(DataHeader);
Clear(); LoadObjectData(creatureData, {});
SetBossNumber(EncounterCount);
DoResetEvent();
} }
uint32 m_auiEncounter[EncounterCount]; void DoResetEvent()
uint32 mRiftPortalCount;
uint32 mShieldPercent;
uint8 mRiftWaveCount;
uint8 mRiftWaveId;
ObjectGuid _medivhGUID;
uint8 _currentRiftId;
void Clear()
{ {
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); EventState = NOT_STARTED;
RiftPortalCount = 0;
ShieldPercent = 100;
LastSummonRiftSpell = 0;
OpenRiftPortalsCount = 0;
mRiftPortalCount = 0; DoUpdateWorldState(WORLD_STATE_BM_SHIELD, 100);
mShieldPercent = 100; DoUpdateWorldState(WORLD_STATE_BM, 0);
mRiftWaveCount = 0; DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0);
mRiftWaveId = 0;
_currentRiftId = 0; Events.CancelEvent(EVENT_SUMMON_PORTAL);
} }
bool IsEncounterInProgress() const override bool SetBossState(uint32 type, EncounterState state) override
{ {
if (GetData(TYPE_MEDIVH) == IN_PROGRESS) if (!InstanceScript::SetBossState(type, state))
return true;
return false;
}
void OnCreatureCreate(Creature* creature) override
{
if (creature->GetEntry() == NPC_MEDIVH)
_medivhGUID = creature->GetGUID();
}
//what other conditions to check?
bool CanProgressEvent()
{
if (instance->GetPlayers().empty())
return false; return false;
return true; switch (type)
{
case DATA_DEJA:
case DATA_TEMPORUS:
if (state == DONE)
SetData(DATA_RIFT, DONE);
break;
case DATA_AEONUS:
if (state == DONE)
{
DoCastSpellOnPlayers(SPELL_THE_BLACK_MORASS_COMPLETE);
DoCastSpellOnPlayers(SPELL_THE_MASTERS_TOUCH_COMPLETE);
DoUpdateWorldState(WORLD_STATE_BM, 0);
SetData(DATA_EVENT, DONE);
} }
break;
uint8 GetRiftWaveId()
{
switch (mRiftPortalCount)
{
case 6:
mRiftWaveId = 2;
return 1;
case 12:
mRiftWaveId = 4;
return 3;
case 18:
return 5;
default: default:
return mRiftWaveId; break;
} }
return true;
} }
void SetData(uint32 type, uint32 data) override void SetData(uint32 type, uint32 data) override
{ {
switch (type) switch (type)
{ {
case TYPE_MEDIVH: case DATA_EVENT:
if (data == SPECIAL && m_auiEncounter[0] == IN_PROGRESS) EventState = data;
switch (data)
{ {
--mShieldPercent; case IN_PROGRESS:
DoUpdateWorldState(WORLD_STATE_BM_SHIELD, mShieldPercent);
if (!mShieldPercent)
{
if (Creature* medivh = instance->GetCreature(_medivhGUID))
{
if (medivh->IsAlive())
{
medivh->KillSelf();
m_auiEncounter[0] = FAIL;
m_auiEncounter[1] = NOT_STARTED;
}
}
}
}
else
{
if (data == IN_PROGRESS)
{
TC_LOG_DEBUG("scripts", "Instance The Black Morass: Starting event.");
DoUpdateWorldState(WORLD_STATE_BM, 1); DoUpdateWorldState(WORLD_STATE_BM, 1);
m_auiEncounter[1] = IN_PROGRESS; ScheduleEventNextPortal(0s);
ScheduleEventNextPortal(15s); if (Creature* saat = GetCreature(DATA_SAAT))
} saat->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
break;
if (data == DONE) case DONE:
{ if (Creature* medivh = GetCreature(DATA_MEDIVH))
//this may be completed further out in the post-event medivh->AI()->DoAction(ACTION_EPILOGUE);
TC_LOG_DEBUG("scripts", "Instance The Black Morass: Event completed."); if (Creature* saat = GetCreature(DATA_SAAT))
Map::PlayerList const& players = instance->GetPlayers(); saat->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
break;
if (!players.empty()) case FAIL:
{ DoResetEvent();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if (Creature* saat = GetCreature(DATA_SAAT))
{ saat->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
if (Player* player = itr->GetSource()) break;
{ default:
if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE) break;
player->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL);
if (player->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE)
player->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH);
}
}
}
}
m_auiEncounter[0] = data;
} }
break; break;
case TYPE_RIFT: case DATA_SHIELD_PCT:
if (data == SPECIAL) if (data == SPECIAL && GetData(DATA_EVENT) == IN_PROGRESS)
{ {
if (mRiftPortalCount < 7) --ShieldPercent;
ScheduleEventNextPortal(5s);
DoUpdateWorldState(WORLD_STATE_BM_SHIELD, ShieldPercent);
switch (ShieldPercent)
{
case 75:
if (Creature* medivh = GetCreature(DATA_MEDIVH))
medivh->AI()->DoAction(ACTION_SHIELD_75);
break;
case 50:
if (Creature* medivh = GetCreature(DATA_MEDIVH))
medivh->AI()->DoAction(ACTION_SHIELD_50);
break;
case 25:
if (Creature* medivh = GetCreature(DATA_MEDIVH))
medivh->AI()->DoAction(ACTION_SHIELD_25);
break;
case 0:
if (Creature* medivh = GetCreature(DATA_MEDIVH))
medivh->AI()->DoAction(ACTION_SHIELD_0);
SetData(DATA_EVENT, FAIL);
break;
default:
break;
} }
else }
m_auiEncounter[1] = data; break;
case DATA_RIFT:
switch (data)
{
case DONE:
--OpenRiftPortalsCount;
ScheduleEventNextPortal(125s);
break;
case SPECIAL:
--OpenRiftPortalsCount;
if (!OpenRiftPortalsCount)
ScheduleEventNextPortal(randtime(0s, 5s));
break;
default:
break;
}
break;
default:
break; break;
} }
} }
@@ -223,110 +183,114 @@ public:
{ {
switch (type) switch (type)
{ {
case TYPE_MEDIVH: case DATA_EVENT:
return m_auiEncounter[0]; return EventState;
case TYPE_RIFT: case DATA_RIFT_COUNT:
return m_auiEncounter[1]; return RiftPortalCount;
case DATA_PORTAL_COUNT: case DATA_SHIELD_PCT:
return mRiftPortalCount; return ShieldPercent;
case DATA_SHIELD:
return mShieldPercent;
} }
return 0; return 0;
} }
ObjectGuid GetGuidData(uint32 data) const override void OnUnitDeath(Unit* unit) override
{ {
if (data == DATA_MEDIVH) switch (unit->GetEntry())
return _medivhGUID; {
case NPC_RIFT_LORD:
return ObjectGuid::Empty; case NPC_RIFT_LORD_ALT:
case NPC_RIFT_KEEPER:
case NPC_RIFT_KEEPER_ALT:
SetData(DATA_RIFT, SPECIAL);
break;
case NPC_INFINITE_CHRONO_LORD:
case NPC_INFINITE_TIMEREAVER:
SetData(DATA_RIFT, DONE);
break;
default:
break;
} }
Creature* SummonedPortalBoss(Creature* me)
{
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
if (entry == RIFT_BOSS)
entry = RandRiftBoss();
TC_LOG_DEBUG("scripts", "Instance The Black Morass: Summoning rift boss entry {}.", entry);
Position pos = me->GetRandomNearPosition(10.0f);
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(me->GetMap()->GetHeight(me->GetPhaseShift(), pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(me->GetPhaseShift(), pos.m_positionX, pos.m_positionY));
if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10min))
return summon;
TC_LOG_DEBUG("scripts", "Instance The Black Morass: What just happened there? No boss, no loot, no fun...");
return nullptr;
} }
void DoSpawnPortal() void DoSpawnPortal()
{ {
if (Creature* medivh = instance->GetCreature(_medivhGUID)) // Spells are guessed
if (Creature* medivh = GetCreature(DATA_MEDIVH))
{ {
uint8 tmp = urand(0, 2); std::vector<uint32> availableSummonRiftSpells =
if (tmp >= _currentRiftId)
++tmp;
TC_LOG_DEBUG("scripts", "Instance The Black Morass: Creating Time Rift at locationId {} (old locationId was {}).", tmp, _currentRiftId);
_currentRiftId = tmp;
Creature* temp = medivh->SummonCreature(NPC_TIME_RIFT,
PortalLocation[tmp][0], PortalLocation[tmp][1], PortalLocation[tmp][2], PortalLocation[tmp][3],
TEMPSUMMON_CORPSE_DESPAWN);
if (temp)
{ {
if (Creature* boss = SummonedPortalBoss(temp)) SPELL_SUMMON_TIME_RIFT_EFFECT_1,
{ SPELL_SUMMON_TIME_RIFT_EFFECT_2,
if (boss->GetEntry() == NPC_AEONUS) SPELL_SUMMON_TIME_RIFT_EFFECT_3,
boss->GetThreatManager().AddThreat(medivh, 0.0f); SPELL_SUMMON_TIME_RIFT_EFFECT_4
else };
{
boss->GetThreatManager().AddThreat(temp, 0.0f); if (LastSummonRiftSpell)
temp->CastSpell(boss, SPELL_RIFT_CHANNEL, false); std::erase(availableSummonRiftSpells, LastSummonRiftSpell);
}
uint32 selectedSpell = Trinity::Containers::SelectRandomContainerElement(availableSummonRiftSpells);
LastSummonRiftSpell = selectedSpell;
medivh->CastSpell(nullptr, selectedSpell, true);
++OpenRiftPortalsCount;
} }
} }
void ProcessEvent(WorldObject* /*gameObject*/, uint32 eventId, WorldObject* /*invoker*/) override
{
// Positions are sniffed but the way they are linked to events is guessed
switch (eventId)
{
case EVENT_SUMMON_TIME_RIFT_1:
if (Creature* medivh = GetCreature(DATA_MEDIVH))
medivh->SummonCreature(NPC_TIME_RIFT, PortalPosition1, TEMPSUMMON_MANUAL_DESPAWN);
break;
case EVENT_SUMMON_TIME_RIFT_2:
if (Creature* medivh = GetCreature(DATA_MEDIVH))
medivh->SummonCreature(NPC_TIME_RIFT, PortalPosition2, TEMPSUMMON_MANUAL_DESPAWN);
break;
case EVENT_SUMMON_TIME_RIFT_3:
if (Creature* medivh = GetCreature(DATA_MEDIVH))
medivh->SummonCreature(NPC_TIME_RIFT, PortalPosition3, TEMPSUMMON_MANUAL_DESPAWN);
break;
case EVENT_SUMMON_TIME_RIFT_4:
if (Creature* medivh = GetCreature(DATA_MEDIVH))
medivh->SummonCreature(NPC_TIME_RIFT, PortalPosition4, TEMPSUMMON_MANUAL_DESPAWN);
break;
default:
break;
} }
} }
void Update(uint32 diff) override void Update(uint32 diff) override
{ {
if (m_auiEncounter[1] != IN_PROGRESS)
return;
//add delay timer?
if (!CanProgressEvent())
{
Clear();
return;
}
Events.Update(diff); Events.Update(diff);
if (Events.ExecuteEvent() == EVENT_NEXT_PORTAL) if (Events.ExecuteEvent() == EVENT_SUMMON_PORTAL)
{ {
++mRiftPortalCount; ++RiftPortalCount;
DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount); DoUpdateWorldState(WORLD_STATE_BM_RIFT, RiftPortalCount);
DoSpawnPortal(); DoSpawnPortal();
ScheduleEventNextPortal(RiftWaves[GetRiftWaveId()].NextPortalTime); if (RiftPortalCount != 6 && RiftPortalCount != 12 && RiftPortalCount != 18)
ScheduleEventNextPortal(RiftPortalCount > 12 ? 90s : 120s);
} }
} }
void ScheduleEventNextPortal(Milliseconds nextPortalTime) void ScheduleEventNextPortal(Milliseconds nextPortalTime)
{ {
if (nextPortalTime > 0s) Events.RescheduleEvent(EVENT_SUMMON_PORTAL, nextPortalTime);
Events.RescheduleEvent(EVENT_NEXT_PORTAL, nextPortalTime);
} }
protected: protected:
EventMap Events; EventMap Events;
uint32 EventState;
uint32 RiftPortalCount;
uint32 ShieldPercent;
uint32 LastSummonRiftSpell;
uint32 OpenRiftPortalsCount;
}; };
}; };
@@ -15,39 +15,95 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/*
* Movement for Shadow Council Enforcer is NYI
* All visuals around Medivh are NYI (see creatures spawned around Medivh)
* Timers at which we summon portals requires to be revisited
* The way we summon portals may be not entirely correct and requires additional research
Current handling is:
1. First portal is opened when event starts (correct)
2. When Rift Lord or Rift Keeper is defeated, next portal is spawned after 0-5s (timer seems correct)
3. When we summon boss, we summon no more portals until boss is defeated (seems to be correct)
4. We summon next portal even if previous was not closed. We can have maximum 5 normal portals + 1 boss portal active at once (to be verified)
5. We summon no new portal imediately after closing any portal if we already have more than one portal active(to be verified)
*/
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "GameObject.h"
#include "InstanceScript.h" #include "InstanceScript.h"
#include "Log.h"
#include "Map.h" #include "Map.h"
#include "ObjectAccessor.h" #include "Player.h"
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellInfo.h" #include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "the_black_morass.h" #include "the_black_morass.h"
enum MedivhBm enum MedivhBlackMorassTexts
{ {
// Medivh
SAY_ENTER = 0, SAY_ENTER = 0,
SAY_WEAK75 = 2, SAY_SHIELD_75 = 1,
SAY_WEAK50 = 3, SAY_SHIELD_50 = 2,
SAY_WEAK25 = 4, SAY_SHIELD_25 = 3,
SAY_WIN = 4,
SAY_DEATH = 5, SAY_DEATH = 5,
SAY_WIN = 6, SAY_ORCS = 6,
SAY_ORCS_ENTER = 7,
SAY_ORCS_ANSWER = 8,
SPELL_CHANNEL = 31556, // Shadow Council Enforcer
SPELL_PORTAL_RUNE = 32570, // aura(portal on ground effect) SAY_RETREAT = 0
};
SPELL_BLACK_CRYSTAL = 32563, // aura enum MedivhBlackMorassSpells
SPELL_PORTAL_CRYSTAL = 32564, // summon {
// Medivh
SPELL_MANA_SHIELD = 31635,
SPELL_MEDIVH_CHANNEL = 31556,
SPELL_QUIET_SUICIDE = 3617,
SPELL_BANISH_PURPLE = 32566, // aura // Dark Portal Dummy 1.30
SPELL_BANISH_GREEN = 32567, // aura SPELL_PORTAL_RUNE = 32570, // NYI
SPELL_CORRUPT = 31326, // Dark Portal Black Crystal Invisible Stalker
SPELL_CORRUPT_AEONUS = 37853, SPELL_BLACK_CRYSTAL = 32563, // NYI
// Dark Portal Dummy
SPELL_PORTAL_CRYSTAL = 32564, // NYI
// Dark Portal Beam Invisible Stalker
SPELL_BANISH_PURPLE = 32566, // NYI
// Time Rift
SPELL_TIME_RIFT_PERIODIC = 31320,
// NYI // NYI
SPELL_SUMMON_TIME_RIFT_PERIODIC_90 = 31353,
SPELL_SUMMON_TIME_RIFT_PERIODIC_120 = 31632,
SPELL_SUMMON_TIME_RIFT_PERIODIC_45 = 31636,
SPELL_SUMMON_TIME_RIFT_PERIODIC_75 = 31637,
SPELL_SUMMON_TIME_RIFT_PERIODIC_30 = 34188,
SPELL_SUMMON_TIME_RIFT_PERIODIC_5 = 35143,
SPELL_SUMMON_TIME_RIFT = 39041,
SPELL_TIME_RIFT_1_READY = 39570,
SPELL_TIME_RIFT_2_READY = 39571,
SPELL_TIME_RIFT_3_READY = 39572,
SPELL_TIME_RIFT_4_READY = 39573,
SPELL_TIME_RIFT_READY_PRIMER = 31352,
SPELL_MEDIVH_LIVES = 31395,
SPELL_MEDIVH_DIES = 31327,
SPELL_MEDIVH_SHIELD = 32613,
// Scripts
SPELL_TIME_RIFT_CHANNEL = 31387,
SPELL_DRAGON_HELPER_EFFECT = 31483,
SPELL_CLOSE_TIME_RIFT_EFFECT = 31323,
SPELL_SUMMON_RIFT_LORD = 31321,
SPELL_SUMMON_RIFT_LORD_2 = 36234,
SPELL_SUMMON_RIFT_KEEPER = 36235,
SPELL_SUMMON_RIFT_KEEPER_2 = 36236,
SPELL_SUMMON_INFINITE_WHELP = 37606, SPELL_SUMMON_INFINITE_WHELP = 37606,
SPELL_SUMMON_INFINITE_ASSASSIN = 31318, SPELL_SUMMON_INFINITE_ASSASSIN = 31318,
SPELL_SUMMON_INFINITE_ASSASSIN_2 = 36229, SPELL_SUMMON_INFINITE_ASSASSIN_2 = 36229,
@@ -58,320 +114,478 @@ enum MedivhBm
SPELL_SUMMON_INFINITE_VANQUISHER = 33364, SPELL_SUMMON_INFINITE_VANQUISHER = 33364,
SPELL_SUMMON_INFINITE_VANQUISHER_2 = 36233, SPELL_SUMMON_INFINITE_VANQUISHER_2 = 36233,
SPELL_SUMMON_RIFT_LORD = 31321,
SPELL_SUMMON_RIFT_LORD_2 = 36234,
SPELL_SUMMON_RIFT_KEEPER = 36235,
SPELL_SUMMON_RIFT_KEEPER_2 = 36236,
SPELL_SUMMON_CHRONO_LORD_DEJA = 31391, SPELL_SUMMON_CHRONO_LORD_DEJA = 31391,
SPELL_SUMMON_TEMPORUS = 31392, SPELL_SUMMON_TEMPORUS = 31392,
SPELL_SUMMON_AEONUS = 31393, SPELL_SUMMON_AEONUS = 31393,
SPELL_SUMMON_INFINITE_CHRONO_LORD = 37177, SPELL_SUMMON_INFINITE_CHRONO_LORD = 37177,
SPELL_SUMMON_INFINITE_TIMEREAVER = 37178, SPELL_SUMMON_INFINITE_TIMEREAVER = 37178
SPELL_SUMMON_TIME_RIFT_PERIODIC_90 = 31353,
SPELL_SUMMON_TIME_RIFT_PERIODIC_120 = 31632,
SPELL_SUMMON_TIME_RIFT_PERIODIC_45 = 31636,
SPELL_SUMMON_TIME_RIFT_PERIODIC_75 = 31637,
SPELL_SUMMON_TIME_RIFT_PERIODIC_30 = 34188,
SPELL_SUMMON_TIME_RIFT_PERIODIC_5 = 35143,
SPELL_SUMMON_TIME_RIFT_EFFECT_1 = 31354,
SPELL_SUMMON_TIME_RIFT_EFFECT_2 = 31355,
SPELL_SUMMON_TIME_RIFT_EFFECT_3 = 31356,
SPELL_SUMMON_TIME_RIFT_EFFECT_4 = 31357,
SPELL_SUMMON_TIME_RIFT = 39041,
SPELL_TIME_RIFT_1_READY = 39570,
SPELL_TIME_RIFT_2_READY = 39571,
SPELL_TIME_RIFT_3_READY = 39572,
SPELL_TIME_RIFT_4_READY = 39573,
SPELL_CLOSE_TIME_RIFT_TRIGGER = 31322,
SPELL_CLOSE_TIME_RIFT_EFFECT = 31323,
SPELL_TIME_RIFT_READY_PRIMER = 31352,
SPELL_TIME_RIFT_CHANNEL = 31387,
SPELL_TIME_RIFT_CHANNEL_TRIGGER = 31388,
SPELL_TIME_RIFT_PERIODIC = 31320,
SPELL_MEDIVH_LIVES = 31395,
SPELL_MEDIVH_DIES = 31327,
SPELL_MEDIVH_SHIELD = 32613,
SPELL_THE_BLACK_MORASS_COMPLETE = 37215,
C_COUNCIL_ENFORCER = 17023
}; };
enum MedivhBlackMorassEvents
{
EVENT_EPILOGUE_1 = 1,
EVENT_EPILOGUE_2,
EVENT_EPILOGUE_3,
EVENT_EPILOGUE_4,
EVENT_EPILOGUE_5,
EVENT_EPILOGUE_6,
EVENT_EPILOGUE_7,
EVENT_EPILOGUE_8
};
enum MedivhBlackMorassMisc
{
ACTION_START_EVENT = 0,
GO_DARK_PORTAL = 185103,
SPAWN_GROUP_ENFORCERS_1 = 377,
SPAWN_GROUP_ENFORCERS_2 = 378,
SPAWN_GROUP_ENFORCERS_3 = 379,
SPAWN_GROUP_ENFORCERS_4 = 380
};
// 15608 - Medivh
struct npc_medivh_bm : public ScriptedAI struct npc_medivh_bm : public ScriptedAI
{ {
npc_medivh_bm(Creature* creature) : ScriptedAI(creature) using ScriptedAI::ScriptedAI;
void JustAppeared() override
{ {
Initialize(); DoCastSelf(SPELL_MANA_SHIELD);
instance = creature->GetInstanceScript(); DoCastSelf(SPELL_MEDIVH_CHANNEL);
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
} }
void Initialize() void DoAction(int32 action) override
{ {
SpellCorrupt_Timer = 0; switch (action)
Check_Timer = 0;
Life75 = true;
Life50 = true;
Life25 = true;
}
InstanceScript* instance;
uint32 SpellCorrupt_Timer;
uint32 Check_Timer;
bool Life75;
bool Life50;
bool Life25;
void Reset() override
{ {
Initialize(); case ACTION_START_EVENT:
if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
DoCast(me, SPELL_CHANNEL, true);
else if (me->HasAura(SPELL_CHANNEL))
me->RemoveAura(SPELL_CHANNEL);
}
void MoveInLineOfSight(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
{
if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS || instance->GetData(TYPE_MEDIVH) == DONE)
return;
Talk(SAY_ENTER); Talk(SAY_ENTER);
instance->SetData(TYPE_MEDIVH, IN_PROGRESS); DoCastSelf(SPELL_MEDIVH_CHANNEL);
DoCast(me, SPELL_CHANNEL, false); break;
Check_Timer = 5000; case ACTION_SHIELD_75:
Talk(SAY_SHIELD_75);
break;
case ACTION_SHIELD_50:
Talk(SAY_SHIELD_50);
break;
case ACTION_SHIELD_25:
Talk(SAY_SHIELD_25);
break;
case ACTION_SHIELD_0:
DoDespawnSpawns();
DoCastSelf(SPELL_QUIET_SUICIDE, true);
break;
case ACTION_EPILOGUE:
_events.ScheduleEvent(EVENT_EPILOGUE_1, 0s);
break;
default:
break;
} }
else if (who->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(who, 15.0f)) }
void DoDespawnSpawns()
{ {
if (instance->GetData(TYPE_MEDIVH) != IN_PROGRESS) std::vector<Creature*> spawns;
return;
uint32 entry = who->GetEntry(); GetCreatureListWithEntryInGrid(spawns, me, NPC_TIME_RIFT, 500.0f);
if (entry == NPC_INFINITE_ASSASIN || entry == NPC_INFINITE_WHELP || entry == NPC_INFINITE_CRONOMANCER || entry == NPC_INFINITE_EXECUTIONER || entry == NPC_INFINITE_VANQUISHER) GetCreatureListWithEntryInGrid(spawns, me, NPC_RIFT_LORD, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_RIFT_LORD_ALT, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_RIFT_KEEPER, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_RIFT_KEEPER_ALT, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_CRONO_LORD_DEJA, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_TEMPORUS, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_AEONUS, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_CHRONO_LORD, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_TIMEREAVER, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_WHELP, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_ASSASIN, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_ASSASIN_ALT, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_CRONOMANCER, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_CRONOMANCER_ALT, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_EXECUTIONER, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_EXECUTIONER_ALT, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_VANQUISHER, 500.0f);
GetCreatureListWithEntryInGrid(spawns, me, NPC_INFINITE_VANQUISHER_ALT, 500.0f);
for (Creature* spawn : spawns)
if (spawn->IsAlive())
spawn->DespawnOrUnsummon();
}
void JustDied(Unit* /*killer*/) override
{ {
who->StopMoving();
who->CastSpell(me, SPELL_CORRUPT, false);
}
else if (entry == NPC_AEONUS)
{
who->StopMoving();
who->CastSpell(me, SPELL_CORRUPT_AEONUS, false);
}
}
}
void AttackStart(Unit* /*who*/) override
{
//if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
// return;
//ScriptedAI::AttackStart(who);
}
void JustEngagedWith(Unit* /*who*/) override { }
void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
{
if (SpellCorrupt_Timer)
return;
if (spellInfo->Id == SPELL_CORRUPT_AEONUS)
SpellCorrupt_Timer = 1000;
if (spellInfo->Id == SPELL_CORRUPT)
SpellCorrupt_Timer = 3000;
}
void JustDied(Unit* killer) override
{
if (killer && killer->GetEntry() == me->GetEntry())
return;
Talk(SAY_DEATH); Talk(SAY_DEATH);
} }
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
{ {
if (SpellCorrupt_Timer) _events.Update(diff);
{
if (SpellCorrupt_Timer <= diff)
{
instance->SetData(TYPE_MEDIVH, SPECIAL);
if (me->HasAura(SPELL_CORRUPT_AEONUS)) while (uint32 eventId = _events.ExecuteEvent())
SpellCorrupt_Timer = 1000;
else if (me->HasAura(SPELL_CORRUPT))
SpellCorrupt_Timer = 3000;
else
SpellCorrupt_Timer = 0;
} else SpellCorrupt_Timer -= diff;
}
if (Check_Timer)
{ {
if (Check_Timer <= diff) switch (eventId)
{
uint32 pct = instance->GetData(DATA_SHIELD);
Check_Timer = 5000;
if (Life25 && pct <= 25)
{
Talk(SAY_WEAK25);
Life25 = false;
}
else if (Life50 && pct <= 50)
{
Talk(SAY_WEAK50);
Life50 = false;
}
else if (Life75 && pct <= 75)
{
Talk(SAY_WEAK75);
Life75 = false;
}
//if we reach this it means event was running but at some point reset.
if (instance->GetData(TYPE_MEDIVH) == NOT_STARTED)
{
me->DespawnOrUnsummon();
me->Respawn();
return;
}
if (instance->GetData(TYPE_RIFT) == DONE)
{ {
case EVENT_EPILOGUE_1:
// Guessed. What should happen if portals weren't closed but Aeonus was defeated and epilogue was triggered?
DoDespawnSpawns();
me->RemoveAurasDueToSpell(SPELL_MEDIVH_CHANNEL);
_events.ScheduleEvent(EVENT_EPILOGUE_2, 10s);
break;
case EVENT_EPILOGUE_2:
me->SetFacingTo(6.2657318115234375f);
Talk(SAY_WIN); Talk(SAY_WIN);
Check_Timer = 0; me->SetImmuneToPC(false);
me->SetEmoteState(EMOTE_STATE_TALK);
if (me->HasAura(SPELL_CHANNEL)) me->SummonGameObject(GO_DARK_PORTAL, -2087.3372f, 7125.657f, 29.942312f, 6.143561f, QuaternionData(0.f, 0.f, -0.069755554f, 0.99756414f), 0s);
me->RemoveAura(SPELL_CHANNEL); _events.ScheduleEvent(EVENT_EPILOGUE_3, 18s);
break;
/// @todo start the post-event here case EVENT_EPILOGUE_3:
instance->SetData(TYPE_MEDIVH, DONE); me->SetFacingTo(3.001966238021850585f);
me->SetEmoteState(EMOTE_ONESHOT_NONE);
me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
_events.ScheduleEvent(EVENT_EPILOGUE_4, 1s);
break;
case EVENT_EPILOGUE_4:
me->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_ENFORCERS_1);
_events.ScheduleEvent(EVENT_EPILOGUE_5, 2s);
break;
case EVENT_EPILOGUE_5:
me->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_ENFORCERS_2);
_events.ScheduleEvent(EVENT_EPILOGUE_6, 2400ms);
break;
case EVENT_EPILOGUE_6:
me->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_ENFORCERS_3);
_events.ScheduleEvent(EVENT_EPILOGUE_7, 2400ms);
break;
case EVENT_EPILOGUE_7:
me->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_ENFORCERS_4);
_events.ScheduleEvent(EVENT_EPILOGUE_8, 8s);
break;
case EVENT_EPILOGUE_8:
Talk(SAY_ORCS);
break;
default:
break;
}
} }
} else Check_Timer -= diff;
} }
//if (!UpdateVictim()) private:
//return; EventMap _events;
//DoMeleeAttackIfReady();
}
};
struct Wave
{
uint32 PortalMob[4]; //spawns for portal waves (in order)
};
static Wave PortalWaves[]=
{
{ {NPC_INFINITE_ASSASIN, NPC_INFINITE_WHELP, NPC_INFINITE_CRONOMANCER, 0} },
{ {NPC_INFINITE_EXECUTIONER, NPC_INFINITE_CRONOMANCER, NPC_INFINITE_WHELP, NPC_INFINITE_ASSASIN} },
{ {NPC_INFINITE_EXECUTIONER, NPC_INFINITE_VANQUISHER, NPC_INFINITE_CRONOMANCER, NPC_INFINITE_ASSASIN} }
}; };
// 17838 - Time Rift
struct npc_time_rift : public ScriptedAI struct npc_time_rift : public ScriptedAI
{ {
npc_time_rift(Creature* creature) : ScriptedAI(creature) using ScriptedAI::ScriptedAI;
void JustAppeared() override
{ {
Initialize(); DoCastSelf(SPELL_TIME_RIFT_PERIODIC);
instance = creature->GetInstanceScript(); }
};
// 31326 - Corrupt Medivh
class spell_black_morass_corrupt_medivh : public AuraScript
{
void OnPeriodic(AuraEffect const* aurEff)
{
if (aurEff->GetTickNumber() % 3)
if (InstanceScript* instance = GetTarget()->GetInstanceScript())
instance->SetData(DATA_SHIELD_PCT, SPECIAL);
} }
void Initialize() void Register() override
{ {
TimeRiftWave_Timer = 15000; OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_morass_corrupt_medivh::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
mRiftWaveCount = 0; }
mWaveId = 0; };
// 37853 - Corrupt Medivh
class spell_black_morass_corrupt_medivh_aeonus : public AuraScript
{
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
if (InstanceScript* instance = GetTarget()->GetInstanceScript())
instance->SetData(DATA_SHIELD_PCT, SPECIAL);
} }
InstanceScript* instance; void Register() override
uint32 TimeRiftWave_Timer;
uint8 mRiftWaveCount;
uint8 mWaveId;
void Reset() override
{ {
Initialize(); OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_morass_corrupt_medivh_aeonus::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
uint8 mPortalCount = instance->GetData(DATA_PORTAL_COUNT);
if (mPortalCount < 6)
mWaveId = 0;
else if (mPortalCount > 12)
mWaveId = 2;
else mWaveId = 1;
} }
void JustEngagedWith(Unit* /*who*/) override { } };
void DoSummonAtRift(uint32 creature_entry) // 31388 - Time Rift Channel Trigger
class spell_black_morass_time_rift_channel_trigger : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
if (!creature_entry) return ValidateSpellInfo({ SPELL_TIME_RIFT_CHANNEL });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (TempSummon* summon = GetCaster()->ToTempSummon())
if (Unit* summoner = summon->GetSummonerUnit())
summoner->CastSpell(summon, SPELL_TIME_RIFT_CHANNEL);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_black_morass_time_rift_channel_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 31550 - Banish Dragon Helper
class spell_black_morass_banish_dragon_helper : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRAGON_HELPER_EFFECT });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastSpell(nullptr, SPELL_DRAGON_HELPER_EFFECT, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_black_morass_banish_dragon_helper::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 31322 - Close Time Rift Trigger
class spell_black_morass_close_time_rift_trigger : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CLOSE_TIME_RIFT_EFFECT });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (TempSummon* summon = GetCaster()->ToTempSummon())
if (Unit* summoner = summon->GetSummonerUnit())
summon->CastSpell(summoner, SPELL_CLOSE_TIME_RIFT_EFFECT);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_black_morass_close_time_rift_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 31323 - Close Time Rift Effect
class spell_black_morass_close_time_rift_effect : public SpellScript
{
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Creature* creature = GetHitUnit()->ToCreature())
creature->DespawnOrUnsummon();
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_black_morass_close_time_rift_effect::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 31320 - Time Rift Periodic
class spell_black_morass_time_rift_periodic : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_SUMMON_RIFT_LORD,
SPELL_SUMMON_RIFT_LORD_2,
SPELL_SUMMON_RIFT_KEEPER,
SPELL_SUMMON_RIFT_KEEPER_2,
SPELL_SUMMON_INFINITE_WHELP,
SPELL_SUMMON_INFINITE_ASSASSIN,
SPELL_SUMMON_INFINITE_ASSASSIN_2,
SPELL_SUMMON_INFINITE_CHRONOMANCER,
SPELL_SUMMON_INFINITE_CHRONOMANCER_2,
SPELL_SUMMON_INFINITE_EXECUTIONER,
SPELL_SUMMON_INFINITE_EXECUTIONER_2,
SPELL_SUMMON_INFINITE_VANQUISHER,
SPELL_SUMMON_INFINITE_VANQUISHER_2,
SPELL_SUMMON_CHRONO_LORD_DEJA,
SPELL_SUMMON_TEMPORUS,
SPELL_SUMMON_AEONUS,
SPELL_SUMMON_INFINITE_CHRONO_LORD,
SPELL_SUMMON_INFINITE_TIMEREAVER
});
}
bool Load() override
{
if (InstanceScript* instance = GetOwner()->GetInstanceScript())
{
_instance = instance;
_riftCount = instance->GetData(DATA_RIFT_COUNT);
if (_riftCount < 7)
_riftWaveId = 0;
else if (_riftCount > 6 && _riftCount < 13)
_riftWaveId = 1;
else if (_riftCount > 12)
_riftWaveId = 2;
return true;
}
return false;
}
void OnPeriodic(AuraEffect const* aurEff)
{
if (_isLastRift)
return; return;
if (instance->GetData(TYPE_MEDIVH) != IN_PROGRESS) Unit* target = GetTarget();
if (_isFirstSummon)
{ {
me->InterruptNonMeleeSpells(true); switch (_riftCount)
me->RemoveAllAuras(); {
return; case 6:
target->CastSpell(nullptr, (_instance->GetBossState(DATA_DEJA) == DONE && target->GetMap()->IsHeroic()) ?
SPELL_SUMMON_INFINITE_CHRONO_LORD : SPELL_SUMMON_CHRONO_LORD_DEJA, true);
break;
case 12:
target->CastSpell(nullptr, (_instance->GetBossState(DATA_TEMPORUS) == DONE && target->GetMap()->IsHeroic()) ?
SPELL_SUMMON_INFINITE_TIMEREAVER : SPELL_SUMMON_TEMPORUS, true);
break;
case 18:
target->CastSpell(nullptr, SPELL_SUMMON_AEONUS, true);
_isLastRift = true;
break;
default:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_RIFT_LORD, SPELL_SUMMON_RIFT_LORD_2, SPELL_SUMMON_RIFT_KEEPER, SPELL_SUMMON_RIFT_KEEPER_2), true);
break;
} }
Position pos = me->GetRandomNearPosition(10.0f); _isFirstSummon = false;
const_cast<AuraEffect*>(aurEff)->ResetTicks();
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(me->GetMap()->GetHeight(me->GetPhaseShift(), pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(me->GetPhaseShift(), pos.m_positionX, pos.m_positionY));
if (Unit* Summon = DoSummon(creature_entry, pos, 30s, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
if (Unit* temp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH)))
AddThreat(temp, 0.0f, Summon);
} }
else
void DoSelectSummon()
{ {
if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) switch (_riftWaveId)
mRiftWaveCount = 0;
uint32 entry = 0;
entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount];
TC_LOG_DEBUG("scripts", "npc_time_rift: summoning wave Creature (Wave {}, Entry {}).", mRiftWaveCount, entry);
++mRiftWaveCount;
if (entry == NPC_INFINITE_WHELP)
{ {
case 0:
{
switch (aurEff->GetTickNumber())
{
case 1:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_ASSASSIN, SPELL_SUMMON_INFINITE_ASSASSIN_2), true);
break;
case 2:
for (uint8 i = 0; i < 3; ++i) for (uint8 i = 0; i < 3; ++i)
DoSummonAtRift(entry); target->CastSpell(nullptr, SPELL_SUMMON_INFINITE_WHELP, true);
} else DoSummonAtRift(entry); break;
case 3:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_CHRONOMANCER, SPELL_SUMMON_INFINITE_CHRONOMANCER_2), true);
const_cast<AuraEffect*>(aurEff)->ResetTicks();
break;
default:
break;
}
break;
}
case 1:
{
switch (aurEff->GetTickNumber())
{
case 1:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_EXECUTIONER, SPELL_SUMMON_INFINITE_EXECUTIONER_2), true);
break;
case 2:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_CHRONOMANCER, SPELL_SUMMON_INFINITE_CHRONOMANCER_2), true);
break;
case 3:
for (uint8 i = 0; i < 3; ++i)
target->CastSpell(nullptr, SPELL_SUMMON_INFINITE_WHELP, true);
break;
case 4:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_ASSASSIN, SPELL_SUMMON_INFINITE_ASSASSIN_2), true);
const_cast<AuraEffect*>(aurEff)->ResetTicks();
break;
default:
break;
}
break;
}
case 2:
{
switch (aurEff->GetTickNumber())
{
case 1:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_EXECUTIONER, SPELL_SUMMON_INFINITE_EXECUTIONER_2), true);
break;
case 2:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_VANQUISHER, SPELL_SUMMON_INFINITE_VANQUISHER_2), true);
break;
case 3:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_CHRONOMANCER, SPELL_SUMMON_INFINITE_CHRONOMANCER_2), true);
break;
case 4:
target->CastSpell(nullptr, RAND(SPELL_SUMMON_INFINITE_ASSASSIN, SPELL_SUMMON_INFINITE_ASSASSIN_2), true);
const_cast<AuraEffect*>(aurEff)->ResetTicks();
break;
default:
break;
}
break;
}
default:
break;
}
}
} }
void UpdateAI(uint32 diff) override void Register() override
{ {
if (TimeRiftWave_Timer <= diff) OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_morass_time_rift_periodic::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
private:
uint32 _riftCount = 0;
uint32 _riftWaveId = 0;
bool _isLastRift = false;
bool _isFirstSummon = true;
InstanceScript* _instance = nullptr;
};
// 4288
class at_black_morass_medivh : public AreaTriggerScript
{
public:
at_black_morass_medivh() : AreaTriggerScript("at_black_morass_medivh") { }
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
{ {
DoSelectSummon(); if (InstanceScript* instance = player->GetInstanceScript())
TimeRiftWave_Timer = 15000; {
} else TimeRiftWave_Timer -= diff; if (instance->GetBossState(DATA_AEONUS) == DONE || instance->GetData(DATA_EVENT) == IN_PROGRESS || instance->GetData(DATA_EVENT) == DONE)
return false;
if (me->IsNonMeleeSpellCast(false)) if (Creature* medivh = instance->GetCreature(DATA_MEDIVH))
return; {
if (medivh->IsAlive())
{
medivh->AI()->DoAction(ACTION_START_EVENT);
instance->SetData(DATA_EVENT, IN_PROGRESS);
}
}
TC_LOG_DEBUG("scripts", "npc_time_rift: not casting anylonger, i need to die."); return false;
me->setDeathState(JUST_DIED); }
return false;
if (instance->GetData(TYPE_RIFT) == IN_PROGRESS)
instance->SetData(TYPE_RIFT, SPECIAL);
} }
}; };
@@ -379,4 +593,12 @@ void AddSC_the_black_morass()
{ {
RegisterBlackMorassCreatureAI(npc_medivh_bm); RegisterBlackMorassCreatureAI(npc_medivh_bm);
RegisterBlackMorassCreatureAI(npc_time_rift); RegisterBlackMorassCreatureAI(npc_time_rift);
RegisterSpellScript(spell_black_morass_corrupt_medivh);
RegisterSpellScript(spell_black_morass_corrupt_medivh_aeonus);
RegisterSpellScript(spell_black_morass_time_rift_channel_trigger);
RegisterSpellScript(spell_black_morass_banish_dragon_helper);
RegisterSpellScript(spell_black_morass_close_time_rift_trigger);
RegisterSpellScript(spell_black_morass_close_time_rift_effect);
RegisterSpellScript(spell_black_morass_time_rift_periodic);
new at_black_morass_medivh();
} }
@@ -23,18 +23,20 @@
#define TBMScriptName "instance_the_black_morass" #define TBMScriptName "instance_the_black_morass"
#define DataHeader "TBM" #define DataHeader "TBM"
uint32 const EncounterCount = 2; uint32 constexpr EncounterCount = 3;
enum TBMDataTypes enum TBMDataTypes
{ {
TYPE_MEDIVH = 1, DATA_DEJA = 0,
TYPE_RIFT = 2, DATA_TEMPORUS = 1,
TYPE_AEONUS = 3, DATA_AEONUS = 2,
TYPE_TEMPORUS = 4,
TYPE_CRONO_LORD_DEJA = 5, DATA_MEDIVH,
DATA_MEDIVH = 10, DATA_SAAT,
DATA_PORTAL_COUNT = 11, DATA_EVENT,
DATA_SHIELD = 12 DATA_RIFT,
DATA_RIFT_COUNT,
DATA_SHIELD_PCT
}; };
enum TBMWorldStateIds enum TBMWorldStateIds
@@ -44,27 +46,59 @@ enum TBMWorldStateIds
WORLD_STATE_BM_RIFT = 2784 WORLD_STATE_BM_RIFT = 2784
}; };
enum TBMQuestIds enum TBMSpellIds
{ {
QUEST_OPENING_PORTAL = 10297, SPELL_THE_BLACK_MORASS_COMPLETE = 37215,
QUEST_MASTER_TOUCH = 9836 SPELL_THE_MASTERS_TOUCH_COMPLETE = 39539,
SPELL_SUMMON_TIME_RIFT_EFFECT_1 = 31354,
SPELL_SUMMON_TIME_RIFT_EFFECT_2 = 31355,
SPELL_SUMMON_TIME_RIFT_EFFECT_3 = 31356,
SPELL_SUMMON_TIME_RIFT_EFFECT_4 = 31357
}; };
enum TBMCreatureIds enum TBMCreatureIds
{ {
NPC_MEDIVH = 15608, NPC_MEDIVH = 15608,
NPC_TIME_RIFT = 17838, NPC_SAAT = 20201,
NPC_TIME_KEEPER = 17918, NPC_TIME_KEEPER = 17918,
NPC_RIFT_KEEPER = 21104, NPC_TIME_RIFT = 17838,
NPC_RIFT_LORD = 17839, NPC_RIFT_LORD = 17839,
NPC_RIFT_LORD_ALT = 21140,
NPC_RIFT_KEEPER = 21104,
NPC_RIFT_KEEPER_ALT = 21148,
NPC_CRONO_LORD_DEJA = 17879, NPC_CRONO_LORD_DEJA = 17879,
NPC_TEMPORUS = 17880, NPC_TEMPORUS = 17880,
NPC_AEONUS = 17881, NPC_AEONUS = 17881,
NPC_INFINITE_ASSASIN = 17835, NPC_INFINITE_CHRONO_LORD = 21697,
NPC_INFINITE_TIMEREAVER = 21698,
NPC_INFINITE_WHELP = 21818, NPC_INFINITE_WHELP = 21818,
NPC_INFINITE_ASSASIN = 17835,
NPC_INFINITE_ASSASIN_ALT = 21137,
NPC_INFINITE_CRONOMANCER = 17892, NPC_INFINITE_CRONOMANCER = 17892,
NPC_INFINITE_CRONOMANCER_ALT = 21136,
NPC_INFINITE_EXECUTIONER = 18994, NPC_INFINITE_EXECUTIONER = 18994,
NPC_INFINITE_VANQUISHER = 18995 NPC_INFINITE_EXECUTIONER_ALT = 21138,
NPC_INFINITE_VANQUISHER = 18995,
NPC_INFINITE_VANQUISHER_ALT = 21139
};
enum TBMActionIds
{
ACTION_SHIELD_75 = 1560800,
ACTION_SHIELD_50 = 1560801,
ACTION_SHIELD_25 = 1560802,
ACTION_SHIELD_0 = 1560803,
ACTION_EPILOGUE = 1560804
};
enum TBMEventIds
{
EVENT_SUMMON_PORTAL = 1,
EVENT_SUMMON_TIME_RIFT_1 = 11137,
EVENT_SUMMON_TIME_RIFT_2 = 11138,
EVENT_SUMMON_TIME_RIFT_3 = 11139,
EVENT_SUMMON_TIME_RIFT_4 = 11140
}; };
template <class AI, class T> template <class AI, class T>