From e21e7cd2e26361d18d57a7c4ec002dbf0abe8ffc Mon Sep 17 00:00:00 2001 From: Chazy Chaz Date: Fri, 5 May 2017 05:52:49 +0200 Subject: Scripts/Commands: Update reload commands names (cherry picked from commit 4843544c217800ba56b3084a8b1ca2fcf62cb091) --- .../world/master/2020_06_14_00_world_2017_05_05_00_world.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_00_world_2017_05_05_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_00_world_2017_05_05_00_world.sql b/sql/updates/world/master/2020_06_14_00_world_2017_05_05_00_world.sql new file mode 100644 index 00000000000..47f6822d310 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_00_world_2017_05_05_00_world.sql @@ -0,0 +1,7 @@ +UPDATE command SET name = 'reload achievement_reward_locale', help = 'Syntax: .reload achievement_reward_locale\nReload achievement_reward_locale table.' WHERE permission = 657; +UPDATE command SET name = 'reload creature_template_locale', help = 'Syntax: .reload creature_template_locale\nReload creature_template_locale table.' WHERE permission = 658; +UPDATE command SET name = 'reload creature_text_locale', help = 'Syntax: .reload creature_text_locale\nReload creature_text_locale Table.' WHERE permission = 659; +UPDATE command SET name = 'reload gameobject_template_locale', help = 'Syntax: .reload gameobject_template_locale\nReload gameobject_template_locale table.' WHERE permission = 660; +UPDATE command SET name = 'reload gossip_menu_option_locale', help = 'Syntax: .reload gossip_menu_option_locale\nReload gossip_menu_option_locale table.' WHERE permission = 661; +UPDATE command SET name = 'reload page_tex_locale', help = 'Syntax: .reload page_tex_locale\nReload page_tex_locale table.' WHERE permission = 665; +UPDATE command SET name = 'reload points_of_interest_locale', help = 'Syntax: .reload points_of_interest_locale\nReload points_of_interest_locale table.' WHERE permission = 666; -- cgit v1.2.3 From 8ded7e576ecd4aede905f7fcebfef029d85602c3 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 6 May 2017 04:45:53 +0200 Subject: Typo fix (cherry picked from commit 9ae53d25779292b9c0a76d40dfa2e3f910fdeaf2) --- sql/updates/world/master/2020_06_14_01_world_2017_05_06_00_world.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/master/2020_06_14_01_world_2017_05_06_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_01_world_2017_05_06_00_world.sql b/sql/updates/world/master/2020_06_14_01_world_2017_05_06_00_world.sql new file mode 100644 index 00000000000..fa58a86f325 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_01_world_2017_05_06_00_world.sql @@ -0,0 +1 @@ +UPDATE command SET name = 'reload page_text_locale', help = 'Syntax: .reload page_text_locale\nReload page_text_locale table.' WHERE permission = 665; -- cgit v1.2.3 From 6a76d5c851d715575e4a64a1da62fc16b5a59d88 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 7 May 2017 08:15:52 +0200 Subject: DB/Misc: Fix PK for gossip_menu_option_locale (cherry picked from commit c06f0bea9a9fc39474f64dca6b6eb2ace56cf8fb) --- sql/updates/world/master/2020_06_14_02_world_2017_05_07_01_world.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_02_world_2017_05_07_01_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_02_world_2017_05_07_01_world.sql b/sql/updates/world/master/2020_06_14_02_world_2017_05_07_01_world.sql new file mode 100644 index 00000000000..f33d464ab21 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_02_world_2017_05_07_01_world.sql @@ -0,0 +1,4 @@ +-- +ALTER TABLE `gossip_menu_option_locale` +DROP PRIMARY KEY, +ADD PRIMARY KEY (`MenuID`, `OptionIndex`, `Locale`); -- cgit v1.2.3 From a74d233cccbefe7bee6fe8547ebba6808a2eeb31 Mon Sep 17 00:00:00 2001 From: Killyana Date: Tue, 9 May 2017 23:01:33 +0200 Subject: DB/Creature: Fallen Earthen Warrior Closes #16559 (cherry picked from commit ccf75008deaefe43ab19062afebf9ef546c18cb9) --- sql/updates/world/master/2020_06_14_03_world_2017_05_09_00_world.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_03_world_2017_05_09_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_03_world_2017_05_09_00_world.sql b/sql/updates/world/master/2020_06_14_03_world_2017_05_09_00_world.sql new file mode 100644 index 00000000000..6134763d355 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_03_world_2017_05_09_00_world.sql @@ -0,0 +1,5 @@ +-- +UPDATE `creature_template` SET `unit_flags`=768, `RegenHealth`=0 WHERE `entry`=26335; +DELETE FROM `creature_template_addon` WHERE `entry`=26335; +INSERT INTO `creature_template_addon` (`entry`, `bytes1`, `bytes2`) VALUES (26335, 7, 1); +UPDATE `creature` SET `curhealth`=1 WHERE `id`=26335; -- cgit v1.2.3 From 9a6c2a4da24b8c412e964c2777f81ac9d79544d5 Mon Sep 17 00:00:00 2001 From: Killyana Date: Wed, 10 May 2017 02:41:50 +0200 Subject: DB/Creature: Arcatraz Sentinel Closes #10647 (cherry picked from commit e036d2232dae839973424707ca7d675fb75af930) --- .../master/2020_06_14_04_world_2017_05_10_00_world.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_04_world_2017_05_10_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_04_world_2017_05_10_00_world.sql b/sql/updates/world/master/2020_06_14_04_world_2017_05_10_00_world.sql new file mode 100644 index 00000000000..57f1bec7778 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_04_world_2017_05_10_00_world.sql @@ -0,0 +1,18 @@ +-- Arcatraz Sentinel (20869, 21586) +DELETE FROM `creature_template_addon` WHERE entry IN (20869, 21586); +INSERT INTO `creature_template_addon` (entry, path_id, mount, bytes1, bytes2, emote, auras) VALUES +(20869, 0, 0, 0, 1, 0, "31261 36716"), +(21586, 0, 0, 0, 1, 0, "31261 38828"); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=20869; +DELETE FROM `smart_scripts` WHERE `entryorguid`=20869 AND `source_type`=0; +INSERT INTO `smart_scripts` VALUES +(20869, 0, 0, 0, 2, 0, 100, 1, 0, 10, 0, 0, 0, '', 11, 36719, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Arcatraz Sentinel - Between 0-2% Health - Cast Spell Explode'), +(20869, 0, 1, 0, 6, 0, 100, 1, 0, 0, 0, 0, 0, '', 11, 37394, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Arcatraz Sentinel - Death - Cast Serverside - Summon Destroyed Sentinel'), +(20869, 0, 2, 3, 10, 0, 100, 1, 0, 15, 0, 0, 1, '', 28, 31261, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Arcatraz Sentinel - ooc los - remove aura'), +(20869, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, '', 49, 0, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 'Arcatraz Sentinel - ooc los - Start attack'); + +-- DELETE FROM `spelldifficulty_dbc` WHERE id IN (36719,36716); +-- INSERT INTO `spelldifficulty_dbc` (`id`,`spellid0`, `spellid1`) VALUES +-- (36719,36719,38830), +-- (36716,36716,38828); -- cgit v1.2.3 From b5ca81855b409a251e3d44db09af9d4218ffe1ff Mon Sep 17 00:00:00 2001 From: Killyana Date: Wed, 10 May 2017 19:47:35 +0200 Subject: DB/Gameobject: Add a missing cosmetic Yellow Teleport (cherry picked from commit cadea4f183c955df86c9d9fc76d801cba8868e3f) --- sql/updates/world/master/2020_06_14_05_world_2017_05_10_02_world.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_05_world_2017_05_10_02_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_05_world_2017_05_10_02_world.sql b/sql/updates/world/master/2020_06_14_05_world_2017_05_10_02_world.sql new file mode 100644 index 00000000000..fd462c4543d --- /dev/null +++ b/sql/updates/world/master/2020_06_14_05_world_2017_05_10_02_world.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `gameobject` WHERE `guid`=59; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnDifficulties`,`PhaseID`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(59, 194026, 571, '0', 0, 3739.33, 3566.95, 341.567, 0.242477, 0, 0, 0.139173, 0.990268, 300, 100, 0); -- cgit v1.2.3 From 058e880d550cdfe7734f13d412313d7ff08eadf8 Mon Sep 17 00:00:00 2001 From: Kittnz Date: Sat, 13 May 2017 19:17:05 +0200 Subject: DB/GameObjects: Add missing gobs for map 450, 560, 329 Mostly chairs and random stuff (cherry picked from commit d04bc1339a9c846ca27681d21116b6355a4e486a) --- .../2020_06_14_06_world_2017_05_13_01_world.sql | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_06_world_2017_05_13_01_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_06_world_2017_05_13_01_world.sql b/sql/updates/world/master/2020_06_14_06_world_2017_05_13_01_world.sql new file mode 100644 index 00000000000..fe3be6bf9ed --- /dev/null +++ b/sql/updates/world/master/2020_06_14_06_world_2017_05_13_01_world.sql @@ -0,0 +1,77 @@ +SET @OGUID:=47713; + +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+72; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`) VALUES +(@OGUID+0 , 176563, 450, 0, 0, '0', 0, -40.41246, 16.34629, -5.145579, 3.455756, 0, 0, -0.9876881, 0.1564362, 7200, 255, 1, '', 23706), -- 176563 (Area: 2917) +(@OGUID+1 , 176566, 450, 0, 0, '0', 0, 206.6491, 66.07558, 25.40491, 3.604106, 0, 0, -0.9733791, 0.2292009, 7200, 255, 0, '', 23706), -- 176566 (Area: 2917) +(@OGUID+2 , 112317, 560, 0, 0, '1,2', 0, 1794.44, 1112.927, 12.46013, 6.204648, 0, 0, -0.03925896, 0.9992291, 7200, 255, 1, '', 23706), -- 112317 (Area: 2369) +(@OGUID+3 , 112316, 560, 0, 0, '1,2', 0, 1795.41, 1111.976, 12.46013, 1.579522, 0, 0, 0.7101851, 0.704015, 7200, 255, 1, '', 23706), -- 112316 (Area: 2369) +(@OGUID+4 , 112319, 560, 0, 0, '1,2', 0, 1808.012, 1112.328, 13.47555, 4.782205, 0, 0, -0.6819973, 0.7313547, 7200, 255, 1, '', 23706), -- 112319 (Area: 2369) +(@OGUID+5 , 112321, 560, 0, 0, '1,2', 0, 1802.565, 1112.28, 13.47555, 4.721118, 0, 0, -0.7040138, 0.7101862, 7200, 255, 1, '', 23706), -- 112321 (Area: 2369) +(@OGUID+6 , 22910, 560, 0, 0, '1,2', 0, 1820.542, 1044.187, 18.65778, 4.71239, 0, 0, -0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 22910 (Area: 2369) +(@OGUID+7 , 22921, 560, 0, 0, '1,2', 0, 1801.726, 1034.977, 11.06904, 5.558876, 0, 0, -0.35429, 0.9351356, 7200, 255, 1, '', 23706), -- 22921 (Area: 2369) +(@OGUID+8 , 22923, 560, 0, 0, '1,2', 0, 1808.022, 1035.029, 11.06904, 4.057892, 0, 0, -0.8968725, 0.4422892, 7200, 255, 1, '', 23706), -- 22923 (Area: 2369) +(@OGUID+9 , 22922, 560, 0, 0, '1,2', 0, 1803.098, 1035.267, 11.06904, 4.729844, 0, 0, -0.7009087, 0.7132511, 7200, 255, 1, '', 23706), -- 22922 (Area: 2369) +(@OGUID+10, 22925, 560, 0, 0, '1,2', 0, 1804.703, 1035.279, 11.06904, 4.729844, 0, 0, -0.7009087, 0.7132511, 7200, 255, 1, '', 23706), -- 22925 (Area: 2369) +(@OGUID+11, 22924, 560, 0, 0, '1,2', 0, 1806.315, 1035.295, 11.06904, 4.598942, 0, 0, -0.7460575, 0.6658815, 7200, 255, 1, '', 23706), -- 22924 (Area: 2369) +(@OGUID+12, 22927, 560, 0, 0, '1,2', 0, 1818.748, 1044.187, 18.65778, 4.71239, 0, 0, -0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 22927 (Area: 2369) +(@OGUID+13, 22926, 560, 0, 0, '1,2', 0, 1801.52, 1033.646, 11.06904, 0.02617911, 0, 0, 0.01308918, 0.9999143, 7200, 255, 1, '', 23706), -- 22926 (Area: 2369) +(@OGUID+14, 184305, 560, 0, 0, '1,2', 0, 1818.346, 1031.224, 11.09751, 3.124123, 0, 0, 0.9999619, 0.008734641, 7200, 255, 1, '', 23706), -- 184305 (Area: 2369) +(@OGUID+15, 180570, 560, 0, 0, '1,2', 0, 1808.454, 1022.87, 13.71209, 1.518436, 0, 0, 0.6883545, 0.7253745, 7200, 255, 1, '', 23706), -- 180570 (Area: 2369) +(@OGUID+16, 184332, 560, 0, 0, '1,2', 0, 1819.035, 1023.37, 19.71265, 4.729844, 0, 0, -0.7009087, 0.7132511, 7200, 255, 1, '', 23706), -- 184332 (Area: 2369 +(@OGUID+17, 22673, 560, 0, 0, '1,2', 0, 1885.541, 1103.728, 18.91458, 2.495818, 0, 0, 0.9483232, 0.3173059, 7200, 255, 1, '', 23706), -- 22673 (Area: 2369) +(@OGUID+18, 22672, 560, 0, 0, '1,2', 0, 1886.727, 1103.384, 18.91458, 1.204277, 0, 0, 0.5664063, 0.8241262, 7200, 255, 1, '', 23706), -- 22672 (Area: 2369) +(@OGUID+19, 22674, 560, 0, 0, '1,2', 0, 1885.833, 1103.073, 18.91458, 5.297076, 0, 0, -0.4733191, 0.8808911, 7200, 255, 1, '', 23706), -- 22674 (Area: 2369) +(@OGUID+20, 22685, 560, 0, 0, '1,2', 0, 1892.805, 1090.597, 23.63159, 2.513274, 0, 0, 0.9510565, 0.3090171, 7200, 255, 1, '', 23706), -- 22685 (Area: 2369) +(@OGUID+21, 22684, 560, 0, 0, '1,2', 0, 1890.807, 1087.847, 23.63159, 2.513274, 0, 0, 0.9510565, 0.3090171, 7200, 255, 1, '', 23706), -- 22684 (Area: 2369) +(@OGUID+22, 22671, 560, 0, 0, '1,2', 0, 1886.854, 1103.559, 23.83143, 1.204277, 0, 0, 0.5664063, 0.8241262, 7200, 255, 1, '', 23706), -- 22671 (Area: 2369) +(@OGUID+23, 22670, 560, 0, 0, '1,2', 0, 1885.96, 1103.248, 23.83143, 5.297076, 0, 0, -0.4733191, 0.8808911, 7200, 255, 1, '', 23706), -- 22670 (Area: 2369) +(@OGUID+24, 112305, 560, 0, 0, '1,2', 0, 1792.475, 1129.977, 13.47555, 4.799657, 0, 0, -0.6755896, 0.7372779, 7200, 255, 1, '', 23706), -- 112305 (Area: 2369) +(@OGUID+25, 112309, 560, 0, 0, '1,2', 0, 1788.27, 1129.94, 13.47555, 4.756022, 0, 0, -0.6915131, 0.7223639, 7200, 255, 1, '', 23706), -- 112309 (Area: 2369) +(@OGUID+26, 112308, 560, 0, 0, '1,2', 0, 1790.442, 1129.959, 13.47555, 4.677484, 0, 0, -0.7193394, 0.6946588, 7200, 255, 1, '', 23706), -- 112308 (Area: 2369) +(@OGUID+27, 112311, 560, 0, 0, '1,2', 0, 1807.419, 1117.274, 13.47555, 1.50098, 0, 0, 0.6819973, 0.7313547, 7200, 255, 1, '', 23706), -- 112311 (Area: 2369) +(@OGUID+28, 112310, 560, 0, 0, '1,2', 0, 1805.387, 1117.256, 13.47555, 1.64061, 0, 0, 0.7313538, 0.6819983, 7200, 255, 1, '', 23706), -- 112310 (Area: 2369) +(@OGUID+29, 112312, 560, 0, 0, '1,2', 0, 1809.591, 1117.293, 13.47555, 1.579522, 0, 0, 0.7101851, 0.704015, 7200, 255, 1, '', 23706), -- 112312 (Area: 2369) +(@OGUID+30, 112301, 560, 0, 0, '1,2', 0, 1805.231, 1130.088, 13.47555, 4.721118, 0, 0, -0.7040138, 0.7101862, 7200, 255, 1, '', 23706), -- 112301 (Area: 2369) +(@OGUID+31, 112303, 560, 0, 0, '1,2', 0, 1809.436, 1130.125, 13.47555, 4.721118, 0, 0, -0.7040138, 0.7101862, 7200, 255, 1, '', 23706), -- 112303 (Area: 2369) +(@OGUID+32, 112302, 560, 0, 0, '1,2', 0, 1807.403, 1130.107, 13.47555, 4.81711, 0, 0, -0.6691303, 0.743145, 7200, 255, 1, '', 23706), -- 112302 (Area: 2369) +(@OGUID+33, 174995, 560, 0, 0, '1,2', 0, 1876.241, 1105.719, 18.84545, 5.654869, 0, 0, -0.3090162, 0.9510568, 7200, 255, 1, '', 23706), -- 174995 (Area: 2369) +(@OGUID+34, 174994, 560, 0, 0, '1,2', 0, 1874.842, 1103.794, 18.84545, 5.654869, 0, 0, -0.3090162, 0.9510568, 7200, 255, 1, '', 23706), -- 174994 (Area: 2369) +(@OGUID+35, 174997, 560, 0, 0, '1,2', 0, 1879.806, 1104.808, 18.84545, 4.084071, 0, 0, -0.8910065, 0.4539906, 7200, 255, 1, '', 23706), -- 174997 (Area: 2369) +(@OGUID+36, 174996, 560, 0, 0, '1,2', 0, 1878.052, 1106.083, 18.84545, 4.084071, 0, 0, -0.8910065, 0.4539906, 7200, 255, 1, '', 23706), -- 174996 (Area: 2369) +(@OGUID+37, 174998, 560, 0, 0, '1,2', 0, 1881.476, 1103.594, 18.84545, 4.084071, 0, 0, -0.8910065, 0.4539906, 7200, 255, 1, '', 23706), -- 174998 (Area: 2369) +(@OGUID+38, 112322, 560, 0, 0, '1,2', 0, 1781.195, 1123.755, 13.47555, 0.04363215, 0, 0, 0.02181435, 0.9997621, 7200, 255, 1, '', 23706), -- 112322 (Area: 2369) +(@OGUID+39, 22904, 560, 0, 0, '1,2', 0, 1822.65, 1035.223, 18.54309, 4.372049, 0, 0, -0.8166418, 0.5771448, 7200, 255, 1, '', 23706), -- 22904 (Area: 2369) +(@OGUID+40, 22909, 560, 0, 0, '1,2', 0, 1813.019, 1022.755, 18.65778, 0.1919871, 0, 0, 0.09584618, 0.9953961, 7200, 255, 1, '', 23706), -- 22909 (Area: 2369) +(@OGUID+41, 22908, 560, 0, 0, '1,2', 0, 1821.753, 1023.72, 11.70037, 3.900813, 0, 0, -0.9288092, 0.3705584, 7200, 255, 1, '', 23706), -- 22908 (Area: 2369) +(@OGUID+42, 36977, 560, 0, 0, '1,2', 0, 1883.635, 1096.758, 18.84545, 5.654869, 0, 0, -0.3090162, 0.9510568, 7200, 255, 1, '', 23706), -- 36977 (Area: 2369) +(@OGUID+43, 3803, 560, 0, 0, '1,2', 0, 1847.715, 1112.489, 16.38847, 1.771508, 0, 0, 0.7743921, 0.632706, 7200, 255, 1, '', 23706), -- 3803 (Area: 2369) +(@OGUID+44, 3804, 560, 0, 0, '1,2', 0, 1846.83, 1112.615, 16.38847, 3.063024, 0, 0, 0.9992285, 0.03927403, 7200, 255, 1, '', 23706), -- 3804 (Area: 2369) +(@OGUID+45, 22915, 560, 0, 0, '1,2', 0, 1820.176, 1023.963, 11.70037, 4.729844, 0, 0, -0.7009087, 0.7132511, 7200, 255, 1, '', 23706), -- 22915 (Area: 2369) +(@OGUID+46, 22915, 560, 0, 0, '1,2', 0, 1820.176, 1023.963, 11.70037, 4.729844, 0, 0, -0.7009087, 0.7132511, 7200, 255, 1, '', 23706), -- 22915 (Area: 2369) +(@OGUID+47, 22917, 560, 0, 0, '1,2', 0, 1821.696, 1020.943, 11.70037, 2.347464, 0, 0, 0.9222002, 0.3867128, 7200, 255, 1, '', 23706), -- 22917 (Area: 2369) +(@OGUID+48, 22916, 560, 0, 0, '1,2', 0, 1818.501, 1023.7, 11.70037, 5.297076, 0, 0, -0.4733191, 0.8808911, 7200, 255, 1, '', 23706), -- 22916 (Area: 2369) +(@OGUID+49, 22919, 560, 0, 0, '1,2', 0, 1822.449, 1032.6, 18.54309, 1.928588, 0, 0, 0.8216467, 0.5699971, 7200, 255, 1, '', 23706), -- 22919 (Area: 2369) +(@OGUID+50, 22918, 560, 0, 0, '1,2', 0, 1820.166, 1020.634, 11.70037, 1.544616, 0, 0, 0.6977901, 0.7163023, 7200, 255, 1, '', 23706), -- 22918 (Area: 2369) +(@OGUID+51, 22920, 560, 0, 0, '1,2', 0, 1818.606, 1020.993, 11.70037, 1.178098, 0, 0, 0.5555706, 0.8314694, 7200, 255, 1, '', 23706), -- 22920 (Area: 2369) +(@OGUID+52, 3803, 560, 0, 0, '1,2', 0, 1849.74, 1032.096, 16.34453, 5.131269, 0, 0, -0.5446386, 0.8386708, 7200, 255, 1, '', 23706), -- 3803 (Area: 2369) +(@OGUID+53, 3804, 560, 0, 0, '1,2', 0, 1850.632, 1032.164, 16.34453, 0.1396245, 0, 0, 0.06975555, 0.9975641, 7200, 255, 1, '', 23706), -- 3804 (Area: 2369) +(@OGUID+54, 38147, 560, 0, 0, '1,2', 0, 1815.941, 1012.808, 18.54309, 1.230456, 0, 0, 0.5771446, 0.816642, 7200, 255, 1, '', 23706), -- 38147 (Area: 2369) +(@OGUID+55, 23013, 560, 0, 0, '1,2', 0, 1989.882, 1163.661, 31.64357, 2.539454, 0, 0, 0.95502, 0.2965415, 7200, 255, 1, '', 23706), -- 23013 (Area: 2369) +(@OGUID+56, 23015, 560, 0, 0, '1,2', 0, 1982.852, 1180.465, 31.61295, 5.358162, 0, 0, -0.4461975, 0.8949345, 7200, 255, 1, '', 23706), -- 23015 (Area: 2369) +(@OGUID+57, 23014, 560, 0, 0, '1,2', 0, 1991.932, 1166.378, 31.64357, 3.176533, 0, 0, -0.9998474, 0.01746928, 7200, 255, 1, '', 23706), -- 23014 (Area: 2 +(@OGUID+58, 4087, 560, 0, 0, '1,2', 0, 2095.073, 1633.465, 49.88202, 1.605702, 0, 0, 0.7193394, 0.6946588, 7200, 255, 1, '', 23706), -- 4087 (Area: 0) +(@OGUID+59, 4089, 560, 0, 0, '1,2', 0, 2088.648, 1645.305, 49.88202, 0.165805, 0, 0, 0.08280754, 0.9965656, 7200, 255, 1, '', 23706), -- 4089 (Area: 0) +(@OGUID+60, 4088, 560, 0, 0, '1,2', 0, 2094.378, 1646.551, 49.88202, 4.415687, 0, 0, -0.8038559, 0.5948241, 7200, 255, 1, '', 23706), -- 4088 (Area: 0) +(@OGUID+61, 4090, 560, 0, 0, '1,2', 0, 2094.719, 1639.939, 48.07408, 5.654869, 0, 0, -0.3090162, 0.9510568, 7200, 255, 1, '', 23706), -- 4090 (Area: 0 +(@OGUID+62, 22603, 560, 0, 0, '1,2', 0, 2329.611, 1608.566, 60.49135, 5.873035, 0, 0, -0.2036409, 0.9790456, 7200, 255, 1, '', 23706), -- 22603 (Area: 0) +(@OGUID+63, 22602, 560, 0, 0, '1,2', 0, 2329.339, 1609.473, 60.49135, 3.68265, 0, 0, -0.9636297, 0.267241, 7200, 255, 1, '', 23706), -- 22602 (Area: 0) +(@OGUID+64, 22605, 560, 0, 0, '1,2', 0, 2329.837, 1609.87, 55.5745, 0.8813897, 0, 0, 0.426568, 0.9044555, 7200, 255, 1, '', 23706), -- 22605 (Area: 0) +(@OGUID+65, 22604, 560, 0, 0, '1,2', 0, 2329.442, 1608.7, 55.5745, 5.873035, 0, 0, -0.2036409, 0.9790456, 7200, 255, 1, '', 23706), -- 22604 (Area: 0) +(@OGUID+66, 22606, 560, 0, 0, '1,2', 0, 2329.17, 1609.607, 55.5745, 3.68265, 0, 0, -0.9636297, 0.267241, 7200, 255, 1, '', 23706), -- 22606 (Area: 0) +(@OGUID+67, 3799, 560, 0, 0, '1,2', 0, 2223.475, 1484.469, 54.98195, 5.087637, 0, 0, -0.5628042, 0.8265902, 7200, 255, 1, '', 23706), -- 3799 (Area: 0) +(@OGUID+68, 3800, 560, 0, 0, '1,2', 0, 2224.369, 1484.498, 54.98195, 0.09599175, 0, 0, 0.04797745, 0.9988484, 7200, 255, 1, '', 23706), -- 3800 (Area: +(@OGUID+69, 123244, 560, 0, 0, '1,2', 0, 2101.137, 1641.488, 49.88202, 3.089183, 0, 0, 0.9996567, 0.02620165, 7200, 255, 1, '', 23706), -- 123244 (Area: 0) +(@OGUID+70, 3799, 560, 0, 0, '1,2', 0, 2116.721, 1483.125, 46.51685, 4.965463, 0, 0, -0.6122169, 0.7906898, 7200, 255, 1, '', 23706), -- 3799 (Area: 0) +(@OGUID+71, 3800, 560, 0, 0, '1,2', 0, 2117.612, 1483.045, 46.51685, 6.257006, 0, 0, -0.01308918, 0.9999143, 7200, 255, 1, '', 23706), -- 3800 (Area: 0) +(@OGUID+72, 176308, 329, 0, 0, '1', 0, 3659.384, -3305.042, 127.0623, 5.009095, 0, 0, -0.5948229, 0.8038568, 7200, 255, 1, '', 23706); -- 176308 (Area: 5917) -- cgit v1.2.3 From 4015c02a4294af3cb2845cfe2ca29a8e6f5b0319 Mon Sep 17 00:00:00 2001 From: TecDian Date: Sun, 14 May 2017 11:30:02 +0200 Subject: Scripts/Events: Add missing line for "Love is in the air" boss fight (#19521) (cherry picked from commit 4b8644d6e6581f13dcb2a965ce77a846017c1431) --- .../world/master/2020_06_14_07_world_2017_05_14_00_world_335.sql | 4 ++++ .../scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_07_world_2017_05_14_00_world_335.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_07_world_2017_05_14_00_world_335.sql b/sql/updates/world/master/2020_06_14_07_world_2017_05_14_00_world_335.sql new file mode 100644 index 00000000000..2ac3d7bc207 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_07_world_2017_05_14_00_world_335.sql @@ -0,0 +1,4 @@ +-- add text for use in boss_apothecary_hummel.cpp +DELETE FROM `creature_text` WHERE `CreatureID`=36296 AND `GroupID`=6 AND `ID`=0; +INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(36296,6,0,"Apothecaries! Give your life for the Crown!",12,0,100,0,0,0,38594,3,'SAY_SUMMON_ADDS'); diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp index a1714085160..9d03d816fda 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp @@ -56,6 +56,7 @@ enum ApothecarySays SAY_CALL_BAXTER = 3, SAY_CALL_FRYE = 4, SAY_HUMMEL_DEATH = 5, + SAY_SUMMON_ADDS = 6, SAY_BAXTER_DEATH = 0, SAY_FRYE_DEATH = 0 }; @@ -226,6 +227,7 @@ class boss_apothecary_hummel : public CreatureScript events.ScheduleEvent(EVENT_PERFUME_SPRAY, Milliseconds(3640)); events.ScheduleEvent(EVENT_CHAIN_REACTION, Seconds(15)); + Talk(SAY_SUMMON_ADDS); std::vector trashs; me->GetCreatureListWithEntryInGrid(trashs, NPC_CROWN_APOTHECARY); for (Creature* crea : trashs) -- cgit v1.2.3 From 7f43529e171d19ebf201bcc2bcb7630a1e0d3b1c Mon Sep 17 00:00:00 2001 From: Dr-J Date: Sun, 14 May 2017 11:52:36 +0100 Subject: DB/SAI: A Righteous Sermon Fix bad target for script for move to position which was using target 1 instead of 8 which was causing npc to walk through wall and dissapear on quest accept (cherry picked from commit e263654c77fbbe94f3af2d462aaf203c9c4f6ec8) --- sql/updates/world/master/2020_06_14_08_world_2017_05_14_01_world.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/master/2020_06_14_08_world_2017_05_14_01_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_08_world_2017_05_14_01_world.sql b/sql/updates/world/master/2020_06_14_08_world_2017_05_14_01_world.sql new file mode 100644 index 00000000000..21f69cdf106 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_08_world_2017_05_14_01_world.sql @@ -0,0 +1 @@ +UPDATE `smart_scripts` SET `target_type`=8 WHERE `entryorguid`=2731600 AND `source_type`=9 AND `id` IN(2,3); -- cgit v1.2.3 From d50dccbfce639203c254f488d55411970502ccdb Mon Sep 17 00:00:00 2001 From: joschiwald Date: Thu, 23 Mar 2017 03:44:43 -0300 Subject: Scripts/Ulduar: Initial implementation of the Thorim Encounter Closes #7651 Fix logic fail in achievement: SPELL_LIGHTNING_CHARGE aka 62279 is casted on Thorim itself to buff him, not the damage spell tracked by the achievement. (cherry picked from commit 5e90c76fd44e81e01e7bd5274867864d082059d2) --- ...20_06_14_09_world_2017_MM_DD_NN_world_15008.sql | 99 ++ .../Northrend/Ulduar/Ulduar/boss_thorim.cpp | 1843 +++++++++++++++++++- .../Northrend/Ulduar/Ulduar/instance_ulduar.cpp | 34 +- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 65 +- .../scripts/Northrend/northrend_script_loader.cpp | 2 + 5 files changed, 2005 insertions(+), 38 deletions(-) create mode 100644 sql/updates/world/master/2020_06_14_09_world_2017_MM_DD_NN_world_15008.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_09_world_2017_MM_DD_NN_world_15008.sql b/sql/updates/world/master/2020_06_14_09_world_2017_MM_DD_NN_world_15008.sql new file mode 100644 index 00000000000..e52203e4e7e --- /dev/null +++ b/sql/updates/world/master/2020_06_14_09_world_2017_MM_DD_NN_world_15008.sql @@ -0,0 +1,99 @@ +/* + * Thorim + */ + +-- todo: immunity runic colossus, rune giant grip and knockback + +DELETE FROM `creature_text` WHERE `CreatureID` IN (32865,32872,32873,33196); +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextID`, `comment`) VALUES +-- Thorim +(32865, 0,0,'Interlopers! You mortals who dare to interfere with my sport will pay... Wait--you...',14,0,100,0,0,15733,33145,'Thorim SAY_AGGRO_1'), +(32865, 1,0,'I remember you... In the mountains... But you... what is this? Where am--',14,0,100,0,0,15734,33270,'Thorim SAY_AGGRO_2'), +(32865, 2,0,'Behold the power of the storms and despair!',14,0,100,0,0,15735,0,'Thorim SAY_SPECIAL_1'), +(32865, 3,0,'Do not hold back! Destroy them!',14,0,100,0,0,15736,34241,'Thorim SAY_SPECIAL_2'), +(32865, 4,0,'Have you begun to regret your intrusion?',14,0,100,0,0,15737,0,'Thorim SAY_SPECIAL_3'), +(32865, 5,0,'Impertinent whelps, you dare challenge me atop my pedestal? I will crush you myself!',14,0,100,0,0,15738,33148,'Thorim SAY_JUMPDOWN'), +(32865, 6,0,'Can''t you at least put up a fight!?',14,0,100,0,0,15739,34239,'Thorim SAY_SLAY_1'), +(32865, 6,1,'Pathetic.',14,0,100,0,0,15740,35768,'Thorim SAY_SLAY_2'), +(32865, 7,0,'My patience has reached its limit!',14,0,100,0,0,15741,33365,'Thorim SAY_BERSERK'), +(32865, 8,0,'Failures! Weaklings!',14,0,100,0,0,15742,33274,'Thorim SAY_WIPE'), +(32865, 9,0,'Stay your arms! I yield!',14,0,100,0,0,15743,33948,'Thorim SAY_DEATH'), +(32865,10,0,'I feel as though I am awakening from a nightmare, but the shadows in this place yet linger.',14,0,100,0,0,15744,33949,'Thorim SAY_END_NORMAL_1'), +(32865,11,0,'Sif... was Sif here? Impossible--she died by my brother''s hand. A dark nightmare indeed....',14,0,100,0,0,15745,33950,'Thorim SAY_END_NORMAL_2'), +(32865,12,0,'I need time to reflect.... I will aid your cause if you should require it. I owe you at least that much. Farewell.',14,0,100,0,0,15746,33951,'Thorim SAY_END_NORMAL_3'), +(32865,13,0,'You! Fiend! You are not my beloved! Be gone!',14,0,100,0,0,15747,33952,'Thorim SAY_END_HARD_1'), +(32865,14,0,'Behold the hand behind all the evil that has befallen Ulduar, left my kingdom in ruins, corrupted my brother, and slain my wife.',14,0,100,0,0,15748,33953,'Thorim SAY_END_HARD_2'), +(32865,15,0,'And now it falls to you, champions, to avenge us all. The task before you is great, but I will lend you my aid as I am able. You must prevail.',14,0,100,0,0,15749,33954,'Thorim SAY_END_HARD_3'), +-- Runic Colossus +(32872, 0,0,'%s surrounds itself with a crackling Runic Barrier!',41,0,100,0,0,0,33267,'Runic Colossus'), +-- Ancient Rune Giant +(32873, 0,0,'%s fortifies nearby allies with runic might!',41,0,100,0,0,0,33523,'Ancient Rune Giant'), +-- Sif +(33196, 0,0,'Thorim, my lord! Why else would these invaders have come into your sanctum but to slay you? They must be stopped!',14,0,100,0,0,15668,33325,'Sif - Start'), +(33196, 1,0,'These pathetic mortals are harmless, beneath my station. Dispose of them!',14,0,100,0,0,15669,33368,'Sif - Despawn'), +(33196, 2,0,'Impossible! Lord Thorim, I will bring your foes a frigid death!',14,0,100,0,0,15670,33369,'Sif - Event'); + +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=194265; +DELETE FROM `smart_scripts` WHERE `entryorguid`=194265 AND `source_type`=1; +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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(194265,1,0,0,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14,34155,0,0,0,0,0,0, 'Lever - On activate - Activate Dark Iron Portcullis'); + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (62577,62603,62576,62602,62580,62604,62016,62057,62058,62042,62466,64767); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(62577,'spell_thorim_blizzard'), +(62603,'spell_thorim_blizzard'), +(62576,'spell_thorim_blizzard_effect'), +(62602,'spell_thorim_blizzard_effect'), +(62580,'spell_thorim_frostbolt_volley'), +(62604,'spell_thorim_frostbolt_volley'), +(62016,'spell_thorim_charge_orb'), +(62057,'spell_thorim_runic_smash'), +(62058,'spell_thorim_runic_smash'), +(62042,'spell_thorim_stormhammer'), +(62466,'spell_thorim_lightning_charge'), +(64767,'spell_thorim_stormhammer_sif'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=62042; + +UPDATE `creature_template` SET `InhabitType`=4, `flags_extra`=128, `ScriptName`='' WHERE `entry` IN (33140,33141); +UPDATE `creature_template` SET `InhabitType`=4, `flags_extra`=128 WHERE `entry` IN (33054,33378); +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (32892); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (62577,62603,62016,62976,63238,64098,62466,62565,62942,64767,62560,61964); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13,1,62577,0,0,31,0,3,32892,0,0,0,'','Thorim - Blizzard'), +(13,1,62603,0,0,31,0,3,32892,0,0,0,'','Thorim - Blizzard'), +(13,1,62016,0,0,31,0,3,33378,0,0,0,'','Thorim - Charge Orb'), +(13,1,62976,0,0,31,0,3,33378,0,0,0,'','Thorim - Lightning Pillar'), +(13,1,62976,0,0,33,0,1,0,0,1,0,'','Thorim - Lightning Pillar'), +(13,1,63238,0,0,31,0,3,33378,0,0,0,'','Thorim - Lightning Pillar'), +(13,1,63238,0,0,33,0,1,0,0,1,0,'','Thorim - Lightning Pillar'), +(13,1,64098,0,0,31,0,3,32865,0,0,0,'','Thorim - Lightning Bolt'), +(13,4,62466,0,0,31,0,3,32780,0,0,0,'','Thorim - Lightning Charge'), +(13,3,62565,0,0,31,0,3,32865,0,0,0,'','Thorim - Touch of Dominion'), +(13,7,62942,0,0,31,0,3,32874,0,0,0,'','Thorim - Runic Fortification'), +(13,7,62942,0,1,31,0,3,32875,0,0,0,'','Thorim - Runic Fortification'), +(13,7,62942,0,2,31,0,3,33110,0,0,0,'','Thorim - Runic Fortification'), +(13,1,64767,0,0,31,0,3,33196,0,0,0,'','Thorim - Stormhammer'), +(13,7,62560,0,0,31,0,3,32876,0,0,0,'','Thorim - Berserk'), +(13,7,62560,0,1,31,0,3,32877,0,0,0,'','Thorim - Berserk'), +(13,7,62560,0,2,31,0,3,32878,0,0,0,'','Thorim - Berserk'), +(13,7,62560,0,3,31,0,3,32904,0,0,0,'','Thorim - Berserk'), +(13,1,61964,0,0,31,0,3,32882,0,0,0,'','Thorim - Circle of Healing'), +(13,1,61964,0,1,31,0,3,32883,0,0,0,'','Thorim - Circle of Healing'), +(13,1,61964,0,2,31,0,3,32885,0,0,0,'','Thorim - Circle of Healing'), +(13,1,61964,0,3,31,0,3,32886,0,0,0,'','Thorim - Circle of Healing'), +(13,1,61964,0,4,31,0,3,32907,0,0,0,'','Thorim - Circle of Healing'), +(13,1,61964,0,5,31,0,3,32908,0,0,0,'','Thorim - Circle of Healing'); + +UPDATE `gameobject_template` SET `size`=3 WHERE `entry` IN (194312,194313,194314,194315); +UPDATE `gameobject_template_addon` SET `faction`=94 WHERE `entry` IN (194312,194313,194314,194315); + +DELETE FROM `gameobject` WHERE `id` IN (194312,194313,194314,194315); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnDifficulties`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) values +(360300,194312,603,'14',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), +(360301,194313,603,'14',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), +(360302,194314,603,'33',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), +(360303,194315,603,'33',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0); + +DELETE FROM `creature` WHERE `id`=32892 AND `position_z` < 425.0; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index a833e13aeec..d15a5700bd4 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -15,27 +15,388 @@ * with this program. If not, see . */ +#include "MoveSplineInit.h" +#include "Player.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "ulduar.h" +#include "SpellAuras.h" +#include "SpellMgr.h" +#include "GridNotifiersImpl.h" +#include "SpellAuraEffects.h" +#include + +enum Spells +{ + // Thorim + SPELL_SHEAT_OF_LIGHTNING = 62276, + SPELL_STORMHAMMER = 62042, + SPELL_STORMHAMMER_SIF = 64767, + SPELL_STORMHAMMER_BOOMERANG = 64909, + SPELL_DEAFENING_THUNDER = 62470, + SPELL_CHARGE_ORB = 62016, + SPELL_SUMMON_LIGHTNING_ORB = 62391, + SPELL_LIGHTNING_DESTRUCTION = 62393, + SPELL_TOUCH_OF_DOMINION = 62507, + SPELL_TOUCH_OF_DOMINION_TRIGGERED = 62565, + SPELL_CHAIN_LIGHTNING = 62131, + SPELL_LIGHTNING_ORB_CHARGED = 62186, // wrong duration, triggered spell should handle lightning release + SPELL_LIGHTNING_CHARGE = 62279, + SPELL_LIGHTNING_RELEASE = 62466, + SPELL_LIGHTNING_PILLAR_2 = 62976, // caster high position, target low position + SPELL_LIGHTNING_PILLAR_1 = 63238, // caster high position, target low position + SPELL_UNBALANCING_STRIKE = 62130, + SPELL_BERSERK_PHASE_1 = 62560, + SPELL_BERSERK_PHASE_2 = 26662, + + // Credits + SPELL_CREDIT_SIFFED = 64980, + SPELL_CREDIT_KILL = 64985, + + // Lightning Field + SPELL_LIGHTNING_FIELD = 64972, + SPELL_LIGHTNING_BEAM_CHANNEL = 45537, + + // Sif + SPELL_BLIZZARD = 62577, + SPELL_BLINK = 62578, + SPELL_FROSTBOLT_VOLLEY = 62580, + SPELL_FROSTBOLT = 62583, + SPELL_FROSTNOVA = 62597, + SPELL_SIF_TRANSFORM = 64778, + + // Runic Colossus + SPELL_SMASH = 62339, + SPELL_RUNIC_BARRIER = 62338, + SPELL_RUNIC_CHARGE = 62613, + SPELL_RUNIC_SMASH = 62465, + SPELL_RUNIC_SMASH_RIGHT = 62057, + SPELL_RUNIC_SMASH_LEFT = 62058, + + // Ancient Rune Giant + SPELL_RUNIC_FORTIFICATION = 62942, + SPELL_RUNE_DETONATION = 62526, + SPELL_STOMP = 62411 +}; + +enum Phases +{ + PHASE_NULL, + PHASE_1, + PHASE_2 +}; + +enum Events +{ + // Thorim + EVENT_SAY_AGGRO_2 = 1, + EVENT_SAY_SIF_START, + EVENT_START_SIF_CHANNEL, + EVENT_STORMHAMMER, + EVENT_CHARGE_ORB, + EVENT_SUMMON_ADDS, + EVENT_BERSERK, + EVENT_JUMPDOWN, + EVENT_UNBALANCING_STRIKE, + EVENT_CHAIN_LIGHTNING, + EVENT_TRANSFER_ENERGY, + EVENT_RELEASE_ENERGY, + EVENT_ACTIVATE_LIGHNING_FIELD, + EVENT_CHECK_PLAYER, + EVENT_OUTRO_1, + EVENT_OUTRO_2, + EVENT_OUTRO_3, + + // Runic Colossus + EVENT_RUNIC_BARRIER, + EVENT_SMASH, + EVENT_RUNIC_CHARGE, + EVENT_RUNIC_SMASH, + + // Ancient Rune Giant + EVENT_RUNIC_FORTIFICATION, + EVENT_STOMP, + EVENT_RUNE_DETONATION, + + // Arena NPC + EVENT_PRIMARY_ABILITY, + EVENT_SECONDARY_ABILITY, + EVENT_THIRD_ABILITY, + EVENT_ABILITY_CHARGE, + + // Sif + EVENT_BLINK, + EVENT_FROST_NOVA, + EVENT_FROSTBOLT, + EVENT_FROSTBOLT_VOLLEY, + EVENT_BLIZZARD +}; enum Yells { - SAY_AGGRO = 0, - SAY_SPECIAL_1 = 1, - SAY_SPECIAL_2 = 2, - SAY_SPECIAL_3 = 3, - SAY_JUMPDOWN = 4, - SAY_SLAY = 5, - SAY_BERSERK = 6, - SAY_WIPE = 7, - SAY_DEATH = 8, - SAY_END_NORMAL_1 = 9, - SAY_END_NORMAL_2 = 10, - SAY_END_NORMAL_3 = 11, - SAY_END_HARD_1 = 12, - SAY_END_HARD_2 = 13, - SAY_END_HARD_3 = 14 + // Thorim + SAY_AGGRO_1 = 0, + SAY_AGGRO_2 = 1, + //SAY_SPECIAL_1 = 2, + SAY_SPECIAL_2 = 3, + //SAY_SPECIAL_3 = 4, + SAY_JUMPDOWN = 5, + SAY_SLAY = 6, + SAY_BERSERK = 7, + SAY_WIPE = 8, + SAY_DEATH = 9, + SAY_END_NORMAL_1 = 10, + SAY_END_NORMAL_2 = 11, + SAY_END_NORMAL_3 = 12, + SAY_END_HARD_1 = 13, + SAY_END_HARD_2 = 14, + SAY_END_HARD_3 = 15, + + // Runic Colossus + EMOTE_RUNIC_BARRIER = 0, + + // Ancient Rune Giant + EMOTE_RUNIC_MIGHT = 0, + + // Sif + SAY_SIF_START = 0, + SAY_SIF_DESPAWN = 1, + SAY_SIF_EVENT = 2 +}; + +enum TrashTypes +{ + // Pre Phase Trash + BEHEMOTH, + MERCENARY_CAPTAIN, + MERCENARY_SOLDIER, + + // Arena Phase Trash + DARK_RUNE_CHAMPION, + DARK_RUNE_WARBRINGER, + DARK_RUNE_COMMONER, + DARK_RUNE_EVOKER, + + // Hall Way Trash + IRON_RING_GUARD, + IRON_HONOR_GUARD, + + // Shared + DARK_RUNE_ACOLYTE +}; + +enum PreAddSpells +{ + SPELL_ACID_BREATH = 62315, + SPELL_SWEEP = 62316, + + SPELL_DEVASTATE = 62317, + SPELL_HEROIC_SWIPE = 62444, + SPELL_SUNDER_ARMOR = 57807, + + SPELL_BARBED_SHOT = 62318, + SPELL_SHOOT = 16496, + + SPELL_RENEW = 62333, + SPELL_GREATER_HEAL = 62334, /// 61965 + SPELL_CIRCLE_OF_HEALING = 61964, + + SPELL_HOLY_SMITE = 62335, + + SPELL_CHARGE = 32323, + SPELL_MORTAL_STRIKE = 35054, + SPELL_WHIRLWIND = 33500, + + SPELL_LOW_BLOW = 62326, + SPELL_PUMMEL = 38313, + + SPELL_RUNIC_LIGHTNING = 62327, + SPELL_RUNIC_MENDING = 62328, + SPELL_RUNIC_SHIELD = 62321, + + SPELL_RUNIC_STRIKE = 62322, + SPELL_AURA_OF_CELERITY = 62320, + + SPELL_IMPALE = 62331, + SPELL_WHIRLING_TRIP = 64151, + + SPELL_CLEAVE = 42724, + SPELL_HAMSTRING = 48639, + SPELL_SHIELD_SMASH = 62332, +}; + +struct ThorimTrashInfo +{ + uint32 Type; + uint32 Entry; + uint32 PrimaryAbility; + uint32 SecondaryAbility; + uint32 ThirdAbility; +}; + +ThorimTrashInfo const StaticThorimTrashInfo[] = +{ + // Pre Phase + { BEHEMOTH, 32882, SPELL_ACID_BREATH, SPELL_SWEEP, 0 }, + { MERCENARY_CAPTAIN, 32908, SPELL_DEVASTATE, SPELL_HEROIC_SWIPE, SPELL_SUNDER_ARMOR }, // alliance? + { MERCENARY_SOLDIER, 32885, SPELL_BARBED_SHOT, SPELL_SHOOT, 0 }, // alliance? + { DARK_RUNE_ACOLYTE, 32886, SPELL_RENEW, SPELL_GREATER_HEAL, SPELL_CIRCLE_OF_HEALING }, + { MERCENARY_CAPTAIN, 32907, SPELL_DEVASTATE, SPELL_HEROIC_SWIPE, SPELL_SUNDER_ARMOR }, // horde? + { MERCENARY_SOLDIER, 32883, SPELL_BARBED_SHOT, SPELL_SHOOT, 0 }, // horde? + + // Arena Phase + { DARK_RUNE_CHAMPION, NPC_DARK_RUNE_CHAMPION, SPELL_MORTAL_STRIKE, SPELL_WHIRLWIND, 0 }, + { DARK_RUNE_WARBRINGER, NPC_DARK_RUNE_WARBRINGER, SPELL_RUNIC_STRIKE, 0, 0 }, + { DARK_RUNE_EVOKER, NPC_DARK_RUNE_EVOKER, SPELL_RUNIC_LIGHTNING, SPELL_RUNIC_SHIELD, SPELL_RUNIC_MENDING }, + { DARK_RUNE_COMMONER, NPC_DARK_RUNE_COMMONER, SPELL_LOW_BLOW, SPELL_PUMMEL, 0 }, + + // Hall Way + { IRON_RING_GUARD, NPC_IRON_RING_GUARD, SPELL_WHIRLING_TRIP, SPELL_IMPALE, 0 }, + { IRON_HONOR_GUARD, NPC_IRON_HONOR_GUARD, SPELL_CLEAVE, SPELL_SHIELD_SMASH, 0 }, + { DARK_RUNE_ACOLYTE, NPC_DARK_RUNE_ACOLYTE, SPELL_RENEW, SPELL_GREATER_HEAL, 0 }, +}; + +enum Actions +{ + ACTION_INCREASE_PREADDS_COUNT, + ACTION_ACTIVATE_RUNIC_SMASH, + ACTION_START_HARD_MODE, + ACTION_BERSERK, +}; + +#define MAX_HARD_MODE_TIME 180000 // 3 Minutes + +#define IN_ARENA(who) (who->GetPositionX() < 2181.19f && who->GetPositionY() > -299.12f) + +struct SummonLocation +{ + Position pos; + uint32 entry; +}; + +SummonLocation const PreAddLocations[] = +{ + { { 2149.68f, -263.477f, 419.679f, 3.120f }, 32882}, + { { 2131.31f, -271.640f, 419.840f, 2.188f }, 32908}, + { { 2127.24f, -259.182f, 419.974f, 5.917f }, 32885}, + { { 2123.32f, -254.770f, 419.840f, 6.170f }, 32885}, + { { 2120.10f, -258.990f, 419.840f, 6.250f }, 32885}, + { { 2129.09f, -277.142f, 419.756f, 1.222f }, 32886} +}; + +SummonLocation const ColossusAddLocations[] = +{ + { { 2218.38f, -297.50f, 412.18f, 1.030f }, NPC_IRON_RING_GUARD }, + { { 2235.07f, -297.98f, 412.18f, 1.613f }, NPC_IRON_RING_GUARD }, + { { 2235.26f, -338.34f, 412.18f, 1.589f }, NPC_IRON_RING_GUARD }, + { { 2217.69f, -337.39f, 412.18f, 1.241f }, NPC_IRON_RING_GUARD }, + { { 2227.58f, -308.30f, 412.18f, 1.591f }, NPC_DARK_RUNE_ACOLYTE }, + { { 2227.47f, -345.37f, 412.18f, 1.566f }, NPC_DARK_RUNE_ACOLYTE } +}; + +SummonLocation const GiantAddLocations[] = +{ + { { 2198.05f, -428.77f, 419.95f, 6.056f }, NPC_IRON_HONOR_GUARD }, + { { 2220.31f, -436.22f, 412.26f, 1.064f }, NPC_IRON_HONOR_GUARD }, + { { 2158.88f, -441.73f, 438.25f, 0.127f }, NPC_IRON_HONOR_GUARD }, + { { 2198.29f, -436.92f, 419.95f, 0.261f }, NPC_DARK_RUNE_ACOLYTE }, + { { 2230.93f, -434.27f, 412.26f, 1.931f }, NPC_DARK_RUNE_ACOLYTE } +}; + +Position const SifSpawnPosition = { 2148.301f, -297.8453f, 438.3308f, 2.687807f }; + +uint32 const LightningOrbPathSize = 8; +G3D::Vector3 const LightningOrbPath[LightningOrbPathSize] = +{ + { 2134.889893f, -298.632996f, 438.247467f }, + { 2134.570068f, -440.317993f, 438.247467f }, + { 2167.820312f, -440.330261f, 438.247589f }, + { 2213.394287f, -433.318298f, 412.665863f }, + { 2227.766113f, -433.275818f, 412.177032f }, + { 2227.551270f, -263.081085f, 412.176880f }, + { 2202.208008f, -262.939270f, 412.168976f }, + { 2182.310059f, -263.233093f, 414.739410f } +}; + +Position const ArenaCenter = { 2135.0f, -263.0f, 420.0f, 0.0f }; // used for trash jump calculation +Position const LightningFieldCenter = { 2135.0f, -312.5f, 438.0f, 0.0f }; // used for lightning field calculation + +// p2 start at 5357 + +class RunicSmashExplosionEvent : public BasicEvent +{ + public: + RunicSmashExplosionEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override + { + _owner->CastSpell((Unit*)NULL, SPELL_RUNIC_SMASH); + return true; + } + + private: + Creature* _owner; +}; + +class TrashJumpEvent : public BasicEvent +{ + public: + TrashJumpEvent(Creature* owner) : _owner(owner), _stage(0) { } + + bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override + { + switch (_stage) + { + case 0: + if (Creature* stalker = _owner->FindNearestCreature(NPC_THORIM_INVISIBLE_STALKER, 30.0f)) + { + _owner->GetMotionMaster()->MoveJump(*stalker, SPEED_CHARGE, 15.0f); + _owner->SetHomePosition(*stalker); + } + ++_stage; + _owner->m_Events.AddEvent(this, _owner->m_Events.CalculateTime(2000)); + return false; + case 1: + _owner->SetReactState(REACT_AGGRESSIVE); + _owner->AI()->DoZoneInCombat(_owner, 200.0f); + return true; + default: + break; + } + + return true; + } + + private: + Creature* _owner; + uint8 _stage; +}; + +class LightningFieldEvent : public BasicEvent +{ + public: + LightningFieldEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override + { + if (InstanceScript* instance = _owner->GetInstanceScript()) + { + if (instance->GetBossState(BOSS_THORIM) == IN_PROGRESS) + { + _owner->CastSpell((Unit*)NULL, SPELL_LIGHTNING_FIELD); + _owner->m_Events.AddEvent(this, _owner->m_Events.CalculateTime(1000)); + return false; + } + } + + _owner->InterruptNonMeleeSpells(false); + _owner->AI()->EnterEvadeMode(); + return true; + } + + private: + Creature* _owner; }; class boss_thorim : public CreatureScript @@ -47,17 +408,44 @@ class boss_thorim : public CreatureScript { boss_thorimAI(Creature* creature) : BossAI(creature, BOSS_THORIM) { + _encounterFinished = false; + Initialize(); } - void Reset() override + void Initialize() { - _Reset(); + _killedCount = 0; + _waveType = 0; + _hardMode = true; + _orbSummoned = false; + _dontStandInTheLightning = true; } - void EnterEvadeMode(EvadeReason why) override + void Reset() override { - Talk(SAY_WIPE); - _EnterEvadeMode(why); + if (_encounterFinished) + return; + + _Reset(); + Initialize(); + + me->SetReactState(REACT_PASSIVE); + SetCombatMovement(false); + me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + + events.SetPhase(PHASE_NULL); + + // Respawn Mini Bosses + for (uint8 i = DATA_RUNIC_COLOSSUS; i <= DATA_RUNE_GIANT; ++i) + if (Creature* miniBoss = ObjectAccessor::GetCreature(*me, instance->GetGuidData(i))) + miniBoss->Respawn(true); + + // Spawn Pre Phase Adds + for (SummonLocation const& s : PreAddLocations) + me->SummonCreature(s.entry, s.pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_THORIM_LEVER))) + go->AddFlag(GO_FLAG_NOT_SELECTABLE); } void KilledUnit(Unit* who) override @@ -66,27 +454,406 @@ class boss_thorim : public CreatureScript Talk(SAY_SLAY); } - void JustDied(Unit* /*killer*/) override + void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override { - Talk(SAY_DEATH); + if (spellInfo->Id == SPELL_TOUCH_OF_DOMINION_TRIGGERED) + { + if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + { + sif->AI()->Talk(SAY_SIF_DESPAWN); + sif->DespawnOrUnsummon(6000); + _hardMode = false; + } + } + } + + void SpellHitTarget(Unit* who, SpellInfo const* spellInfo) override + { + if (who->GetTypeId() == TYPEID_PLAYER && spellInfo->Id == SPELL_LIGHTNING_RELEASE) + _dontStandInTheLightning = false; + } + + void FinishEncounter() + { + if (_encounterFinished) + return; + + _encounterFinished = true; + + DoCastAOE(SPELL_CREDIT_KILL, true); // before change faction + + me->SetReactState(REACT_PASSIVE); + me->InterruptNonMeleeSpells(true); + me->RemoveAllAttackers(); + me->AttackStop(); + me->SetFaction(35); + + if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + { + summons.Despawn(sif); + sif->DespawnOrUnsummon(10000); + } + _JustDied(); + + Talk(SAY_DEATH); + events.ScheduleEvent(EVENT_OUTRO_1, 4000); + events.ScheduleEvent(EVENT_OUTRO_2, _hardMode ? 8000 : 11000); + events.ScheduleEvent(EVENT_OUTRO_3, _hardMode ? 19000 : 21000); + + me->m_Events.AddEvent(new KeeperDespawnEvent(me), me->m_Events.CalculateTime(35000)); } void EnterCombat(Unit* /*who*/) override { - Talk(SAY_AGGRO); _EnterCombat(); + Talk(SAY_AGGRO_1); + + events.SetPhase(PHASE_1); + + events.ScheduleEvent(EVENT_SAY_AGGRO_2, 9000, 0, PHASE_1); + events.ScheduleEvent(EVENT_SAY_SIF_START, 16500, 0, PHASE_1); + events.ScheduleEvent(EVENT_START_SIF_CHANNEL, 25000, 0, PHASE_1); + + events.ScheduleEvent(EVENT_STORMHAMMER, 40000, 0, PHASE_1); + events.ScheduleEvent(EVENT_CHARGE_ORB, 30000, 0, PHASE_1); + events.ScheduleEvent(EVENT_SUMMON_ADDS, 15000, 0, PHASE_1); + events.ScheduleEvent(EVENT_BERSERK, 369000); + events.ScheduleEvent(EVENT_CHECK_PLAYER, 10000); + + DoCast(me, SPELL_SHEAT_OF_LIGHTNING); + + if (Creature* runic = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_RUNIC_COLOSSUS))) + runic->AI()->DoAction(ACTION_ACTIVATE_RUNIC_SMASH); + + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_THORIM_LEVER))) + go->RemoveFlag(GO_FLAG_NOT_SELECTABLE); + + // Summon Sif + me->SummonCreature(NPC_SIF, SifSpawnPosition); + } + + void JustSummoned(Creature* summon) override + { + switch (summon->GetEntry()) + { + case NPC_LIGHTNING_ORB: + { + summon->SetReactState(REACT_PASSIVE); + summon->CastSpell(summon, SPELL_LIGHTNING_DESTRUCTION, true); + + Position pos(LightningOrbPath[LightningOrbPathSize - 1].x, LightningOrbPath[LightningOrbPathSize - 1].y, LightningOrbPath[LightningOrbPathSize - 1].z); + summon->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, pos, false); + + Movement::PointsArray path(LightningOrbPath, LightningOrbPath + LightningOrbPathSize); + + Movement::MoveSplineInit init(summon); + init.MovebyPath(path); + init.Launch(); + break; + } + case NPC_DARK_RUNE_CHAMPION: + case NPC_DARK_RUNE_WARBRINGER: + case NPC_DARK_RUNE_EVOKER: + case NPC_DARK_RUNE_COMMONER: + summon->SetReactState(REACT_PASSIVE); + summon->m_Events.AddEvent(new TrashJumpEvent(summon), summon->m_Events.CalculateTime(3000)); + break; + case NPC_SIF: + summon->SetReactState(REACT_PASSIVE); + break; + default: + break; + } + + BossAI::JustSummoned(summon); } - void UpdateAI(uint32 /*diff*/) override + void UpdateAI(uint32 diff) override { if (!UpdateVictim()) return; - //SPELLS @todo - // + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SAY_AGGRO_2: + Talk(SAY_AGGRO_2); + break; + case EVENT_SAY_SIF_START: + if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + sif->AI()->Talk(SAY_SIF_START); + break; + case EVENT_START_SIF_CHANNEL: + if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + sif->CastSpell(me, SPELL_TOUCH_OF_DOMINION); + break; + case EVENT_STORMHAMMER: + DoCast(SPELL_STORMHAMMER); + events.ScheduleEvent(EVENT_STORMHAMMER, urand(15000, 20000), 0, PHASE_1); + break; + case EVENT_CHARGE_ORB: + DoCastAOE(SPELL_CHARGE_ORB); + events.ScheduleEvent(EVENT_CHARGE_ORB, urand(15000, 20000), 0, PHASE_1); + break; + case EVENT_SUMMON_ADDS: + SummonWave(); + events.ScheduleEvent(EVENT_SUMMON_ADDS, _orbSummoned ? 3000 : 10000, 0, PHASE_1); + break; + case EVENT_JUMPDOWN: + if (_hardMode) + if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + sif->AI()->DoAction(ACTION_START_HARD_MODE); + me->RemoveAurasDueToSpell(SPELL_SHEAT_OF_LIGHTNING); + me->SetReactState(REACT_AGGRESSIVE); + SetCombatMovement(true); + me->GetMotionMaster()->MoveJump(2134.79f, -263.03f, 419.84f, me->GetOrientation(), 30.0f, 20.0f); + events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, 15000, 0, PHASE_2); + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 20000, 0, PHASE_2); + events.ScheduleEvent(EVENT_TRANSFER_ENERGY, 20000, 0, PHASE_2); + break; + case EVENT_UNBALANCING_STRIKE: + DoCastVictim(SPELL_UNBALANCING_STRIKE); + events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, urand(15000, 20000), 0, PHASE_2); + break; + case EVENT_CHAIN_LIGHTNING: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(target, SPELL_CHAIN_LIGHTNING); + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(7000, 15000), 0, PHASE_2); + break; + case EVENT_TRANSFER_ENERGY: + { + std::list triggers; + me->GetCreatureListWithEntryInGrid(triggers, NPC_THUNDER_ORB, 200.0f); + triggers.remove_if([](Creature* trigger) + { + return trigger->GetPositionZ() < 425.0f; + }); + + if (!triggers.empty()) + { + Creature* pillar = Trinity::Containers::SelectRandomContainerElement(triggers); + _activePillarGUID = pillar->GetGUID(); + pillar->CastSpell(pillar, SPELL_LIGHTNING_ORB_CHARGED, true); + pillar->CastSpell((Unit*)nullptr, SPELL_LIGHTNING_PILLAR_2); + events.ScheduleEvent(EVENT_RELEASE_ENERGY, 8000, 0, PHASE_2); + } + + events.ScheduleEvent(EVENT_TRANSFER_ENERGY, 16000, 0, PHASE_2); + break; + } + case EVENT_RELEASE_ENERGY: + if (Creature* pillar = ObjectAccessor::GetCreature(*me, _activePillarGUID)) + DoCast(pillar, SPELL_LIGHTNING_RELEASE); + break; + case EVENT_BERSERK: + if (events.IsInPhase(PHASE_1)) + { + Talk(SAY_WIPE); + DoCastAOE(SPELL_BERSERK_PHASE_1, true); + DoCast(me, SPELL_SUMMON_LIGHTNING_ORB, true); + } + else + { + Talk(SAY_BERSERK); + DoCast(me, SPELL_BERSERK_PHASE_2, true); + } + break; + case EVENT_ACTIVATE_LIGHNING_FIELD: + { + std::list triggers; + me->GetCreatureListWithEntryInGrid(triggers, NPC_THORIM_EVENT_BUNNY, 100.0f); + triggers.remove_if([](Creature* bunny) + { + if (bunny->GetPositionZ() < 430.0f) + return true; + return LightningFieldCenter.GetExactDist2dSq(bunny) > 1225.0f; + }); + + uint64 timer = 1000; + for (Creature* bunny : triggers) + bunny->m_Events.AddEvent(new LightningFieldEvent(bunny), bunny->m_Events.CalculateTime(timer += 100)); + + triggers.remove_if([](Creature* bunny) + { + return LightningFieldCenter.GetExactDist2dSq(bunny) < 400.0f; + }); + + triggers.sort([](Creature* a, Creature* b) + { + return a->GetPositionX() < b->GetPositionX(); + }); + + for (std::list::const_iterator itr = triggers.begin(); itr != triggers.end();) + { + std::list::const_iterator prev = itr++; + if (itr != triggers.end()) + (*prev)->CastSpell(*itr, SPELL_LIGHTNING_BEAM_CHANNEL); + } + break; + } + case EVENT_CHECK_PLAYER: + if (!me->GetMap()->GetPlayersCountExceptGMs()) + EnterEvadeMode(); + events.ScheduleEvent(EVENT_CHECK_PLAYER, 10000); + break; + case EVENT_OUTRO_1: + Talk(_hardMode ? SAY_END_HARD_1 : SAY_END_NORMAL_1); + if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + DoCast(sif, SPELL_STORMHAMMER_SIF); + break; + case EVENT_OUTRO_2: + Talk(_hardMode ? SAY_END_HARD_2 : SAY_END_NORMAL_2); + break; + case EVENT_OUTRO_3: + Talk(_hardMode ? SAY_END_HARD_3 : SAY_END_NORMAL_3); + break; + default: + break; + } + } + DoMeleeAttackIfReady(); } + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_BERSERK: + if (events.IsInPhase(PHASE_2)) + return; + + if (!_orbSummoned) + { + _orbSummoned = true; + events.RescheduleEvent(EVENT_BERSERK, 1000); + } + return; + case ACTION_INCREASE_PREADDS_COUNT: + if (++_killedCount >= 6) + { + // Event starts + me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + DoZoneInCombat(me, 250.0f); + } + break; + default: + break; + } + } + + void GetTrashSpawnTriggers(std::list& triggerList, uint32 count = 1) + { + me->GetCreatureListWithEntryInGrid(triggerList, NPC_THORIM_EVENT_BUNNY, 100.0f); + triggerList.remove_if([](Creature* bunny) + { + if (bunny->GetPositionZ() < 430.0f) + return true; + return ArenaCenter.GetExactDist2dSq(bunny) < 3025.0f; + }); + + if (triggerList.empty()) + return; + + if (count == 1) + { + Creature* bunny = Trinity::Containers::SelectRandomContainerElement(triggerList); + triggerList.clear(); + triggerList.push_back(bunny); + } + else + Trinity::Containers::RandomResize(triggerList, count); + } + + void SummonWave() + { + switch (_waveType) + { + case 0: + { + // Dark Rune Commoner + std::list triggers; + GetTrashSpawnTriggers(triggers, urand(5, 6)); + + for (Creature* bunny : triggers) + me->SummonCreature(StaticThorimTrashInfo[6 + 3].Entry, *bunny, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + + ++_waveType; + break; + } + case 1: + if (urand(0, 1)) + { + // Dark Rune Champion or Dark Rune Evoker + std::list triggers; + GetTrashSpawnTriggers(triggers, urand(2, 4)); + + for (Creature* bunny : triggers) + me->SummonCreature(StaticThorimTrashInfo[6 + RAND(0, 2)].Entry, *bunny, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + } + else + { + // Dark Rune Warbringer + std::list triggers; + GetTrashSpawnTriggers(triggers); + + for (Creature* bunny : triggers) + me->SummonCreature(StaticThorimTrashInfo[6 + 1].Entry, *bunny, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + } + --_waveType; + break; + } + } + + bool CanStartPhase2(Unit* actor) const + { + if (actor->GetTypeId() != TYPEID_PLAYER || !me->IsWithinDistInMap(actor, 10.0f)) + return false; + + Creature* runicColossus = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_RUNIC_COLOSSUS)); + Creature* runeGiant = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_RUNE_GIANT)); + return runicColossus && !runicColossus->IsAlive() && runeGiant && !runeGiant->IsAlive(); + } + + void DamageTaken(Unit* attacker, uint32& damage) override + { + if (events.IsInPhase(PHASE_1) && CanStartPhase2(attacker)) + { + Talk(SAY_JUMPDOWN); + events.SetPhase(PHASE_2); + events.ScheduleEvent(EVENT_JUMPDOWN, 8000); + events.ScheduleEvent(EVENT_ACTIVATE_LIGHNING_FIELD, 15000); + events.RescheduleEvent(EVENT_BERSERK, 300000, 0, PHASE_2); + + if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + sif->InterruptNonMeleeSpells(false); + + // Hard Mode + if (_hardMode && events.GetTimer() <= MAX_HARD_MODE_TIME) + DoCastAOE(SPELL_CREDIT_SIFFED, true); + } + else if (me->HealthBelowPctDamaged(1, damage)) + { + damage = 0; + FinishEncounter(); + } + } + + private: + ObjectGuid _activePillarGUID; + uint8 _killedCount; + uint8 _waveType; + bool _hardMode; + bool _encounterFinished; + bool _orbSummoned; + bool _dontStandInTheLightning; }; CreatureAI* GetAI(Creature* creature) const override @@ -95,7 +862,1031 @@ class boss_thorim : public CreatureScript } }; +struct npc_thorim_trashAI : public ScriptedAI +{ + npc_thorim_trashAI(Creature* creature) : ScriptedAI(creature) + { + _instance = creature->GetInstanceScript(); + for (uint8 i = 0; i < 13; ++i) + if (me->GetEntry() == StaticThorimTrashInfo[i].Entry) + _info = &StaticThorimTrashInfo[i]; + + ASSERT(_info); + } + + struct AIHelper + { + /// returns heal amount of the given spell including hots + static uint32 GetTotalHeal(SpellInfo const* spellInfo, Unit const* caster) + { + uint32 heal = 0; + for (SpellEffectInfo const* effect : spellInfo->GetEffects()) + { + if (effect->IsEffect(SPELL_EFFECT_HEAL)) + heal += effect->CalcValue(caster); + + if (effect->IsEffect(SPELL_EFFECT_APPLY_AURA) && effect->IsAura(SPELL_AURA_PERIODIC_HEAL)) + heal += spellInfo->GetMaxTicks() * effect->CalcValue(caster); + } + return heal; + } + + /// returns heal amount of the given spell including hots + static uint32 GetTotalHeal(uint32 spellId, Unit const* caster) + { + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, caster->GetMap()->GetDifficultyID())) + return GetTotalHeal(spellInfo, caster); + return 0; + } + + /// returns remaining heal amount on given target + static uint32 GetRemainingHealOn(Unit* target) + { + uint32 heal = 0; + Unit::AuraApplicationMap const& auras = target->GetAppliedAuras(); + for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + { + Aura const* aura = itr->second->GetBase(); + + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (AuraEffect const* aurEff = aura->GetEffect(i)) + { + if (aurEff->GetAuraType() == SPELL_AURA_PERIODIC_HEAL) + heal += aurEff->GetAmount() * (aurEff->GetTotalTicks() - aurEff->GetTickNumber()); + } + } + } + return heal; + } + + class MostHPMissingInRange + { + public: + MostHPMissingInRange(Unit const* referer, float range, uint32 hp, uint32 exclAura = 0, bool exclSelf = false) + : _referer(referer), _range(range), _hp(hp), _exclAura(exclAura), _exclSelf(exclSelf) { } + + bool operator()(Unit* u) + { + if (_exclSelf && u == _referer) + return false; + + if (_exclAura && u->HasAura(_exclAura)) + return false; + + if ((u->GetHealth() + GetRemainingHealOn(u) + _hp) > u->GetMaxHealth()) + return false; + + uint32 missingHP = u->GetMaxHealth() - u->GetHealth(); + if (u->IsAlive() && _referer->IsFriendlyTo(u) && _referer->IsWithinDistInMap(u, _range) && missingHP > _hp) + { + _hp = missingHP; + return true; + } + + return false; + } + + private: + Unit const* _referer; + float _range; + uint32 _hp; + uint32 _exclAura; + bool _exclSelf; + }; + + static Unit* GetUnitWithMostMissingHp(SpellInfo const* spellInfo, Unit* caster) + { + float range = spellInfo->GetMaxRange(false); + uint32 heal = GetTotalHeal(spellInfo, caster); + + Unit* target = nullptr; + Trinity::MostHPMissingInRange checker(caster, range, heal); + Trinity::UnitLastSearcher searcher(caster, target, checker); + Cell::VisitGridObjects(caster, searcher, 60.0f); + + return target; + } + + static Unit* GetHealTarget(uint32 spellId, Unit* caster) + { + Unit* healTarget = nullptr; + + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, caster->GetMap()->GetDifficultyID())) + { + if (!spellInfo->HasAttribute(SPELL_ATTR1_CANT_TARGET_SELF) && !roll_chance_f(caster->GetHealthPct()) && !((caster->GetHealth() + GetRemainingHealOn(caster) + GetTotalHeal(spellInfo, caster)) > caster->GetMaxHealth())) + healTarget = caster; + else + healTarget = GetUnitWithMostMissingHp(spellInfo, caster); + } + + return healTarget; + } + }; + + bool UseAbility(uint32 spellId) + { + Unit* target = nullptr; + if (AIHelper::GetTotalHeal(spellId, me)) + target = AIHelper::GetHealTarget(spellId, me); + else + target = me->GetVictim(); + + if (target) + { + if (_info->Type == MERCENARY_SOLDIER) + { + bool allowMove = true; + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetDifficulty())) + { + if (me->IsInRange(target, spellInfo->GetMinRange(false), spellInfo->GetMaxRange(false)) + && me->IsWithinLOSInMap(target)) + allowMove = false; + } + SetCombatMovement(allowMove); + } + + DoCast(target, spellId); + return true; + } + + return false; + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + ExecuteEvent(eventId); + } + + if (_info->Type == DARK_RUNE_ACOLYTE) + DoSpellAttackIfReady(SPELL_HOLY_SMITE); + else + DoMeleeAttackIfReady(); + } + + virtual void ExecuteEvent(uint32 eventId) = 0; + +protected: + InstanceScript* _instance; + EventMap _events; + + ThorimTrashInfo const* _info = nullptr; +}; + +class npc_thorim_pre_phase : public CreatureScript +{ + public: + npc_thorim_pre_phase() : CreatureScript("npc_thorim_pre_phase") { } + + struct npc_thorim_pre_phaseAI : public npc_thorim_trashAI + { + npc_thorim_pre_phaseAI(Creature* creature) : npc_thorim_trashAI(creature) + { + me->setActive(true); // prevent grid unload + } + + void Reset() + { + _events.Reset(); + if (_info->PrimaryAbility) + _events.ScheduleEvent(EVENT_PRIMARY_ABILITY, urand(3000, 6000)); + if (_info->SecondaryAbility) + _events.ScheduleEvent(EVENT_SECONDARY_ABILITY, _info->SecondaryAbility == SPELL_SHOOT ? 2000 : urand(12000, 15000)); + if (_info->ThirdAbility) + _events.ScheduleEvent(EVENT_THIRD_ABILITY, urand(6000, 8000)); + if (_info->Type == MERCENARY_SOLDIER) + SetCombatMovement(false); + } + + void JustDied(Unit* /*victim*/) + { + if (Creature* thorim = _instance->GetCreature(BOSS_THORIM)) + thorim->AI()->DoAction(ACTION_INCREASE_PREADDS_COUNT); + } + + void DamageTaken(Unit* attacker, uint32& damage) override + { + if (!attacker->GetAffectingPlayer()) + damage = 0; + } + + void ExecuteEvent(uint32 eventId) override + { + switch (eventId) + { + case EVENT_PRIMARY_ABILITY: + if (UseAbility(_info->PrimaryAbility)) + _events.ScheduleEvent(eventId, urand(15000, 20000)); + else + _events.ScheduleEvent(eventId, 1000); + break; + case EVENT_SECONDARY_ABILITY: + if (UseAbility(_info->SecondaryAbility)) + _events.ScheduleEvent(eventId, _info->SecondaryAbility == SPELL_SHOOT ? 2000 : urand(4000, 8000)); + else + _events.ScheduleEvent(eventId, 1000); + break; + case EVENT_THIRD_ABILITY: + if (UseAbility(_info->ThirdAbility)) + _events.ScheduleEvent(eventId, urand(6000, 8000)); + else + _events.ScheduleEvent(eventId, 1000); + break; + default: + break; + } + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetUlduarAI(creature); + } +}; + +class npc_thorim_arena_phase : public CreatureScript +{ + public: + npc_thorim_arena_phase() : CreatureScript("npc_thorim_arena_phase") { } + + struct npc_thorim_arena_phaseAI : public npc_thorim_trashAI + { + npc_thorim_arena_phaseAI(Creature* creature) : npc_thorim_trashAI(creature) + { + switch (_info->Type) + { + case DARK_RUNE_CHAMPION: + case DARK_RUNE_WARBRINGER: + case DARK_RUNE_COMMONER: + case DARK_RUNE_EVOKER: + _isInArena = true; + break; + default: + _isInArena = false; + break; + } + //_isInArena = IN_ARENA(me); + } + + bool CanAIAttack(Unit const* who) const override + { + return _isInArena == IN_ARENA(who); + } + + void Reset() override + { + _events.Reset(); + if (_info->PrimaryAbility) + _events.ScheduleEvent(EVENT_PRIMARY_ABILITY, urand(3000, 6000)); + if (_info->SecondaryAbility) + _events.ScheduleEvent(EVENT_SECONDARY_ABILITY, urand(7000, 9000)); + if (_info->ThirdAbility) + _events.ScheduleEvent(EVENT_THIRD_ABILITY, urand(6000, 8000)); + if (_info->Type == DARK_RUNE_CHAMPION) + _events.ScheduleEvent(EVENT_ABILITY_CHARGE, 8000); + } + + void EnterCombat(Unit* /*who*/) + { + if (_info->Type == DARK_RUNE_WARBRINGER) + DoCast(me, SPELL_AURA_OF_CELERITY); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + // this should only happen if theres no alive player in the arena -> summon orb + // might be called by mind control release or controllers death? + if (Creature* thorim = _instance->GetCreature(BOSS_THORIM)) + thorim->AI()->DoAction(ACTION_BERSERK); + ScriptedAI::EnterEvadeMode(); + } + + void ExecuteEvent(uint32 eventId) override + { + switch (eventId) + { + case EVENT_PRIMARY_ABILITY: + if (UseAbility(_info->PrimaryAbility)) + _events.ScheduleEvent(eventId, urand(3000, 6000)); + else + _events.ScheduleEvent(eventId, 1000); + break; + case EVENT_SECONDARY_ABILITY: + if (UseAbility(_info->SecondaryAbility)) + _events.ScheduleEvent(eventId, urand(12000, 16000)); + else + _events.ScheduleEvent(eventId, 1000); + break; + case EVENT_THIRD_ABILITY: + if (UseAbility(_info->ThirdAbility)) + _events.ScheduleEvent(eventId, urand(6000, 8000)); + else + _events.ScheduleEvent(eventId, 1000); + break; + case EVENT_ABILITY_CHARGE: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, [this](Unit* unit){ return unit->GetTypeId() == TYPEID_PLAYER && unit->IsInRange(me, 8.0f, 25.0f); })) + DoCast(target, SPELL_CHARGE); + _events.ScheduleEvent(eventId, 12000); + break; + default: + break; + } + } + + private: + bool _isInArena; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetUlduarAI(creature); + } +}; + +struct npc_thorim_minibossAI : public ScriptedAI +{ + npc_thorim_minibossAI(Creature* creature) : ScriptedAI(creature), _summons(me) + { + _instance = creature->GetInstanceScript(); + } + + void JustSummoned(Creature* summon) override + { + _summons.Summon(summon); + ScriptedAI::JustSummoned(summon); + } + + void SummonedCreatureDespawn(Creature* summon) override + { + ScriptedAI::SummonedCreatureDespawn(summon); + _summons.Despawn(summon); + } + +protected: + InstanceScript* _instance; + EventMap _events; + SummonList _summons; +}; + +class npc_runic_colossus : public CreatureScript +{ + public: + npc_runic_colossus() : CreatureScript("npc_runic_colossus") { } + + struct npc_runic_colossusAI : public npc_thorim_minibossAI + { + npc_runic_colossusAI(Creature* creature) : npc_thorim_minibossAI(creature) + { + } + + void Reset() override + { + _events.Reset(); + + // Runed Door closed + _instance->HandleGameObject(_instance->GetGuidData(DATA_RUNIC_DOOR), false); + + // Spawn trashes + _summons.DespawnAll(); + for (SummonLocation const& s : ColossusAddLocations) + me->SummonCreature(s.entry, s.pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + } + + void MoveInLineOfSight(Unit* /*who*/) override + { + // don't enter combat + } + + void JustDied(Unit* /*victim*/) override + { + // Runed Door opened + _instance->HandleGameObject(_instance->GetGuidData(DATA_RUNIC_DOOR), true); + + if (Creature* thorim = _instance->GetCreature(BOSS_THORIM)) + thorim->AI()->Talk(SAY_SPECIAL_2); + } + + void DoAction(int32 action) override + { + if (action == ACTION_ACTIVATE_RUNIC_SMASH) + _events.ScheduleEvent(EVENT_RUNIC_SMASH, 12000); + } + + void EnterCombat(Unit* /*who*/) override + { + DoZoneInCombat(); + _events.Reset(); + _events.ScheduleEvent(EVENT_RUNIC_BARRIER, urand(12000, 15000)); + _events.ScheduleEvent(EVENT_SMASH, urand(15000, 18000)); + _events.ScheduleEvent(EVENT_RUNIC_CHARGE, urand(20000, 24000)); + me->InterruptNonMeleeSpells(true); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_RUNIC_BARRIER: + Talk(EMOTE_RUNIC_BARRIER); + DoCast(me, SPELL_RUNIC_BARRIER); + _events.ScheduleEvent(eventId, urand(35000, 45000)); + break; + case EVENT_SMASH: + DoCast(me, SPELL_SMASH); + _events.ScheduleEvent(eventId, urand(15000, 18000)); + break; + case EVENT_RUNIC_CHARGE: + { + Unit* referer = me; + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, [referer](Unit* unit){ return unit->GetTypeId() == TYPEID_PLAYER && unit->IsInRange(referer, 8.0f, 40.0f); })) + DoCast(target, SPELL_RUNIC_CHARGE); + _events.ScheduleEvent(eventId, 20000); + break; + } + case EVENT_RUNIC_SMASH: + DoCast(me, RAND(SPELL_RUNIC_SMASH_LEFT, SPELL_RUNIC_SMASH_RIGHT)); + _events.ScheduleEvent(eventId, 6000); + break; + default: + break; + } + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetUlduarAI(creature); + } +}; + +class npc_ancient_rune_giant : public CreatureScript +{ + public: + npc_ancient_rune_giant() : CreatureScript("npc_ancient_rune_giant") { } + + struct npc_ancient_rune_giantAI : public npc_thorim_minibossAI + { + npc_ancient_rune_giantAI(Creature* creature) : npc_thorim_minibossAI(creature) { } + + void Reset() override + { + _events.Reset(); + + // Stone Door closed + _instance->HandleGameObject(_instance->GetGuidData(DATA_STONE_DOOR), false); + + // Spawn trashes + _summons.DespawnAll(); + for (SummonLocation const& s : GiantAddLocations) + me->SummonCreature(s.entry, s.pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + } + + void EnterCombat(Unit* /*who*/) override + { + DoZoneInCombat(); + _events.Reset(); + _events.ScheduleEvent(EVENT_RUNIC_FORTIFICATION, 1); + _events.ScheduleEvent(EVENT_STOMP, urand(10000, 12000)); + _events.ScheduleEvent(EVENT_RUNE_DETONATION, 25000); + } + + void JustDied(Unit* /*victim*/) override + { + // Stone Door opened + _instance->HandleGameObject(_instance->GetGuidData(DATA_STONE_DOOR), true); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_RUNIC_FORTIFICATION: + Talk(EMOTE_RUNIC_MIGHT); + DoCastAOE(SPELL_RUNIC_FORTIFICATION); + break; + case EVENT_STOMP: + DoCastAOE(SPELL_STOMP); + _events.ScheduleEvent(eventId, urand(10000, 12000)); + break; + case EVENT_RUNE_DETONATION: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true)) + DoCast(target, SPELL_RUNE_DETONATION); + _events.ScheduleEvent(eventId, urand(10000, 12000)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetUlduarAI(creature); + } +}; + +class npc_sif : public CreatureScript +{ + public: + npc_sif() : CreatureScript("npc_sif") { } + + struct npc_sifAI : public ScriptedAI + { + npc_sifAI(Creature* creature) : ScriptedAI(creature), _summons(me) + { + SetCombatMovement(false); + } + + void Reset() override + { + _events.Reset(); + _summons.DespawnAll(); + } + + void JustSummoned(Creature* summon) override + { + _summons.Summon(summon); + if (summon->GetEntry() == NPC_THORIM_EVENT_BUNNY) + summon->GetMotionMaster()->MoveRandom(60.0f); + } + + void SummonedCreatureDespawn(Creature* summon) override + { + _summons.Despawn(summon); + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override + { + if (spellInfo->Id == SPELL_STORMHAMMER_SIF) + { + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); + } + } + + void DoAction(int32 action) override + { + if (action == ACTION_START_HARD_MODE) + { + me->SetReactState(REACT_AGGRESSIVE); + DoZoneInCombat(me, 250.0f); + Talk(SAY_SIF_EVENT); + _events.Reset(); + _events.ScheduleEvent(EVENT_FROSTBOLT, 2000); + _events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, 15000); + _events.ScheduleEvent(EVENT_BLINK, urand(20000, 25000)); + _events.ScheduleEvent(EVENT_BLIZZARD, 30000); + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_BLINK: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) + DoCast(target, SPELL_BLINK); + _events.ScheduleEvent(EVENT_FROST_NOVA, 0); + _events.ScheduleEvent(eventId, urand(20000, 25000)); + return; + case EVENT_FROST_NOVA: + DoCastAOE(SPELL_FROSTNOVA); + return; + case EVENT_FROSTBOLT: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) + DoCast(target, SPELL_FROSTBOLT); + _events.ScheduleEvent(eventId, 2000); + return; + case EVENT_FROSTBOLT_VOLLEY: + DoCastAOE(SPELL_FROSTBOLT_VOLLEY); + _events.ScheduleEvent(eventId, urand(15000, 20000)); + return; + case EVENT_BLIZZARD: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true)) + me->SummonCreature(NPC_THORIM_EVENT_BUNNY, *target, TEMPSUMMON_TIMED_DESPAWN, 25000); + DoCastAOE(SPELL_BLIZZARD); + _events.ScheduleEvent(eventId, urand(35000, 45000)); + return; + default: + break; + } + } + + // no melee attack + } + + private: + EventMap _events; + SummonList _summons; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetUlduarAI(creature); + } +}; + +class HeightPositionCheck +{ + public: + HeightPositionCheck(bool ret) : _ret(ret) { } + + bool operator()(WorldObject* obj) const + { + return obj->GetPositionZ() > 425.0f == _ret; + } + + private: + bool _ret; +}; + +// 62577 - Blizzard +// 62603 - Blizzard +class spell_thorim_blizzard : public SpellScriptLoader +{ + public: + spell_thorim_blizzard() : SpellScriptLoader("spell_thorim_blizzard") { } + + class spell_thorim_blizzard_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_blizzard_SpellScript); + + void FilterTargets(std::list& targets) + { + targets.remove_if(HeightPositionCheck(true)); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thorim_blizzard_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_blizzard_SpellScript(); + } +}; + +// 62576 - Blizzard +// 62602 - Blizzard +class spell_thorim_blizzard_effect : public SpellScriptLoader +{ + public: + spell_thorim_blizzard_effect() : SpellScriptLoader("spell_thorim_blizzard_effect") { } + + class spell_thorim_blizzard_effect_AuraScript : public AuraScript + { + PrepareAuraScript(spell_thorim_blizzard_effect_AuraScript); + + bool CheckAreaTarget(Unit* target) + { + /// @todo: fix this for all dynobj auras + if (target != GetOwner()) + { + // check if not stacking aura already on target + // this one prevents overriding auras periodically by 2 near area aura owners + Unit::AuraApplicationMap const& auraMap = target->GetAppliedAuras(); + for (Unit::AuraApplicationMap::const_iterator iter = auraMap.begin(); iter != auraMap.end(); ++iter) + { + Aura const* aura = iter->second->GetBase(); + if (GetId() == aura->GetId() && GetOwner() != aura->GetOwner() /*!GetAura()->CanStackWith(aura)*/) + return false; + } + } + return true; + } + + void Register() override + { + DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_thorim_blizzard_effect_AuraScript::CheckAreaTarget); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_thorim_blizzard_effect_AuraScript(); + } +}; + +// 62580, 62604 - Frostbolt Volley +class spell_thorim_frostbolt_volley : public SpellScriptLoader +{ + public: + spell_thorim_frostbolt_volley() : SpellScriptLoader("spell_thorim_frostbolt_volley") { } + + class spell_thorim_frostbolt_volley_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_frostbolt_volley_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if([](WorldObject* target) + { + return target->GetTypeId() != TYPEID_PLAYER && (target->GetTypeId() != TYPEID_UNIT || !target->ToUnit()->IsPet()); + }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thorim_frostbolt_volley_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_frostbolt_volley_SpellScript(); + } +}; + +// 62016 - Charge Orb +class spell_thorim_charge_orb : public SpellScriptLoader +{ + public: + spell_thorim_charge_orb() : SpellScriptLoader("spell_thorim_charge_orb") { } + + class spell_thorim_charge_orb_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_charge_orb_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_LIGHTNING_PILLAR_1 }); + } + + void FilterTargets(std::list& targets) + { + targets.remove_if([](WorldObject* target) + { + return target->GetPositionZ() < 425.0f; + }); + + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); + } + + void HandleScript() + { + if (Unit* target = GetHitUnit()) + target->CastSpell((Unit*)nullptr, SPELL_LIGHTNING_PILLAR_1, true); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thorim_charge_orb_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + AfterHit += SpellHitFn(spell_thorim_charge_orb_SpellScript::HandleScript); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_charge_orb_SpellScript(); + } +}; + +// 62466 - Lightning Charge +class spell_thorim_lightning_charge : public SpellScriptLoader +{ + public: + spell_thorim_lightning_charge() : SpellScriptLoader("spell_thorim_lightning_charge") { } + + class spell_thorim_lightning_charge_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_lightning_charge_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_LIGHTNING_CHARGE }); + } + + void HandleFocus() + { + /// @workaround: focus target is not working because spell is triggered and instant + if (Creature* creature = GetCaster()->ToCreature()) + creature->FocusTarget(GetSpell(), GetExplTargetWorldObject()); + } + + void HandleCharge() + { + GetCaster()->CastSpell(GetCaster(), SPELL_LIGHTNING_CHARGE, true); + } + + void Register() override + { + BeforeCast += SpellCastFn(spell_thorim_lightning_charge_SpellScript::HandleFocus); + AfterCast += SpellCastFn(spell_thorim_lightning_charge_SpellScript::HandleCharge); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_lightning_charge_SpellScript(); + } +}; + +// 62042 - Stormhammer +class spell_thorim_stormhammer : public SpellScriptLoader +{ + public: + spell_thorim_stormhammer() : SpellScriptLoader("spell_thorim_stormhammer") { } + + class spell_thorim_stormhammer_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_stormhammer_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_STORMHAMMER_BOOMERANG, + SPELL_DEAFENING_THUNDER + }); + } + + void FilterTargets(std::list& targets) + { + targets.remove_if([](WorldObject* target) + { + return !IN_ARENA(target); + }); + + if (targets.empty()) + { + FinishCast(SPELL_FAILED_NO_VALID_TARGETS); + return; + } + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + { + target->CastSpell(target, SPELL_DEAFENING_THUNDER, true); + target->CastSpell(GetCaster(), SPELL_STORMHAMMER_BOOMERANG, true); + } + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thorim_stormhammer_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_thorim_stormhammer_SpellScript::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_stormhammer_SpellScript(); + } +}; + +// 64767 - Stormhammer +class spell_thorim_stormhammer_sif : public SpellScriptLoader +{ + public: + spell_thorim_stormhammer_sif() : SpellScriptLoader("spell_thorim_stormhammer_sif") { } + + class spell_thorim_stormhammer_sif_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_stormhammer_sif_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_STORMHAMMER_BOOMERANG, + SPELL_SIF_TRANSFORM + }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + { + target->CastSpell(GetCaster(), SPELL_STORMHAMMER_BOOMERANG, true); + target->CastSpell(target, SPELL_SIF_TRANSFORM, true); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_thorim_stormhammer_sif_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_stormhammer_sif_SpellScript(); + } +}; + +// 62057, 62058 - Runic Smash +class spell_thorim_runic_smash : public SpellScriptLoader +{ + public: + spell_thorim_runic_smash() : SpellScriptLoader("spell_thorim_runic_smash") { } + + class spell_thorim_runic_smash_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_runic_smash_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_RUNIC_SMASH }); + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + std::list triggers; + GetCaster()->GetCreatureListWithEntryInGrid(triggers, GetSpellInfo()->Id == SPELL_RUNIC_SMASH_LEFT ? NPC_GOLEM_LEFT_HAND_BUNNY : NPC_GOLEM_RIGHT_HAND_BUNNY, 150.0f); + for (Creature* bunny : triggers) + { + float dist = GetCaster()->GetExactDist(bunny); + bunny->m_Events.AddEvent(new RunicSmashExplosionEvent(bunny), bunny->m_Events.CalculateTime(uint64(dist * 30))); + }; + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_thorim_runic_smash_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_TRIGGER_SPELL); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_runic_smash_SpellScript(); + } +}; + void AddSC_boss_thorim() { new boss_thorim(); + new npc_thorim_pre_phase(); + new npc_thorim_arena_phase(); + new npc_runic_colossus(); + new npc_ancient_rune_giant(); + new npc_sif(); + new spell_thorim_blizzard(); + new spell_thorim_blizzard_effect(); + new spell_thorim_frostbolt_volley(); + new spell_thorim_charge_orb(); + new spell_thorim_lightning_charge(); + new spell_thorim_stormhammer(); + new spell_thorim_stormhammer_sif(); + new spell_thorim_runic_smash(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index d34a7ac516c..c07fcbc0a6d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -59,6 +59,7 @@ static DoorData const doorData[] = { GO_MIMIRON_DOOR_1, BOSS_MIMIRON, DOOR_TYPE_ROOM }, { GO_MIMIRON_DOOR_2, BOSS_MIMIRON, DOOR_TYPE_ROOM }, { GO_MIMIRON_DOOR_3, BOSS_MIMIRON, DOOR_TYPE_ROOM }, + { GO_THORIM_ENCOUNTER_DOOR, BOSS_THORIM, DOOR_TYPE_ROOM }, { GO_VEZAX_DOOR, BOSS_VEZAX, DOOR_TYPE_PASSAGE }, { GO_YOGG_SARON_DOOR, BOSS_YOGG_SARON, DOOR_TYPE_ROOM }, { GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM }, @@ -95,6 +96,9 @@ ObjectData const creatureData[] = { NPC_EXPEDITION_COMMANDER, DATA_EXPEDITION_COMMANDER }, { NPC_RAZORSCALE_CONTROLLER, DATA_RAZORSCALE_CONTROL }, + { NPC_SIF, DATA_SIF }, + { NPC_RUNIC_COLOSSUS, DATA_RUNIC_COLOSSUS }, + { NPC_RUNE_GIANT, DATA_RUNE_GIANT }, { NPC_COMPUTER, DATA_COMPUTER }, { NPC_WORLD_TRIGGER_MIMIRON, DATA_MIMIRON_WORLD_TRIGGER }, { NPC_VOICE_OF_YOGG_SARON, DATA_VOICE_OF_YOGG_SARON }, @@ -118,6 +122,9 @@ ObjectData const objectData[] = { GO_RAZOR_HARPOON_2, GO_RAZOR_HARPOON_2 }, { GO_RAZOR_HARPOON_3, GO_RAZOR_HARPOON_3 }, { GO_RAZOR_HARPOON_4, GO_RAZOR_HARPOON_4 }, + { GO_THORIM_LEVER, DATA_THORIM_LEVER }, + { GO_THORIM_STONE_DOOR, DATA_STONE_DOOR }, + { GO_THORIM_RUNIC_DOOR, DATA_RUNIC_DOOR }, { 0, 0 } }; @@ -173,7 +180,8 @@ class instance_ulduar : public InstanceMapScript ObjectGuid LeviathanGateGUID; ObjectGuid KologarnChestGUID; ObjectGuid KologarnBridgeGUID; - ObjectGuid ThorimChestGUID; + ObjectGuid CacheOfStormsGUID; + ObjectGuid CacheOfStormsHardmodeGUID; ObjectGuid HodirRareCacheGUID; ObjectGuid HodirChestGUID; ObjectGuid MimironTramGUID; @@ -447,9 +455,13 @@ class instance_ulduar : public InstanceMapScript if (GetBossState(BOSS_KOLOGARN) == DONE) HandleGameObject(ObjectGuid::Empty, false, gameObject); break; - case GO_THORIM_CHEST_HERO: - case GO_THORIM_CHEST: - ThorimChestGUID = gameObject->GetGUID(); + case GO_CACHE_OF_STORMS_10: + case GO_CACHE_OF_STORMS_25: + CacheOfStormsGUID = gameObject->GetGUID(); + break; + case GO_CACHE_OF_STORMS_HARDMODE_10: + case GO_CACHE_OF_STORMS_HARDMODE_25: + CacheOfStormsHardmodeGUID = gameObject->GetGUID(); break; case GO_HODIR_RARE_CACHE_OF_WINTER_HERO: case GO_HODIR_RARE_CACHE_OF_WINTER: @@ -656,9 +668,17 @@ class instance_ulduar : public InstanceMapScript case BOSS_THORIM: if (state == DONE) { - if (GameObject* gameObject = instance->GetGameObject(ThorimChestGUID)) - gameObject->SetRespawnTime(gameObject->GetRespawnDelay()); - + if (Creature* thorim = GetCreature(BOSS_THORIM)) + { + if (GameObject* cache = instance->GetGameObject(thorim->AI()->GetData(DATA_THORIM_HARDMODE) ? CacheOfStormsHardmodeGUID : CacheOfStormsGUID)) + { + cache->SetLootRecipient(thorim->GetLootRecipient()); + cache->SetRespawnTime(cache->GetRespawnDelay()); + cache->RemoveFlag(GO_FLAG_LOCKED); + cache->RemoveFlag(GO_FLAG_NOT_SELECTABLE); + cache->RemoveFlag(GO_FLAG_NODESPAWN); + } + } instance->SummonCreature(NPC_THORIM_OBSERVATION_RING, ObservationRingKeepersPos[2]); } break; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index a26b699b396..e7279005679 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -157,6 +157,24 @@ enum UlduarNPCs // Freya Achievement Trigger NPC_FREYA_ACHIEVE_TRIGGER = 33406, + // Thorim + NPC_THORIM_INVISIBLE_STALKER = 32780, + NPC_RUNIC_COLOSSUS = 32872, + NPC_RUNE_GIANT = 32873, + NPC_IRON_RING_GUARD = 32874, + NPC_IRON_HONOR_GUARD = 32875, + NPC_DARK_RUNE_CHAMPION = 32876, + NPC_DARK_RUNE_WARBRINGER = 32877, + NPC_DARK_RUNE_EVOKER = 32878, + NPC_DARK_RUNE_COMMONER = 32904, + NPC_DARK_RUNE_ACOLYTE = 33110, + NPC_THORIM_EVENT_BUNNY = 32892, + NPC_LIGHTNING_ORB = 33138, + NPC_GOLEM_RIGHT_HAND_BUNNY = 33140, + NPC_GOLEM_LEFT_HAND_BUNNY = 33141, + NPC_SIF = 33196, + NPC_THUNDER_ORB = 33378, + // Yogg-Saron NPC_SARA = 33134, NPC_GUARDIAN_OF_YOGG_SARON = 33136, @@ -241,8 +259,14 @@ enum UlduarGameObjects GO_HODIR_CHEST = 194307, // Thorim - GO_THORIM_CHEST_HERO = 194315, - GO_THORIM_CHEST = 194314, + GO_CACHE_OF_STORMS_10 = 194312, + GO_CACHE_OF_STORMS_HARDMODE_10 = 194313, + GO_CACHE_OF_STORMS_25 = 194315, + GO_CACHE_OF_STORMS_HARDMODE_25 = 194314, + GO_THORIM_RUNIC_DOOR = 194557, + GO_THORIM_STONE_DOOR = 194558, + GO_THORIM_ENCOUNTER_DOOR = 194559, + GO_THORIM_LEVER = 194265, // Mimiron GO_MIMIRON_TRAM = 194675, @@ -407,6 +431,15 @@ enum UlduarData DATA_ALGALON_TRAPDOOR, DATA_BRANN_BRONZEBEARD_ALG, + // Thorim + DATA_SIF, + DATA_THORIM_LEVER, + DATA_RUNIC_COLOSSUS, + DATA_RUNE_GIANT, + DATA_RUNIC_DOOR, + DATA_STONE_DOOR, + DATA_THORIM_HARDMODE, + // Misc DATA_BRANN_BRONZEBEARD_INTRO, DATA_LORE_KEEPER_OF_NORGANNON, @@ -423,10 +456,15 @@ enum UlduarWorldStates enum UlduarAchievementData { // FL Achievement boolean - DATA_UNBROKEN = 29052906, // 2905, 2906 are achievement IDs, + DATA_UNBROKEN = 29052906, // 2905, 2906 are achievement IDs, MAX_HERALD_ARMOR_ITEMLEVEL = 226, - MAX_HERALD_WEAPON_ITEMLEVEL = 232, - SPELL_LUMBERJACKED_CREDIT = 65296 + MAX_HERALD_WEAPON_ITEMLEVEL = 232 +}; + +enum UlduarSharedSpells +{ + SPELL_LUMBERJACKED_CREDIT = 65296, + SPELL_TELEPORT_KEEPER_VISUAL = 62940 // used by keepers }; enum UlduarEvents @@ -445,6 +483,23 @@ enum YoggSaronIllusions STORMWIND_ILLUSION = 2, }; +class KeeperDespawnEvent : public BasicEvent +{ +public: + KeeperDespawnEvent(Creature* owner, uint32 despawnTimerOffset = 500) : _owner(owner), _despawnTimer(despawnTimerOffset) { } + + bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override + { + _owner->CastSpell(_owner, SPELL_TELEPORT_KEEPER_VISUAL); + _owner->DespawnOrUnsummon(1000 + _despawnTimer); + return true; + } + +private: + Creature* _owner; + uint32 _despawnTimer; +}; + template inline AI* GetUlduarAI(T* obj) { diff --git a/src/server/scripts/Northrend/northrend_script_loader.cpp b/src/server/scripts/Northrend/northrend_script_loader.cpp index 934d29e61b6..57bd641591c 100644 --- a/src/server/scripts/Northrend/northrend_script_loader.cpp +++ b/src/server/scripts/Northrend/northrend_script_loader.cpp @@ -110,6 +110,7 @@ void AddSC_boss_general_vezax(); void AddSC_boss_mimiron(); void AddSC_boss_hodir(); void AddSC_boss_freya(); +void AddSC_boss_thorim(); void AddSC_boss_yogg_saron(); void AddSC_boss_algalon_the_observer(); void AddSC_instance_ulduar(); @@ -291,6 +292,7 @@ void AddNorthrendScripts() AddSC_boss_mimiron(); AddSC_boss_hodir(); AddSC_boss_freya(); + AddSC_boss_thorim(); AddSC_boss_yogg_saron(); AddSC_boss_algalon_the_observer(); AddSC_instance_ulduar(); -- cgit v1.2.3 From e2bc8c538360ba753ca3f11d1ea21e7519930919 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 23 Mar 2017 04:26:09 -0300 Subject: Core/Scripts: improvements on the Thorim script Improvements done to initial work by joschiwald: - Fixed stormhammer casting and visuals - Fixed spell credits - Implemented removal of Impale when HP is higher than 90% - Corrected faction templates for the pre combat creatures - Implemeted Leap on the arena adds (thanks to joschiwald for implementing conditions) - Scripted lighting charge using AuraScript periodic - Fixed timings - Corrections on the hallway encounters (added knockback immunity to minibosses too) - Fixed multiple blizzards issue - Lever will now reset properly, should players fail to get inside. This allows the door to be opened more than once during the combat - Corrections in the outro event - Implemented paralytic field traps on the hallway. - Implemented Ancient Gate of the Keepers opening. - Changed blizzard bunny targetting to conditions entirely. - Removed obsolete scripts - Standards: delete spell script names by ScriptName instead of spell_id - Swapped factions for pre-adds (alliance should get horde trash and vs) - Fixed Leap setting home position for adds - Removed a bunch of magic numbers - Runic Colossus should finish current Runic Explosion before beginning to attack - Fixed UpdateAI logic to put it in line with other scripts (ie don't stop casts) Special thanks to: - chaodhib for the blizzard trigger waypoints and investigation on spell radius - Malcrom for creating the Conditions Creator :P Closes #15008 Closes #17072 (cherry picked from commit 4a69f5bda58fe3af5ec6000e0ec10a3b0732969a) --- .../2020_06_14_09_world_2017_05_16_01_world.sql | 210 +++++ ...20_06_14_09_world_2017_MM_DD_NN_world_15008.sql | 99 --- src/server/game/Spells/SpellMgr.cpp | 8 + .../Northrend/Ulduar/Ulduar/boss_thorim.cpp | 916 ++++++++++++++------- .../Northrend/Ulduar/Ulduar/instance_ulduar.cpp | 27 +- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 13 +- 6 files changed, 854 insertions(+), 419 deletions(-) create mode 100644 sql/updates/world/master/2020_06_14_09_world_2017_05_16_01_world.sql delete mode 100644 sql/updates/world/master/2020_06_14_09_world_2017_MM_DD_NN_world_15008.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_09_world_2017_05_16_01_world.sql b/sql/updates/world/master/2020_06_14_09_world_2017_05_16_01_world.sql new file mode 100644 index 00000000000..8e0718846b3 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_09_world_2017_05_16_01_world.sql @@ -0,0 +1,210 @@ +/* + * Thorim + */ + +DELETE FROM `creature_text` WHERE `CreatureID` IN (32865,32872,32873,33196); +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextID`, `comment`) VALUES +-- Thorim +(32865, 0,0,'Interlopers! You mortals who dare to interfere with my sport will pay... Wait--you...',14,0,100,0,0,15733,33145,'Thorim SAY_AGGRO_1'), +(32865, 1,0,'I remember you... In the mountains... But you... what is this? Where am--',14,0,100,0,0,15734,33270,'Thorim SAY_AGGRO_2'), +(32865, 2,0,'Do not hold back! Destroy them!',14,0,100,0,0,15736,34241,'Thorim SAY_SPECIAL'), +(32865, 3,0,'Impertinent whelps, you dare challenge me atop my pedestal? I will crush you myself!',14,0,100,0,0,15738,33148,'Thorim SAY_JUMPDOWN'), +(32865, 4,0,'Can''t you at least put up a fight!?',14,0,100,0,0,15739,34239,'Thorim SAY_SLAY_1'), +(32865, 4,1,'Pathetic.',14,0,100,0,0,15740,35768,'Thorim SAY_SLAY_2'), +(32865, 5,0,'My patience has reached its limit!',14,0,100,0,0,15741,33365,'Thorim SAY_BERSERK'), +(32865, 6,0,'Failures! Weaklings!',14,0,100,0,0,15742,33274,'Thorim SAY_WIPE'), +(32865, 7,0,'Stay your arms! I yield!',14,0,100,0,0,15743,33948,'Thorim SAY_DEATH'), +(32865, 8,0,'I feel as though I am awakening from a nightmare, but the shadows in this place yet linger.',14,0,100,0,0,15744,33949,'Thorim SAY_END_NORMAL_1'), +(32865, 9,0,'Sif... was Sif here? Impossible--she died by my brother''s hand. A dark nightmare indeed....',14,0,100,0,0,15745,33950,'Thorim SAY_END_NORMAL_2'), +(32865,10,0,'I need time to reflect.... I will aid your cause if you should require it. I owe you at least that much. Farewell.',14,0,100,0,0,15746,33951,'Thorim SAY_END_NORMAL_3'), +(32865,11,0,'You! Fiend! You are not my beloved! Be gone!',14,0,100,0,0,15747,33952,'Thorim SAY_END_HARD_1'), +(32865,12,0,'Behold the hand behind all the evil that has befallen Ulduar, left my kingdom in ruins, corrupted my brother, and slain my wife.',14,0,100,0,0,15748,33953,'Thorim SAY_END_HARD_2'), +(32865,13,0,'And now it falls to you, champions, to avenge us all. The task before you is great, but I will lend you my aid as I am able. You must prevail.',14,0,100,0,0,15749,33954,'Thorim SAY_END_HARD_3'), +-- Runic Colossus +(32872, 0,0,'%s surrounds itself with a crackling Runic Barrier!',41,0,100,0,0,0,33267,'Runic Colossus'), +-- Ancient Rune Giant +(32873, 0,0,'%s fortifies nearby allies with runic might!',41,0,100,0,0,0,33523,'Ancient Rune Giant'), +-- Sif +(33196, 0,0,'Thorim, my lord! Why else would these invaders have come into your sanctum but to slay you? They must be stopped!',14,0,100,0,0,15668,33325,'Sif - Start'), +(33196, 1,0,'These pathetic mortals are harmless, beneath my station. Dispose of them!',14,0,100,0,0,15669,33368,'Sif - Despawn'), +(33196, 2,0,'Impossible! Lord Thorim, I will bring your foes a frigid death!',14,0,100,0,0,15670,33369,'Sif - Event'); + +-- Lever SAI +SET @ENTRY := 194264; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@ENTRY; +UPDATE `gameobject_template_addon` SET `flags`=32 WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=1; +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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,1,0,0,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14,34155,0,0,0,0,0,0,'Lever - On Gameobject State Changed - Activate Gameobject'); + +-- Thorim Trap Bunny SAI +SET @ENTRY := 33054; +UPDATE `creature_template` SET `AIName`='SmartAI', `flags_extra`=2 WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,10,0,100,0,0,12,17000,17000,11,62241,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thorim Trap Bunny - Within 0-12 Range Out of Combat LoS - Cast Paralytic Field'); + +SET @ENTRY := 33725; +UPDATE `creature_template` SET `AIName`='SmartAI', `flags_extra`=2 WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,10,0,100,0,0,12,17000,17000,11,63540,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thorim Trap Bunny - Within 0-12 Range Out of Combat LoS - Cast Paralytic Field'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_thorim_blizzard_effect','spell_thorim_frostbolt_volley','spell_thorim_charge_orb','spell_thorim_runic_smash','spell_thorim_stormhammer','spell_thorim_lightning_charge','spell_thorim_stormhammer_sif','spell_thorim_stormhammer_boomerang','spell_thorim_activate_lightning_orb_periodic','spell_iron_ring_guard_impale','spell_thorim_arena_leap'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(62576,'spell_thorim_blizzard_effect'), +(62602,'spell_thorim_blizzard_effect'), +(62580,'spell_thorim_frostbolt_volley'), +(62604,'spell_thorim_frostbolt_volley'), +(62016,'spell_thorim_charge_orb'), +(62057,'spell_thorim_runic_smash'), +(62058,'spell_thorim_runic_smash'), +(62042,'spell_thorim_stormhammer'), +(62466,'spell_thorim_lightning_charge'), +(64767,'spell_thorim_stormhammer_sif'), +(64909,'spell_thorim_stormhammer_boomerang'), +(62184,'spell_thorim_activate_lightning_orb_periodic'), +(62331,'spell_iron_ring_guard_impale'), +(62418,'spell_iron_ring_guard_impale'), +(61934,'spell_thorim_arena_leap'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=62042; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = -62320; +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(-62320, -62398, 0, 'Aura of Celerity - Remove Visual'); + +UPDATE `creature_template` SET `ScriptName`='boss_thorim' WHERE `entry`=32865; +UPDATE `creature_template` SET `ScriptName`='npc_sif' WHERE `entry`=33196; +UPDATE `creature_template` SET `ScriptName`='npc_thorim_pre_phase' WHERE `entry` IN (32885,32883,32908,32907,32882,32886); +UPDATE `creature_template` SET `ScriptName`='npc_thorim_arena_phase' WHERE `entry` IN (32876,32904,32878,32877,32874,32875,33110); +UPDATE `creature_template` SET `ScriptName`='npc_runic_colossus' WHERE `entry`=32872; +UPDATE `creature_template` SET `ScriptName`='npc_ancient_rune_giant' WHERE `entry`=32873; +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x40000000 WHERE `entry` IN (32872, 32873, 33148, 33149); +UPDATE `creature_template` SET `difficulty_entry_1`=33150 WHERE `entry`=32908; -- Swapped Difficulty entry npcs +UPDATE `creature_template` SET `difficulty_entry_1`=33151 WHERE `entry`=32907; -- Caused swapped displayIDs in 25n +UPDATE `creature_template` SET `InhabitType`=4, `flags_extra`=128, `ScriptName`='' WHERE `entry` IN (33140,33141); +UPDATE `creature_template` SET `InhabitType`=4, `flags_extra`=128 WHERE `entry` IN (33378,32879); +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (32892); +UPDATE `creature_template` SET `faction`=1692 WHERE `entry` IN (32885,32883,33152,33153,32908,33150,32907,33151); +UPDATE `creature_template` SET `faction`=1693 WHERE `entry` IN (32882,33154); +UPDATE `creature_template` SET `speed_walk`=2.5/2.5, `speed_run`=14.0/7.0, `BaseAttackTime`=1500, `RangeAttackTime`=1500, `flags_extra`=`flags_extra`|0x00000200 WHERE `entry` IN (32865,33147); + +SET @THORIM_BLIZZARD_BUNNY := 136515; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (62577,62603,62016,62976,63238,64098,62466,62565,62942,64767,62560,61964,61934); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 62577, 0, 0, 31, 0, 3, 32892, @THORIM_BLIZZARD_BUNNY, 0, 0, 0, '', 'Spell Blizzard (effect 0) will hit the potential target of the spell if target is unit Thorim Event Bunny guid 136515.'), +(13, 1, 62603, 0, 0, 31, 0, 3, 32892, @THORIM_BLIZZARD_BUNNY, 0, 0, 0, '', 'Spell Blizzard (effect 0) will hit the potential target of the spell if target is unit Thorim Event Bunny guid 136515.'), +(13, 1, 62016, 0, 0, 31, 0, 3, 33378, 0, 0, 0, 0, '', 'Spell Charge Orb (effect 0) will hit the potential target of the spell if target is unit Thunder Orb.'), +(13, 1, 62976, 0, 0, 31, 0, 3, 33378, 0, 0, 0, 0, '', 'Spell Lightning Pillar (effect 0) will hit the potential target of the spell if target is unit Thunder Orb.'), +(13, 1, 62976, 0, 0, 33, 0, 1, 0, 0, 1, 0, 0, '', 'Spell Lightning Pillar (effect 0) will hit the potential target of the spell if target is not the same as condition target.'), +(13, 1, 63238, 0, 0, 31, 0, 3, 33378, 0, 0, 0, 0, '', 'Spell Lightning Pillar (effect 0) will hit the potential target of the spell if target is unit Thunder Orb.'), +(13, 1, 63238, 0, 0, 33, 0, 1, 0, 0, 1, 0, 0, '', 'Spell Lightning Pillar (effect 0) will hit the potential target of the spell if target is not the same as condition target.'), +(13, 1, 64098, 0, 0, 31, 0, 3, 32865, 0, 0, 0, 0, '', 'Spell Lightning Bolt (effect 0) will hit the potential target of the spell if target is unit Thorim.'), +(13, 4, 62466, 0, 0, 31, 0, 3, 32780, 0, 0, 0, 0, '', 'Spell Lightning Charge (effect 2) will hit the potential target of the spell if target is unit Invisible Stalker (All Phases).'), +(13, 3, 62565, 0, 0, 31, 0, 3, 32865, 0, 0, 0, 0, '', 'Spell Touch of Dominion (effects 0 & 1) will hit the potential target of the spell if target is unit Thorim.'), +(13, 7, 62942, 0, 0, 31, 0, 3, 32874, 0, 0, 0, 0, '', 'Spell Runic Fortification (effect 0 & 1 & 2) will hit the potential target of the spell if target is unit Iron Ring Guard.'), +(13, 7, 62942, 0, 1, 31, 0, 3, 32875, 0, 0, 0, 0, '', 'Spell Runic Fortification (effect 0 & 1 & 2) will hit the potential target of the spell if target is unit Iron Honor Guard.'), +(13, 7, 62942, 0, 2, 31, 0, 3, 33110, 0, 0, 0, 0, '', 'Spell Runic Fortification (effect 0 & 1 & 2) will hit the potential target of the spell if target is unit Dark Rune Acolyte.'), +(13, 1, 64767, 0, 0, 31, 0, 3, 33196, 0, 0, 0, 0, '', 'Spell Stormhammer (effect 0) will hit the potential target of the spell if target is unit Sif.'), +(13, 7, 62560, 0, 0, 31, 0, 3, 32876, 0, 0, 0, 0, '', 'Spell Berserk (effect 0 & 1 & 2) will hit the potential target of the spell if target is unit Dark Rune Champion.'), +(13, 7, 62560, 0, 1, 31, 0, 3, 32877, 0, 0, 0, 0, '', 'Spell Berserk (effect 0 & 1 & 2) will hit the potential target of the spell if target is unit Dark Rune Warbringer.'), +(13, 7, 62560, 0, 2, 31, 0, 3, 32878, 0, 0, 0, 0, '', 'Spell Berserk (effect 0 & 1 & 2) will hit the potential target of the spell if target is unit Dark Rune Evoker.'), +(13, 7, 62560, 0, 3, 31, 0, 3, 32904, 0, 0, 0, 0, '', 'Spell Berserk (effect 0 & 1 & 2) will hit the potential target of the spell if target is unit Dark Rune Commoner.'), +(13, 1, 61964, 0, 0, 31, 0, 3, 32882, 0, 0, 0, 0, '', 'Spell Circle of Healing (effect 0) will hit the potential target of the spell if target is unit Jormungar Behemoth.'), +(13, 1, 61964, 0, 1, 31, 0, 3, 32883, 0, 0, 0, 0, '', 'Spell Circle of Healing (effect 0) will hit the potential target of the spell if target is unit Captured Mercenary Soldier.'), +(13, 1, 61964, 0, 2, 31, 0, 3, 32885, 0, 0, 0, 0, '', 'Spell Circle of Healing (effect 0) will hit the potential target of the spell if target is unit Captured Mercenary Soldier.'), +(13, 1, 61964, 0, 3, 31, 0, 3, 32886, 0, 0, 0, 0, '', 'Spell Circle of Healing (effect 0) will hit the potential target of the spell if target is unit Dark Rune Acolyte.'), +(13, 1, 61964, 0, 4, 31, 0, 3, 32907, 0, 0, 0, 0, '', 'Spell Circle of Healing (effect 0) will hit the potential target of the spell if target is unit Captured Mercenary Captain.'), +(13, 1, 61964, 0, 5, 31, 0, 3, 32908, 0, 0, 0, 0, '', 'Spell Circle of Healing (effect 0) will hit the potential target of the spell if target is unit Captured Mercenary Captain.'), +(13, 1, 61934, 0, 0, 31, 0, 3, 32892, 0, 0, 0, 0, 'condition_thorim_arena_leap', 'Spell Leap (effect 0) will hit the potential target of the spell if target is unit Thorim Event Bunny.'), +(13, 1, 61934, 0, 0, 31, 0, 3, 32892, @THORIM_BLIZZARD_BUNNY, 1, 0, 0, '', 'Spell Leap (effect 0) will hit the potential target of the spell if target is not unit Thorim Event Bunny guid 136515.'); + +DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN (62042,64767,45537); +INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES +(0, 62042, 64, '', '', 'Stormhammer - Ignore LOS'), +(0, 64767, 64, '', '', 'Stormhammer - Ignore LOS'), +(0, 45537, 64, '', '', 'Lightning Beam Channel - Ignore LOS'); + +DELETE FROM `creature` WHERE `id` IN (32882,32908,32907,32885,32883,32886); -- PreAdds +DELETE FROM `creature` WHERE `id` IN (32874,32875,33110); -- Colossus, Giant Adds + +-- Fix Thorim Controller multi spawns +SET @CGUID:=136446; +DELETE FROM `creature` WHERE `id`=32879; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnDifficulties`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID, 32879, 603, '14,33', 0, 2134.774, -262.3073, 428.6936, 1.343904, 7200, 0, 0); -- 32879 (Area: 0) (Auras: 62184 - 62184) + +UPDATE `gameobject_template` SET `size`=3 WHERE `entry`=194315; +UPDATE `gameobject_template_addon` SET `faction`=94, `flags`=16 WHERE `entry` IN (194313,194314,194315); + +SET @OGUID := 3926; -- 4 free guids +DELETE FROM `gameobject` WHERE `id` IN (194312,194313,194314,194315); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnDifficulties`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) values +(@OGUID+0,194312,603,'14',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), +(@OGUID+1,194313,603,'14',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), +(@OGUID+2,194314,603,'33',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), +(@OGUID+3,194315,603,'33',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0); + +UPDATE `gameobject_loot_template` SET `LootMode`=1 WHERE `Entry`=27074; +DELETE FROM `gameobject_loot_template` WHERE `Entry` IN (26955,26956); +INSERT INTO `gameobject_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES +(26955,1,34372,100,0,1,0,1,1,'Thorim25 HM - normal mode loot'), +(26955,2,12033,100,0,1,0,1,2,'Thorim25 HM - T8.5 tokens'), +(26955,3,34154,10,0,1,0,1,1,'Thorim25 HM - Random Ulduar craft recipe'), +(26955,45038,0,18,0,1,0,1,1,'Thorim25 HM - Val''anyr fragment'), +(26955,45087,0,10,0,1,0,1,1,'Thorim25 HM - Runed Orb'), +(26955,45470,0,0,0,1,1,1,1,'Thorim25 HM - Wisdom''s Hold'), +(26955,45471,0,0,0,1,1,1,1,'Thorim25 HM - Fate''s Clutch'), +(26955,45472,0,0,0,1,1,1,1,'Thorim25 HM - Warhelm of the Champion'), +(26955,45473,0,0,0,1,1,1,1,'Thorim25 HM - Embrace of the Gladiator'), +(26955,45474,0,0,0,1,1,1,1,'Thorim25 HM - Pauldrons of the Combatant'), +(26955,45570,0,0,0,1,1,1,1,'Thorim25 HM - Skyforge Crossbow'), +(26955,45817,0,100,1,1,0,1,1,'Thorim25 HM - Thorim''s Sigil'), +(26955,47241,0,100,0,1,0,1,1,'Thorim25 HM - Emblem of Triumph'), + +(26956,1,34372,100,0,1,0,1,1,'Thorim25 - normal mode loot'), +(26956,2,12033,100,0,1,0,1,2,'Thorim25 - T8.5 tokens'), +(26956,3,34154,10,0,1,0,1,1,'Thorim25 - Random Ulduar craft recipe'), +(26956,45038,0,8,0,1,0,1,1,'Thorim25 - Val''anyr fragment'), +(26956,45087,0,10,0,1,0,1,1,'Thorim25 - Runed Orb'), +(26956,47241,0,100,0,1,0,1,1,'Thorim25 - Emblem of Triumph'); + +-- Pathing for Thorim Event Bunny Entry: 32892 'TDB FORMAT' +SET @PATH := @THORIM_BLIZZARD_BUNNY * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2148.425,`position_y`=-276.7478,`position_z`=419.5923 WHERE `guid`=@THORIM_BLIZZARD_BUNNY; +DELETE FROM `creature_addon` WHERE `guid`=@THORIM_BLIZZARD_BUNNY; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@THORIM_BLIZZARD_BUNNY,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,2148.425,-276.7478,419.5923,0,0,0,0,100,0), +(@PATH,2,2145.229,-278.5732,419.6016,0,0,0,0,100,0), +(@PATH,3,2142.105,-280.7194,419.5932,0,0,0,0,100,0), +(@PATH,4,2138.419,-281.2838,419.5999,0,0,0,0,100,0), +(@PATH,5,2134.843,-281.9885,419.5996,0,0,0,0,100,0), +(@PATH,6,2131.128,-281.278,419.5985,0,0,0,0,100,0), +(@PATH,7,2127.415,-280.8166,419.5875,0,0,0,0,100,0), +(@PATH,8,2124.459,-278.4777,419.6088,0,0,0,0,100,0), +(@PATH,9,2121.098,-276.7148,419.5924,0,0,0,0,100,0), +(@PATH,10,2119.281,-273.4217,419.6069,0,0,0,0,100,0), +(@PATH,11,2116.933,-270.4605,419.5851,0,0,0,0,100,0), +(@PATH,12,2116.359,-266.7142,419.6042,0,0,0,0,100,0), +(@PATH,13,2115.436,-263.0562,419.5847,0,0,0,0,100,0), +(@PATH,14,2116.543,-259.411,419.6082,0,0,0,0,100,0), +(@PATH,15,2116.943,-255.605,419.5851,0,0,0,0,100,0), +(@PATH,16,2119.377,-252.7493,419.6096,0,0,0,0,100,0), +(@PATH,17,2121.183,-249.3546,419.5858,0,0,0,0,100,0), +(@PATH,18,2124.49,-247.5925,419.6089,0,0,0,0,100,0), +(@PATH,19,2127.329,-245.1714,419.5925,0,0,0,0,100,0), +(@PATH,20,2131.097,-244.8609,419.6089,0,0,0,0,100,0), +(@PATH,21,2134.792,-243.7036,419.585,0,0,0,0,100,0), +(@PATH,22,2138.466,-244.3162,419.5979,0,0,0,0,100,0), +(@PATH,23,2142.386,-244.7266,419.5746,0,0,0,0,100,0), +(@PATH,24,2145.455,-247.1502,419.5968,0,0,0,0,100,0), +(@PATH,25,2148.564,-249.0781,419.5791,0,0,0,0,100,0), +(@PATH,26,2150.63,-252.4069,419.598,0,0,0,0,100,0), +(@PATH,27,2153.104,-255.5907,419.5758,0,0,0,0,100,0), +(@PATH,28,2153.286,-259.4698,419.6053,0,0,0,0,100,0), +(@PATH,29,2154.193,-263.0425,419.6039,0,0,0,0,100,0), +(@PATH,30,2153.279,-266.768,419.6026,0,0,0,0,100,0), +(@PATH,31,2152.758,-270.5462,419.5822,0,0,0,0,100,0), +(@PATH,32,2150.38,-273.4614,419.605,0,0,0,0,100,0); diff --git a/sql/updates/world/master/2020_06_14_09_world_2017_MM_DD_NN_world_15008.sql b/sql/updates/world/master/2020_06_14_09_world_2017_MM_DD_NN_world_15008.sql deleted file mode 100644 index e52203e4e7e..00000000000 --- a/sql/updates/world/master/2020_06_14_09_world_2017_MM_DD_NN_world_15008.sql +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Thorim - */ - --- todo: immunity runic colossus, rune giant grip and knockback - -DELETE FROM `creature_text` WHERE `CreatureID` IN (32865,32872,32873,33196); -INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextID`, `comment`) VALUES --- Thorim -(32865, 0,0,'Interlopers! You mortals who dare to interfere with my sport will pay... Wait--you...',14,0,100,0,0,15733,33145,'Thorim SAY_AGGRO_1'), -(32865, 1,0,'I remember you... In the mountains... But you... what is this? Where am--',14,0,100,0,0,15734,33270,'Thorim SAY_AGGRO_2'), -(32865, 2,0,'Behold the power of the storms and despair!',14,0,100,0,0,15735,0,'Thorim SAY_SPECIAL_1'), -(32865, 3,0,'Do not hold back! Destroy them!',14,0,100,0,0,15736,34241,'Thorim SAY_SPECIAL_2'), -(32865, 4,0,'Have you begun to regret your intrusion?',14,0,100,0,0,15737,0,'Thorim SAY_SPECIAL_3'), -(32865, 5,0,'Impertinent whelps, you dare challenge me atop my pedestal? I will crush you myself!',14,0,100,0,0,15738,33148,'Thorim SAY_JUMPDOWN'), -(32865, 6,0,'Can''t you at least put up a fight!?',14,0,100,0,0,15739,34239,'Thorim SAY_SLAY_1'), -(32865, 6,1,'Pathetic.',14,0,100,0,0,15740,35768,'Thorim SAY_SLAY_2'), -(32865, 7,0,'My patience has reached its limit!',14,0,100,0,0,15741,33365,'Thorim SAY_BERSERK'), -(32865, 8,0,'Failures! Weaklings!',14,0,100,0,0,15742,33274,'Thorim SAY_WIPE'), -(32865, 9,0,'Stay your arms! I yield!',14,0,100,0,0,15743,33948,'Thorim SAY_DEATH'), -(32865,10,0,'I feel as though I am awakening from a nightmare, but the shadows in this place yet linger.',14,0,100,0,0,15744,33949,'Thorim SAY_END_NORMAL_1'), -(32865,11,0,'Sif... was Sif here? Impossible--she died by my brother''s hand. A dark nightmare indeed....',14,0,100,0,0,15745,33950,'Thorim SAY_END_NORMAL_2'), -(32865,12,0,'I need time to reflect.... I will aid your cause if you should require it. I owe you at least that much. Farewell.',14,0,100,0,0,15746,33951,'Thorim SAY_END_NORMAL_3'), -(32865,13,0,'You! Fiend! You are not my beloved! Be gone!',14,0,100,0,0,15747,33952,'Thorim SAY_END_HARD_1'), -(32865,14,0,'Behold the hand behind all the evil that has befallen Ulduar, left my kingdom in ruins, corrupted my brother, and slain my wife.',14,0,100,0,0,15748,33953,'Thorim SAY_END_HARD_2'), -(32865,15,0,'And now it falls to you, champions, to avenge us all. The task before you is great, but I will lend you my aid as I am able. You must prevail.',14,0,100,0,0,15749,33954,'Thorim SAY_END_HARD_3'), --- Runic Colossus -(32872, 0,0,'%s surrounds itself with a crackling Runic Barrier!',41,0,100,0,0,0,33267,'Runic Colossus'), --- Ancient Rune Giant -(32873, 0,0,'%s fortifies nearby allies with runic might!',41,0,100,0,0,0,33523,'Ancient Rune Giant'), --- Sif -(33196, 0,0,'Thorim, my lord! Why else would these invaders have come into your sanctum but to slay you? They must be stopped!',14,0,100,0,0,15668,33325,'Sif - Start'), -(33196, 1,0,'These pathetic mortals are harmless, beneath my station. Dispose of them!',14,0,100,0,0,15669,33368,'Sif - Despawn'), -(33196, 2,0,'Impossible! Lord Thorim, I will bring your foes a frigid death!',14,0,100,0,0,15670,33369,'Sif - Event'); - -UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=194265; -DELETE FROM `smart_scripts` WHERE `entryorguid`=194265 AND `source_type`=1; -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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(194265,1,0,0,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14,34155,0,0,0,0,0,0, 'Lever - On activate - Activate Dark Iron Portcullis'); - -DELETE FROM `spell_script_names` WHERE `spell_id` IN (62577,62603,62576,62602,62580,62604,62016,62057,62058,62042,62466,64767); -INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES -(62577,'spell_thorim_blizzard'), -(62603,'spell_thorim_blizzard'), -(62576,'spell_thorim_blizzard_effect'), -(62602,'spell_thorim_blizzard_effect'), -(62580,'spell_thorim_frostbolt_volley'), -(62604,'spell_thorim_frostbolt_volley'), -(62016,'spell_thorim_charge_orb'), -(62057,'spell_thorim_runic_smash'), -(62058,'spell_thorim_runic_smash'), -(62042,'spell_thorim_stormhammer'), -(62466,'spell_thorim_lightning_charge'), -(64767,'spell_thorim_stormhammer_sif'); - -DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=62042; - -UPDATE `creature_template` SET `InhabitType`=4, `flags_extra`=128, `ScriptName`='' WHERE `entry` IN (33140,33141); -UPDATE `creature_template` SET `InhabitType`=4, `flags_extra`=128 WHERE `entry` IN (33054,33378); -UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (32892); - -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (62577,62603,62016,62976,63238,64098,62466,62565,62942,64767,62560,61964); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES -(13,1,62577,0,0,31,0,3,32892,0,0,0,'','Thorim - Blizzard'), -(13,1,62603,0,0,31,0,3,32892,0,0,0,'','Thorim - Blizzard'), -(13,1,62016,0,0,31,0,3,33378,0,0,0,'','Thorim - Charge Orb'), -(13,1,62976,0,0,31,0,3,33378,0,0,0,'','Thorim - Lightning Pillar'), -(13,1,62976,0,0,33,0,1,0,0,1,0,'','Thorim - Lightning Pillar'), -(13,1,63238,0,0,31,0,3,33378,0,0,0,'','Thorim - Lightning Pillar'), -(13,1,63238,0,0,33,0,1,0,0,1,0,'','Thorim - Lightning Pillar'), -(13,1,64098,0,0,31,0,3,32865,0,0,0,'','Thorim - Lightning Bolt'), -(13,4,62466,0,0,31,0,3,32780,0,0,0,'','Thorim - Lightning Charge'), -(13,3,62565,0,0,31,0,3,32865,0,0,0,'','Thorim - Touch of Dominion'), -(13,7,62942,0,0,31,0,3,32874,0,0,0,'','Thorim - Runic Fortification'), -(13,7,62942,0,1,31,0,3,32875,0,0,0,'','Thorim - Runic Fortification'), -(13,7,62942,0,2,31,0,3,33110,0,0,0,'','Thorim - Runic Fortification'), -(13,1,64767,0,0,31,0,3,33196,0,0,0,'','Thorim - Stormhammer'), -(13,7,62560,0,0,31,0,3,32876,0,0,0,'','Thorim - Berserk'), -(13,7,62560,0,1,31,0,3,32877,0,0,0,'','Thorim - Berserk'), -(13,7,62560,0,2,31,0,3,32878,0,0,0,'','Thorim - Berserk'), -(13,7,62560,0,3,31,0,3,32904,0,0,0,'','Thorim - Berserk'), -(13,1,61964,0,0,31,0,3,32882,0,0,0,'','Thorim - Circle of Healing'), -(13,1,61964,0,1,31,0,3,32883,0,0,0,'','Thorim - Circle of Healing'), -(13,1,61964,0,2,31,0,3,32885,0,0,0,'','Thorim - Circle of Healing'), -(13,1,61964,0,3,31,0,3,32886,0,0,0,'','Thorim - Circle of Healing'), -(13,1,61964,0,4,31,0,3,32907,0,0,0,'','Thorim - Circle of Healing'), -(13,1,61964,0,5,31,0,3,32908,0,0,0,'','Thorim - Circle of Healing'); - -UPDATE `gameobject_template` SET `size`=3 WHERE `entry` IN (194312,194313,194314,194315); -UPDATE `gameobject_template_addon` SET `faction`=94 WHERE `entry` IN (194312,194313,194314,194315); - -DELETE FROM `gameobject` WHERE `id` IN (194312,194313,194314,194315); -INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnDifficulties`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) values -(360300,194312,603,'14',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), -(360301,194313,603,'14',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), -(360302,194314,603,'33',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0), -(360303,194315,603,'33',0,2134.948,-286.436,419.5051,1.588249,0,0,0.7132502,0.7009096,-604800,255,1,0); - -DELETE FROM `creature` WHERE `id`=32892 AND `position_z` < 425.0; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 1e2bc42c17d..f2afcdbc474 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3363,6 +3363,14 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AttributesEx |= SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY; }); + // Blizzard (Thorim) + ApplySpellFix({ 62576, 62602 }, [](SpellInfo* spellInfo) + { + // DBC data is wrong for EFFECT_0, it's a different dynobject target than EFFECT_1 + // Both effects should be shared by the same DynObject + const_cast(spellInfo->GetEffect(EFFECT_0))->TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER_LEFT); + }); + // Spinning Up (Mimiron) ApplySpellFix({ 63414 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index d15a5700bd4..f5a8e693922 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -20,17 +20,23 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellScript.h" +#include "SpellAuraEffects.h" +#include "TypeContainerVisitor.h" +#include "CellImpl.h" +#include "GridNotifiersImpl.h" #include "ulduar.h" #include "SpellAuras.h" #include "SpellMgr.h" -#include "GridNotifiersImpl.h" -#include "SpellAuraEffects.h" #include +#include "AreaBoundary.h" +#include "InstanceScript.h" +#include "ObjectAccessor.h" +#include "MotionMaster.h" enum Spells { // Thorim - SPELL_SHEAT_OF_LIGHTNING = 62276, + SPELL_SHEATH_OF_LIGHTNING = 62276, SPELL_STORMHAMMER = 62042, SPELL_STORMHAMMER_SIF = 64767, SPELL_STORMHAMMER_BOOMERANG = 64909, @@ -48,7 +54,8 @@ enum Spells SPELL_LIGHTNING_PILLAR_1 = 63238, // caster high position, target low position SPELL_UNBALANCING_STRIKE = 62130, SPELL_BERSERK_PHASE_1 = 62560, - SPELL_BERSERK_PHASE_2 = 26662, + SPELL_BERSERK_PHASE_2 = 62555, + SPELL_ACTIVATE_LIGHTNING_ORB_PERIODIC = 62184, // Credits SPELL_CREDIT_SIFFED = 64980, @@ -100,10 +107,9 @@ enum Events EVENT_JUMPDOWN, EVENT_UNBALANCING_STRIKE, EVENT_CHAIN_LIGHTNING, - EVENT_TRANSFER_ENERGY, - EVENT_RELEASE_ENERGY, - EVENT_ACTIVATE_LIGHNING_FIELD, - EVENT_CHECK_PLAYER, + EVENT_START_PERIODIC_CHARGE, + EVENT_LIGHTNING_CHARGE, + EVENT_ACTIVATE_LIGHTNING_FIELD, EVENT_OUTRO_1, EVENT_OUTRO_2, EVENT_OUTRO_3, @@ -138,20 +144,18 @@ enum Yells // Thorim SAY_AGGRO_1 = 0, SAY_AGGRO_2 = 1, - //SAY_SPECIAL_1 = 2, - SAY_SPECIAL_2 = 3, - //SAY_SPECIAL_3 = 4, - SAY_JUMPDOWN = 5, - SAY_SLAY = 6, - SAY_BERSERK = 7, - SAY_WIPE = 8, - SAY_DEATH = 9, - SAY_END_NORMAL_1 = 10, - SAY_END_NORMAL_2 = 11, - SAY_END_NORMAL_3 = 12, - SAY_END_HARD_1 = 13, - SAY_END_HARD_2 = 14, - SAY_END_HARD_3 = 15, + SAY_SPECIAL = 2, + SAY_JUMPDOWN = 3, + SAY_SLAY = 4, + SAY_BERSERK = 5, + SAY_WIPE = 6, + SAY_DEATH = 7, + SAY_END_NORMAL_1 = 8, + SAY_END_NORMAL_2 = 9, + SAY_END_NORMAL_3 = 10, + SAY_END_HARD_1 = 11, + SAY_END_HARD_2 = 12, + SAY_END_HARD_3 = 13, // Runic Colossus EMOTE_RUNIC_BARRIER = 0, @@ -165,27 +169,6 @@ enum Yells SAY_SIF_EVENT = 2 }; -enum TrashTypes -{ - // Pre Phase Trash - BEHEMOTH, - MERCENARY_CAPTAIN, - MERCENARY_SOLDIER, - - // Arena Phase Trash - DARK_RUNE_CHAMPION, - DARK_RUNE_WARBRINGER, - DARK_RUNE_COMMONER, - DARK_RUNE_EVOKER, - - // Hall Way Trash - IRON_RING_GUARD, - IRON_HONOR_GUARD, - - // Shared - DARK_RUNE_ACOLYTE -}; - enum PreAddSpells { SPELL_ACID_BREATH = 62315, @@ -204,6 +187,8 @@ enum PreAddSpells SPELL_HOLY_SMITE = 62335, + SPELL_LEAP = 61934, + SPELL_CHARGE = 32323, SPELL_MORTAL_STRIKE = 35054, SPELL_WHIRLWIND = 33500, @@ -226,6 +211,27 @@ enum PreAddSpells SPELL_SHIELD_SMASH = 62332, }; +enum TrashTypes +{ + // Pre Phase Trash + BEHEMOTH, + MERCENARY_CAPTAIN, + MERCENARY_SOLDIER, + + // Arena Phase Trash + DARK_RUNE_CHAMPION, + DARK_RUNE_WARBRINGER, + DARK_RUNE_COMMONER, + DARK_RUNE_EVOKER, + + // Hall Way Trash + IRON_RING_GUARD, + IRON_HONOR_GUARD, + + // Shared + DARK_RUNE_ACOLYTE +}; + struct ThorimTrashInfo { uint32 Type; @@ -235,40 +241,39 @@ struct ThorimTrashInfo uint32 ThirdAbility; }; -ThorimTrashInfo const StaticThorimTrashInfo[] = +uint8 const ThorimTrashCount = 13; +ThorimTrashInfo const StaticThorimTrashInfo[ThorimTrashCount] = { // Pre Phase - { BEHEMOTH, 32882, SPELL_ACID_BREATH, SPELL_SWEEP, 0 }, - { MERCENARY_CAPTAIN, 32908, SPELL_DEVASTATE, SPELL_HEROIC_SWIPE, SPELL_SUNDER_ARMOR }, // alliance? - { MERCENARY_SOLDIER, 32885, SPELL_BARBED_SHOT, SPELL_SHOOT, 0 }, // alliance? - { DARK_RUNE_ACOLYTE, 32886, SPELL_RENEW, SPELL_GREATER_HEAL, SPELL_CIRCLE_OF_HEALING }, - { MERCENARY_CAPTAIN, 32907, SPELL_DEVASTATE, SPELL_HEROIC_SWIPE, SPELL_SUNDER_ARMOR }, // horde? - { MERCENARY_SOLDIER, 32883, SPELL_BARBED_SHOT, SPELL_SHOOT, 0 }, // horde? + { BEHEMOTH, NPC_JORMUNGAR_BEHEMOTH, SPELL_ACID_BREATH, SPELL_SWEEP, 0 }, + { MERCENARY_CAPTAIN, NPC_MERCENARY_CAPTAIN_A, SPELL_DEVASTATE, SPELL_HEROIC_SWIPE, SPELL_SUNDER_ARMOR }, + { MERCENARY_SOLDIER, NPC_MERCENARY_SOLDIER_A, SPELL_BARBED_SHOT, SPELL_SHOOT, 0 }, + { DARK_RUNE_ACOLYTE, NPC_DARK_RUNE_ACOLYTE_PRE, SPELL_RENEW, SPELL_GREATER_HEAL, SPELL_CIRCLE_OF_HEALING }, + { MERCENARY_CAPTAIN, NPC_MERCENARY_CAPTAIN_H, SPELL_DEVASTATE, SPELL_HEROIC_SWIPE, SPELL_SUNDER_ARMOR }, + { MERCENARY_SOLDIER, NPC_MERCENARY_SOLDIER_H, SPELL_BARBED_SHOT, SPELL_SHOOT, 0 }, // Arena Phase - { DARK_RUNE_CHAMPION, NPC_DARK_RUNE_CHAMPION, SPELL_MORTAL_STRIKE, SPELL_WHIRLWIND, 0 }, - { DARK_RUNE_WARBRINGER, NPC_DARK_RUNE_WARBRINGER, SPELL_RUNIC_STRIKE, 0, 0 }, - { DARK_RUNE_EVOKER, NPC_DARK_RUNE_EVOKER, SPELL_RUNIC_LIGHTNING, SPELL_RUNIC_SHIELD, SPELL_RUNIC_MENDING }, - { DARK_RUNE_COMMONER, NPC_DARK_RUNE_COMMONER, SPELL_LOW_BLOW, SPELL_PUMMEL, 0 }, + { DARK_RUNE_CHAMPION, NPC_DARK_RUNE_CHAMPION, SPELL_MORTAL_STRIKE, SPELL_WHIRLWIND, 0 }, + { DARK_RUNE_WARBRINGER, NPC_DARK_RUNE_WARBRINGER, SPELL_RUNIC_STRIKE, 0, 0 }, + { DARK_RUNE_EVOKER, NPC_DARK_RUNE_EVOKER, SPELL_RUNIC_LIGHTNING, SPELL_RUNIC_SHIELD, SPELL_RUNIC_MENDING }, + { DARK_RUNE_COMMONER, NPC_DARK_RUNE_COMMONER, SPELL_LOW_BLOW, SPELL_PUMMEL, 0 }, // Hall Way - { IRON_RING_GUARD, NPC_IRON_RING_GUARD, SPELL_WHIRLING_TRIP, SPELL_IMPALE, 0 }, - { IRON_HONOR_GUARD, NPC_IRON_HONOR_GUARD, SPELL_CLEAVE, SPELL_SHIELD_SMASH, 0 }, - { DARK_RUNE_ACOLYTE, NPC_DARK_RUNE_ACOLYTE, SPELL_RENEW, SPELL_GREATER_HEAL, 0 }, + { IRON_RING_GUARD, NPC_IRON_RING_GUARD, SPELL_WHIRLING_TRIP, SPELL_IMPALE, 0 }, + { IRON_HONOR_GUARD, NPC_IRON_HONOR_GUARD, SPELL_CLEAVE, SPELL_SHIELD_SMASH, 0 }, + { DARK_RUNE_ACOLYTE, NPC_DARK_RUNE_ACOLYTE, SPELL_RENEW, SPELL_GREATER_HEAL, 0 } }; enum Actions { ACTION_INCREASE_PREADDS_COUNT, ACTION_ACTIVATE_RUNIC_SMASH, + ACTION_ACTIVATE_ADDS, + ACTION_PILLAR_CHARGED, ACTION_START_HARD_MODE, - ACTION_BERSERK, + ACTION_BERSERK }; -#define MAX_HARD_MODE_TIME 180000 // 3 Minutes - -#define IN_ARENA(who) (who->GetPositionX() < 2181.19f && who->GetPositionY() > -299.12f) - struct SummonLocation { Position pos; @@ -277,12 +282,12 @@ struct SummonLocation SummonLocation const PreAddLocations[] = { - { { 2149.68f, -263.477f, 419.679f, 3.120f }, 32882}, - { { 2131.31f, -271.640f, 419.840f, 2.188f }, 32908}, - { { 2127.24f, -259.182f, 419.974f, 5.917f }, 32885}, - { { 2123.32f, -254.770f, 419.840f, 6.170f }, 32885}, - { { 2120.10f, -258.990f, 419.840f, 6.250f }, 32885}, - { { 2129.09f, -277.142f, 419.756f, 1.222f }, 32886} + { { 2149.68f, -263.477f, 419.679f, 3.120f }, NPC_JORMUNGAR_BEHEMOTH }, + { { 2131.31f, -271.640f, 419.840f, 2.188f }, NPC_MERCENARY_CAPTAIN_A }, + { { 2127.24f, -259.182f, 419.974f, 5.917f }, NPC_MERCENARY_SOLDIER_A }, + { { 2123.32f, -254.770f, 419.840f, 6.170f }, NPC_MERCENARY_SOLDIER_A }, + { { 2120.10f, -258.990f, 419.840f, 6.250f }, NPC_MERCENARY_SOLDIER_A }, + { { 2129.09f, -277.142f, 419.756f, 1.222f }, NPC_DARK_RUNE_ACOLYTE_PRE } }; SummonLocation const ColossusAddLocations[] = @@ -306,6 +311,18 @@ SummonLocation const GiantAddLocations[] = Position const SifSpawnPosition = { 2148.301f, -297.8453f, 438.3308f, 2.687807f }; +enum Data +{ + DATA_CHARGED_PILLAR = 1, + + FACTION_FRIENDLY = 35 +}; + +enum DisplayIds +{ + THORIM_WEAPON_DISPLAY_ID = 45900 +}; + uint32 const LightningOrbPathSize = 8; G3D::Vector3 const LightningOrbPath[LightningOrbPathSize] = { @@ -319,10 +336,37 @@ G3D::Vector3 const LightningOrbPath[LightningOrbPathSize] = { 2182.310059f, -263.233093f, 414.739410f } }; -Position const ArenaCenter = { 2135.0f, -263.0f, 420.0f, 0.0f }; // used for trash jump calculation -Position const LightningFieldCenter = { 2135.0f, -312.5f, 438.0f, 0.0f }; // used for lightning field calculation +// used for trash jump calculation +Position const ArenaCenter = { 2134.77f, -262.307f }; + +// used for lightning field calculation +Position const LightningFieldCenter = { 2135.178f, -321.122f }; + +CircleBoundary const ArenaFloorCircle(ArenaCenter, 45.4); +CircleBoundary const InvertedBalconyCircle(LightningFieldCenter, 32.0, true); + +CreatureBoundary const ArenaBoundaries = +{ + &ArenaFloorCircle, + &InvertedBalconyCircle +}; + +class HeightPositionCheck +{ + public: + HeightPositionCheck(bool ret) : _ret(ret) { } + + bool operator()(Position const* pos) const + { + return pos->GetPositionZ() > THORIM_BALCONY_Z_CHECK == _ret; + } + + private: + bool _ret; -// p2 start at 5357 + static float const THORIM_BALCONY_Z_CHECK; +}; +float const HeightPositionCheck::THORIM_BALCONY_Z_CHECK = 428.0f; class RunicSmashExplosionEvent : public BasicEvent { @@ -331,7 +375,7 @@ class RunicSmashExplosionEvent : public BasicEvent bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override { - _owner->CastSpell((Unit*)NULL, SPELL_RUNIC_SMASH); + _owner->CastSpell((Unit*)nullptr, SPELL_RUNIC_SMASH); return true; } @@ -344,22 +388,19 @@ class TrashJumpEvent : public BasicEvent public: TrashJumpEvent(Creature* owner) : _owner(owner), _stage(0) { } - bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override + bool Execute(uint64 eventTime, uint32 /*updateTime*/) override { switch (_stage) { case 0: - if (Creature* stalker = _owner->FindNearestCreature(NPC_THORIM_INVISIBLE_STALKER, 30.0f)) - { - _owner->GetMotionMaster()->MoveJump(*stalker, SPEED_CHARGE, 15.0f); - _owner->SetHomePosition(*stalker); - } + _owner->CastSpell((Unit*)nullptr, SPELL_LEAP); ++_stage; - _owner->m_Events.AddEvent(this, _owner->m_Events.CalculateTime(2000)); + _owner->m_Events.AddEvent(this, eventTime + 2000); return false; case 1: _owner->SetReactState(REACT_AGGRESSIVE); - _owner->AI()->DoZoneInCombat(_owner, 200.0f); + _owner->AI()->DoZoneInCombat(_owner); + _owner->AI()->SetBoundary(&ArenaBoundaries); return true; default: break; @@ -378,14 +419,14 @@ class LightningFieldEvent : public BasicEvent public: LightningFieldEvent(Creature* owner) : _owner(owner) { } - bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override + bool Execute(uint64 eventTime, uint32 /*updateTime*/) override { if (InstanceScript* instance = _owner->GetInstanceScript()) { if (instance->GetBossState(BOSS_THORIM) == IN_PROGRESS) { - _owner->CastSpell((Unit*)NULL, SPELL_LIGHTNING_FIELD); - _owner->m_Events.AddEvent(this, _owner->m_Events.CalculateTime(1000)); + _owner->CastSpell((Unit*)nullptr, SPELL_LIGHTNING_FIELD); + _owner->m_Events.AddEvent(this, eventTime + 1000); return false; } } @@ -426,11 +467,13 @@ class boss_thorim : public CreatureScript if (_encounterFinished) return; + SetBoundary(nullptr); _Reset(); Initialize(); me->SetReactState(REACT_PASSIVE); - SetCombatMovement(false); + me->SetDisableGravity(true); + me->SetControlled(true, UNIT_STATE_ROOT); me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); events.SetPhase(PHASE_NULL); @@ -444,8 +487,38 @@ class boss_thorim : public CreatureScript for (SummonLocation const& s : PreAddLocations) me->SummonCreature(s.entry, s.pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_THORIM_LEVER))) - go->AddFlag(GO_FLAG_NOT_SELECTABLE); + if (GameObject* lever = instance->GetGameObject(DATA_THORIM_LEVER)) + lever->AddFlag(GO_FLAG_NOT_SELECTABLE); + + // Remove trigger auras + if (Creature* pillar = ObjectAccessor::GetCreature(*me, _activePillarGUID)) + pillar->RemoveAllAuras(); + + if (Creature* controller = instance->GetCreature(DATA_THORIM_CONTROLLER)) + controller->RemoveAllAuras(); + + _activePillarGUID.Clear(); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + summons.DespawnAll(); + _DespawnAtEvade(); + } + + void SetGUID(ObjectGuid guid, int32 type) override + { + if (type == DATA_CHARGED_PILLAR) + { + _activePillarGUID = guid; + + if (Creature* pillar = ObjectAccessor::GetCreature(*me, _activePillarGUID)) + { + pillar->CastSpell(pillar, SPELL_LIGHTNING_ORB_CHARGED, true); + pillar->CastSpell((Unit*)nullptr, SPELL_LIGHTNING_PILLAR_2); + events.ScheduleEvent(EVENT_LIGHTNING_CHARGE, 8000, 0, PHASE_2); + } + } } void KilledUnit(Unit* who) override @@ -458,7 +531,7 @@ class boss_thorim : public CreatureScript { if (spellInfo->Id == SPELL_TOUCH_OF_DOMINION_TRIGGERED) { - if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + if (Creature* sif = instance->GetCreature(DATA_SIF)) { sif->AI()->Talk(SAY_SIF_DESPAWN); sif->DespawnOrUnsummon(6000); @@ -486,12 +559,21 @@ class boss_thorim : public CreatureScript me->InterruptNonMeleeSpells(true); me->RemoveAllAttackers(); me->AttackStop(); - me->SetFaction(35); + me->SetFaction(FACTION_FRIENDLY); + me->AddUnitFlag(UNIT_FLAG_RENAME); - if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + if (Creature* controller = instance->GetCreature(DATA_THORIM_CONTROLLER)) + controller->RemoveAllAuras(); + if (Creature* pillar = ObjectAccessor::GetCreature(*me, _activePillarGUID)) + pillar->RemoveAllAuras(); + + if (_hardMode) { - summons.Despawn(sif); - sif->DespawnOrUnsummon(10000); + if (Creature* sif = instance->GetCreature(DATA_SIF)) + { + summons.Despawn(sif); + sif->DespawnOrUnsummon(10000); + } } _JustDied(); @@ -504,6 +586,15 @@ class boss_thorim : public CreatureScript me->m_Events.AddEvent(new KeeperDespawnEvent(me), me->m_Events.CalculateTime(35000)); } + void MovementInform(uint32 type, uint32 id) override + { + if (type != EFFECT_MOTION_TYPE || id != EVENT_JUMP) + return; + + me->getThreatManager().resetAllAggro(); + SetBoundary(&ArenaBoundaries); + } + void EnterCombat(Unit* /*who*/) override { _EnterCombat(); @@ -513,21 +604,23 @@ class boss_thorim : public CreatureScript events.ScheduleEvent(EVENT_SAY_AGGRO_2, 9000, 0, PHASE_1); events.ScheduleEvent(EVENT_SAY_SIF_START, 16500, 0, PHASE_1); - events.ScheduleEvent(EVENT_START_SIF_CHANNEL, 25000, 0, PHASE_1); + events.ScheduleEvent(EVENT_START_SIF_CHANNEL, 22500, 0, PHASE_1); events.ScheduleEvent(EVENT_STORMHAMMER, 40000, 0, PHASE_1); events.ScheduleEvent(EVENT_CHARGE_ORB, 30000, 0, PHASE_1); events.ScheduleEvent(EVENT_SUMMON_ADDS, 15000, 0, PHASE_1); events.ScheduleEvent(EVENT_BERSERK, 369000); - events.ScheduleEvent(EVENT_CHECK_PLAYER, 10000); - DoCast(me, SPELL_SHEAT_OF_LIGHTNING); + DoCast(me, SPELL_SHEATH_OF_LIGHTNING); - if (Creature* runic = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_RUNIC_COLOSSUS))) - runic->AI()->DoAction(ACTION_ACTIVATE_RUNIC_SMASH); + if (Creature* runicColossus = instance->GetCreature(DATA_RUNIC_COLOSSUS)) + { + runicColossus->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + runicColossus->AI()->DoAction(ACTION_ACTIVATE_ADDS); + } - if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_THORIM_LEVER))) - go->RemoveFlag(GO_FLAG_NOT_SELECTABLE); + if (GameObject* lever = instance->GetGameObject(DATA_THORIM_LEVER)) + lever->RemoveFlag(GO_FLAG_NOT_SELECTABLE); // Summon Sif me->SummonCreature(NPC_SIF, SifSpawnPosition); @@ -542,8 +635,7 @@ class boss_thorim : public CreatureScript summon->SetReactState(REACT_PASSIVE); summon->CastSpell(summon, SPELL_LIGHTNING_DESTRUCTION, true); - Position pos(LightningOrbPath[LightningOrbPathSize - 1].x, LightningOrbPath[LightningOrbPathSize - 1].y, LightningOrbPath[LightningOrbPathSize - 1].z); - summon->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, pos, false); + summon->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, LightningOrbPath[LightningOrbPathSize - 1].x, LightningOrbPath[LightningOrbPathSize - 1].y, LightningOrbPath[LightningOrbPathSize - 1].z, false); Movement::PointsArray path(LightningOrbPath, LightningOrbPath + LightningOrbPathSize); @@ -587,68 +679,52 @@ class boss_thorim : public CreatureScript Talk(SAY_AGGRO_2); break; case EVENT_SAY_SIF_START: - if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + if (Creature* sif = instance->GetCreature(DATA_SIF)) sif->AI()->Talk(SAY_SIF_START); break; case EVENT_START_SIF_CHANNEL: - if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + if (Creature* sif = instance->GetCreature(DATA_SIF)) sif->CastSpell(me, SPELL_TOUCH_OF_DOMINION); break; case EVENT_STORMHAMMER: DoCast(SPELL_STORMHAMMER); - events.ScheduleEvent(EVENT_STORMHAMMER, urand(15000, 20000), 0, PHASE_1); + events.Repeat(15000, 20000); break; case EVENT_CHARGE_ORB: DoCastAOE(SPELL_CHARGE_ORB); - events.ScheduleEvent(EVENT_CHARGE_ORB, urand(15000, 20000), 0, PHASE_1); + events.Repeat(15000, 20000); break; case EVENT_SUMMON_ADDS: SummonWave(); - events.ScheduleEvent(EVENT_SUMMON_ADDS, _orbSummoned ? 3000 : 10000, 0, PHASE_1); + events.Repeat(_orbSummoned ? 3000 : 10000); break; case EVENT_JUMPDOWN: if (_hardMode) - if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + if (Creature* sif = instance->GetCreature(DATA_SIF)) sif->AI()->DoAction(ACTION_START_HARD_MODE); - me->RemoveAurasDueToSpell(SPELL_SHEAT_OF_LIGHTNING); + me->RemoveAurasDueToSpell(SPELL_SHEATH_OF_LIGHTNING); me->SetReactState(REACT_AGGRESSIVE); - SetCombatMovement(true); - me->GetMotionMaster()->MoveJump(2134.79f, -263.03f, 419.84f, me->GetOrientation(), 30.0f, 20.0f); + me->SetDisableGravity(false); + me->SetControlled(false, UNIT_STATE_ROOT); + me->GetMotionMaster()->MoveJump(2134.8f, -263.056f, 419.983f, me->GetOrientation(), 30.0f, 20.0f); + events.ScheduleEvent(EVENT_START_PERIODIC_CHARGE, 2000, 0, PHASE_2); events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, 15000, 0, PHASE_2); events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 20000, 0, PHASE_2); - events.ScheduleEvent(EVENT_TRANSFER_ENERGY, 20000, 0, PHASE_2); break; case EVENT_UNBALANCING_STRIKE: DoCastVictim(SPELL_UNBALANCING_STRIKE); - events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, urand(15000, 20000), 0, PHASE_2); + events.Repeat(15000, 20000); break; case EVENT_CHAIN_LIGHTNING: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) DoCast(target, SPELL_CHAIN_LIGHTNING); - events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(7000, 15000), 0, PHASE_2); + events.Repeat(7000, 15000); break; - case EVENT_TRANSFER_ENERGY: - { - std::list triggers; - me->GetCreatureListWithEntryInGrid(triggers, NPC_THUNDER_ORB, 200.0f); - triggers.remove_if([](Creature* trigger) - { - return trigger->GetPositionZ() < 425.0f; - }); - - if (!triggers.empty()) - { - Creature* pillar = Trinity::Containers::SelectRandomContainerElement(triggers); - _activePillarGUID = pillar->GetGUID(); - pillar->CastSpell(pillar, SPELL_LIGHTNING_ORB_CHARGED, true); - pillar->CastSpell((Unit*)nullptr, SPELL_LIGHTNING_PILLAR_2); - events.ScheduleEvent(EVENT_RELEASE_ENERGY, 8000, 0, PHASE_2); - } - - events.ScheduleEvent(EVENT_TRANSFER_ENERGY, 16000, 0, PHASE_2); + case EVENT_START_PERIODIC_CHARGE: + if (Creature* controller = instance->GetCreature(DATA_THORIM_CONTROLLER)) + controller->CastSpell(controller, SPELL_ACTIVATE_LIGHTNING_ORB_PERIODIC, true); break; - } - case EVENT_RELEASE_ENERGY: + case EVENT_LIGHTNING_CHARGE: if (Creature* pillar = ObjectAccessor::GetCreature(*me, _activePillarGUID)) DoCast(pillar, SPELL_LIGHTNING_RELEASE); break; @@ -665,15 +741,15 @@ class boss_thorim : public CreatureScript DoCast(me, SPELL_BERSERK_PHASE_2, true); } break; - case EVENT_ACTIVATE_LIGHNING_FIELD: + case EVENT_ACTIVATE_LIGHTNING_FIELD: { std::list triggers; me->GetCreatureListWithEntryInGrid(triggers, NPC_THORIM_EVENT_BUNNY, 100.0f); triggers.remove_if([](Creature* bunny) { - if (bunny->GetPositionZ() < 430.0f) + if (HeightPositionCheck(false)(bunny)) return true; - return LightningFieldCenter.GetExactDist2dSq(bunny) > 1225.0f; + return LightningFieldCenter.GetExactDist2dSq(bunny) > 1296.0f; }); uint64 timer = 1000; @@ -682,7 +758,7 @@ class boss_thorim : public CreatureScript triggers.remove_if([](Creature* bunny) { - return LightningFieldCenter.GetExactDist2dSq(bunny) < 400.0f; + return LightningFieldCenter.GetExactDist2dSq(bunny) < 576.0f; }); triggers.sort([](Creature* a, Creature* b) @@ -690,26 +766,24 @@ class boss_thorim : public CreatureScript return a->GetPositionX() < b->GetPositionX(); }); - for (std::list::const_iterator itr = triggers.begin(); itr != triggers.end();) + for (auto itr = triggers.cbegin(); itr != triggers.cend();) { - std::list::const_iterator prev = itr++; + auto prev = itr++; if (itr != triggers.end()) (*prev)->CastSpell(*itr, SPELL_LIGHTNING_BEAM_CHANNEL); } break; } - case EVENT_CHECK_PLAYER: - if (!me->GetMap()->GetPlayersCountExceptGMs()) - EnterEvadeMode(); - events.ScheduleEvent(EVENT_CHECK_PLAYER, 10000); - break; case EVENT_OUTRO_1: Talk(_hardMode ? SAY_END_HARD_1 : SAY_END_NORMAL_1); - if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) - DoCast(sif, SPELL_STORMHAMMER_SIF); + if (_hardMode) + DoCast(me, SPELL_STORMHAMMER_SIF); break; case EVENT_OUTRO_2: Talk(_hardMode ? SAY_END_HARD_2 : SAY_END_NORMAL_2); + if (_hardMode) + if (Creature* sif = instance->GetCreature(DATA_SIF)) + sif->SetStandState(UNIT_STAND_STATE_DEAD); break; case EVENT_OUTRO_3: Talk(_hardMode ? SAY_END_HARD_3 : SAY_END_NORMAL_3); @@ -717,6 +791,9 @@ class boss_thorim : public CreatureScript default: break; } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; } DoMeleeAttackIfReady(); @@ -741,7 +818,7 @@ class boss_thorim : public CreatureScript { // Event starts me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - DoZoneInCombat(me, 250.0f); + DoZoneInCombat(me); } break; default: @@ -754,7 +831,7 @@ class boss_thorim : public CreatureScript me->GetCreatureListWithEntryInGrid(triggerList, NPC_THORIM_EVENT_BUNNY, 100.0f); triggerList.remove_if([](Creature* bunny) { - if (bunny->GetPositionZ() < 430.0f) + if (HeightPositionCheck(false)(bunny)) return true; return ArenaCenter.GetExactDist2dSq(bunny) < 3025.0f; }); @@ -817,8 +894,8 @@ class boss_thorim : public CreatureScript if (actor->GetTypeId() != TYPEID_PLAYER || !me->IsWithinDistInMap(actor, 10.0f)) return false; - Creature* runicColossus = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_RUNIC_COLOSSUS)); - Creature* runeGiant = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_RUNE_GIANT)); + Creature* runicColossus = instance->GetCreature(DATA_RUNIC_COLOSSUS); + Creature* runeGiant = instance->GetCreature(DATA_RUNE_GIANT); return runicColossus && !runicColossus->IsAlive() && runeGiant && !runeGiant->IsAlive(); } @@ -829,14 +906,14 @@ class boss_thorim : public CreatureScript Talk(SAY_JUMPDOWN); events.SetPhase(PHASE_2); events.ScheduleEvent(EVENT_JUMPDOWN, 8000); - events.ScheduleEvent(EVENT_ACTIVATE_LIGHNING_FIELD, 15000); + events.ScheduleEvent(EVENT_ACTIVATE_LIGHTNING_FIELD, 15000); events.RescheduleEvent(EVENT_BERSERK, 300000, 0, PHASE_2); - if (Creature* sif = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SIF))) + if (Creature* sif = instance->GetCreature(DATA_SIF)) sif->InterruptNonMeleeSpells(false); // Hard Mode - if (_hardMode && events.GetTimer() <= MAX_HARD_MODE_TIME) + if (_hardMode) DoCastAOE(SPELL_CREDIT_SIFFED, true); } else if (me->HealthBelowPctDamaged(1, damage)) @@ -867,7 +944,7 @@ struct npc_thorim_trashAI : public ScriptedAI npc_thorim_trashAI(Creature* creature) : ScriptedAI(creature) { _instance = creature->GetInstanceScript(); - for (uint8 i = 0; i < 13; ++i) + for (uint8 i = 0; i < ThorimTrashCount; ++i) if (me->GetEntry() == StaticThorimTrashInfo[i].Entry) _info = &StaticThorimTrashInfo[i]; @@ -891,32 +968,14 @@ struct npc_thorim_trashAI : public ScriptedAI return heal; } - /// returns heal amount of the given spell including hots - static uint32 GetTotalHeal(uint32 spellId, Unit const* caster) - { - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, caster->GetMap()->GetDifficultyID())) - return GetTotalHeal(spellInfo, caster); - return 0; - } - /// returns remaining heal amount on given target static uint32 GetRemainingHealOn(Unit* target) { uint32 heal = 0; - Unit::AuraApplicationMap const& auras = target->GetAppliedAuras(); - for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - { - Aura const* aura = itr->second->GetBase(); + Unit::AuraEffectList const& auras = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL); + for (AuraEffect const* aurEff : auras) + heal += aurEff->GetAmount() * (aurEff->GetTotalTicks() - aurEff->GetTickNumber()); - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (AuraEffect const* aurEff = aura->GetEffect(i)) - { - if (aurEff->GetAuraType() == SPELL_AURA_PERIODIC_HEAL) - heal += aurEff->GetAmount() * (aurEff->GetTotalTicks() - aurEff->GetTickNumber()); - } - } - } return heal; } @@ -957,8 +1016,9 @@ struct npc_thorim_trashAI : public ScriptedAI static Unit* GetUnitWithMostMissingHp(SpellInfo const* spellInfo, Unit* caster) { - float range = spellInfo->GetMaxRange(false); - uint32 heal = GetTotalHeal(spellInfo, caster); + // use positive range, it's a healing spell + float const range = spellInfo->GetMaxRange(true); + uint32 const heal = GetTotalHeal(spellInfo, caster); Unit* target = nullptr; Trinity::MostHPMissingInRange checker(caster, range, heal); @@ -968,17 +1028,13 @@ struct npc_thorim_trashAI : public ScriptedAI return target; } - static Unit* GetHealTarget(uint32 spellId, Unit* caster) + static Unit* GetHealTarget(SpellInfo const* spellInfo, Unit* caster) { Unit* healTarget = nullptr; - - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, caster->GetMap()->GetDifficultyID())) - { - if (!spellInfo->HasAttribute(SPELL_ATTR1_CANT_TARGET_SELF) && !roll_chance_f(caster->GetHealthPct()) && !((caster->GetHealth() + GetRemainingHealOn(caster) + GetTotalHeal(spellInfo, caster)) > caster->GetMaxHealth())) - healTarget = caster; - else - healTarget = GetUnitWithMostMissingHp(spellInfo, caster); - } + if (!spellInfo->HasAttribute(SPELL_ATTR1_CANT_TARGET_SELF) && !roll_chance_f(caster->GetHealthPct()) && ((caster->GetHealth() + GetRemainingHealOn(caster) + GetTotalHeal(spellInfo, caster)) <= caster->GetMaxHealth())) + healTarget = caster; + else + healTarget = GetUnitWithMostMissingHp(spellInfo, caster); return healTarget; } @@ -986,34 +1042,43 @@ struct npc_thorim_trashAI : public ScriptedAI bool UseAbility(uint32 spellId) { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetDifficulty()); + if (!spellInfo) + return false; + Unit* target = nullptr; - if (AIHelper::GetTotalHeal(spellId, me)) - target = AIHelper::GetHealTarget(spellId, me); + if (AIHelper::GetTotalHeal(spellInfo, me)) + target = AIHelper::GetHealTarget(spellInfo, me); else target = me->GetVictim(); - if (target) + if (!target) + return false; + + if (_info->Type == MERCENARY_SOLDIER) { - if (_info->Type == MERCENARY_SOLDIER) + bool allowMove = true; + if (me->IsInRange(target, spellInfo->GetMinRange(), spellInfo->GetMaxRange())) + allowMove = false; + + if (IsCombatMovementAllowed() != allowMove) { - bool allowMove = true; - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetDifficulty())) - { - if (me->IsInRange(target, spellInfo->GetMinRange(false), spellInfo->GetMaxRange(false)) - && me->IsWithinLOSInMap(target)) - allowMove = false; - } SetCombatMovement(allowMove); - } - DoCast(target, spellId); - return true; + // need relaunch movement + ScriptedAI::AttackStart(target); + + // give some time to allow reposition, try again in a second + if (allowMove) + return false; + } } - return false; + DoCast(target, spellId); + return true; } - void UpdateAI(uint32 diff) override + void UpdateAI(uint32 diff) final override { if (!UpdateVictim()) return; @@ -1026,6 +1091,9 @@ struct npc_thorim_trashAI : public ScriptedAI while (uint32 eventId = _events.ExecuteEvent()) { ExecuteEvent(eventId); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; } if (_info->Type == DARK_RUNE_ACOLYTE) @@ -1055,7 +1123,7 @@ class npc_thorim_pre_phase : public CreatureScript me->setActive(true); // prevent grid unload } - void Reset() + void Reset() override { _events.Reset(); if (_info->PrimaryAbility) @@ -1068,14 +1136,20 @@ class npc_thorim_pre_phase : public CreatureScript SetCombatMovement(false); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*victim*/) override { if (Creature* thorim = _instance->GetCreature(BOSS_THORIM)) thorim->AI()->DoAction(ACTION_INCREASE_PREADDS_COUNT); } + bool ShouldSparWith(Unit const* target) const override + { + return !target->GetAffectingPlayer(); + } + void DamageTaken(Unit* attacker, uint32& damage) override { + // nullify spell damage if (!attacker->GetAffectingPlayer()) damage = 0; } @@ -1131,16 +1205,25 @@ class npc_thorim_arena_phase : public CreatureScript case DARK_RUNE_EVOKER: _isInArena = true; break; + case DARK_RUNE_ACOLYTE: + { + _isInArena = (_info->Entry == NPC_DARK_RUNE_ACOLYTE_PRE); + SetBoundary(&ArenaBoundaries, !_isInArena); + break; + } default: _isInArena = false; break; } - //_isInArena = IN_ARENA(me); } bool CanAIAttack(Unit const* who) const override { - return _isInArena == IN_ARENA(who); + // don't try to attack players in balcony + if (_isInArena && HeightPositionCheck(true)(who)) + return false; + + return CheckBoundary(who); } void Reset() override @@ -1156,19 +1239,25 @@ class npc_thorim_arena_phase : public CreatureScript _events.ScheduleEvent(EVENT_ABILITY_CHARGE, 8000); } - void EnterCombat(Unit* /*who*/) + void EnterCombat(Unit* /*who*/) override { if (_info->Type == DARK_RUNE_WARBRINGER) DoCast(me, SPELL_AURA_OF_CELERITY); + + if (!_isInArena) + if (Creature* colossus = _instance->GetCreature(DATA_RUNIC_COLOSSUS)) + colossus->AI()->DoAction(ACTION_ACTIVATE_RUNIC_SMASH); } - void EnterEvadeMode(EvadeReason /*why*/) override + void EnterEvadeMode(EvadeReason why) override { + if (why != EVADE_REASON_NO_HOSTILES && why != EVADE_REASON_BOUNDARY) + return; + // this should only happen if theres no alive player in the arena -> summon orb - // might be called by mind control release or controllers death? if (Creature* thorim = _instance->GetCreature(BOSS_THORIM)) thorim->AI()->DoAction(ACTION_BERSERK); - ScriptedAI::EnterEvadeMode(); + ScriptedAI::EnterEvadeMode(why); } void ExecuteEvent(uint32 eventId) override @@ -1177,27 +1266,30 @@ class npc_thorim_arena_phase : public CreatureScript { case EVENT_PRIMARY_ABILITY: if (UseAbility(_info->PrimaryAbility)) - _events.ScheduleEvent(eventId, urand(3000, 6000)); + _events.Repeat(3000, 6000); else - _events.ScheduleEvent(eventId, 1000); + _events.Repeat(1000); break; case EVENT_SECONDARY_ABILITY: if (UseAbility(_info->SecondaryAbility)) - _events.ScheduleEvent(eventId, urand(12000, 16000)); + _events.Repeat(12000, 16000); else - _events.ScheduleEvent(eventId, 1000); + _events.Repeat(1000); break; case EVENT_THIRD_ABILITY: if (UseAbility(_info->ThirdAbility)) - _events.ScheduleEvent(eventId, urand(6000, 8000)); + _events.Repeat(6000, 8000); else - _events.ScheduleEvent(eventId, 1000); + _events.Repeat(1000); break; case EVENT_ABILITY_CHARGE: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, [this](Unit* unit){ return unit->GetTypeId() == TYPEID_PLAYER && unit->IsInRange(me, 8.0f, 25.0f); })) + { + Unit* referer = me; + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, [referer](Unit* unit){ return unit->GetTypeId() == TYPEID_PLAYER && unit->IsInRange(referer, 8.0f, 25.0f); })) DoCast(target, SPELL_CHARGE); _events.ScheduleEvent(eventId, 12000); break; + } default: break; } @@ -1218,20 +1310,35 @@ struct npc_thorim_minibossAI : public ScriptedAI npc_thorim_minibossAI(Creature* creature) : ScriptedAI(creature), _summons(me) { _instance = creature->GetInstanceScript(); + + SetBoundary(&ArenaBoundaries, true); + } + + bool CanAIAttack(Unit const* who) const final override + { + return CheckBoundary(who); } - void JustSummoned(Creature* summon) override + void JustSummoned(Creature* summon) final override { _summons.Summon(summon); - ScriptedAI::JustSummoned(summon); } - void SummonedCreatureDespawn(Creature* summon) override + void SummonedCreatureDespawn(Creature* summon) final override { - ScriptedAI::SummonedCreatureDespawn(summon); _summons.Despawn(summon); } + void DoAction(int32 action) override + { + if (action == ACTION_ACTIVATE_ADDS) + { + for (ObjectGuid const& guid : _summons) + if (Creature* summon = ObjectAccessor::GetCreature(*me, guid)) + summon->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + } + } + protected: InstanceScript* _instance; EventMap _events; @@ -1247,13 +1354,20 @@ class npc_runic_colossus : public CreatureScript { npc_runic_colossusAI(Creature* creature) : npc_thorim_minibossAI(creature) { + Initialize(); + } + + void Initialize() + { + _runicActive = false; } void Reset() override { + Initialize(); _events.Reset(); - // Runed Door closed + // close the Runic Door _instance->HandleGameObject(_instance->GetGuidData(DATA_RUNIC_DOOR), false); // Spawn trashes @@ -1267,19 +1381,33 @@ class npc_runic_colossus : public CreatureScript // don't enter combat } + void DoAction(int32 action) override + { + npc_thorim_minibossAI::DoAction(action); + + if (_runicActive) + return; + + if (action == ACTION_ACTIVATE_RUNIC_SMASH) + { + _runicActive = true; + _events.ScheduleEvent(EVENT_RUNIC_SMASH, 7000); + } + } + void JustDied(Unit* /*victim*/) override { - // Runed Door opened + // open the Runic Door _instance->HandleGameObject(_instance->GetGuidData(DATA_RUNIC_DOOR), true); if (Creature* thorim = _instance->GetCreature(BOSS_THORIM)) - thorim->AI()->Talk(SAY_SPECIAL_2); - } + thorim->AI()->Talk(SAY_SPECIAL); - void DoAction(int32 action) override - { - if (action == ACTION_ACTIVATE_RUNIC_SMASH) - _events.ScheduleEvent(EVENT_RUNIC_SMASH, 12000); + if (Creature* giant = _instance->GetCreature(DATA_RUNE_GIANT)) + { + giant->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + giant->AI()->DoAction(ACTION_ACTIVATE_ADDS); + } } void EnterCombat(Unit* /*who*/) override @@ -1289,7 +1417,6 @@ class npc_runic_colossus : public CreatureScript _events.ScheduleEvent(EVENT_RUNIC_BARRIER, urand(12000, 15000)); _events.ScheduleEvent(EVENT_SMASH, urand(15000, 18000)); _events.ScheduleEvent(EVENT_RUNIC_CHARGE, urand(20000, 24000)); - me->InterruptNonMeleeSpells(true); } void UpdateAI(uint32 diff) override @@ -1305,28 +1432,31 @@ class npc_runic_colossus : public CreatureScript { case EVENT_RUNIC_BARRIER: Talk(EMOTE_RUNIC_BARRIER); - DoCast(me, SPELL_RUNIC_BARRIER); - _events.ScheduleEvent(eventId, urand(35000, 45000)); + DoCastAOE(SPELL_RUNIC_BARRIER); + _events.Repeat(35000, 45000); break; case EVENT_SMASH: - DoCast(me, SPELL_SMASH); - _events.ScheduleEvent(eventId, urand(15000, 18000)); + DoCastAOE(SPELL_SMASH); + _events.Repeat(15000, 18000); break; case EVENT_RUNIC_CHARGE: { Unit* referer = me; if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, [referer](Unit* unit){ return unit->GetTypeId() == TYPEID_PLAYER && unit->IsInRange(referer, 8.0f, 40.0f); })) DoCast(target, SPELL_RUNIC_CHARGE); - _events.ScheduleEvent(eventId, 20000); + _events.Repeat(20000); break; } case EVENT_RUNIC_SMASH: DoCast(me, RAND(SPELL_RUNIC_SMASH_LEFT, SPELL_RUNIC_SMASH_RIGHT)); - _events.ScheduleEvent(eventId, 6000); + _events.Repeat(6000); break; default: break; } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; } if (!UpdateVictim()) @@ -1334,6 +1464,9 @@ class npc_runic_colossus : public CreatureScript DoMeleeAttackIfReady(); } + + private: + bool _runicActive; }; CreatureAI* GetAI(Creature* creature) const override @@ -1355,7 +1488,7 @@ class npc_ancient_rune_giant : public CreatureScript { _events.Reset(); - // Stone Door closed + // close the Stone Door _instance->HandleGameObject(_instance->GetGuidData(DATA_STONE_DOOR), false); // Spawn trashes @@ -1375,7 +1508,7 @@ class npc_ancient_rune_giant : public CreatureScript void JustDied(Unit* /*victim*/) override { - // Stone Door opened + // opem the Stone Door _instance->HandleGameObject(_instance->GetGuidData(DATA_STONE_DOOR), true); } @@ -1399,16 +1532,19 @@ class npc_ancient_rune_giant : public CreatureScript break; case EVENT_STOMP: DoCastAOE(SPELL_STOMP); - _events.ScheduleEvent(eventId, urand(10000, 12000)); + _events.Repeat(10000, 12000); break; case EVENT_RUNE_DETONATION: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true)) DoCast(target, SPELL_RUNE_DETONATION); - _events.ScheduleEvent(eventId, urand(10000, 12000)); + _events.Repeat(10000, 12000); break; default: break; } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; } DoMeleeAttackIfReady(); @@ -1428,33 +1564,22 @@ class npc_sif : public CreatureScript struct npc_sifAI : public ScriptedAI { - npc_sifAI(Creature* creature) : ScriptedAI(creature), _summons(me) + npc_sifAI(Creature* creature) : ScriptedAI(creature) { SetCombatMovement(false); + _instance = creature->GetInstanceScript(); } void Reset() override { _events.Reset(); - _summons.DespawnAll(); - } - - void JustSummoned(Creature* summon) override - { - _summons.Summon(summon); - if (summon->GetEntry() == NPC_THORIM_EVENT_BUNNY) - summon->GetMotionMaster()->MoveRandom(60.0f); - } - - void SummonedCreatureDespawn(Creature* summon) override - { - _summons.Despawn(summon); } void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override { if (spellInfo->Id == SPELL_STORMHAMMER_SIF) { + me->InterruptSpell(CURRENT_GENERIC_SPELL); me->SetReactState(REACT_PASSIVE); me->AttackStop(); } @@ -1493,7 +1618,7 @@ class npc_sif : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) DoCast(target, SPELL_BLINK); _events.ScheduleEvent(EVENT_FROST_NOVA, 0); - _events.ScheduleEvent(eventId, urand(20000, 25000)); + _events.Repeat(20000, 25000); return; case EVENT_FROST_NOVA: DoCastAOE(SPELL_FROSTNOVA); @@ -1501,21 +1626,22 @@ class npc_sif : public CreatureScript case EVENT_FROSTBOLT: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) DoCast(target, SPELL_FROSTBOLT); - _events.ScheduleEvent(eventId, 2000); + _events.Repeat(2000); return; case EVENT_FROSTBOLT_VOLLEY: DoCastAOE(SPELL_FROSTBOLT_VOLLEY); - _events.ScheduleEvent(eventId, urand(15000, 20000)); + _events.Repeat(15000, 20000); return; case EVENT_BLIZZARD: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true)) - me->SummonCreature(NPC_THORIM_EVENT_BUNNY, *target, TEMPSUMMON_TIMED_DESPAWN, 25000); DoCastAOE(SPELL_BLIZZARD); - _events.ScheduleEvent(eventId, urand(35000, 45000)); + _events.Repeat(35000, 45000); return; default: break; } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; } // no melee attack @@ -1523,7 +1649,7 @@ class npc_sif : public CreatureScript private: EventMap _events; - SummonList _summons; + InstanceScript* _instance; }; CreatureAI* GetAI(Creature* creature) const override @@ -1532,48 +1658,6 @@ class npc_sif : public CreatureScript } }; -class HeightPositionCheck -{ - public: - HeightPositionCheck(bool ret) : _ret(ret) { } - - bool operator()(WorldObject* obj) const - { - return obj->GetPositionZ() > 425.0f == _ret; - } - - private: - bool _ret; -}; - -// 62577 - Blizzard -// 62603 - Blizzard -class spell_thorim_blizzard : public SpellScriptLoader -{ - public: - spell_thorim_blizzard() : SpellScriptLoader("spell_thorim_blizzard") { } - - class spell_thorim_blizzard_SpellScript : public SpellScript - { - PrepareSpellScript(spell_thorim_blizzard_SpellScript); - - void FilterTargets(std::list& targets) - { - targets.remove_if(HeightPositionCheck(true)); - } - - void Register() override - { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thorim_blizzard_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_thorim_blizzard_SpellScript(); - } -}; - // 62576 - Blizzard // 62602 - Blizzard class spell_thorim_blizzard_effect : public SpellScriptLoader @@ -1600,6 +1684,7 @@ class spell_thorim_blizzard_effect : public SpellScriptLoader return false; } } + return true; } @@ -1662,10 +1747,7 @@ class spell_thorim_charge_orb : public SpellScriptLoader void FilterTargets(std::list& targets) { - targets.remove_if([](WorldObject* target) - { - return target->GetPositionZ() < 425.0f; - }); + targets.remove_if(HeightPositionCheck(false)); if (targets.empty()) return; @@ -1718,7 +1800,7 @@ class spell_thorim_lightning_charge : public SpellScriptLoader void HandleCharge() { - GetCaster()->CastSpell(GetCaster(), SPELL_LIGHTNING_CHARGE, true); + GetCaster()->CastSpell(GetCaster(), SPELL_LIGHTNING_CHARGE); } void Register() override @@ -1734,6 +1816,47 @@ class spell_thorim_lightning_charge : public SpellScriptLoader } }; +// 61934 - Leap +class spell_thorim_arena_leap : public SpellScriptLoader +{ + public: + spell_thorim_arena_leap() : SpellScriptLoader("spell_thorim_arena_leap") { } + + class spell_thorim_arena_leap_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_arena_leap_SpellScript); + + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_UNIT; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Position const* pos = GetHitDest()) + GetCaster()->ToCreature()->SetHomePosition(*pos); + } + + void Register() override + { + OnEffectLaunch += SpellEffectFn(spell_thorim_arena_leap_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_JUMP_DEST); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_arena_leap_SpellScript(); + } +}; + +struct OutOfArenaCheck +{ + bool operator()(Position const* who) const + { + return !CreatureAI::IsInBounds(ArenaBoundaries, who); + } +}; + // 62042 - Stormhammer class spell_thorim_stormhammer : public SpellScriptLoader { @@ -1755,10 +1878,7 @@ class spell_thorim_stormhammer : public SpellScriptLoader void FilterTargets(std::list& targets) { - targets.remove_if([](WorldObject* target) - { - return !IN_ARENA(target); - }); + targets.remove_if([](WorldObject* target) -> bool { return HeightPositionCheck(true)(target) || OutOfArenaCheck()(target); }); if (targets.empty()) { @@ -1780,9 +1900,15 @@ class spell_thorim_stormhammer : public SpellScriptLoader } } + void LoseHammer() + { + GetCaster()->SetVirtualItem(0, 0); + } + void Register() override { OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_thorim_stormhammer_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY); + AfterCast += SpellCastFn(spell_thorim_stormhammer_SpellScript::LoseHammer); OnEffectHitTarget += SpellEffectFn(spell_thorim_stormhammer_SpellScript::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -1821,8 +1947,14 @@ class spell_thorim_stormhammer_sif : public SpellScriptLoader } } + void LoseHammer() + { + GetCaster()->SetVirtualItem(0, 0); + } + void Register() override { + AfterCast += SpellCastFn(spell_thorim_stormhammer_sif_SpellScript::LoseHammer); OnEffectHitTarget += SpellEffectFn(spell_thorim_stormhammer_sif_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -1833,6 +1965,34 @@ class spell_thorim_stormhammer_sif : public SpellScriptLoader } }; +// 64909 - Stormhammer +class spell_thorim_stormhammer_boomerang : public SpellScriptLoader +{ + public: + spell_thorim_stormhammer_boomerang() : SpellScriptLoader("spell_thorim_stormhammer_boomerang") { } + + class spell_thorim_stormhammer_boomerang_SpellScript : public SpellScript + { + PrepareSpellScript(spell_thorim_stormhammer_boomerang_SpellScript); + + void RecoverHammer(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + target->SetVirtualItem(0, THORIM_WEAPON_DISPLAY_ID); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_thorim_stormhammer_boomerang_SpellScript::RecoverHammer, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_thorim_stormhammer_boomerang_SpellScript(); + } +}; + // 62057, 62058 - Runic Smash class spell_thorim_runic_smash : public SpellScriptLoader { @@ -1852,12 +2012,12 @@ class spell_thorim_runic_smash : public SpellScriptLoader { PreventHitDefaultEffect(effIndex); - std::list triggers; + std::vector triggers; GetCaster()->GetCreatureListWithEntryInGrid(triggers, GetSpellInfo()->Id == SPELL_RUNIC_SMASH_LEFT ? NPC_GOLEM_LEFT_HAND_BUNNY : NPC_GOLEM_RIGHT_HAND_BUNNY, 150.0f); - for (Creature* bunny : triggers) + for (Creature* trigger : triggers) { - float dist = GetCaster()->GetExactDist(bunny); - bunny->m_Events.AddEvent(new RunicSmashExplosionEvent(bunny), bunny->m_Events.CalculateTime(uint64(dist * 30))); + float dist = GetCaster()->GetExactDist(trigger); + trigger->m_Events.AddEvent(new RunicSmashExplosionEvent(trigger), trigger->m_Events.CalculateTime(uint64(dist * 30.f))); }; } @@ -1873,6 +2033,122 @@ class spell_thorim_runic_smash : public SpellScriptLoader } }; +class UpperOrbCheck +{ + public: + UpperOrbCheck() : _check(true) { } + + bool operator() (Creature* target) const + { + return target->GetEntry() == NPC_THUNDER_ORB && _check(target); + } + + private: + HeightPositionCheck const _check; +}; + +// 62184 - Activate Lightning Orb Periodic +class spell_thorim_activate_lightning_orb_periodic : public SpellScriptLoader +{ + public: + spell_thorim_activate_lightning_orb_periodic() : SpellScriptLoader("spell_thorim_activate_lightning_orb_periodic") { } + + class spell_thorim_activate_lightning_orb_periodic_AuraScript : public AuraScript + { + PrepareAuraScript(spell_thorim_activate_lightning_orb_periodic_AuraScript); + + InstanceScript* instance = nullptr; + + void PeriodicTick(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + + Unit* caster = GetCaster(); + std::vector triggers; + + UpperOrbCheck check; + Trinity::CreatureListSearcher searcher(caster, triggers, check); + Cell::VisitGridObjects(caster, searcher, 100.f); + + if (!triggers.empty()) + { + Creature* target = Trinity::Containers::SelectRandomContainerElement(triggers); + if (Creature* thorim = instance->GetCreature(BOSS_THORIM)) + thorim->AI()->SetGUID(target->GetGUID(), DATA_CHARGED_PILLAR); + } + } + + bool Load() override + { + if (Unit* caster = GetCaster()) + instance = caster->GetInstanceScript(); + + return instance != nullptr; + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_activate_lightning_orb_periodic_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_thorim_activate_lightning_orb_periodic_AuraScript(); + } +}; + +// 62331, 62418 - Impale +class spell_iron_ring_guard_impale : public SpellScriptLoader +{ + public: + spell_iron_ring_guard_impale() : SpellScriptLoader("spell_iron_ring_guard_impale") { } + + class spell_iron_ring_guard_impale_AuraScript : public AuraScript + { + PrepareAuraScript(spell_iron_ring_guard_impale_AuraScript); + + void PeriodicTick(AuraEffect const* /*aurEff*/) + { + if (GetTarget()->HealthAbovePct(GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue())) + { + Remove(AURA_REMOVE_BY_ENEMY_SPELL); + PreventDefaultAction(); + } + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_iron_ring_guard_impale_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_iron_ring_guard_impale_AuraScript(); + } +}; + +class condition_thorim_arena_leap : public ConditionScript +{ + public: + condition_thorim_arena_leap() : ConditionScript("condition_thorim_arena_leap"), _check(false) { } + + bool OnConditionCheck(Condition const* condition, ConditionSourceInfo& sourceInfo) override + { + WorldObject* target = sourceInfo.mConditionTargets[condition->ConditionTarget]; + InstanceScript* instance = target->GetInstanceScript(); + + if (!instance) + return false; + + return _check(target); + } + + private: + HeightPositionCheck _check; +}; + void AddSC_boss_thorim() { new boss_thorim(); @@ -1881,12 +2157,16 @@ void AddSC_boss_thorim() new npc_runic_colossus(); new npc_ancient_rune_giant(); new npc_sif(); - new spell_thorim_blizzard(); new spell_thorim_blizzard_effect(); new spell_thorim_frostbolt_volley(); new spell_thorim_charge_orb(); new spell_thorim_lightning_charge(); new spell_thorim_stormhammer(); new spell_thorim_stormhammer_sif(); + new spell_thorim_stormhammer_boomerang(); + new spell_thorim_arena_leap(); new spell_thorim_runic_smash(); + new spell_thorim_activate_lightning_orb_periodic(); + new spell_iron_ring_guard_impale(); + new condition_thorim_arena_leap(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index c07fcbc0a6d..84773bff908 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -40,7 +40,7 @@ static BossBoundaryData const boundaries = { BOSS_ALGALON, new CircleBoundary(Position(1632.668f, -307.7656f), 45.0) }, { BOSS_ALGALON, new ZRangeBoundary(410.0f, 440.0f) }, { BOSS_HODIR, new EllipseBoundary(Position(2001.5f, -240.0f), 50.0, 75.0) }, - { BOSS_THORIM, new CircleBoundary(Position(2134.73f, -263.2f), 50.0) }, + // Thorim sets boundaries dinamically { BOSS_FREYA, new RectangleBoundary(2094.6f, 2520.0f, -250.0f, 200.0f) }, { BOSS_MIMIRON, new CircleBoundary(Position(2744.0f, 2569.0f), 70.0) }, { BOSS_VEZAX, new RectangleBoundary(1740.0f, 1930.0f, 31.0f, 228.0f) }, @@ -60,6 +60,10 @@ static DoorData const doorData[] = { GO_MIMIRON_DOOR_2, BOSS_MIMIRON, DOOR_TYPE_ROOM }, { GO_MIMIRON_DOOR_3, BOSS_MIMIRON, DOOR_TYPE_ROOM }, { GO_THORIM_ENCOUNTER_DOOR, BOSS_THORIM, DOOR_TYPE_ROOM }, + { GO_ANCIENT_GATE_OF_THE_KEEPERS, BOSS_HODIR, DOOR_TYPE_PASSAGE }, + { GO_ANCIENT_GATE_OF_THE_KEEPERS, BOSS_MIMIRON, DOOR_TYPE_PASSAGE }, + { GO_ANCIENT_GATE_OF_THE_KEEPERS, BOSS_THORIM, DOOR_TYPE_PASSAGE }, + { GO_ANCIENT_GATE_OF_THE_KEEPERS, BOSS_FREYA, DOOR_TYPE_PASSAGE }, { GO_VEZAX_DOOR, BOSS_VEZAX, DOOR_TYPE_PASSAGE }, { GO_YOGG_SARON_DOOR, BOSS_YOGG_SARON, DOOR_TYPE_ROOM }, { GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM }, @@ -99,6 +103,7 @@ ObjectData const creatureData[] = { NPC_SIF, DATA_SIF }, { NPC_RUNIC_COLOSSUS, DATA_RUNIC_COLOSSUS }, { NPC_RUNE_GIANT, DATA_RUNE_GIANT }, + { NPC_THORIM_CONTROLLER, DATA_THORIM_CONTROLLER }, { NPC_COMPUTER, DATA_COMPUTER }, { NPC_WORLD_TRIGGER_MIMIRON, DATA_MIMIRON_WORLD_TRIGGER }, { NPC_VOICE_OF_YOGG_SARON, DATA_VOICE_OF_YOGG_SARON }, @@ -180,6 +185,7 @@ class instance_ulduar : public InstanceMapScript ObjectGuid LeviathanGateGUID; ObjectGuid KologarnChestGUID; ObjectGuid KologarnBridgeGUID; + ObjectGuid ThorimDarkIronPortcullisGUID; ObjectGuid CacheOfStormsGUID; ObjectGuid CacheOfStormsHardmodeGUID; ObjectGuid HodirRareCacheGUID; @@ -338,6 +344,16 @@ class instance_ulduar : public InstanceMapScript creature->UpdateEntry(NPC_BATTLE_PRIEST_GINA); break; + // Thorim + case NPC_MERCENARY_CAPTAIN_H: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_MERCENARY_CAPTAIN_A); + break; + case NPC_MERCENARY_SOLDIER_H: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_MERCENARY_SOLDIER_A); + break; + // Freya case NPC_IRONBRANCH: ElderGUIDs[0] = creature->GetGUID(); @@ -455,6 +471,9 @@ class instance_ulduar : public InstanceMapScript if (GetBossState(BOSS_KOLOGARN) == DONE) HandleGameObject(ObjectGuid::Empty, false, gameObject); break; + case GO_THORIM_DARK_IRON_PORTCULLIS: + ThorimDarkIronPortcullisGUID = gameObject->GetGUID(); + break; case GO_CACHE_OF_STORMS_10: case GO_CACHE_OF_STORMS_25: CacheOfStormsGUID = gameObject->GetGUID(); @@ -679,8 +698,14 @@ class instance_ulduar : public InstanceMapScript cache->RemoveFlag(GO_FLAG_NODESPAWN); } } + instance->SummonCreature(NPC_THORIM_OBSERVATION_RING, ObservationRingKeepersPos[2]); } + else + { + DoCloseDoorOrButton(GetGuidData(DATA_THORIM_LEVER)); + DoCloseDoorOrButton(ThorimDarkIronPortcullisGUID); + } break; case BOSS_ALGALON: if (state == DONE) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index e7279005679..885686e6fc6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -159,6 +159,12 @@ enum UlduarNPCs // Thorim NPC_THORIM_INVISIBLE_STALKER = 32780, + NPC_JORMUNGAR_BEHEMOTH = 32882, + NPC_MERCENARY_CAPTAIN_A = 32908, + NPC_MERCENARY_CAPTAIN_H = 32907, + NPC_MERCENARY_SOLDIER_A = 32885, + NPC_MERCENARY_SOLDIER_H = 32883, + NPC_DARK_RUNE_ACOLYTE_PRE = 32886, NPC_RUNIC_COLOSSUS = 32872, NPC_RUNE_GIANT = 32873, NPC_IRON_RING_GUARD = 32874, @@ -174,6 +180,7 @@ enum UlduarNPCs NPC_GOLEM_LEFT_HAND_BUNNY = 33141, NPC_SIF = 33196, NPC_THUNDER_ORB = 33378, + NPC_THORIM_CONTROLLER = 32879, // Yogg-Saron NPC_SARA = 33134, @@ -249,6 +256,8 @@ enum UlduarGameObjects GO_KOLOGARN_BRIDGE = 194232, GO_KOLOGARN_DOOR = 194553, + GO_ANCIENT_GATE_OF_THE_KEEPERS = 194255, + // Hodir GO_HODIR_ENTRANCE = 194442, GO_HODIR_DOOR = 194634, @@ -266,7 +275,8 @@ enum UlduarGameObjects GO_THORIM_RUNIC_DOOR = 194557, GO_THORIM_STONE_DOOR = 194558, GO_THORIM_ENCOUNTER_DOOR = 194559, - GO_THORIM_LEVER = 194265, + GO_THORIM_LEVER = 194264, + GO_THORIM_DARK_IRON_PORTCULLIS = 194560, // Mimiron GO_MIMIRON_TRAM = 194675, @@ -439,6 +449,7 @@ enum UlduarData DATA_RUNIC_DOOR, DATA_STONE_DOOR, DATA_THORIM_HARDMODE, + DATA_THORIM_CONTROLLER, // Misc DATA_BRANN_BRONZEBEARD_INTRO, -- cgit v1.2.3 From 732ad0f2eb7cbc41d4ae13f2b584d212d7c4d06c Mon Sep 17 00:00:00 2001 From: Killyana Date: Wed, 24 May 2017 02:13:12 +0200 Subject: DB/Quest: Blowing Hodir's Horn requirement Ref #19787 (cherry picked from commit b90fc70c209b24a8aad8e38da6be9de98f50901e) --- sql/updates/world/master/2020_06_14_10_world_2017_05_24_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_10_world_2017_05_24_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_10_world_2017_05_24_00_world.sql b/sql/updates/world/master/2020_06_14_10_world_2017_05_24_00_world.sql new file mode 100644 index 00000000000..5d9655ebf49 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_10_world_2017_05_24_00_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `quest_template_addon` SET `PrevQuestID`=12976 WHERE `id`=12977; -- cgit v1.2.3 From afad6a7f7dc5c1fc7d62db96e68e8e52b44824d7 Mon Sep 17 00:00:00 2001 From: Killyana Date: Wed, 17 May 2017 06:07:01 +0200 Subject: DB: Fix some DB errors (cherry picked from commit 586cc0e0b4c9f63090bd340c1cf58fbfe807063e) --- sql/updates/world/master/2020_06_14_11_world_2017_05_17_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_11_world_2017_05_17_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_11_world_2017_05_17_00_world.sql b/sql/updates/world/master/2020_06_14_11_world_2017_05_17_00_world.sql new file mode 100644 index 00000000000..3b946f6006b --- /dev/null +++ b/sql/updates/world/master/2020_06_14_11_world_2017_05_17_00_world.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `creature_addon` WHERE `guid` IN (136274,136490,136555); -- cgit v1.2.3 From 607c5ad5541bac7ce8a2787ef9c87b4ebea74a5e Mon Sep 17 00:00:00 2001 From: Killyana Date: Mon, 22 May 2017 21:37:26 +0200 Subject: DB/Creature: Blightguard spawns (cherry picked from commit d96482b2d49c61fe26533def461276a8038db4ab) --- .../2020_06_14_12_world_2017_05_22_00_world.sql | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_12_world_2017_05_22_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_12_world_2017_05_22_00_world.sql b/sql/updates/world/master/2020_06_14_12_world_2017_05_22_00_world.sql new file mode 100644 index 00000000000..32a484f4dfb --- /dev/null +++ b/sql/updates/world/master/2020_06_14_12_world_2017_05_22_00_world.sql @@ -0,0 +1,25 @@ +-- +DELETE FROM `creature` WHERE `guid` IN (79380,79383,79609,79614,79626,79631,79636,79650,79876,79895,79899,79921,80289,80295,80299,80300,80303,80311,80312,80315,80316,80323); +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnDifficulties`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `curhealth`, `curmana`, `MovementType`) VALUES +(79380, 28603, 571, '0', 0, 0, 0, 6022.67, -2049.14, 238.189, 1.46482, 600, 10, 0, 0, 1), +(79383, 28603, 571, '0', 0, 0, 0, 6042.88, -2119.83, 239.522, 5.55282, 600, 10, 0, 0, 1), +(79609, 28603, 571, '0', 0, 0, 0, 6101.08, -2157.18, 239.578, 5.52926, 600, 10, 0, 0, 1), +(79614, 28603, 571, '0', 0, 0, 0, 6176.72, -2208.48, 241.65, 0.110007, 600, 10, 0, 0, 1), +(79626, 28603, 571, '0', 0, 0, 0, 6227.74, -2193.69, 236.211, 0.663713, 600, 10, 0, 0, 1), +(79631, 28603, 571, '0', 0, 0, 0, 6270.34, -2053.92, 238.548, 1.23705, 600, 10, 0, 0, 1), +(79636, 28603, 571, '0', 0, 0, 0, 6069.51, -1913.87, 236.212, 2.78429, 600, 10, 0, 0, 1), +(79650, 28603, 571, '0', 0, 0, 0, 6017.94, -1903.71, 239.384, 3.56183, 600, 10, 0, 0, 1), +(79876, 28603, 571, '0', 0, 0, 0, 5981.49, -1963.15, 237.669, 4.15088, 600, 10, 0, 0, 1), +(79895, 28603, 571, '0', 0, 0, 0, 6017.39, -2106.46, 243.382, 5.40752, 600, 10, 0, 0, 1), +(79899, 28603, 571, '0', 0, 0, 0, 5275.12, -1678.04, 236.349, 1.1703, 600, 10, 0, 0, 1), +(79921, 28603, 571, '0', 0, 0, 0, 5224.69, -1751.98, 235.717, 3.17306, 600, 10, 0, 0, 1), +(80289, 28603, 571, '0', 0, 0, 0, 5154.48, -1745.88, 238.291, 3.26731, 600, 10, 0, 0, 1), +(80295, 28603, 571, '0', 0, 0, 0, 5082.87, -1725.64, 235.624, 3.55791, 600, 10, 0, 0, 1), +(80299, 28603, 571, '0', 0, 0, 0, 5034.49, -1655.17, 240.16, 1.8693, 600, 10, 0, 0, 1), +(80300, 28603, 571, '0', 0, 0, 0, 5069.11, -1540.09, 240.561, 6.1183, 600, 10, 0, 0, 1), +(80303, 28603, 571, '0', 0, 0, 0, 5099.29, -1559.64, 238.941, 0.624444, 600, 10, 0, 0, 1), +(80311, 28603, 571, '0', 0, 0, 0, 6183.62, -2102.73, 235.653, 3.426750, 600, 10, 0, 0, 1), +(80312, 28603, 571, '0', 0, 0, 0, 6113.59, -2105.41, 234.909, 0.441447, 600, 10, 0, 0, 1), +(80315, 28603, 571, '0', 0, 0, 0, 6091.98, -2019.44, 235.639, 1.670596, 600, 10, 0, 0, 1), +(80316, 28603, 571, '0', 0, 0, 0, 6199.66, -1957.45, 234.049, 1.207211, 600, 10, 0, 0, 1), +(80323, 28603, 571, '0', 0, 0, 0, 6242.41, -2003.27, 234.282, 4.150887, 600, 10, 0, 0, 1); -- cgit v1.2.3 From 282e1f152d91ecab544a7732db0caeb6ce40f1cb Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 23 May 2017 23:29:18 +0200 Subject: DB/Commands: Typo in account set gmlevel help field Closes #19448 by Heaven31415 (cherry picked from commit 3b8f85fd8176a0f229011a1a1845c55a7615ff97) --- sql/updates/world/master/2020_06_14_13_world_2017_05_23_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_13_world_2017_05_23_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_13_world_2017_05_23_00_world.sql b/sql/updates/world/master/2020_06_14_13_world_2017_05_23_00_world.sql new file mode 100644 index 00000000000..635d13558d6 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_13_world_2017_05_23_00_world.sql @@ -0,0 +1,2 @@ +-- correct typo in account set gmlevel command help +UPDATE `command` SET `help`="Syntax: .account set gmlevel [$account] #level [#realmID]\r\n\r\nSet the security level for targeted player (can't be used at self) or for account $name to a level of #level on the realm #realmID.\r\n\r\n#level may range from 0 to 3.\r\n\r\n#realmID may be -1 for all realms." WHERE `name`='account set gmlevel'; -- cgit v1.2.3 From e9dc7756867c9bd9569f60686485af944cf6e703 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Thu, 25 May 2017 12:03:41 +0100 Subject: DB/SAI: Tormenting the softknuckles Fix script so that if player does not sucessfully kill the hardknuckle matriach it does not remain hostile as an invisible mob to players doing damage to players who get in agro range. (cherry picked from commit a261056f58b76ff58b64e278105aa9069ac13210) --- .../world/master/2020_06_14_14_world_2017_05_25_00_world.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_14_world_2017_05_25_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_14_world_2017_05_25_00_world.sql b/sql/updates/world/master/2020_06_14_14_world_2017_05_25_00_world.sql new file mode 100644 index 00000000000..f8a1e0e2bfd --- /dev/null +++ b/sql/updates/world/master/2020_06_14_14_world_2017_05_25_00_world.sql @@ -0,0 +1,7 @@ +UPDATE `smart_scripts` SET `link`=13 WHERE `entryorguid`=28213 AND `source_type`=0 AND `id`IN(8,10); +UPDATE `smart_scripts` SET `event_type`=7 WHERE `entryorguid`=28213 AND `source_type`=0 AND `id`=9 AND `link`=10; +DELETE FROM `smart_scripts` WHERE `entryorguid` =28213 AND `source_type`=0 AND `id`IN(13,14,6); +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`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(28213, 0, 13, 0, 61, 0, 100, 512, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hardknuckle Matriarch - On Respawn - Set Passive'), +(28213, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 500, 0, 0, 0, 0, 0, 0, 'Hardknuckle Matriarch - On Data Set 1 1 - Start Attacking'), +(28213, 0, 6, 14, 61, 0, 100, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hardknuckle Matriarch - On Data Set 1 1 - Set Aggresive'); -- cgit v1.2.3 From 8c6d28f72da362c563d0f03ea9028d22c94723b7 Mon Sep 17 00:00:00 2001 From: Killyana Date: Wed, 24 May 2017 17:03:39 +0200 Subject: DB/GamObject: Sons of Hodir Gameobject quest givers Visibility Closes #19787 (cherry picked from commit 66bd3459e4bdcdec8bcd86631e585b5614061666) --- .../world/master/2020_06_14_15_world_2017_05_24_01_world.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_15_world_2017_05_24_01_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_15_world_2017_05_24_01_world.sql b/sql/updates/world/master/2020_06_14_15_world_2017_05_24_01_world.sql new file mode 100644 index 00000000000..2eb3abfea9a --- /dev/null +++ b/sql/updates/world/master/2020_06_14_15_world_2017_05_24_01_world.sql @@ -0,0 +1,9 @@ +-- +UPDATE `gameobject_addon` SET `invisibilityType`=9, `invisibilityValue`=1000 WHERE `guid`=270; +UPDATE `gameobject_addon` SET `invisibilityType`=8, `invisibilityValue`=1000 WHERE `guid`=21077; +UPDATE `gameobject_addon` SET `invisibilityType`=5, `invisibilityValue`=1000 WHERE `guid`=21079; +DELETE FROM `spell_area` WHERE `spell` IN (56773,56772,56774) AND `area`=4438; +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `flags`, `quest_start_status`, `quest_end_status`) VALUES +(56773, 4438, 12987, 0, 0, 0, 2, 3, 66, 0), +(56772, 4438, 13001, 0, 0, 0, 2, 3, 64, 0), +(56774, 4438, 12976, 0, 0, 0, 2, 3, 64, 0); -- cgit v1.2.3 From a3439b6555759f533194ed0da98c5b08ae58cf4a Mon Sep 17 00:00:00 2001 From: Keader Date: Thu, 25 May 2017 17:12:08 -0300 Subject: DB/Spells: Fixed Paladin T8 Holy 2P Bonus proc Close #19796 (cherry picked from commit 4fcea41519d5cf9bc63dcfff67eb2be6e6ea8105) --- sql/updates/world/master/2020_06_14_16_world_2017_05_25_01_world.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/master/2020_06_14_16_world_2017_05_25_01_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_16_world_2017_05_25_01_world.sql b/sql/updates/world/master/2020_06_14_16_world_2017_05_25_01_world.sql new file mode 100644 index 00000000000..eb91c138ca6 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_16_world_2017_05_25_01_world.sql @@ -0,0 +1 @@ +UPDATE `spell_proc` SET `AttributesMask`=0x2 WHERE `SpellId`=64890; -- cgit v1.2.3 From 3f83c9dd1d409afa5f81dfc2cdcf21cb15b6c06b Mon Sep 17 00:00:00 2001 From: Killyana Date: Mon, 29 May 2017 00:51:46 +0200 Subject: DB: Add some missing Broadcast Text (cherry picked from commit 60a69bcd3d6ae5fe55d6a18e67938a3a61bbbe6a) --- .../2020_06_14_17_world_2017_05_28_05_world.sql | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_17_world_2017_05_28_05_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_17_world_2017_05_28_05_world.sql b/sql/updates/world/master/2020_06_14_17_world_2017_05_28_05_world.sql new file mode 100644 index 00000000000..0f85da3fb9e --- /dev/null +++ b/sql/updates/world/master/2020_06_14_17_world_2017_05_28_05_world.sql @@ -0,0 +1,37 @@ +-- +UPDATE `creature_text` SET `BroadcastTextId`=22882 WHERE `CreatureID`=24151 AND `GroupID`=0 AND `ID`=0; +UPDATE `creature_text` SET `BroadcastTextId`=22880 WHERE `CreatureID`=24151 AND `GroupID`=0 AND `ID`=1; +UPDATE `creature_text` SET `BroadcastTextId`=22881 WHERE `CreatureID`=24151 AND `GroupID`=0 AND `ID`=2; +UPDATE `creature_text` SET `BroadcastTextId`=22698 WHERE `CreatureID`=24216 AND `GroupID`=0 AND `ID`=0; +UPDATE `creature_text` SET `BroadcastTextId`=22701 WHERE `CreatureID`=24216 AND `GroupID`=0 AND `ID`=1; +UPDATE `creature_text` SET `BroadcastTextId`=22699 WHERE `CreatureID`=24216 AND `GroupID`=0 AND `ID`=2; +UPDATE `creature_text` SET `BroadcastTextId`=22702 WHERE `CreatureID`=24216 AND `GroupID`=0 AND `ID`=3; +UPDATE `creature_text` SET `BroadcastTextId`=22697 WHERE `CreatureID`=24216 AND `GroupID`=0 AND `ID`=4; +UPDATE `creature_text` SET `BroadcastTextId`=22700 WHERE `CreatureID`=24216 AND `GroupID`=0 AND `ID`=5; +UPDATE `creature_text` SET `BroadcastTextId`=22953 WHERE `CreatureID`=24216 AND `GroupID`=1 AND `ID`=0; +UPDATE `creature_text` SET `BroadcastTextId`=22957 WHERE `CreatureID`=24216 AND `GroupID`=1 AND `ID`=1; +UPDATE `creature_text` SET `BroadcastTextId`=22954 WHERE `CreatureID`=24216 AND `GroupID`=1 AND `ID`=2; +UPDATE `creature_text` SET `BroadcastTextId`=22955 WHERE `CreatureID`=24216 AND `GroupID`=1 AND `ID`=3; +UPDATE `creature_text` SET `BroadcastTextId`=22956 WHERE `CreatureID`=24216 AND `GroupID`=1 AND `ID`=4; +UPDATE `creature_text` SET `BroadcastTextId`=22698 WHERE `CreatureID`=24249 AND `GroupID`=0 AND `ID`=0; +UPDATE `creature_text` SET `BroadcastTextId`=22701 WHERE `CreatureID`=24249 AND `GroupID`=0 AND `ID`=1; +UPDATE `creature_text` SET `BroadcastTextId`=22699 WHERE `CreatureID`=24249 AND `GroupID`=0 AND `ID`=2; +UPDATE `creature_text` SET `BroadcastTextId`=22815 WHERE `CreatureID`=24249 AND `GroupID`=0 AND `ID`=3; +UPDATE `creature_text` SET `BroadcastTextId`=22813 WHERE `CreatureID`=24249 AND `GroupID`=0 AND `ID`=4; +UPDATE `creature_text` SET `BroadcastTextId`=22814 WHERE `CreatureID`=24249 AND `GroupID`=0 AND `ID`=5; +UPDATE `creature_text` SET `BroadcastTextId`=23082 WHERE `CreatureID`=24249 AND `GroupID`=1 AND `ID`=0; +UPDATE `creature_text` SET `BroadcastTextId`=23083 WHERE `CreatureID`=24249 AND `GroupID`=1 AND `ID`=1; +UPDATE `creature_text` SET `BroadcastTextId`=23084 WHERE `CreatureID`=24249 AND `GroupID`=1 AND `ID`=2; +UPDATE `creature_text` SET `BroadcastTextId`=22698 WHERE `CreatureID`=24250 AND `GroupID`=0 AND `ID`=0; +UPDATE `creature_text` SET `BroadcastTextId`=22701 WHERE `CreatureID`=24250 AND `GroupID`=0 AND `ID`=1; +UPDATE `creature_text` SET `BroadcastTextId`=22699 WHERE `CreatureID`=24250 AND `GroupID`=0 AND `ID`=2; +UPDATE `creature_text` SET `BroadcastTextId`=22815 WHERE `CreatureID`=24250 AND `GroupID`=0 AND `ID`=3; +UPDATE `creature_text` SET `BroadcastTextId`=22813 WHERE `CreatureID`=24250 AND `GroupID`=0 AND `ID`=4; +UPDATE `creature_text` SET `BroadcastTextId`=24847 WHERE `CreatureID`=24250 AND `GroupID`=0 AND `ID`=5; +UPDATE `creature_text` SET `BroadcastTextId`=22859 WHERE `CreatureID`=24250 AND `GroupID`=1 AND `ID`=0; +UPDATE `creature_text` SET `BroadcastTextId`=22860 WHERE `CreatureID`=24250 AND `GroupID`=1 AND `ID`=1; +UPDATE `creature_text` SET `BroadcastTextId`=22857 WHERE `CreatureID`=24250 AND `GroupID`=1 AND `ID`=2; +UPDATE `creature_text` SET `BroadcastTextId`=23076 WHERE `CreatureID`=24250 AND `GroupID`=2 AND `ID`=0; +UPDATE `creature_text` SET `BroadcastTextId`=23077 WHERE `CreatureID`=24250 AND `GroupID`=2 AND `ID`=1; +UPDATE `creature_text` SET `BroadcastTextId`=23078 WHERE `CreatureID`=24250 AND `GroupID`=2 AND `ID`=2; +UPDATE `creature_text` SET `BroadcastTextId`=23079 WHERE `CreatureID`=24250 AND `GroupID`=2 AND `ID`=3; -- cgit v1.2.3 From 7211c6e51d7471cef6c2de6bf1b1bf3711887835 Mon Sep 17 00:00:00 2001 From: ForesterDev Date: Fri, 26 May 2017 10:52:56 +0400 Subject: Scripts/Command: implement .debug play music command Closes #19809 (cherry picked from commit dd4ff1fe5458c89fc1d988fcc6ba5792ee482dcf) --- sql/base/auth_database.sql | 3 + sql/updates/auth/master/2020_05_19_00_auth.sql | 7 +++ .../2020_06_14_18_world_2017_05_29_00_world.sql | 3 + src/server/game/Accounts/RBAC.h | 1 + src/server/scripts/Commands/cs_debug.cpp | 66 ++++++++++++++++------ 5 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 sql/updates/auth/master/2020_05_19_00_auth.sql create mode 100644 sql/updates/world/master/2020_06_14_18_world_2017_05_29_00_world.sql (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 5ebb0a579eb..da0258f519b 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -1267,6 +1267,7 @@ INSERT INTO `rbac_linked_permissions` VALUES (198,316), (198,317), (198,318), +(198,855), (198,367), (198,368), (198,369), @@ -2084,6 +2085,7 @@ INSERT INTO `rbac_permissions` VALUES (852,'Command: go offset'), (853,'Command: .reload conversation_template'), (854,'Command: .debug conversation'), +(855,'Command: debug play music'), (868,'Command: modify power'), (869,'Command: debug send playerchoice'), (872,'Command: server debug'); @@ -2331,6 +2333,7 @@ INSERT INTO `updates` VALUES ('2020_03_31_00_auth.sql','BA82A58E95730A397922B6723DA027986E6CD535','RELEASED','2020-03-31 17:00:16',0), ('2020_04_04_00_auth.sql','5F118989A9F8AFA3B2065AB9C2C0BB7D9A0EB97A','RELEASED','2020-04-04 13:23:53',0), ('2020_04_30_00_auth.sql','2FD304B8EF82D529D69287BF22EF061A267F827E','RELEASED','2020-04-30 00:39:29',0), +('2020_05_19_00_auth.sql','12D9F26538F63546B74793499E8A71BD885E8E5F','RELEASED','2020-05-19 12:00:00',0), ('2020_06_04_00_auth.sql','BA797B558196B1A07F8FF66E5288AD04659CF6AC','RELEASED','2020-06-04 09:57:07',0); /*!40000 ALTER TABLE `updates` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/auth/master/2020_05_19_00_auth.sql b/sql/updates/auth/master/2020_05_19_00_auth.sql new file mode 100644 index 00000000000..7ddeabe630c --- /dev/null +++ b/sql/updates/auth/master/2020_05_19_00_auth.sql @@ -0,0 +1,7 @@ +DELETE FROM `rbac_permissions` WHERE `id` = 855; +INSERT INTO `rbac_permissions` (`id`,`name`) VALUES +(855, 'Command: debug play music'); + +DELETE FROM `rbac_linked_permissions` WHERE `id` = 855; +INSERT INTO `rbac_linked_permissions` (`id`,`linkedId`) VALUES +(198, 855); diff --git a/sql/updates/world/master/2020_06_14_18_world_2017_05_29_00_world.sql b/sql/updates/world/master/2020_06_14_18_world_2017_05_29_00_world.sql new file mode 100644 index 00000000000..6282e1c7b69 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_18_world_2017_05_29_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `command` WHERE `name` = 'debug play music'; +INSERT INTO `command` (`name`,`permission`,`help`) VALUES +('debug play music', 855, 'Syntax: .debug play music #musicId\nPlay music with #musicId.\nMusic will be played only for you. Other players will not hear this.'); diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 9ad98ac6466..68b3d673a15 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -760,6 +760,7 @@ enum RBACPermissions RBAC_PERM_COMMAND_GO_OFFSET = 852, RBAC_PERM_COMMAND_RELOAD_CONVERSATION_TEMPLATE = 853, RBAC_PERM_COMMAND_DEBUG_CONVERSATION = 854, + RBAC_PERM_COMMAND_DEBUG_PLAY_MUSIC = 855, RBAC_PERM_COMMAND_NPC_SPAWNGROUP = 856, // reserved for dynamic_spawning RBAC_PERM_COMMAND_NPC_DESPAWNGROUP = 857, // reserved for dynamic_spawning RBAC_PERM_COMMAND_GOBJECT_SPAWNGROUP = 858, // reserved for dynamic_spawning diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 11417b305a5..81bc3e533e1 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -61,6 +61,7 @@ public: { "cinematic", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_CINEMATIC, false, &HandleDebugPlayCinematicCommand, "" }, { "movie", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_MOVIE, false, &HandleDebugPlayMovieCommand, "" }, { "sound", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_SOUND, false, &HandleDebugPlaySoundCommand, "" }, + { "music", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_MUSIC, false, &HandleDebugPlayMusicCommand, "" }, }; static std::vector debugSendCommandTable = { @@ -117,8 +118,8 @@ public: static bool HandleDebugPlayCinematicCommand(ChatHandler* handler, char const* args) { - // USAGE: .debug play cinematic #cinematicid - // #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column) + // USAGE: .debug play cinematic #cinematicId + // #cinematicId - ID decimal number from CinemaicSequences.dbc (1st column) if (!*args) { handler->SendSysMessage(LANG_BAD_VALUE); @@ -126,12 +127,12 @@ public: return false; } - uint32 id = atoul(args); + uint32 cinematicId = atoul(args); - CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(id); + CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId); if (!cineSeq) { - handler->PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, id); + handler->PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, cinematicId); handler->SetSentErrorMessage(true); return false; } @@ -139,7 +140,7 @@ public: // Dump camera locations if (std::vector const* flyByCameras = GetFlyByCameras(cineSeq->Camera[0])) { - handler->PSendSysMessage("Waypoints for sequence %u, camera %u", id, cineSeq->Camera[0]); + handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->Camera[0]); uint32 count = 1; for (FlyByCamera const& cam : *flyByCameras) { @@ -149,14 +150,14 @@ public: handler->PSendSysMessage(SZFMTD " waypoints dumped", flyByCameras->size()); } - handler->GetSession()->GetPlayer()->SendCinematicStart(id); + handler->GetSession()->GetPlayer()->SendCinematicStart(cinematicId); return true; } static bool HandleDebugPlayMovieCommand(ChatHandler* handler, char const* args) { - // USAGE: .debug play movie #movieid - // #movieid - ID decimal number from Movie.dbc (1st column) + // USAGE: .debug play movie #movieId + // #movieId - ID decimal number from Movie.dbc (1st column) if (!*args) { handler->SendSysMessage(LANG_BAD_VALUE); @@ -164,24 +165,24 @@ public: return false; } - uint32 id = atoul(args); + uint32 movieId = atoul(args); - if (!sMovieStore.LookupEntry(id)) + if (!sMovieStore.LookupEntry(movieId)) { - handler->PSendSysMessage(LANG_MOVIE_NOT_EXIST, id); + handler->PSendSysMessage(LANG_MOVIE_NOT_EXIST, movieId); handler->SetSentErrorMessage(true); return false; } - handler->GetSession()->GetPlayer()->SendMovieStart(id); + handler->GetSession()->GetPlayer()->SendMovieStart(movieId); return true; } //Play sound static bool HandleDebugPlaySoundCommand(ChatHandler* handler, char const* args) { - // USAGE: .debug playsound #soundid - // #soundid - ID decimal number from SoundEntries.dbc (1st column) + // USAGE: .debug playsound #soundId + // #soundId - ID decimal number from SoundEntries.dbc (1st column) if (!*args) { handler->SendSysMessage(LANG_BAD_VALUE); @@ -198,6 +199,8 @@ public: return false; } + Player* player = handler->GetSession()->GetPlayer(); + Unit* unit = handler->getSelectedUnit(); if (!unit) { @@ -206,15 +209,42 @@ public: return false; } - if (!handler->GetSession()->GetPlayer()->GetTarget().IsEmpty()) - unit->PlayDistanceSound(soundId, handler->GetSession()->GetPlayer()); + if (player->GetTarget().IsEmpty()) + unit->PlayDistanceSound(soundId, player); else - unit->PlayDirectSound(soundId, handler->GetSession()->GetPlayer()); + unit->PlayDirectSound(soundId, player); handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, soundId); return true; } + static bool HandleDebugPlayMusicCommand(ChatHandler* handler, char const* args) + { + // USAGE: .debug play music #musicId + // #musicId - ID decimal number from SoundEntries.dbc (1st column) + if (!*args) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 musicId = atoul(args); + if (!sSoundKitStore.LookupEntry(musicId)) + { + handler->PSendSysMessage(LANG_SOUND_NOT_EXIST, musicId); + handler->SetSentErrorMessage(true); + return false; + } + + Player* player = handler->GetSession()->GetPlayer(); + + player->PlayDirectMusic(musicId, player); + + handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, musicId); + return true; + } + static bool HandleDebugSendSpellFailCommand(ChatHandler* handler, char const* args) { if (!*args) -- cgit v1.2.3 From 800d664502082328675852428f23a7fb2f938dca Mon Sep 17 00:00:00 2001 From: Dr-J Date: Sun, 28 May 2017 11:43:08 +0100 Subject: DB/SAI: Add some missing charmed flags DB/SAI: Add missing charmed flags to blight geists which is required for when they are charmed as part of it roll's downhill. (cherry picked from commit f2c351158b527b3dc8493cf1edd841ddad2de579) --- sql/updates/world/master/2020_06_14_19_world_2017_05_28_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_19_world_2017_05_28_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_19_world_2017_05_28_00_world.sql b/sql/updates/world/master/2020_06_14_19_world_2017_05_28_00_world.sql new file mode 100644 index 00000000000..964970806f3 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_19_world_2017_05_28_00_world.sql @@ -0,0 +1,2 @@ +UPDATE `smart_scripts` SET `event_flags`=`event_flags`|0x200 WHERE `entryorguid`=28750 AND `source_type`=0 AND `id` IN(0,2,4); +UPDATE `smart_scripts` SET `event_flags`=`event_flags`|0x200 WHERE `entryorguid`=2875000 AND `source_type`=9; -- cgit v1.2.3 From c8901a52ee1fb35a9feea194fd39cbc2dbf6844d Mon Sep 17 00:00:00 2001 From: Killyana Date: Sun, 28 May 2017 18:09:07 +0200 Subject: DB/Creature: Remove double spawns from Death Knights area (cherry picked from commit 7f1315f77d804987691e614583efee52e544b584) --- sql/updates/world/master/2020_06_14_20_world_2017_05_28_01_world.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_20_world_2017_05_28_01_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_20_world_2017_05_28_01_world.sql b/sql/updates/world/master/2020_06_14_20_world_2017_05_28_01_world.sql new file mode 100644 index 00000000000..4851dcf6986 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_20_world_2017_05_28_01_world.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `creature` WHERE `guid` IN (129652, 129656, 129651, 129655, 129644,130577,130842,130581,130590,130582,130597,130848,130847,130846,130723,130849,130739,130855,130745,130746,130742,130748,130702,130701,130853,130703,130557,130573,130558,130700,130691,130692,130693,130834,130832,130835,130697,130694,130836,130637,130641,130838,130696,130840,130603,130685,130687,130613,130688,130686,129733,129732,129774,129765,129767,129803,129783); +DELETE FROM `creature_addon` WHERE `guid` IN (129652, 129656, 129651, 129655, 129644,130577,130842,130581,130590,130582,130597,130848,130847,130846,130723,130849,130739,130855,130745,130746,130742,130748,130702,130701,130853,130703,130557,130573,130558,130700,130691,130692,130693,130834,130832,130835,130697,130694,130836,130637,130641,130838,130696,130840,130603,130685,130687,130613,130688,130686,129733,129732,129774,129765,129767,129803,129783); +DELETE FROM `waypoint_data` WHERE `id` IN (1296520, 1296560, 1296510, 1296550, 1296440); -- cgit v1.2.3 From e782799c30367cfb0be4433395cf96b052268551 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Sun, 28 May 2017 19:18:41 +0100 Subject: DB/Conditions: Charles Worth Correct conditions for gossip closes #19516 (cherry picked from commit 607686a91267587a05ab6fadc0fce7bc4c93a27b) --- sql/updates/world/master/2020_06_14_21_world_2017_05_28_03_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_21_world_2017_05_28_03_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_21_world_2017_05_28_03_world.sql b/sql/updates/world/master/2020_06_14_21_world_2017_05_28_03_world.sql new file mode 100644 index 00000000000..a9ffb21052a --- /dev/null +++ b/sql/updates/world/master/2020_06_14_21_world_2017_05_28_03_world.sql @@ -0,0 +1,2 @@ +UPDATE `conditions` SET `SourceEntry`=3 WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10118 AND `SourceEntry`=5 AND `ConditionTypeOrReference`=17 and `ConditionValue1`=1288; +UPDATE `conditions` SET `SourceEntry`=5 WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10118 AND `SourceEntry`=3 AND `ConditionTypeOrReference`=17 and `ConditionValue1` IN(1360,41); -- cgit v1.2.3 From cdf591f6f0627b7060c35228f084a0be4177c42b Mon Sep 17 00:00:00 2001 From: Aokromes Date: Fri, 2 Jun 2017 01:21:08 +0200 Subject: DB/Creature: Fix 2 incorrect MovementType Updates #19831 (cherry picked from commit 877749cf3ffd479a87f7b3a7ac1b3703389c6cb3) --- sql/updates/world/master/2020_06_14_22_world_2017_06_02_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_22_world_2017_06_02_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_22_world_2017_06_02_00_world.sql b/sql/updates/world/master/2020_06_14_22_world_2017_06_02_00_world.sql new file mode 100644 index 00000000000..96abdae5c20 --- /dev/null +++ b/sql/updates/world/master/2020_06_14_22_world_2017_06_02_00_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature` SET `MovementType`=1 WHERE `guid` IN (51879,51914); -- cgit v1.2.3 From 8cddf0d2c76cf7de0bbff88d664c94ac4745f596 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Fri, 2 Jun 2017 15:30:21 +0200 Subject: DB/Misc: Fix some startup errors (cherry picked from commit 67115eda7ea428fd6f23b84b1662a2a6166189b2) --- sql/updates/world/master/2020_06_14_23_world_2017_06_02_01_world.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_23_world_2017_06_02_01_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_23_world_2017_06_02_01_world.sql b/sql/updates/world/master/2020_06_14_23_world_2017_06_02_01_world.sql new file mode 100644 index 00000000000..fd00cce104e --- /dev/null +++ b/sql/updates/world/master/2020_06_14_23_world_2017_06_02_01_world.sql @@ -0,0 +1,3 @@ +-- +UPDATE `creature_template` SET `AIName`='NullCreatureAI' WHERE `AIName`='NullAI'; +UPDATE `creature` SET `spawndist`=5 WHERE `guid` IN (51879,51914); -- cgit v1.2.3 From 43f771a4f0f959b788a870d3257edf32d31e02cb Mon Sep 17 00:00:00 2001 From: Killyana Date: Fri, 2 Jun 2017 19:55:40 +0200 Subject: DB/Creature: Add some Ziggurat Defender spawns (cherry picked from commit a87bc7826a2a8598ca16ece93d3a3267f45721a9) --- .../world/master/2020_06_14_24_world_2017_06_02_02_world.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_24_world_2017_06_02_02_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_24_world_2017_06_02_02_world.sql b/sql/updates/world/master/2020_06_14_24_world_2017_06_02_02_world.sql new file mode 100644 index 00000000000..1ff1d82e05c --- /dev/null +++ b/sql/updates/world/master/2020_06_14_24_world_2017_06_02_02_world.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM `creature` WHERE `guid` IN (80342, 80351, 80364, 80378); +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES +(80342, 26202, 571, 0, 0, '0', 0, 0, 0, 3247.804, 3688.892, 21.705, 3.158267, 300, 7, 0, 1, 0, 1, 0, 0, 0, -1), +(80351, 26202, 571, 0, 0, '0', 0, 0, 0, 3180.858, 3820.200, 28.555, 3.158267, 300, 7, 0, 1, 0, 1, 0, 0, 0, -1), +(80364, 26202, 571, 0, 0, '0', 0, 0, 0, 3190.193, 3852.021, 27.972, 3.158267, 300, 7, 0, 1, 0, 1, 0, 0, 0, -1), +(80378, 26202, 571, 0, 0, '0', 0, 0, 0, 3158.872, 3841.474, 25.945, 3.158267, 300, 7, 0, 1, 0, 1, 0, 0, 0, -1); -- cgit v1.2.3 From cf88f0a9735f9ba010a4ae46e848c8f1a86e17fa Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 3 Jun 2017 00:53:43 +0200 Subject: DB/Misc: Remove one startup error (cherry picked from commit d6fbe994325ea6b23d144562245e749115700996) --- sql/updates/world/master/2020_06_14_25_world_2017_06_03_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/master/2020_06_14_25_world_2017_06_03_00_world.sql (limited to 'sql') diff --git a/sql/updates/world/master/2020_06_14_25_world_2017_06_03_00_world.sql b/sql/updates/world/master/2020_06_14_25_world_2017_06_03_00_world.sql new file mode 100644 index 00000000000..75b15ae7e9b --- /dev/null +++ b/sql/updates/world/master/2020_06_14_25_world_2017_06_03_00_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `AIName`='' WHERE `entry`=12999; -- cgit v1.2.3