diff --git a/.github/actions/linux-build/action.yml b/.github/actions/linux-build/action.yml index 739be2342..7218239cc 100644 --- a/.github/actions/linux-build/action.yml +++ b/.github/actions/linux-build/action.yml @@ -101,6 +101,8 @@ runs: -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_C_FLAGS="-Werror" \ + -DCMAKE_CXX_FLAGS="-Werror" \ -DBUILD_TESTING="ON" \ -DUSE_SCRIPTPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \ -DUSE_COREPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \ diff --git a/.github/workflows/core-build-nopch.yml b/.github/workflows/core-build-nopch.yml index dd7e322f9..23611a122 100644 --- a/.github/workflows/core-build-nopch.yml +++ b/.github/workflows/core-build-nopch.yml @@ -23,10 +23,6 @@ jobs: compiler: CC: clang-15 CXX: clang++-15 - - os: ubuntu-22.04 - compiler: - CC: gcc-12 - CXX: g++-12 - os: ubuntu-24.04 compiler: CC: clang-18 diff --git a/data/sql/updates/db_world/2024_07_07_00.sql b/data/sql/updates/db_world/2024_07_07_00.sql new file mode 100644 index 000000000..3dddcf67a --- /dev/null +++ b/data/sql/updates/db_world/2024_07_07_00.sql @@ -0,0 +1,25 @@ +-- DB update 2024_07_06_11 -> 2024_07_07_00 +-- +DELETE FROM `gossip_menu_option` WHERE (`MenuID` = 161); +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES +(161, 0, 0, 'Mennet said I should ask you for a set of thieves\' tools.', 2621, 1, 1, 0, 0, 0, 0, NULL, 0, 0), +(161, 1, 0, 'I need another set of thieves\' tools.', 2643, 1, 1, 0, 0, 0, 0, '', 0, 0); + + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 6566; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 6566); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(6566, 0, 0, 2, 62, 0, 100, 0, 161, 0, 0, 0, 0, 0, 11, 9949, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Estelle Gendry - On Gossip Option 0 Selected - Cast \'Thieves` Tool Rack Conjure\''), +(6566, 0, 1, 2, 62, 0, 100, 0, 161, 1, 0, 0, 0, 0, 11, 9949, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Estelle Gendry - On Gossip Option 1 Selected - Cast \'Thieves` Tool Rack Conjure\''), +(6566, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Estelle Gendry - On Gossip Option Selected - Close Gossip'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 15) AND (`SourceGroup` = 161); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 161, 0, 0, 0, 2, 0, 5060, 1, 1, 1, 0, 0, '', 'Estelle Gendry should not give player Thieves\' Tools if the player has one already'), +(15, 161, 0, 0, 0, 2, 0, 5060, 1, 0, 1, 0, 0, '', 'Estelle Gendry should not give player Thieves\' Tools if the player has one already'), +(15, 161, 0, 0, 0, 47, 0, 1999, 10, 0, 0, 0, 0, '', 'Estelle Gendry should only give player Thieves\' Tools if the player is on the appropriate quest'), + +(15, 161, 1, 0, 0, 2, 0, 5060, 1, 1, 1, 0, 0, '', 'Estelle Gendry should not give player Thieves\' Tools if the player has one already'), +(15, 161, 1, 0, 0, 2, 0, 5060, 1, 0, 1, 0, 0, '', 'Estelle Gendry should not give player Thieves\' Tools if the player has one already'), +(15, 161, 1, 0, 0, 47, 0, 1999, 64, 0, 0, 0, 0, '', 'Estelle Gendry should only give player Thieves\' Tools if the player has completed the appropriate quest'); diff --git a/data/sql/updates/db_world/2024_07_07_01.sql b/data/sql/updates/db_world/2024_07_07_01.sql new file mode 100644 index 000000000..ac36e88a5 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_07_01.sql @@ -0,0 +1,3 @@ +-- DB update 2024_07_07_00 -> 2024_07_07_01 +-- +UPDATE `item_template` SET `spellppmRate_4` = 5 WHERE (`entry` = 30318); diff --git a/data/sql/updates/db_world/2024_07_07_02.sql b/data/sql/updates/db_world/2024_07_07_02.sql new file mode 100644 index 000000000..4b7db267f --- /dev/null +++ b/data/sql/updates/db_world/2024_07_07_02.sql @@ -0,0 +1,4 @@ +-- DB update 2024_07_07_01 -> 2024_07_07_02 +-- +UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`&~16384 WHERE `type` = 9 AND `mechanic_immune_mask`&16384; +UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`&~16384 WHERE `type` = 6 AND `mechanic_immune_mask`&16384 AND `entry` NOT IN (4543, 8317, 11561, 16194, 16215, 16216, 28443); diff --git a/data/sql/updates/db_world/2024_07_07_03.sql b/data/sql/updates/db_world/2024_07_07_03.sql new file mode 100644 index 000000000..68f508fcf --- /dev/null +++ b/data/sql/updates/db_world/2024_07_07_03.sql @@ -0,0 +1,3 @@ +-- DB update 2024_07_07_02 -> 2024_07_07_03 +-- Talon King Ikiss - interrupt immunity +UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`|33554432 WHERE (`entry` IN (18473,20706)); diff --git a/data/sql/updates/db_world/2024_07_07_04.sql b/data/sql/updates/db_world/2024_07_07_04.sql new file mode 100644 index 000000000..24562180b --- /dev/null +++ b/data/sql/updates/db_world/2024_07_07_04.sql @@ -0,0 +1,339 @@ +-- DB update 2024_07_07_03 -> 2024_07_07_04 +SET +@CGUID = 12550; -- First free + +DELETE FROM `creature` WHERE `id1` = 12129 AND `guid` IN (52047, 52048, 52049, 52050, 52051, 52052, 52053); +DELETE FROM `creature` WHERE `id1` = 12129 AND `guid` BETWEEN @CGUID+0 AND @CGUID+3; +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES +(@CGUID+0, 12129, 0, 0, 249, 0, 0, 3, 1, 1, -49.92992, -98.07133, -38.5961, 6.248278617858886718, 6300, 0, 0, 213640, 0, 2, 0, 0, 0, '', 50375, 2, ''), +(@CGUID+1, 12129, 0, 0, 249, 0, 0, 3, 1, 1, -62.975872, -98.323456, -38.851532, 3.101630926132202148, 6300, 0, 0, 213640, 0, 2, 0, 0, 0, '', 50375, 2, ''), +(@CGUID+2, 12129, 0, 0, 249, 0, 0, 3, 1, 1, -165.48122, -205.45609, -66.3212, 2.256742238998413085, 6300, 0, 0, 213640, 0, 2, 0, 0, 0, '', 50375, 1, ''), +(@CGUID+3, 12129, 0, 0, 249, 0, 0, 3, 1, 1, -200.14285, -212.38086, -68.62948, 0.855211317539215087, 6300, 0, 0, 213640, 0, 0, 0, 0, 0, '', 50375, 1, ''); + +DELETE FROM `creature_addon` WHERE `guid` IN (52047, 52048, 52049, 52050, 52051, 52052, 52053); +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+3; +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(@CGUID+0, (@CGUID+0)*10, 0, 0, 1, 0, 0, ''), +(@CGUID+1, (@CGUID+1)*10, 0, 0, 1, 0, 0, ''), +(@CGUID+2, (@CGUID+2)*10, 0, 0, 1, 0, 0, ''); + +DELETE FROM `linked_respawn` WHERE `guid` IN (52047, 52048, 52049, 52050, 52051, 52052, 52053) AND `linkedguid` = 47572; +DELETE FROM `linked_respawn` WHERE `guid` IN (@CGUID+0, @CGUID+1, @CGUID+2, @CGUID+3) AND `linkedguid` = 47572; +INSERT INTO `linked_respawn` (`guid`, `linkedGuid`, `linkType`) VALUES +(@CGUID+0, 47572, 0), +(@CGUID+1, 47572, 0), +(@CGUID+2, 47572, 0), +(@CGUID+3, 47572, 0); + +DELETE FROM `waypoint_data` WHERE `id` IN (520480, 520490, 520510); +DELETE FROM `waypoint_data` WHERE `id` IN (((@CGUID+0)*10), ((@CGUID+1)*10), ((@CGUID+2)*10)); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `action_chance`) VALUES +((@CGUID+0)*10, 1, -53.513702, -97.9611, -38.68338, NULL, 0, 100), +((@CGUID+0)*10, 2, -56.06462, -97.792885, -38.387665, NULL, 0, 100), +((@CGUID+0)*10, 3, -57.56462, -98.042885, -38.387665, NULL, 0, 100), +((@CGUID+0)*10, 4, -63.31462, -98.292885, -38.387665, NULL, 0, 100), +((@CGUID+0)*10, 5, -68.06462, -98.542885, -36.887665, NULL, 0, 100), +((@CGUID+0)*10, 6, -70.94271, -98.804344, -36.16156, NULL, 0, 100), +((@CGUID+0)*10, 7, -73.45618, -99.05878, -34.77289, NULL, 0, 100), +((@CGUID+0)*10, 8, -76.20618, -99.05878, -35.02289, NULL, 0, 100), +((@CGUID+0)*10, 9, -78.20618, -99.80878, -35.02289, NULL, 0, 100), +((@CGUID+0)*10, 10, -82.45618, -101.30878, -35.77289, NULL, 0, 100), +((@CGUID+0)*10, 11, -85.20618, -102.05878, -36.27289, NULL, 0, 100), +((@CGUID+0)*10, 12, -91.074615, -104.028145, -38.29629, NULL, 0, 100), +((@CGUID+0)*10, 13, -91.90683, -104.2933, -38.430725, NULL, 0, 100), +((@CGUID+0)*10, 14, -93.40683, -104.7933, -38.180725, NULL, 0, 100), +((@CGUID+0)*10, 15, -94.65683, -105.7933, -38.180725, NULL, 0, 100), +((@CGUID+0)*10, 16, -94.90683, -106.0433, -38.180725, NULL, 0, 100), +((@CGUID+0)*10, 17, -97.65683, -108.2933, -39.180725, NULL, 0, 100), +((@CGUID+0)*10, 18, -98.65683, -109.2933, -39.680725, NULL, 0, 100), +((@CGUID+0)*10, 19, -102.40683, -112.5433, -41.680725, NULL, 0, 100), +((@CGUID+0)*10, 20, -107.15683, -116.2933, -45.180725, NULL, 0, 100), +((@CGUID+0)*10, 21, -109.02659, -118.160286, -46.97295, NULL, 0, 100), +((@CGUID+0)*10, 22, -111.339874, -120.07501, -48.446712, NULL, 0, 100), +((@CGUID+0)*10, 23, -114.589874, -123.32501, -48.946712, NULL, 0, 100), +((@CGUID+0)*10, 24, -117.589874, -126.07501, -49.196712, NULL, 0, 100), +((@CGUID+0)*10, 25, -123.589874, -131.57501, -50.946712, NULL, 0, 100), +((@CGUID+0)*10, 26, -123.839874, -131.82501, -50.946712, NULL, 0, 100), +((@CGUID+0)*10, 27, -126.839874, -134.57501, -50.946712, NULL, 0, 100), +((@CGUID+0)*10, 28, -129.08987, -136.82501, -51.946712, NULL, 0, 100), +((@CGUID+0)*10, 29, -129.40517, -136.99536, -52.29922, NULL, 0, 100), +((@CGUID+0)*10, 30, -133.23221, -140.51117, -52.711273, NULL, 0, 100), +((@CGUID+0)*10, 31, -135.73221, -142.26117, -53.211273, NULL, 0, 100), +((@CGUID+0)*10, 32, -136.23221, -142.51117, -53.211273, NULL, 0, 100), +((@CGUID+0)*10, 33, -143.73221, -147.51117, -54.211273, NULL, 0, 100), +((@CGUID+0)*10, 34, -146.23221, -149.26117, -53.461273, NULL, 0, 100), +((@CGUID+0)*10, 35, -149.48221, -151.51117, -53.211273, NULL, 0, 100), +((@CGUID+0)*10, 36, -149.73221, -151.51117, -53.211273, NULL, 0, 100), +((@CGUID+0)*10, 37, -149.98221, -152.01117, -53.461273, NULL, 0, 100), +((@CGUID+0)*10, 38, -150.98221, -152.51117, -53.961273, NULL, 0, 100), +((@CGUID+0)*10, 39, -152.23793, -153.43494, -54.47902, NULL, 0, 100), +((@CGUID+0)*10, 40, -156.08177, -155.97754, -55.90998, NULL, 0, 100), +((@CGUID+0)*10, 41, -157.08177, -157.22754, -56.40998, NULL, 0, 100), +((@CGUID+0)*10, 42, -159.08177, -159.97754, -57.40998, NULL, 0, 100), +((@CGUID+0)*10, 43, -162.83177, -164.72754, -58.90998, NULL, 0, 100), +((@CGUID+0)*10, 44, -163.58177, -165.47754, -59.65998, NULL, 0, 100), +((@CGUID+0)*10, 45, -165.83177, -168.72754, -61.15998, NULL, 0, 100), +((@CGUID+0)*10, 46, -166.08177, -168.97754, -61.40998, NULL, 0, 100), +((@CGUID+0)*10, 47, -167.77838, -170.99925, -62.498924, NULL, 0, 100), +((@CGUID+0)*10, 48, -169.47145, -173.16231, -63.261635, NULL, 0, 100), +((@CGUID+0)*10, 49, -170.92561, -175.02014, -63.84094, NULL, 0, 100), +((@CGUID+0)*10, 50, -171.06142, -178.09026, -64.45865, NULL, 0, 100), +((@CGUID+0)*10, 51, -171.10358, -179.04335, -64.86902, NULL, 0, 100), +((@CGUID+0)*10, 52, -171.10733, -179.12845, -65.04507, NULL, 0, 100), +((@CGUID+0)*10, 53, -171.2945, -183.35968, -65.745575, NULL, 0, 100), +((@CGUID+0)*10, 54, -171.67883, -192.04868, -66.635994, NULL, 0, 100), +((@CGUID+0)*10, 55, -171.91806, -197.45735, -66.65244, NULL, 0, 100), +((@CGUID+0)*10, 56, -171.942, -197.99861, -66.64427, NULL, 0, 100), +((@CGUID+0)*10, 57, -171.92313, -201.1838, -66.473434, NULL, 0, 100), +((@CGUID+0)*10, 58, -170.42313, -201.9338, -66.223434, NULL, 0, 100), +((@CGUID+0)*10, 59, -165.17313, -204.9338, -66.223434, NULL, 0, 100), +((@CGUID+0)*10, 60, -160.42313, -207.6838, -66.223434, NULL, 0, 100), +((@CGUID+0)*10, 61, -156.11948, -210.32213, -66.47666, NULL, 0, 100), +((@CGUID+0)*10, 62, -153.8925, -211.39844, -66.4801, NULL, 0, 100), +((@CGUID+0)*10, 63, -153.1425, -211.89844, -66.7301, NULL, 0, 100), +((@CGUID+0)*10, 64, -145.6425, -212.64844, -68.4801, NULL, 0, 100), +((@CGUID+0)*10, 65, -145.1425, -212.64844, -68.4801, NULL, 0, 100), +((@CGUID+0)*10, 66, -141.6425, -213.14844, -68.7301, NULL, 0, 100), +((@CGUID+0)*10, 67, -138.3925, -213.64844, -69.2301, NULL, 0, 100), +((@CGUID+0)*10, 68, -132.08371, -214.65836, -70.658585, NULL, 0, 100), +((@CGUID+0)*10, 69, -131.05392, -214.75316, -70.60764, NULL, 0, 100), +((@CGUID+0)*10, 70, -129.30392, -214.75316, -70.85764, NULL, 0, 100), +((@CGUID+0)*10, 71, -124.803925, -214.75316, -71.35764, NULL, 0, 100), +((@CGUID+0)*10, 72, -121.553925, -214.75316, -71.35764, NULL, 0, 100), +((@CGUID+0)*10, 73, -121.553925, -214.75316, -71.60764, NULL, 0, 100), +((@CGUID+0)*10, 74, -117.803925, -214.75316, -72.35764, NULL, 0, 100), +((@CGUID+0)*10, 75, -116.803925, -214.75316, -72.85764, NULL, 0, 100), +((@CGUID+0)*10, 76, -111.303925, -214.75316, -74.60764, NULL, 0, 100), +((@CGUID+0)*10, 77, -111.02415, -214.84796, -75.0567, NULL, 0, 100), +((@CGUID+0)*10, 78, -111.28157, -214.7845, -74.57919, NULL, 0, 100), +((@CGUID+0)*10, 79, -116.53157, -215.0345, -72.82919, NULL, 0, 100), +((@CGUID+0)*10, 80, -117.53157, -215.0345, -72.32919, NULL, 0, 100), +((@CGUID+0)*10, 81, -121.28157, -215.0345, -71.57919, NULL, 0, 100), +((@CGUID+0)*10, 82, -121.21734, -215.15184, -71.70333, NULL, 0, 100), +((@CGUID+0)*10, 83, -121.81659, -214.94745, -71.10617, NULL, 0, 100), +((@CGUID+0)*10, 84, -123.56659, -214.94745, -71.10617, NULL, 0, 100), +((@CGUID+0)*10, 85, -125.06659, -214.69745, -71.10617, NULL, 0, 100), +((@CGUID+0)*10, 86, -129.81659, -214.19745, -70.60617, NULL, 0, 100), +((@CGUID+0)*10, 87, -138.31659, -213.19745, -69.35617, NULL, 0, 100), +((@CGUID+0)*10, 88, -141.06659, -212.94745, -68.60617, NULL, 0, 100), +((@CGUID+0)*10, 89, -145.31659, -212.69745, -68.60617, NULL, 0, 100), +((@CGUID+0)*10, 90, -146.06659, -212.44745, -68.35617, NULL, 0, 100), +((@CGUID+0)*10, 91, -154.06659, -211.44745, -66.35617, NULL, 0, 100), +((@CGUID+0)*10, 92, -156.35484, -211.28949, -66.550674, NULL, 0, 100), +((@CGUID+0)*10, 93, -160.84909, -210.59854, -66.222, NULL, 0, 100), +((@CGUID+0)*10, 94, -162.84909, -208.59854, -66.222, NULL, 0, 100), +((@CGUID+0)*10, 95, -165.34909, -205.84854, -66.222, NULL, 0, 100), +((@CGUID+0)*10, 96, -169.34909, -201.59854, -66.222, NULL, 0, 100), +((@CGUID+0)*10, 97, -172.73747, -198.58713, -66.68329, NULL, 0, 100), +((@CGUID+0)*10, 98, -175.15808, -195.55733, -66.523766, NULL, 0, 100), +((@CGUID+0)*10, 99, -174.15808, -193.05733, -66.523766, NULL, 0, 100), +((@CGUID+0)*10, 100, -170.65808, -183.05733, -65.273766, NULL, 0, 100), +((@CGUID+0)*10, 101, -169.40808, -179.05733, -64.523766, NULL, 0, 100), +((@CGUID+0)*10, 102, -169.40808, -178.80733, -64.273766, NULL, 0, 100), +((@CGUID+0)*10, 103, -168.90808, -177.80733, -64.023766, NULL, 0, 100), +((@CGUID+0)*10, 104, -167.65808, -174.05733, -63.273766, NULL, 0, 100), +((@CGUID+0)*10, 105, -167.14984, -172.57756, -62.914707, NULL, 0, 100), +((@CGUID+0)*10, 106, -165.98276, -169.62744, -61.613777, NULL, 0, 100), +((@CGUID+0)*10, 107, -165.73276, -169.37744, -61.363777, NULL, 0, 100), +((@CGUID+0)*10, 108, -165.48276, -168.87744, -61.113777, NULL, 0, 100), +((@CGUID+0)*10, 109, -163.23276, -166.37744, -59.863777, NULL, 0, 100), +((@CGUID+0)*10, 110, -162.23276, -165.37744, -58.613777, NULL, 0, 100), +((@CGUID+0)*10, 111, -156.48276, -158.37744, -56.363777, NULL, 0, 100), +((@CGUID+0)*10, 112, -156.23276, -158.37744, -56.363777, NULL, 0, 100), +((@CGUID+0)*10, 113, -152.73276, -154.37744, -54.613777, NULL, 0, 100), +((@CGUID+0)*10, 114, -152.71101, -154.33183, -54.789116, NULL, 0, 100), +((@CGUID+0)*10, 115, -150.49062, -151.9926, -53.404808, NULL, 0, 100), +((@CGUID+0)*10, 116, -149.74062, -151.4926, -53.154808, NULL, 0, 100), +((@CGUID+0)*10, 117, -146.74062, -148.9926, -53.154808, NULL, 0, 100), +((@CGUID+0)*10, 118, -144.24062, -146.9926, -54.154808, NULL, 0, 100), +((@CGUID+0)*10, 119, -136.74062, -141.4926, -52.904808, NULL, 0, 100), +((@CGUID+0)*10, 120, -135.99062, -140.7426, -52.654808, NULL, 0, 100), +((@CGUID+0)*10, 121, -129.99062, -136.2426, -52.154808, NULL, 0, 100), +((@CGUID+0)*10, 122, -127.490616, -134.4926, -51.404808, NULL, 0, 100), +((@CGUID+0)*10, 123, -124.70422, -132.27127, -51.393177, NULL, 0, 100), +((@CGUID+0)*10, 124, -124.056305, -131.68816, -51.059364, NULL, 0, 100), +((@CGUID+0)*10, 125, -123.806305, -131.43816, -51.059364, NULL, 0, 100), +((@CGUID+0)*10, 126, -121.056305, -129.43816, -50.059364, NULL, 0, 100), +((@CGUID+0)*10, 127, -117.056305, -126.188156, -48.809364, NULL, 0, 100), +((@CGUID+0)*10, 128, -113.806305, -123.688156, -48.809364, NULL, 0, 100), +((@CGUID+0)*10, 129, -110.556305, -120.938156, -48.059364, NULL, 0, 100), +((@CGUID+0)*10, 130, -106.306305, -117.688156, -45.559364, NULL, 0, 100), +((@CGUID+0)*10, 131, -101.556305, -113.938156, -41.559364, NULL, 0, 100), +((@CGUID+0)*10, 132, -101.17739, -113.613754, -41.58105, NULL, 0, 100), +((@CGUID+0)*10, 133, -98.60477, -111.61609, -40.06495, NULL, 0, 100), +((@CGUID+0)*10, 134, -97.10477, -110.36609, -39.31495, NULL, 0, 100), +((@CGUID+0)*10, 135, -95.85477, -109.61609, -38.81495, NULL, 0, 100), +((@CGUID+0)*10, 136, -95.10477, -109.11609, -38.56495, NULL, 0, 100), +((@CGUID+0)*10, 137, -92.35477, -107.61609, -38.06495, NULL, 0, 100), +((@CGUID+0)*10, 138, -89.85477, -105.86609, -38.06495, NULL, 0, 100), +((@CGUID+0)*10, 139, -84.85477, -103.11609, -36.06495, NULL, 0, 100), +((@CGUID+0)*10, 140, -82.60477, -101.86609, -35.81495, NULL, 0, 100), +((@CGUID+0)*10, 141, -78.35477, -99.11609, -35.06495, NULL, 0, 100), +((@CGUID+0)*10, 142, -77.66356, -98.88371, -35.235012, NULL, 0, 100), +((@CGUID+0)*10, 143, -75.195114, -97.62215, -34.99008, NULL, 0, 100), +((@CGUID+0)*10, 144, -73.195114, -97.62215, -34.74008, NULL, 0, 100), +((@CGUID+0)*10, 145, -68.195114, -97.62215, -36.99008, NULL, 0, 100), +((@CGUID+0)*10, 146, -63.195114, -97.62215, -38.49008, NULL, 0, 100), +((@CGUID+0)*10, 147, -57.445114, -97.87215, -38.24008, NULL, 0, 100); + +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `action_chance`) VALUES +((@CGUID+1)*10, 1, -68.33388, -98.186905, -37.29089, NULL, 0, 100), +((@CGUID+1)*10, 2, -69.58388, -97.936905, -36.54089, NULL, 0, 100), +((@CGUID+1)*10, 3, -73.58388, -98.436905, -34.79089, NULL, 0, 100), +((@CGUID+1)*10, 4, -78.08388, -98.936905, -35.04089, NULL, 0, 100), +((@CGUID+1)*10, 5, -80.83388, -98.936905, -35.54089, NULL, 0, 100), +((@CGUID+1)*10, 6, -81.85883, -99.18625, -35.817738, NULL, 0, 100), +((@CGUID+1)*10, 7, -83.00012, -99.39705, -35.71315, NULL, 0, 100), +((@CGUID+1)*10, 8, -86.25012, -99.64705, -36.46315, NULL, 0, 100), +((@CGUID+1)*10, 9, -86.50012, -99.64705, -36.46315, NULL, 0, 100), +((@CGUID+1)*10, 10, -87.00012, -100.14705, -36.46315, NULL, 0, 100), +((@CGUID+1)*10, 11, -91.75012, -104.14705, -38.46315, NULL, 0, 100), +((@CGUID+1)*10, 12, -94.00012, -106.39705, -38.21315, NULL, 0, 100), +((@CGUID+1)*10, 13, -97.00012, -108.64705, -39.21315, NULL, 0, 100), +((@CGUID+1)*10, 14, -97.25012, -108.89705, -39.21315, NULL, 0, 100), +((@CGUID+1)*10, 15, -101.32728, -112.52852, -41.35693, NULL, 0, 100), +((@CGUID+1)*10, 16, -102.292694, -113.38759, -41.51863, NULL, 0, 100), +((@CGUID+1)*10, 17, -103.042694, -114.13759, -42.51863, NULL, 0, 100), +((@CGUID+1)*10, 18, -106.792694, -117.13759, -45.51863, NULL, 0, 100), +((@CGUID+1)*10, 19, -110.792694, -120.63759, -48.26863, NULL, 0, 100), +((@CGUID+1)*10, 20, -114.292694, -123.63759, -48.76863, NULL, 0, 100), +((@CGUID+1)*10, 21, -117.042694, -126.13759, -48.76863, NULL, 0, 100), +((@CGUID+1)*10, 22, -123.792694, -131.88759, -51.01863, NULL, 0, 100), +((@CGUID+1)*10, 23, -124.13504, -132.13545, -51.370613, NULL, 0, 100), +((@CGUID+1)*10, 24, -127.12387, -134.76512, -51.360924, NULL, 0, 100), +((@CGUID+1)*10, 25, -127.87387, -135.26512, -51.610924, NULL, 0, 100), +((@CGUID+1)*10, 26, -129.12387, -136.01512, -51.860924, NULL, 0, 100), +((@CGUID+1)*10, 27, -129.87387, -136.51512, -52.110924, NULL, 0, 100), +((@CGUID+1)*10, 28, -135.87387, -140.26512, -52.610924, NULL, 0, 100), +((@CGUID+1)*10, 29, -136.62387, -140.76512, -52.860924, NULL, 0, 100), +((@CGUID+1)*10, 30, -144.77158, -145.97307, -54.279335, NULL, 0, 100), +((@CGUID+1)*10, 31, -147.64163, -147.69339, -53.32099, NULL, 0, 100), +((@CGUID+1)*10, 32, -148.64163, -148.44339, -53.07099, NULL, 0, 100), +((@CGUID+1)*10, 33, -150.64163, -150.69339, -53.32099, NULL, 0, 100), +((@CGUID+1)*10, 34, -151.39163, -151.44339, -53.57099, NULL, 0, 100), +((@CGUID+1)*10, 35, -151.89163, -152.19339, -54.07099, NULL, 0, 100), +((@CGUID+1)*10, 36, -156.39163, -157.69339, -56.32099, NULL, 0, 100), +((@CGUID+1)*10, 37, -158.14163, -159.19339, -57.07099, NULL, 0, 100), +((@CGUID+1)*10, 38, -162.89163, -164.69339, -58.82099, NULL, 0, 100), +((@CGUID+1)*10, 39, -163.64163, -165.44339, -59.57099, NULL, 0, 100), +((@CGUID+1)*10, 40, -166.39163, -168.69339, -61.32099, NULL, 0, 100), +((@CGUID+1)*10, 41, -168.01167, -170.41371, -62.362644, NULL, 0, 100), +((@CGUID+1)*10, 42, -166.5622, -168.65425, -61.35694, NULL, 0, 100), +((@CGUID+1)*10, 43, -166.3122, -168.40425, -61.35694, NULL, 0, 100), +((@CGUID+1)*10, 44, -163.5622, -165.40425, -59.60694, NULL, 0, 100), +((@CGUID+1)*10, 45, -162.8122, -164.65425, -58.85694, NULL, 0, 100), +((@CGUID+1)*10, 46, -158.3122, -159.40425, -57.10694, NULL, 0, 100), +((@CGUID+1)*10, 47, -156.8122, -157.65425, -56.35694, NULL, 0, 100), +((@CGUID+1)*10, 48, -151.8122, -152.15425, -54.10694, NULL, 0, 100), +((@CGUID+1)*10, 49, -151.3122, -151.40425, -53.60694, NULL, 0, 100), +((@CGUID+1)*10, 50, -150.5622, -150.65425, -53.10694, NULL, 0, 100), +((@CGUID+1)*10, 51, -150.16519, -150.15695, -53.3733, NULL, 0, 100), +((@CGUID+1)*10, 52, -148.46165, -148.20181, -53.026817, NULL, 0, 100), +((@CGUID+1)*10, 53, -148.21165, -147.95181, -53.026817, NULL, 0, 100), +((@CGUID+1)*10, 54, -147.21165, -147.45181, -53.026817, NULL, 0, 100), +((@CGUID+1)*10, 55, -144.71165, -145.95181, -53.776817, NULL, 0, 100), +((@CGUID+1)*10, 56, -136.96165, -140.95181, -52.776817, NULL, 0, 100), +((@CGUID+1)*10, 57, -135.96165, -140.45181, -52.776817, NULL, 0, 100), +((@CGUID+1)*10, 58, -129.71165, -136.45181, -52.276817, NULL, 0, 100), +((@CGUID+1)*10, 59, -129.57365, -136.39131, -52.261353, NULL, 0, 100), +((@CGUID+1)*10, 60, -128.85753, -135.74957, -51.68496, NULL, 0, 100), +((@CGUID+1)*10, 61, -127.60753, -134.99957, -51.18496, NULL, 0, 100), +((@CGUID+1)*10, 62, -126.85753, -134.49957, -51.18496, NULL, 0, 100), +((@CGUID+1)*10, 63, -123.85753, -131.99957, -50.93496, NULL, 0, 100), +((@CGUID+1)*10, 64, -123.35753, -131.49957, -50.93496, NULL, 0, 100), +((@CGUID+1)*10, 65, -117.10753, -125.99957, -48.93496, NULL, 0, 100), +((@CGUID+1)*10, 66, -114.35753, -123.74957, -48.68496, NULL, 0, 100), +((@CGUID+1)*10, 67, -110.85753, -120.74957, -48.18496, NULL, 0, 100), +((@CGUID+1)*10, 68, -106.85753, -117.24957, -45.43496, NULL, 0, 100), +((@CGUID+1)*10, 69, -105.946335, -116.51649, -44.96616, NULL, 0, 100), +((@CGUID+1)*10, 70, -101.97188, -113.06731, -41.265575, NULL, 0, 100), +((@CGUID+1)*10, 71, -97.22188, -109.06731, -39.515575, NULL, 0, 100), +((@CGUID+1)*10, 72, -96.97188, -108.81731, -39.265575, NULL, 0, 100), +((@CGUID+1)*10, 73, -94.22188, -106.31731, -38.265575, NULL, 0, 100), +((@CGUID+1)*10, 74, -91.97188, -104.31731, -38.265575, NULL, 0, 100), +((@CGUID+1)*10, 75, -88.23172, -101.127945, -37.14901, NULL, 0, 100), +((@CGUID+1)*10, 76, -86.967354, -99.84122, -36.457047, NULL, 0, 100), +((@CGUID+1)*10, 77, -86.217354, -99.59122, -36.457047, NULL, 0, 100), +((@CGUID+1)*10, 78, -85.967354, -99.59122, -36.457047, NULL, 0, 100), +((@CGUID+1)*10, 79, -82.717354, -99.34122, -35.707047, NULL, 0, 100), +((@CGUID+1)*10, 80, -80.967354, -99.09122, -35.457047, NULL, 0, 100), +((@CGUID+1)*10, 81, -78.217354, -98.84122, -35.207047, NULL, 0, 100), +((@CGUID+1)*10, 82, -73.467354, -98.34122, -34.707047, NULL, 0, 100), +((@CGUID+1)*10, 83, -69.70299, -98.05448, -36.765087, NULL, 0, 100); + +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `action_chance`) VALUES +((@CGUID+2)*10, 1, -165.38808, -205.46146, -66.086075, NULL, 0, 100), +((@CGUID+2)*10, 2, -168.63808, -201.21146, -66.336075, NULL, 0, 100), +((@CGUID+2)*10, 3, -171.88808, -197.46146, -66.586075, NULL, 0, 100), +((@CGUID+2)*10, 4, -174.20085, -194.80345, -66.808914, NULL, 0, 100), +((@CGUID+2)*10, 5, -174.77066, -193.50612, -66.46869, NULL, 0, 100), +((@CGUID+2)*10, 6, -175.27066, -192.75612, -66.46869, NULL, 0, 100), +((@CGUID+2)*10, 7, -172.52066, -184.50612, -65.46869, NULL, 0, 100), +((@CGUID+2)*10, 8, -171.02066, -179.00612, -64.96869, NULL, 0, 100), +((@CGUID+2)*10, 9, -170.89464, -178.41698, -64.57501, NULL, 0, 100), +((@CGUID+2)*10, 10, -170.59988, -177.82619, -63.918083, NULL, 0, 100), +((@CGUID+2)*10, 11, -170.09988, -176.57619, -63.668083, NULL, 0, 100), +((@CGUID+2)*10, 12, -168.34988, -173.32619, -62.918083, NULL, 0, 100), +((@CGUID+2)*10, 13, -166.34988, -169.07619, -61.418083, NULL, 0, 100), +((@CGUID+2)*10, 14, -166.09988, -168.57619, -61.168083, NULL, 0, 100), +((@CGUID+2)*10, 15, -164.09988, -164.57619, -59.668083, NULL, 0, 100), +((@CGUID+2)*10, 16, -163.84988, -164.07619, -59.168083, NULL, 0, 100), +((@CGUID+2)*10, 17, -162.84988, -162.07619, -58.668083, NULL, 0, 100), +((@CGUID+2)*10, 18, -161.81549, -160.19283, -58.305344, NULL, 0, 100), +((@CGUID+2)*10, 19, -160.50998, -157.95198, -57.29561, NULL, 0, 100), +((@CGUID+2)*10, 20, -157.75998, -155.95198, -56.29561, NULL, 0, 100), +((@CGUID+2)*10, 21, -152.25998, -151.95198, -54.04561, NULL, 0, 100), +((@CGUID+2)*10, 22, -151.00998, -151.45198, -53.54561, NULL, 0, 100), +((@CGUID+2)*10, 23, -150.50998, -150.95198, -53.29561, NULL, 0, 100), +((@CGUID+2)*10, 24, -147.00998, -148.70198, -53.29561, NULL, 0, 100), +((@CGUID+2)*10, 25, -144.75998, -146.95198, -54.29561, NULL, 0, 100), +((@CGUID+2)*10, 26, -142.80211, -145.54257, -54.141586, NULL, 0, 100), +((@CGUID+2)*10, 27, -139.97365, -143.48856, -53.472828, NULL, 0, 100), +((@CGUID+2)*10, 28, -135.72365, -139.98856, -52.722828, NULL, 0, 100), +((@CGUID+2)*10, 29, -130.47365, -135.98856, -51.972828, NULL, 0, 100), +((@CGUID+2)*10, 30, -127.97365, -133.98856, -51.222828, NULL, 0, 100), +((@CGUID+2)*10, 31, -127.72365, -133.73856, -51.222828, NULL, 0, 100), +((@CGUID+2)*10, 32, -126.14518, -132.43456, -51.30407, NULL, 0, 100), +((@CGUID+2)*10, 33, -127.67482, -133.57285, -51.29497, NULL, 0, 100), +((@CGUID+2)*10, 34, -128.17482, -134.07285, -51.29497, NULL, 0, 100), +((@CGUID+2)*10, 35, -130.42482, -135.82285, -52.04497, NULL, 0, 100), +((@CGUID+2)*10, 36, -135.67482, -140.07285, -52.54497, NULL, 0, 100), +((@CGUID+2)*10, 37, -136.67482, -140.82285, -52.79497, NULL, 0, 100), +((@CGUID+2)*10, 38, -137.19707, -141.29898, -53.31602, NULL, 0, 100), +((@CGUID+2)*10, 39, -140.2511, -143.76718, -53.538586, NULL, 0, 100), +((@CGUID+2)*10, 40, -144.7511, -146.76718, -54.288586, NULL, 0, 100), +((@CGUID+2)*10, 41, -147.2511, -148.51718, -53.288586, NULL, 0, 100), +((@CGUID+2)*10, 42, -147.5011, -148.76718, -53.288586, NULL, 0, 100), +((@CGUID+2)*10, 43, -150.2511, -150.76718, -53.288586, NULL, 0, 100), +((@CGUID+2)*10, 44, -151.0011, -151.26718, -53.538586, NULL, 0, 100), +((@CGUID+2)*10, 45, -152.2511, -152.01718, -54.038586, NULL, 0, 100), +((@CGUID+2)*10, 46, -157.02011, -155.56682, -56.331123, NULL, 0, 100), +((@CGUID+2)*10, 47, -157.93028, -156.1378, -56.479797, NULL, 0, 100), +((@CGUID+2)*10, 48, -160.68028, -158.1378, -57.479797, NULL, 0, 100), +((@CGUID+2)*10, 49, -162.93028, -162.1378, -58.729797, NULL, 0, 100), +((@CGUID+2)*10, 50, -163.68028, -163.8878, -59.229797, NULL, 0, 100), +((@CGUID+2)*10, 51, -163.93028, -164.6378, -59.479797, NULL, 0, 100), +((@CGUID+2)*10, 52, -165.93028, -168.6378, -61.229797, NULL, 0, 100), +((@CGUID+2)*10, 53, -166.18028, -168.8878, -61.479797, NULL, 0, 100), +((@CGUID+2)*10, 54, -167.99568, -172.1661, -62.839737, NULL, 0, 100), +((@CGUID+2)*10, 55, -168.818, -173.6055, -63.09514, NULL, 0, 100), +((@CGUID+2)*10, 56, -170.318, -176.6055, -63.84514, NULL, 0, 100), +((@CGUID+2)*10, 57, -170.818, -178.1055, -64.34514, NULL, 0, 100), +((@CGUID+2)*10, 58, -171.068, -179.1055, -64.59514, NULL, 0, 100), +((@CGUID+2)*10, 59, -171.068, -179.1055, -64.84514, NULL, 0, 100), +((@CGUID+2)*10, 60, -172.568, -184.3555, -65.59514, NULL, 0, 100), +((@CGUID+2)*10, 61, -174.11246, -188.33551, -66.332634, NULL, 0, 100), +((@CGUID+2)*10, 62, -175.37415, -193.10675, -66.32712, NULL, 0, 100), +((@CGUID+2)*10, 63, -174.87415, -193.60675, -66.57712, NULL, 0, 100), +((@CGUID+2)*10, 64, -171.87415, -197.10675, -66.32712, NULL, 0, 100), +((@CGUID+2)*10, 65, -168.62415, -201.10675, -66.32712, NULL, 0, 100), +((@CGUID+2)*10, 66, -167.26472, -203.27719, -66.355125, NULL, 0, 100), +((@CGUID+2)*10, 67, -165.21088, -205.64462, -66.07692, NULL, 0, 100), +((@CGUID+2)*10, 68, -164.96088, -205.89462, -66.07692, NULL, 0, 100), +((@CGUID+2)*10, 69, -160.46088, -207.89462, -66.07692, NULL, 0, 100), +((@CGUID+2)*10, 70, -154.21088, -211.14462, -66.32692, NULL, 0, 100), +((@CGUID+2)*10, 71, -151.65704, -212.51204, -67.29871, NULL, 0, 100), +((@CGUID+2)*10, 72, -154.14645, -210.94502, -66.31016, NULL, 0, 100), +((@CGUID+2)*10, 73, -160.39645, -207.94502, -66.06016, NULL, 0, 100), +((@CGUID+2)*10, 74, -161.2214, -207.80463, -66.3057, NULL, 0, 100), +((@CGUID+2)*10, 75, -165.18085, -205.67477, -66.078125, NULL, 0, 100); diff --git a/data/sql/updates/db_world/2024_07_07_05.sql b/data/sql/updates/db_world/2024_07_07_05.sql new file mode 100644 index 000000000..b3bfcc015 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_07_05.sql @@ -0,0 +1,39 @@ +-- DB update 2024_07_07_04 -> 2024_07_07_05 +SET +@CGUID = 12554; + +DELETE FROM `creature` WHERE `id1` = 17660 AND `guid` IN (135966, 135967); +DELETE FROM `creature` WHERE `id1` = 17660 AND `guid` IN (@CGUID+0, @CGUID+1); +INSERT INTO `creature` (`guid`, `id1`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES +(@CGUID+0, 17660, 532, 3457, 3457, 1, 1, 0, -11117.73828125, -1930.064697265625, 266.5784912109375, 0.667460560798645019, 604800, 0, 0, 4890, 0, 2, 0, 0, 0, '', 51943, 1, ''), +(@CGUID+1, 17660, 532, 3457, 3457, 1, 1, 0, -11014.953125, -2033.3409423828125, 228.4856719970703125, 1.298128366470336914, 604800, 0, 0, 4890, 0, 2, 0, 0, 0, '', 51943, 1, ''); + +DELETE FROM `creature_template_movement` WHERE `CreatureId` = 17660; +INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES +(17660, 0, 0, 1, 0, 0, 0, NULL); + +DELETE FROM `creature_addon` WHERE `guid` IN (@CGUID+0, @CGUID+1); +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(@CGUID+0, (@CGUID+0)*10, 0, 0, 0, 0, 0, ''), +(@CGUID+1, (@CGUID+1)*10, 0, 0, 0, 0, 0, ''); + +DELETE FROM `waypoint_data` WHERE `id` IN (((@CGUID+0)*10), ((@CGUID+1)*10)); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `action_chance`) VALUES +((@CGUID+0)*10, 1, -11098.419, -1937.0795, 278.84317, NULL, 0, 100), +((@CGUID+0)*10, 2, -11114.553, -1982.4431, 285.61502, NULL, 0, 100), +((@CGUID+0)*10, 3, -11140.832, -1980.028, 284.5932, NULL, 0, 100), +((@CGUID+0)*10, 4, -11132.868, -1950.2848, 267.4821, NULL, 0, 100), +((@CGUID+0)*10, 5, -11114.48, -1928.0963, 267.4821, NULL, 0, 100), +((@CGUID+0)*10, 6, -11098.419, -1937.0795, 278.84317, NULL, 0, 100), +((@CGUID+0)*10, 7, -11114.553, -1982.4431, 285.61502, NULL, 0, 100), +((@CGUID+0)*10, 8, -11140.832, -1980.028, 284.5932, NULL, 0, 100), + +((@CGUID+1)*10, 1, -11012.726, -2061.759, 228.55539, NULL, 0, 100), +((@CGUID+1)*10, 2, -11014.861, -2033.0435, 228.55539, NULL, 0, 100), +((@CGUID+1)*10, 3, -11001.45, -2028.6311, 236.86093, NULL, 0, 100), +((@CGUID+1)*10, 4, -10998.617, -2077.8254, 237.05539, NULL, 0, 100), +((@CGUID+1)*10, 5, -11012.573, -2091.948, 243.74983, NULL, 0, 100), +((@CGUID+1)*10, 6, -11020.521, -2075.4788, 228.55539, NULL, 0, 100), +((@CGUID+1)*10, 7, -11012.726, -2061.759, 228.55539, NULL, 0, 100), +((@CGUID+1)*10, 8, -11014.861, -2033.0435, 228.55539, NULL, 0, 100), +((@CGUID+1)*10, 9, -11001.45, -2028.6311, 236.86093, NULL, 0, 100); diff --git a/data/sql/updates/db_world/2024_07_08_00.sql b/data/sql/updates/db_world/2024_07_08_00.sql new file mode 100644 index 000000000..cc1ce22bf --- /dev/null +++ b/data/sql/updates/db_world/2024_07_08_00.sql @@ -0,0 +1,15 @@ +-- DB update 2024_07_07_05 -> 2024_07_08_00 +-- +SET @OGUID := 11154; + +DELETE FROM `gameobject` WHERE `map` = 550 AND `id` IN (184069,184325,184597,184324,184596,184327,184326,184329,184328); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +(@OGUID+0, 184069, 550, 3845, 3845, 1, 1, 743.056640625, 4.634430885314941406, 137.7958526611328125, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 0, 50791), +(@OGUID+1, 184325, 550, 3845, 3845, 1, 1, 676.5166015625, -44.5224761962890625, 48.28133010864257812, 2.530723094940185546, 0, 0, 0.953716278076171875, 0.300707906484603881, 7200, 255, 0, 50791), +(@OGUID+2, 184597, 550, 3845, 3845, 1, 1, 744.0447998046875, 42.35361862182617187, 46.66099929809570312, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 0, 50791), +(@OGUID+3, 184324, 550, 3845, 3845, 1, 1, 676.698486328125, 43.16431427001953125, 48.28136062622070312, 0.610865473747253417, 0, 0, 0.300705909729003906, 0.953716933727264404, 7200, 255, 0, 50791), +(@OGUID+4, 184596, 550, 3845, 3845, 1, 1, 744.04461669921875, -44.6344795227050781, 46.66096878051757812, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 0, 50791), +(@OGUID+5, 184327, 550, 3845, 3845, 1, 1, 544.5379638671875, -143.139236450195312, 26.34531021118164062, 3.403396368026733398, 0, 0, -0.99144458770751953, 0.130528271198272705, 7200, 255, 0, 50791), +(@OGUID+6, 184326, 550, 3845, 3845, 1, 1, 654.1446533203125, -76.8280258178710937, 48.19501495361328125, 2.530723094940185546, 0, 0, 0.953716278076171875, 0.300707906484603881, 7200, 255, 0, 50791), +(@OGUID+7, 184329, 550, 3845, 3845, 1, 1, 544.62628173828125, 141.8879852294921875, 26.34531021118164062, 2.879789113998413085, 0, 0, 0.991444587707519531, 0.130528271198272705, 7200, 255, 0, 50791), +(@OGUID+8, 184328, 550, 3845, 3845, 1, 1, 654.129150390625, 75.33162689208984375, 48.19504547119140625, 0.610865473747253417, 0, 0, 0.300705909729003906, 0.953716933727264404, 7200, 255, 0, 50791); diff --git a/data/sql/updates/db_world/2024_07_09_00.sql b/data/sql/updates/db_world/2024_07_09_00.sql new file mode 100644 index 000000000..1c4899821 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_00.sql @@ -0,0 +1,11 @@ +-- DB update 2024_07_08_00 -> 2024_07_09_00 +-- Quest: Threat from Above, creatures already have KillCredit for 23450 +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 22143) AND (`source_type` = 0) AND (`id` IN (4)); +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 22144) AND (`source_type` = 0) AND (`id` IN (4)); +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 22148) AND (`source_type` = 0) AND (`id` IN (2)); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 23022); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(23022, 0, 0, 0, 0, 0, 100, 0, 0, 0, 2400, 3800, 0, 0, 11, 15232, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Gordunni Soulreaper - In Combat - Cast \'Shadow Bolt\''), +(23022, 0, 1, 0, 0, 0, 100, 0, 4000, 6000, 18000, 25000, 0, 0, 11, 20464, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gordunni Soulreaper - In Combat - Cast \'Summon Skeleton\''), +(23022, 0, 2, 0, 2, 0, 100, 0, 0, 30, 30000, 35000, 0, 0, 11, 20743, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Gordunni Soulreaper - Between 0-30% Health - Cast \'Drain Life\''); diff --git a/data/sql/updates/db_world/2024_07_09_01.sql b/data/sql/updates/db_world/2024_07_09_01.sql new file mode 100644 index 000000000..d888864aa --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_01.sql @@ -0,0 +1,17 @@ +-- DB update 2024_07_09_00 -> 2024_07_09_01 +-- +DELETE FROM `gossip_menu_option` WHERE (`MenuID` = 4004) AND (`OptionID` IN (1)); +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES +(4004, 1, 0, 'Merideth, could I have some more manna-enriched horse feed please?', 9792, 1, 1, 0, 0, 0, 0, '', 0, 0); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 2357; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 2357); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2357, 0, 0, 1, 62, 0, 100, 0, 4004, 1, 0, 0, 0, 0, 11, 23304, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Merideth Carlson - On Gossip Option 1 Selected - Cast \'Manna-Enriched Horse Feed\''), +(2357, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Merideth Carlson - On Gossip Option 1 Selected - Close Gossip'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 15) AND (`SourceGroup` = 4004) AND (`SourceEntry` = 1); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 4004, 1, 0, 0, 47, 0, 7645, 64, 0, 0, 0, 0, '', 'Player can request another Manna-Enriched Horse Feed if player completed quest'), +(15, 4004, 1, 0, 0, 2, 0, 18775, 1, 0, 1, 0, 0, '', 'Player can request another Manna-Enriched Horse Feed if does not already have it'), +(15, 4004, 1, 0, 0, 2, 0, 18775, 1, 1, 1, 0, 0, '', 'Player can request another Manna-Enriched Horse Feed if does not already have it'); diff --git a/data/sql/updates/db_world/2024_07_09_02.sql b/data/sql/updates/db_world/2024_07_09_02.sql new file mode 100644 index 000000000..0a820f678 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_02.sql @@ -0,0 +1,33 @@ +-- DB update 2024_07_09_01 -> 2024_07_09_02 +-- +SET @OGUID := 131; + +DELETE FROM `gameobject` WHERE `id` = 154357; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0, 154357, 0, -9360.16992187500000000000, -2243.55004882812500000000, 45.49539947509765600000, 5.63741016387939450000, 0.00000000000000000000, 0.00000000000000000000, -0.31730499863624570000, 0.94832402467727660000, 2, 255, 1), +(@OGUID+1, 154357, 0, -9324.09960937500000000000, -1986.68994140625000000000, 43.58140182495117000000, 5.95157003402710000000, 0.00000000000000000000, 0.00000000000000000000, -0.16504700481891632000, 0.98628598451614380000, 2, 255, 1), +(@OGUID+2, 154357, 0, -9360.54003906250000000000, -2372.20996093750000000000, 40.86640167236328000000, 2.47836995124816900000, 0.00000000000000000000, 0.00000000000000000000, 0.94551801681518550000, 0.32556799054145813000, 2, 255, 1), +(@OGUID+3, 154357, 0, -9316.16015625000000000000, -2146.71997070312500000000, 45.98830032348633000000, 4.01425981521606450000, 0.00000000000000000000, 0.00000000000000000000, -0.90630698204040530000, 0.42261898517608640000, 2, 255, 1), +(@OGUID+4, 154357, 0, -9375.87011718750000000000, -2303.81005859375000000000, 45.55229949951172000000, 3.92700004577636700000, 0.00000000000000000000, 0.00000000000000000000, -0.92387902736663820000, 0.38268598914146423000, 2, 255, 1), +(@OGUID+5, 154357, 0, -9363.99023437500000000000, -2396.56005859375000000000, 36.88159942626953000000, 4.27606010437011700000, 0.00000000000000000000, 0.00000000000000000000, -0.84339100122451780000, 0.53729999065399170000, 2, 255, 1), +(@OGUID+6, 154357, 0, -9344.79980468750000000000, -2042.31005859375000000000, 40.94120025634765600000, 5.49778985977172850000, 0.00000000000000000000, 0.00000000000000000000, -0.38268300890922546000, 0.92387998104095460000, 2, 255, 1), +(@OGUID+7, 154357, 0, -9357.16992187500000000000, -2129.56005859375000000000, 42.33779907226562500000, 5.09636020660400400000, 0.00000000000000000000, 0.00000000000000000000, -0.55919301509857180000, 0.82903802394866940000, 2, 255, 1), +(@OGUID+8, 154357, 0, -9367.62988281250000000000, -2094.20996093750000000000, 45.34899902343750000000, 5.68977022171020500000, 0.00000000000000000000, 0.00000000000000000000, -0.29237198829650880000, 0.95630502700805660000, 2, 255, 1), +(@OGUID+9, 154357, 0, -9386.95996093750000000000, -2175.23999023437500000000, 41.99969863891601600000, 3.52556991577148440000, 0.00000000000000000000, 0.00000000000000000000, -0.98162698745727540000, 0.19081200659275055000, 2, 255, 1); + +DELETE FROM `pool_template` WHERE `entry` = 138 AND `description` LIKE '%Glinting Mud%'; +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(138, 2, 'Glinting Mud - 2/10'); + +DELETE FROM `pool_gameobject` WHERE `pool_entry` = 138 AND `description` = 'Glinting Mud'; +INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `chance`, `description`) VALUES +(@OGUID+0, 138, 0, 'Glinting Mud'), +(@OGUID+1, 138, 0, 'Glinting Mud'), +(@OGUID+2, 138, 0, 'Glinting Mud'), +(@OGUID+3, 138, 0, 'Glinting Mud'), +(@OGUID+4, 138, 0, 'Glinting Mud'), +(@OGUID+5, 138, 0, 'Glinting Mud'), +(@OGUID+6, 138, 0, 'Glinting Mud'), +(@OGUID+7, 138, 0, 'Glinting Mud'), +(@OGUID+8, 138, 0, 'Glinting Mud'), +(@OGUID+9, 138, 0, 'Glinting Mud'); diff --git a/data/sql/updates/db_world/2024_07_09_03.sql b/data/sql/updates/db_world/2024_07_09_03.sql new file mode 100644 index 000000000..ea723b7aa --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_03.sql @@ -0,0 +1,9 @@ +-- DB update 2024_07_09_02 -> 2024_07_09_03 +-- +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 20041) AND (`source_type` = 0) AND (`id` IN (4)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(20041, 0, 4, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 34937, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Crystalcore Sentinel - On Aggro - Remove Aura \'Powered Down\''); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2004100) AND (`source_type` = 9) AND (`id` IN (3)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2004100, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 34937, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Crystalcore Sentinel - Script9 - Remove All Auras'); diff --git a/data/sql/updates/db_world/2024_07_09_04.sql b/data/sql/updates/db_world/2024_07_09_04.sql new file mode 100644 index 000000000..a042592cd --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_04.sql @@ -0,0 +1,7 @@ +-- DB update 2024_07_09_03 -> 2024_07_09_04 +-- +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 1181); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(1181, 0, 0, 0, 4, 0, 10, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Mo\'grosh Shaman - On Aggro - Say Line 0'), +(1181, 0, 1, 0, 0, 0, 100, 0, 0, 0, 3400, 5400, 0, 0, 11, 9532, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Mo\'grosh Shaman - In Combat - Cast \'Lightning Bolt\''), +(1181, 0, 2, 0, 16, 0, 60, 0, 3229, 30, 8000, 13000, 1, 0, 11, 3229, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Mo\'grosh Shaman - On Friendly Unit Missing Buff \'Quick Bloodlust\' - Cast \'Quick Bloodlust\''); diff --git a/data/sql/updates/db_world/2024_07_09_05.sql b/data/sql/updates/db_world/2024_07_09_05.sql new file mode 100644 index 000000000..db8f148c5 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_05.sql @@ -0,0 +1,12 @@ +-- DB update 2024_07_09_04 -> 2024_07_09_05 +-- +UPDATE `spell_script_names` SET `ScriptName`='spell_q11919_q11940_drake_hunt_aura' WHERE `spell_id`=46620 AND `ScriptName`='spell_q11919_q11940_drake_hunt'; +UPDATE `spell_script_names` SET `ScriptName`='spell_ioc_repair_turret_aura' WHERE `spell_id`=68077 AND `ScriptName`='spell_ioc_repair_turret'; +UPDATE `spell_script_names` SET `ScriptName`='spell_ioc_parachute_ic_aura' WHERE `spell_id`=66656 AND `ScriptName`='spell_ioc_parachute_ic'; +UPDATE `spell_script_names` SET `ScriptName`='spell_q12243_fire_upon_the_waters_aura' WHERE `spell_id`=48522 AND `ScriptName`='spell_q12243_fire_upon_the_waters'; +UPDATE `spell_script_names` SET `ScriptName`='spell_q13003_thursting_hodirs_spear_aura' WHERE `spell_id`=56689 AND `ScriptName`='spell_q13003_thursting_hodirs_spear'; +UPDATE `spell_script_names` SET `ScriptName`='spell_close_rift_aura' WHERE `spell_id`=56763 AND `ScriptName`='spell_close_rift'; +UPDATE `spell_script_names` SET `ScriptName`='spell_wintergrasp_hide_small_elementals_aura' WHERE `spell_id`=52107 AND `ScriptName`='spell_wintergrasp_hide_small_elementals'; +UPDATE `spell_script_names` SET `ScriptName`='spell_infected_worgen_bite_aura' WHERE `spell_id`=53094 AND `ScriptName`='spell_infected_worgen_bite'; +UPDATE `spell_script_names` SET `ScriptName`='spell_z_check_aura' WHERE `spell_id`=61678 AND `ScriptName`='spell_z_check'; +UPDATE `spell_script_names` SET `ScriptName`='spell_warhead_fuse_aura' WHERE `spell_id`=49181 AND `ScriptName`='spell_warhead_fuse'; diff --git a/data/sql/updates/db_world/2024_07_09_06.sql b/data/sql/updates/db_world/2024_07_09_06.sql new file mode 100644 index 000000000..d92ed5961 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_06.sql @@ -0,0 +1,30 @@ +-- DB update 2024_07_09_05 -> 2024_07_09_06 +-- +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 21251); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(21251, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 88, 2125100, 2125102, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Reset - Run Random Script'), +(21251, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 31, 1, 12, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Reset - Set Phase Random Between 1-12'), +(21251, 0, 2, 0, 0, 15, 100, 0, 14600, 19700, 21400, 33100, 0, 0, 11, 38976, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - In Combat - Cast \'Spore Quake\' (Phases 1 & 2 & 3 & 4)'), +(21251, 0, 3, 0, 0, 15, 100, 0, 5700, 11400, 14400, 24900, 0, 0, 11, 39032, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - In Combat - Cast \'Initial Infection\' (Phases 1 & 2 & 3 & 4)'), +(21251, 0, 4, 0, 0, 240, 100, 0, 16800, 22400, 27700, 31200, 0, 0, 11, 38971, 0, 0, 0, 0, 0, 6, 0, 1, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - In Combat - Cast \'Acid Geyser\' (Phases 5 & 6 & 7 & 8)'), +(21251, 0, 5, 0, 0, 240, 100, 0, 9400, 14500, 21200, 32400, 0, 0, 11, 39044, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - In Combat - Cast \'Serpentshrine Parasite\' (Phases 5 & 6 & 7 & 8)'), +(21251, 0, 6, 0, 9, 3840, 100, 0, 2400, 6800, 2400, 6800, 0, 5, 11, 39015, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Within 0-5 Range - Cast \'Atrophic Blow\' (Phases 9 & 10 & 11 & 12)'), +(21251, 0, 7, 0, 0, 3840, 100, 0, 6700, 10900, 16100, 21800, 0, 0, 11, 39031, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - In Combat - Cast \'Enrage\' (Phases 9 & 10 & 11 & 12)'), +(21251, 0, 8, 0, 6, 273, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38718, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Just Died - Cast \'Toxic Pool\' (Phases 1 & 5 & 9)'), +(21251, 0, 9, 0, 6, 546, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38922, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Just Died - Cast \'Serverside - Summon Colossus Lurkers\' (Phases 2 & 6 & 10)'), +(21251, 0, 10, 0, 6, 1092, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38928, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Just Died - Cast \'Serverside - Summon Colossus Ragers\' (Phases 3 & 7 & 11)'), +(21251, 0, 11, 12, 6, 2184, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38726, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Just Died - Cast \'Serverside - Summon Serpentshrine Mushroom\' (Phases 4 & 8 & 12)'), +(21251, 0, 12, 13, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38726, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Just Died - Cast \'Serverside - Summon Serpentshrine Mushroom\' (Phases 4 & 8 & 12)'), +(21251, 0, 13, 14, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38726, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Just Died - Cast \'Serverside - Summon Serpentshrine Mushroom\' (Phases 4 & 8 & 12)'), +(21251, 0, 14, 15, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38726, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Just Died - Cast \'Serverside - Summon Serpentshrine Mushroom\' (Phases 4 & 8 & 12)'), +(21251, 0, 15, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38726, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Just Died - Cast \'Serverside - Summon Serpentshrine Mushroom\' (Phases 4 & 8 & 12)'); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 22335); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22335, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38730, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Mushrom Spell Effect - On Respawn - Cast \'Refreshing Mist\''); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` BETWEEN 2125100 AND 2125102); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2125100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38714, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Actionlist - Cast \'Frost Vulnerability\''), +(2125101, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38715, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Actionlist - Cast \'Fire Vulnerability\''), +(2125102, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 38717, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Actionlist - Cast \'Nature Vulnerability\''); diff --git a/data/sql/updates/db_world/2024_07_09_07.sql b/data/sql/updates/db_world/2024_07_09_07.sql new file mode 100644 index 000000000..2c305ef91 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_07.sql @@ -0,0 +1,42 @@ +-- DB update 2024_07_09_06 -> 2024_07_09_07 +-- +DELETE FROM `creature_formations` WHERE `memberGUID` IN (158167,158168,158169,158170,158171,158172,158173,158174,158175,158176,158177,158178,158155,158156,158157,158158,158159,158160,158161,158162,158163,158164,158165,158166,158143,158144,158145,158146,158147,158148,158149,158150,158151,158152,158153,158154); +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `groupAI`) VALUES +(158167, 158167, 3), +(158167, 158168, 3), +(158167, 158169, 3), +(158167, 158170, 3), +(158167, 158171, 3), +(158167, 158172, 3), +(158167, 158173, 3), +(158167, 158174, 3), +(158167, 158175, 3), +(158167, 158176, 3), +(158167, 158177, 3), +(158167, 158178, 3), + +(158155, 158155, 3), +(158155, 158156, 3), +(158155, 158157, 3), +(158155, 158158, 3), +(158155, 158159, 3), +(158155, 158160, 3), +(158155, 158161, 3), +(158155, 158162, 3), +(158155, 158163, 3), +(158155, 158164, 3), +(158155, 158165, 3), +(158155, 158166, 3), + +(158143, 158143, 3), +(158143, 158144, 3), +(158143, 158145, 3), +(158143, 158146, 3), +(158143, 158147, 3), +(158143, 158148, 3), +(158143, 158149, 3), +(158143, 158150, 3), +(158143, 158151, 3), +(158143, 158152, 3), +(158143, 158153, 3), +(158143, 158154, 3); diff --git a/data/sql/updates/db_world/2024_07_09_08.sql b/data/sql/updates/db_world/2024_07_09_08.sql new file mode 100644 index 000000000..b3f32c47e --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_08.sql @@ -0,0 +1,5 @@ +-- DB update 2024_07_09_07 -> 2024_07_09_08 +-- +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 21268) AND (`source_type` = 0) AND (`id` IN (3)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(21268, 0, 3, 0, 106, 0, 100, 0, 6000, 9000, 12000, 18000, 0, 10, 11, 36994, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Netherstrand Longbow - On Hostile in Range - Cast \'Blink\''); diff --git a/data/sql/updates/db_world/2024_07_09_09.sql b/data/sql/updates/db_world/2024_07_09_09.sql new file mode 100644 index 000000000..813af9b36 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_09.sql @@ -0,0 +1,3 @@ +-- DB update 2024_07_09_08 -> 2024_07_09_09 +-- +UPDATE `creature_template` SET `flags_extra` = 2097152 WHERE (`entry` = 21419); diff --git a/data/sql/updates/db_world/2024_07_09_10.sql b/data/sql/updates/db_world/2024_07_09_10.sql new file mode 100644 index 000000000..07942657a --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_10.sql @@ -0,0 +1,3 @@ +-- DB update 2024_07_09_09 -> 2024_07_09_10 +-- +UPDATE `creature` SET `spawntimesecs` = 60 WHERE `id1` = 22006 AND `guid` = 77084; diff --git a/data/sql/updates/db_world/2024_07_09_11.sql b/data/sql/updates/db_world/2024_07_09_11.sql new file mode 100644 index 000000000..20bf3383d --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_11.sql @@ -0,0 +1,3 @@ +-- DB update 2024_07_09_10 -> 2024_07_09_11 +-- +UPDATE `quest_template_addon` SET `RequiredMinRepValue` = 3000 WHERE (`ID` = 11091); diff --git a/data/sql/updates/db_world/2024_07_09_12.sql b/data/sql/updates/db_world/2024_07_09_12.sql new file mode 100644 index 000000000..5743a2f18 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_12.sql @@ -0,0 +1,34 @@ +-- DB update 2024_07_09_11 -> 2024_07_09_12 +-- +DELETE FROM `creature_loot_template` WHERE (`Entry` IN (20031,20032,20033,20034,20035,20036,20037,20039,20040,20041,20042,20043,20044,20045,20046,20047,20048,20049,20050,20052)) AND (`Item` IN (30020,30024,30026,30028,30029,30030)); +DELETE FROM `creature_loot_template` WHERE (`Entry` IN (20031,20032,20033,20034,20035,20036,20037,20039,20040,20041,20042,20043,20044,20045,20046,20047,20048,20049,20050,20052)) AND (`Reference` IN (55500)); +INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(20031, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20032, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20033, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20034, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20035, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20036, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20037, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20039, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20040, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20041, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20042, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20043, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20044, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20045, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20046, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +-- (20047, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), -- It shares lootid with another creature :< +(20048, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20049, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20050, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'), +(20052, 55500, 55500, 10, 0, 1, 0, 1, 1, 'Zone Loot - The Eye - Epic Gear'); + +DELETE FROM `reference_loot_template` WHERE (`Entry` = 55500); +INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(55500, 30020, 0, 0, 0, 1, 1, 1, 1, 'Fire-Cord of the Magus'), +(55500, 30024, 0, 0, 0, 1, 1, 1, 1, 'Mantle of the Elven Kings'), +(55500, 30026, 0, 0, 0, 1, 1, 1, 1, 'Bands of the Celestial Archer'), +(55500, 30028, 0, 0, 0, 1, 1, 1, 1, 'Seventh Ring of the Tirisfalen'), +(55500, 30029, 0, 0, 0, 1, 1, 1, 1, 'Bark-Gloves of Ancient Wisdom'), +(55500, 30030, 0, 0, 0, 1, 1, 1, 1, 'Girdle of Fallen Stars'); diff --git a/data/sql/updates/db_world/2024_07_09_13.sql b/data/sql/updates/db_world/2024_07_09_13.sql new file mode 100644 index 000000000..26e2087eb --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_13.sql @@ -0,0 +1,3 @@ +-- DB update 2024_07_09_12 -> 2024_07_09_13 +-- +UPDATE `quest_template_addon` SET `SpecialFlags` = `SpecialFlags`|1 WHERE (`ID` IN (11103, 11104, 11105, 11106)); diff --git a/data/sql/updates/db_world/2024_07_09_14.sql b/data/sql/updates/db_world/2024_07_09_14.sql new file mode 100644 index 000000000..528486b68 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_14.sql @@ -0,0 +1,12 @@ +-- DB update 2024_07_09_13 -> 2024_07_09_14 +-- +UPDATE `creature_template_addon` SET `auras` = '18943' WHERE (`entry` = 20040); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 20040); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(20040, 0, 0, 0, 0, 0, 100, 0, 20950, 25000, 17000, 29900, 0, 0, 11, 37102, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Crystalcore Devastator - In Combat - Cast \'Knock Away\''), +(20040, 0, 1, 0, 0, 0, 100, 0, 20000, 30000, 30000, 40000, 0, 0, 11, 35035, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Crystalcore Devastator - In Combat - Cast \'Countercharge\''), +(20040, 0, 2, 5, 105, 0, 33, 0, 3600, 3600, 3600, 3600, 0, 50, 11, 35039, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Crystalcore Devastator - On Hostile Casting in Range - Cast \'Countercharge\' if Crystalcore Devastator has Countercharge aura'), +(20040, 0, 3, 4, 8, 0, 100, 512, 34946, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Crystalcore Devastator - On Spellhit \'Golem Repair\' - Store Targetlist'), +(20040, 0, 4, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 80, 2004000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Crystalcore Devastator - On Spellhit \'Golem Repair\' - Run Script'), +(20040, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 35039, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Crystalcore Devastator - On Hostile Casting in Range - Remove Aura \'Countercharge\''); diff --git a/data/sql/updates/db_world/2024_07_09_15.sql b/data/sql/updates/db_world/2024_07_09_15.sql new file mode 100644 index 000000000..d022d31eb --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_15.sql @@ -0,0 +1,8 @@ +-- DB update 2024_07_09_14 -> 2024_07_09_15 +-- Introspection +DELETE FROM `spell_custom_attr` WHERE `spell_id` IN (40055,40165,40166,40167); +INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES +(40055, 4096), +(40165, 4096), +(40166, 4096), +(40167, 4096); diff --git a/data/sql/updates/db_world/2024_07_09_16.sql b/data/sql/updates/db_world/2024_07_09_16.sql new file mode 100644 index 000000000..b1bbc6784 --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_16.sql @@ -0,0 +1,3 @@ +-- DB update 2024_07_09_15 -> 2024_07_09_16 +-- Sturdy Plate +UPDATE `creature_template` SET `unit_flags` = `unit_flags`|33554432 WHERE (`entry` = 32839); diff --git a/data/sql/updates/db_world/2024_07_09_17.sql b/data/sql/updates/db_world/2024_07_09_17.sql new file mode 100644 index 000000000..b6755b59d --- /dev/null +++ b/data/sql/updates/db_world/2024_07_09_17.sql @@ -0,0 +1,11 @@ +-- DB update 2024_07_09_16 -> 2024_07_09_17 +-- +DELETE FROM `creature_template_spell` WHERE (`CreatureID` = 20042); +INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES +(20042, 1, 37112, 55261), +(20042, 2, 37118, 55261), +(20042, 3, 37120, 55261); + +DELETE FROM `spell_cooldown_overrides` WHERE `Id` = 37118; +INSERT INTO `spell_cooldown_overrides` (`Id`, `RecoveryTime`, `CategoryRecoveryTime`, `StartRecoveryTime`, `StartRecoveryCategory`, `Comment`) VALUES +(37118, 8000, 8000, 0, 0, 'Tempest-Smith - Shell Shock'); diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 2a8a16ee4..e7cb0dec9 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -4386,6 +4386,13 @@ TeleportTimeoutFar = 45 DailyRBGArenaPoints.MinLevel = 71 +# +# MunchingBlizzlike.Enabled +# Description: Enable the Blizzlike implementation of munching with e.g. Warrior's Rend or Mage's Ignite +# Default: 1 - (Blizzlike) + +MunchingBlizzlike.Enabled = 1 + # ################################################################################################### diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 7930317bf..37ac2ff76 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1810,20 +1810,23 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; } case SMART_TARGET_RANDOM_POINT: - if (me) { - float range = (float)e.target.randomPoint.range; - Position srcPos = { e.target.x, e.target.y, e.target.z, e.target.o }; - Position randomPoint = me->GetRandomPoint(srcPos, range); - me->GetMotionMaster()->MovePoint( - e.action.moveToPos.pointId, - randomPoint.m_positionX, - randomPoint.m_positionY, - randomPoint.m_positionZ, - true, - true, - isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE - ); + if (me) + { + float range = (float)e.target.randomPoint.range; + Position srcPos = { e.target.x, e.target.y, e.target.z, e.target.o }; + Position randomPoint = me->GetRandomPoint(srcPos, range); + me->GetMotionMaster()->MovePoint( + e.action.moveToPos.pointId, + randomPoint.m_positionX, + randomPoint.m_positionY, + randomPoint.m_positionZ, + true, + true, + isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE + ); + + } break; } diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 6f2c14b46..5982599fd 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -204,8 +204,8 @@ void CalendarMgr::RemoveEvent(CalendarEvent* calendarEvent, ObjectGuid remover) trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); - delete calendarEvent; _events.erase(calendarEvent); + delete calendarEvent; return; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 44776dc46..cbba5a954 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1921,7 +1921,7 @@ void GameObject::Use(Unit* user) if (info->entry == 194097) spellId = 61994; // Ritual of Summoning else - spellId = 59782; // Summoning Stone Effect + spellId = 23598; // Meeting Stone Summon break; } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 0f77f0c97..7a1dbbfe2 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -2503,7 +2503,7 @@ float Pet::GetNativeObjectScale() const if (creatureFamily && creatureFamily->minScale > 0.0f && getPetType() & HUNTER_PET) { float minScaleLevel = creatureFamily->minScaleLevel; - uint8 level = getLevel(); + uint8 level = GetLevel(); float minLevelScaleMod = level >= minScaleLevel ? (level / minScaleLevel) : 0.0f; float maxScaleMod = creatureFamily->maxScaleLevel - minScaleLevel; @@ -2513,15 +2513,32 @@ float Pet::GetNativeObjectScale() const float scaleMod = creatureFamily->maxScaleLevel != minScaleLevel ? minLevelScaleMod / maxScaleMod : 0.f; - float scale = (creatureFamily->maxScale - creatureFamily->minScale) * scaleMod + creatureFamily->minScale; + float maxScale = creatureFamily->maxScale; - scale = std::min(scale, creatureFamily->maxScale); - - if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId())) + // override maxScale + switch (ctFamily) { - if (scale < 1.f && displayInfo->scale > 1.f) - scale *= displayInfo->scale; + case CREATURE_FAMILY_CHIMAERA: + case CREATURE_FAMILY_CORE_HOUND: + case CREATURE_FAMILY_CRAB: + case CREATURE_FAMILY_DEVILSAUR: + case CREATURE_FAMILY_NETHER_RAY: + case CREATURE_FAMILY_RHINO: + case CREATURE_FAMILY_SPIDER: + case CREATURE_FAMILY_TURTLE: + case CREATURE_FAMILY_WARP_STALKER: + case CREATURE_FAMILY_WASP: + case CREATURE_FAMILY_WIND_SERPENT: + maxScale = 1.0f; + break; + default: + break; } + + float scale = (maxScale - creatureFamily->minScale) * scaleMod + creatureFamily->minScale; + + scale = std::min(scale, maxScale); + return scale; } diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index ac495b02e..739ff3935 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -173,12 +173,13 @@ void Totem::UnSummon(uint32 msTime) bool Totem::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const { - // xinef: immune to all positive spells, except of stoneclaw totem absorb and sentry totem bind sight + // xinef: immune to all positive spells, except of stoneclaw totem absorb, sentry totem bind sight and intervene // totems positive spells have unit_caster target if (spellInfo->Effects[index].Effect != SPELL_EFFECT_DUMMY && spellInfo->Effects[index].Effect != SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->IsPositive() && spellInfo->Effects[index].TargetA.GetTarget() != TARGET_UNIT_CASTER && - spellInfo->Effects[index].TargetA.GetCheckType() != TARGET_CHECK_ENTRY && spellInfo->Id != 55277 && spellInfo->Id != 6277) + spellInfo->Effects[index].TargetA.GetCheckType() != TARGET_CHECK_ENTRY && + spellInfo->Id != SPELL_STONECLAW && spellInfo->Id != SPELL_BIND_SIGHT && spellInfo->Id != SPELL_INTERVENE) return true; // Cyclone shouldn't be casted on totems diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h index fcaabf91d..5265435d5 100644 --- a/src/server/game/Entities/Totem/Totem.h +++ b/src/server/game/Entities/Totem/Totem.h @@ -37,7 +37,15 @@ enum class TotemSpellIds : uint32 #define SENTRY_TOTEM_ENTRY 3968 #define EARTHBIND_TOTEM_ENTRY 2630 -constexpr uint32 SPELL_CYCLONE = 33786; +enum TotemImmunitySpells +{ + // Immune + SPELL_CYCLONE = 33786, + // Not Immune + SPELL_STONECLAW = 55277, + SPELL_BIND_SIGHT = 6277, + SPELL_INTERVENE = 3411 +}; class Totem : public Minion { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3e3984c31..459d7b8f2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -20597,7 +20597,7 @@ void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, Aura } // xinef: delay only for casting on different unit - if (this == caster) + if (this == caster || !sWorld->getBoolConfig(CONFIG_MUNCHING_BLIZZLIKE)) caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, addAmount, this, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, caster->GetGUID()); else caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId), caster->m_Events.CalculateQueueTime(400)); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 992f3102b..e1172ff87 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1066,7 +1066,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex) finish(); - m_caster->CastSpell((Unit*)nullptr, spellInfo, false); + m_caster->CastSpell((Unit*)nullptr, spellInfo, true); } void Spell::EffectJump(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index f75316ef2..e0387de8f 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -1943,7 +1943,8 @@ void SpellMgr::LoadSpellInfoCorrections() }); // Ulduar, Mimiron, Magnetic Core (summon) - ApplySpellFix({ 64444 }, [](SpellInfo* spellInfo) + // Meeting Stone Summon + ApplySpellFix({ 64444, 23598 }, [](SpellInfo* spellInfo) { spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER); }); @@ -4807,6 +4808,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].TriggerSpell = 38530; // Quest Credit for Eye of Grillok }); + // Greater Fireball + ApplySpellFix({ 33051 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx4 |= SPELL_ATTR4_NO_CAST_LOG; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/game/World/IWorld.h b/src/server/game/World/IWorld.h index cae01b845..638c132d6 100644 --- a/src/server/game/World/IWorld.h +++ b/src/server/game/World/IWorld.h @@ -185,6 +185,7 @@ enum WorldBoolConfigs CONFIG_STRICT_NAMES_RESERVED, CONFIG_STRICT_NAMES_PROFANITY, CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH, + CONFIG_MUNCHING_BLIZZLIKE, BOOL_CONFIG_VALUE_COUNT }; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 353369583..d3ba8d66f 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1283,6 +1283,8 @@ void World::LoadConfigSettings(bool reload) _bool_configs[CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH] = sConfigMgr->GetOption("Pet.RankMod.Health", true); + _bool_configs[CONFIG_MUNCHING_BLIZZLIKE] = sConfigMgr->GetOption("MunchingBlizzlike.Enabled", true); + _int_configs[CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD] = sConfigMgr->GetOption("DailyRBGArenaPoints.MinLevel", 71); _int_configs[CONFIG_AUCTION_HOUSE_SEARCH_TIMEOUT] = sConfigMgr->GetOption("AuctionHouse.SearchTimeout", 1000); diff --git a/src/server/scripts/Commands/PlayerCommand.h b/src/server/scripts/Commands/PlayerCommand.h index 08603edb8..10410e9ac 100644 --- a/src/server/scripts/Commands/PlayerCommand.h +++ b/src/server/scripts/Commands/PlayerCommand.h @@ -19,7 +19,6 @@ #define _PLAYER_COMMAND_H #include "Chat.h" -#include "Common.h" class Player; class SpellInfo; diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp index d730c0a34..ca742f767 100644 --- a/src/server/scripts/Commands/cs_achievement.cpp +++ b/src/server/scripts/Commands/cs_achievement.cpp @@ -22,7 +22,6 @@ Comment: All achievement related commands Category: commandscripts EndScriptData */ -#include "AchievementMgr.h" #include "Chat.h" #include "CommandScript.h" #include "Player.h" diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 9b03cc878..612537c8f 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -38,10 +38,8 @@ #include "ObjectMgr.h" #include "PoolMgr.h" #include "ScriptMgr.h" -#include "SpellMgr.h" #include "Transport.h" #include "Warden.h" -#include "World.h" #include #include diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp index f717469e6..b48ae4fbc 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -22,7 +22,6 @@ Comment: All disable related commands Category: commandscripts EndScriptData */ -#include "AchievementMgr.h" #include "Chat.h" #include "CommandScript.h" #include "DisableMgr.h" diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp index 80d036d2c..bda903f7d 100644 --- a/src/server/scripts/Commands/cs_event.cpp +++ b/src/server/scripts/Commands/cs_event.cpp @@ -27,7 +27,6 @@ #include "GameEventMgr.h" #include "GameTime.h" #include "Language.h" -#include "Player.h" #include "Timer.h" using namespace Acore::ChatCommands; diff --git a/src/server/scripts/Commands/cs_gear.cpp b/src/server/scripts/Commands/cs_gear.cpp index 3f0e3aedc..9753997fe 100644 --- a/src/server/scripts/Commands/cs_gear.cpp +++ b/src/server/scripts/Commands/cs_gear.cpp @@ -18,7 +18,6 @@ #include "Chat.h" #include "CommandScript.h" #include "Language.h" -#include "Log.h" #include "Player.h" #include "WorldSession.h" diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 499d5f72f..3eab21a35 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -23,7 +23,6 @@ #include "Language.h" #include "MapMgr.h" #include "ObjectMgr.h" -#include "Opcodes.h" #include "Player.h" #include "PoolMgr.h" #include "Transport.h" diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp index 441bde078..62abe21ae 100644 --- a/src/server/scripts/Commands/cs_group.cpp +++ b/src/server/scripts/Commands/cs_group.cpp @@ -17,7 +17,6 @@ #include "Chat.h" #include "CommandScript.h" -#include "DatabaseEnv.h" #include "GroupMgr.h" #include "Language.h" #include "Player.h" diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index 732f0982b..37d1d66e7 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -25,12 +25,10 @@ #include "Chat.h" #include "CommandScript.h" #include "GameTime.h" -#include "Group.h" #include "InstanceSaveMgr.h" #include "InstanceScript.h" #include "Language.h" #include "MapMgr.h" -#include "ObjectAccessor.h" #include "Player.h" using namespace Acore::ChatCommands; diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp index 1cf649976..5e809cafa 100644 --- a/src/server/scripts/Commands/cs_lfg.cpp +++ b/src/server/scripts/Commands/cs_lfg.cpp @@ -17,7 +17,6 @@ #include "Chat.h" #include "CommandScript.h" -#include "DatabaseEnv.h" #include "Group.h" #include "LFGMgr.h" #include "Language.h" diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index af687c177..caeb7c2e1 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -30,7 +30,6 @@ EndScriptData */ #include "GameObject.h" #include "Language.h" #include "MapMgr.h" -#include "ObjectAccessor.h" #include "ObjectMgr.h" #include "Player.h" #include "Random.h" diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 0ad9752bb..20cf780e7 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -22,7 +22,6 @@ Comment: All lookup related commands Category: commandscripts EndScriptData */ -#include "AccountMgr.h" #include "CharacterCache.h" #include "Chat.h" #include "CommandScript.h" diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index c5dabb940..443a31537 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -36,7 +36,6 @@ #include "MiscPackets.h" #include "MovementGenerator.h" #include "ObjectAccessor.h" -#include "Opcodes.h" #include "Pet.h" #include "Player.h" #include "Realm.h" diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index 9c1130071..9e72cfc70 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -30,10 +30,8 @@ #include "GridNotifiersImpl.h" #include "MMapFactory.h" #include "Map.h" -#include "ObjectMgr.h" #include "PathGenerator.h" #include "Player.h" -#include "PointMovementGenerator.h" #include "TargetedMovementGenerator.h" using namespace Acore::ChatCommands; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index aaadedb7b..302c09a96 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -22,7 +22,6 @@ Comment: All modify related commands Category: commandscripts EndScriptData */ -#include "AccountMgr.h" #include "Chat.h" #include "CommandScript.h" #include "ObjectMgr.h" diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 5ea17dca8..cdd32ada0 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -26,7 +26,6 @@ EndScriptData */ #include "Chat.h" #include "CommandScript.h" #include "Language.h" -#include "ObjectAccessor.h" #include "Pet.h" #include "Player.h" #include "ScriptMgr.h" diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 0c1087436..6b4e7f7c2 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -26,10 +26,10 @@ #include "CommandScript.h" #include "GameTime.h" #include "GitRevision.h" +#include "Log.h" #include "ModuleMgr.h" #include "MotdMgr.h" #include "MySQLThreading.h" -#include "Player.h" #include "Realm.h" #include "StringConvert.h" #include "UpdateTime.h" diff --git a/src/server/scripts/Commands/cs_spectator.cpp b/src/server/scripts/Commands/cs_spectator.cpp index 540cedc49..4819e0b01 100644 --- a/src/server/scripts/Commands/cs_spectator.cpp +++ b/src/server/scripts/Commands/cs_spectator.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ -#include "AccountMgr.h" #include "ArenaSpectator.h" #include "BattlegroundMgr.h" #include "Chat.h" diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index b968b72b7..fa77beb3a 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -24,7 +24,6 @@ EndScriptData */ #include "Chat.h" #include "CommandScript.h" -#include "ObjectMgr.h" #include "Player.h" #include "WaypointMgr.h" diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index e586d9ecf..d40ba1bdb 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -124,8 +124,8 @@ struct boss_shade_of_aran : public BossAI _drinking = false; _hasDrunk = false; - for (int i = 0; i < immuneSpells.size(); i++) - me->ApplySpellImmune(0, IMMUNITY_ID, immuneSpells[i], true); + for (auto spell : immuneSpells) + me->ApplySpellImmune(0, IMMUNITY_ID, spell, true); if (GameObject* libraryDoor = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR))) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 6b5fae927..c24a63ec1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -338,13 +338,13 @@ struct boss_archimonde : public BossAI { switch (player->getClass()) { - case CLASS_PALADIN: + case CLASS_MAGE: case CLASS_PRIEST: case CLASS_WARLOCK: player->CastSpell(me, SPELL_SOUL_CHARGE_RED, true); break; case CLASS_DEATH_KNIGHT: - case CLASS_MAGE: + case CLASS_PALADIN: case CLASS_ROGUE: case CLASS_WARRIOR: player->CastSpell(me, SPELL_SOUL_CHARGE_YELLOW, true); @@ -504,7 +504,7 @@ class spell_doomfire : public AuraScript int32 bp = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); float tickCoef = (static_cast(aurEff->GetTickNumber() - 1) / aurEff->GetTotalTicks()); // Tick moved back to ensure proper damage on each tick int32 damage = bp - (bp*tickCoef); - SpellCastResult result = target->CastCustomSpell(target, SPELL_DOOMFIRE_DOT, &damage, &damage, &damage, true, nullptr, nullptr, target->GetGUID()); + target->CastCustomSpell(target, SPELL_DOOMFIRE_DOT, &damage, &damage, &damage, true, nullptr, nullptr, target->GetGUID()); } void Register() override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 79387d099..39bce4e6e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -39,6 +39,7 @@ enum Texts enum Misc { + GROUP_FROST = 1, PATH_RAGE_WINTERCHILL = 177670, POINT_COMBAT_START = 7 }; @@ -50,9 +51,9 @@ public: { _recentlySpoken = false; scheduler.SetValidator([this] - { - return !me->HasUnitState(UNIT_STATE_CASTING); - }); + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); } void JustEngagedWith(Unit* who) override @@ -61,26 +62,31 @@ public: scheduler.Schedule(18s, 24s, [this](TaskContext context) { + context.SetGroup(GROUP_FROST); + DoCastSelf(SPELL_FROST_ARMOR); context.Repeat(30s, 45s); }).Schedule(5s, 9s, [this](TaskContext context) { + context.SetGroup(GROUP_FROST); + DoCastRandomTarget(SPELL_ICEBOLT); context.Repeat(9s, 15s); }).Schedule(12s, 17s, [this](TaskContext context) { - if (SelectTarget(SelectTargetMethod::Random, 0, 20.f)) - { - DoCastAOE(SPELL_FROST_NOVA); + context.SetGroup(GROUP_FROST); + + if (DoCastRandomTarget(SPELL_FROST_NOVA, 0, 45.f) == SPELL_CAST_OK) Talk(SAY_NOVA); - context.Repeat(25s, 30s); - } - else - context.Repeat(1200ms); + + context.Repeat(25s, 30s); }).Schedule(21s, 28s, [this](TaskContext context) { - if (DoCastRandomTarget(SPELL_DEATH_AND_DECAY, 0, 40.f)) + if (DoCastRandomTarget(SPELL_DEATH_AND_DECAY, 0, 40.f) == SPELL_CAST_OK) + { Talk(SAY_DECAY); + context.DelayGroup(GROUP_FROST, 15s); + } context.Repeat(45s); }).Schedule(10min, [this](TaskContext context) @@ -106,9 +112,9 @@ public: case ALLIANCE_BASE_CHARGE_2: case ALLIANCE_BASE_CHARGE_3: me->m_Events.AddEventAtOffset([this]() - { - me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true); - }, 1s); + { + me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true); + }, 1s); break; } } @@ -121,9 +127,9 @@ public: _recentlySpoken = true; scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); + { + _recentlySpoken = false; + }); } } diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp index d4410e4fa..c9e14c87e 100644 --- a/src/server/scripts/Northrend/isle_of_conquest.cpp +++ b/src/server/scripts/Northrend/isle_of_conquest.cpp @@ -308,30 +308,24 @@ public: } }; -class spell_ioc_repair_turret : public SpellScriptLoader +class spell_ioc_repair_turret_aura : public AuraScript { -public: - spell_ioc_repair_turret() : SpellScriptLoader("spell_ioc_repair_turret") { } + PrepareAuraScript(spell_ioc_repair_turret_aura); - class spell_ioc_repair_turret_AuraScript : public AuraScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareAuraScript(spell_ioc_repair_turret_AuraScript); + return ValidateSpellInfo({ SPELL_REPAIR_TURRET_DUMMY }); + } - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) - GetTarget()->CastSpell(GetTarget(), SPELL_REPAIR_TURRET_DUMMY, true); - } - - void Register() override - { - AfterEffectRemove += AuraEffectRemoveFn(spell_ioc_repair_turret_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const override + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - return new spell_ioc_repair_turret_AuraScript(); + if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) + GetTarget()->CastSpell(GetTarget(), SPELL_REPAIR_TURRET_DUMMY, true); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_ioc_repair_turret_aura::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; @@ -344,162 +338,128 @@ enum blastCriteria SPELL_BOMB_INATION_CREDIT = 68367, }; -class spell_ioc_bomb_blast_criteria : public SpellScriptLoader +class spell_ioc_bomb_blast_criteria : public SpellScript { -public: - spell_ioc_bomb_blast_criteria() : SpellScriptLoader("spell_ioc_bomb_blast_criteria") { } + PrepareSpellScript(spell_ioc_bomb_blast_criteria); - class spell_ioc_bomb_blast_criteria_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_ioc_bomb_blast_criteria_SpellScript); + return ValidateSpellInfo({ SPELL_BOMB_INABLE_CREDIT, SPELL_BOMB_INATION_CREDIT }); + } - void HandleGameObjectDamage(SpellEffIndex /*effIndex*/) - { - Unit* owner = GetCaster()->GetOwner(); - if (!owner) - return; - - if (GetSpellInfo()->Id == SPELL_SEAFORIUM_BLAST) - owner->CastSpell(owner, SPELL_BOMB_INABLE_CREDIT, true); - else if (GetSpellInfo()->Id == SPELL_HUGE_SEAFORIUM_BLAST) - owner->CastSpell(owner, SPELL_BOMB_INATION_CREDIT, true); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_ioc_bomb_blast_criteria_SpellScript::HandleGameObjectDamage, EFFECT_1, SPELL_EFFECT_GAMEOBJECT_DAMAGE); - } - }; - - SpellScript* GetSpellScript() const override + void HandleGameObjectDamage(SpellEffIndex /*effIndex*/) { - return new spell_ioc_bomb_blast_criteria_SpellScript(); + Unit* owner = GetCaster()->GetOwner(); + if (!owner) + return; + + if (GetSpellInfo()->Id == SPELL_SEAFORIUM_BLAST) + owner->CastSpell(owner, SPELL_BOMB_INABLE_CREDIT, true); + else if (GetSpellInfo()->Id == SPELL_HUGE_SEAFORIUM_BLAST) + owner->CastSpell(owner, SPELL_BOMB_INATION_CREDIT, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_ioc_bomb_blast_criteria::HandleGameObjectDamage, EFFECT_1, SPELL_EFFECT_GAMEOBJECT_DAMAGE); } }; -class spell_ioc_gunship_portal : public SpellScriptLoader +class spell_ioc_gunship_portal : public SpellScript { -public: - spell_ioc_gunship_portal() : SpellScriptLoader("spell_ioc_gunship_portal") { } + PrepareSpellScript(spell_ioc_gunship_portal); - class spell_ioc_gunship_portal_SpellScript : public SpellScript + bool Load() override { - PrepareSpellScript(spell_ioc_gunship_portal_SpellScript); + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - void HandleScript(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - /*Player* caster = GetCaster()->ToPlayer(); - * - * HACK: GetWorldLocation() returns real position and not transportposition. - * ServertoClient: SMSG_MOVE_TELEPORT (0x0B39) - * counter: 45 - * Tranpsort Guid: Full: xxxx Type: MOTransport Low: xxx - * Transport Position X: 0 Y: 0 Z: 0 O: 0 - * Position: X: 7.305609 Y: -0.095246 Z: 34.51022 O: 0 - - caster->TeleportTo(GetHitCreature()->GetWorldLocation(), TELE_TO_NOT_LEAVE_TRANSPORT);*/ - } - - void HandleScript2(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - Player* caster = GetCaster()->ToPlayer(); - if (!caster->IsBeingTeleported()) - if (Battleground* bg = caster->GetBattleground()) - bg->DoAction(2 /**/, caster->GetGUID()); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_ioc_gunship_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - OnEffectHitTarget += SpellEffectFn(spell_ioc_gunship_portal_SpellScript::HandleScript2, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void HandleScript(SpellEffIndex effIndex) { - return new spell_ioc_gunship_portal_SpellScript(); + PreventHitDefaultEffect(effIndex); + /*Player* caster = GetCaster()->ToPlayer(); + * + * HACK: GetWorldLocation() returns real position and not transportposition. + * ServertoClient: SMSG_MOVE_TELEPORT (0x0B39) + * counter: 45 + * Tranpsort Guid: Full: xxxx Type: MOTransport Low: xxx + * Transport Position X: 0 Y: 0 Z: 0 O: 0 + * Position: X: 7.305609 Y: -0.095246 Z: 34.51022 O: 0 + + caster->TeleportTo(GetHitCreature()->GetWorldLocation(), TELE_TO_NOT_LEAVE_TRANSPORT);*/ + } + + void HandleScript2(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + Player* caster = GetCaster()->ToPlayer(); + if (!caster->IsBeingTeleported()) + if (Battleground* bg = caster->GetBattleground()) + bg->DoAction(2 /**/, caster->GetGUID()); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_ioc_gunship_portal::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_ioc_gunship_portal::HandleScript2, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } }; -class spell_ioc_parachute_ic : public SpellScriptLoader +class spell_ioc_parachute_ic_aura : public AuraScript { -public: - spell_ioc_parachute_ic() : SpellScriptLoader("spell_ioc_parachute_ic") { } + PrepareAuraScript(spell_ioc_parachute_ic_aura); - class spell_ioc_parachute_ic_AuraScript : public AuraScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareAuraScript(spell_ioc_parachute_ic_AuraScript) + return ValidateSpellInfo({ SPELL_PARACHUTE_IC }); + } - void HandleTriggerSpell(AuraEffect const* /*aurEff*/) - { - if (Player* target = GetTarget()->ToPlayer()) - if (target->m_movementInfo.fallTime > 2500 && !target->GetTransport()) - target->CastSpell(target, SPELL_PARACHUTE_IC, true); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_ioc_parachute_ic_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const override + void HandleTriggerSpell(AuraEffect const* /*aurEff*/) { - return new spell_ioc_parachute_ic_AuraScript(); + if (Player* target = GetTarget()->ToPlayer()) + if (target->m_movementInfo.fallTime > 2500 && !target->GetTransport()) + target->CastSpell(target, SPELL_PARACHUTE_IC, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_ioc_parachute_ic_aura::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; -class spell_ioc_launch : public SpellScriptLoader +class spell_ioc_launch : public SpellScript { -public: - spell_ioc_launch() : SpellScriptLoader("spell_ioc_launch") { } + PrepareSpellScript(spell_ioc_launch); - class spell_ioc_launch_SpellScript : public SpellScript + void HandleScript(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_ioc_launch_SpellScript); + if (Player* player = GetHitPlayer()) + player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage + } - void HandleScript(SpellEffIndex /*effIndex*/) - { - if (Player* player = GetHitPlayer()) - player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage - } - - void Launch() - { - WorldLocation const* const position = GetExplTargetDest(); - - if (Player* player = GetHitPlayer()) - { - player->ExitVehicle(); - player->DisableSpline(); - player->GetMap()->PlayerRelocation(player, GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ(), GetCaster()->GetOrientation()); - - float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY()); - float elevation = GetSpell()->m_targets.GetElevation(); - float speedZ = std::max(10.0f, float(50.0f * std::sin(elevation))); - float speedXY = dist * 10.0f / speedZ; - - player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_ioc_launch_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST); - AfterHit += SpellHitFn(spell_ioc_launch_SpellScript::Launch); - } - }; - - SpellScript* GetSpellScript() const override + void Launch() { - return new spell_ioc_launch_SpellScript(); + WorldLocation const* const position = GetExplTargetDest(); + + if (Player* player = GetHitPlayer()) + { + player->ExitVehicle(); + player->DisableSpline(); + player->GetMap()->PlayerRelocation(player, GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ(), GetCaster()->GetOrientation()); + + float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY()); + float elevation = GetSpell()->m_targets.GetElevation(); + float speedZ = std::max(10.0f, float(50.0f * std::sin(elevation))); + float speedXY = dist * 10.0f / speedZ; + + player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_ioc_launch::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST); + AfterHit += SpellHitFn(spell_ioc_launch::Launch); } }; @@ -509,10 +469,10 @@ void AddSC_isle_of_conquest() new npc_four_car_garage(); new npc_ioc_gunship_captain(); new boss_isle_of_conquest(); - new spell_ioc_repair_turret(); - new spell_ioc_bomb_blast_criteria(); - new spell_ioc_gunship_portal(); - new spell_ioc_parachute_ic(); - new spell_ioc_launch(); + RegisterSpellScript(spell_ioc_repair_turret_aura); + RegisterSpellScript(spell_ioc_bomb_blast_criteria); + RegisterSpellScript(spell_ioc_gunship_portal); + RegisterSpellScript(spell_ioc_parachute_ic_aura); + RegisterSpellScript(spell_ioc_launch); } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index a681ab4ef..9be383800 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -34,47 +34,41 @@ enum eDrakeHunt SPELL_SUBDUED = 46675 }; -class spell_q11919_q11940_drake_hunt : public SpellScriptLoader +class spell_q11919_q11940_drake_hunt_aura : public AuraScript { -public: - spell_q11919_q11940_drake_hunt() : SpellScriptLoader("spell_q11919_q11940_drake_hunt") { } + PrepareAuraScript(spell_q11919_q11940_drake_hunt_aura); - class spell_q11919_q11940_drake_hunt_AuraScript : public AuraScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareAuraScript(spell_q11919_q11940_drake_hunt_AuraScript) + return ValidateSpellInfo({ SPELL_SUBDUED, SPELL_DRAKE_HATCHLING_SUBDUED }); + } - bool Load() override - { - return GetOwner()->GetTypeId() == TYPEID_UNIT; - } - - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE || !GetCaster()) - return; - - Creature* owner = GetOwner()->ToCreature(); - owner->RemoveAllAurasExceptType(SPELL_AURA_DUMMY); - owner->CombatStop(true); - owner->GetThreatMgr().ClearAllThreat(); - owner->GetMotionMaster()->Clear(false); - owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, M_PI, MOTION_SLOT_ACTIVE); - owner->CastSpell(owner, SPELL_SUBDUED, true); - GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true); - owner->SetFaction(FACTION_FRIENDLY); - owner->SetImmuneToAll(true); - owner->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS); - } - - void Register() override - { - AfterEffectRemove += AuraEffectRemoveFn(spell_q11919_q11940_drake_hunt_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const override + bool Load() override { - return new spell_q11919_q11940_drake_hunt_AuraScript(); + return GetOwner()->GetTypeId() == TYPEID_UNIT; + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE || !GetCaster()) + return; + + Creature* owner = GetOwner()->ToCreature(); + owner->RemoveAllAurasExceptType(SPELL_AURA_DUMMY); + owner->CombatStop(true); + owner->GetThreatMgr().ClearAllThreat(); + owner->GetMotionMaster()->Clear(false); + owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, M_PI, MOTION_SLOT_ACTIVE); + owner->CastSpell(owner, SPELL_SUBDUED, true); + GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true); + owner->SetFaction(FACTION_FRIENDLY); + owner->SetImmuneToAll(true); + owner->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_q11919_q11940_drake_hunt_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; @@ -667,29 +661,23 @@ public: }; // Spell 45625: - Arcane Chains: Character Force Cast -class spell_arcane_chains_character_force_cast : public SpellScriptLoader +class spell_arcane_chains_character_force_cast : public SpellScript { -public: - spell_arcane_chains_character_force_cast() : SpellScriptLoader("spell_arcane_chains_character_force_cast") {} + PrepareSpellScript(spell_arcane_chains_character_force_cast); - class spell_arcane_chains_character_force_cast_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_arcane_chains_character_force_cast_SpellScript); + return ValidateSpellInfo({ SPELL_ARCANE_CHAINS_SUMMON_CHAINED_MAGE_HUNTER, 45626 }); + } - void HandleScriptEffect(SpellEffIndex /* effIndex */) - { - GetHitUnit()->CastSpell(GetCaster(), SPELL_ARCANE_CHAINS_SUMMON_CHAINED_MAGE_HUNTER, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SET_FACING & ~TRIGGERED_IGNORE_AURA_INTERRUPT_FLAGS & ~TRIGGERED_IGNORE_CAST_ITEM & ~TRIGGERED_IGNORE_GCD)); // Player cast back 45626 on npc - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_arcane_chains_character_force_cast_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void HandleScriptEffect(SpellEffIndex /* effIndex */) { - return new spell_arcane_chains_character_force_cast_SpellScript(); + GetHitUnit()->CastSpell(GetCaster(), SPELL_ARCANE_CHAINS_SUMMON_CHAINED_MAGE_HUNTER, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SET_FACING & ~TRIGGERED_IGNORE_AURA_INTERRUPT_FLAGS & ~TRIGGERED_IGNORE_CAST_ITEM & ~TRIGGERED_IGNORE_GCD)); // Player cast back 45626 on npc + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_arcane_chains_character_force_cast::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -1309,31 +1297,20 @@ enum BloodsporeRuination EVENT_RESET_ORIENTATION }; -class spell_q11719_bloodspore_ruination_45997 : public SpellScriptLoader +class spell_q11719_bloodspore_ruination_45997 : public SpellScript { -public: - spell_q11719_bloodspore_ruination_45997() : SpellScriptLoader("spell_q11719_bloodspore_ruination_45997") { } + PrepareSpellScript(spell_q11719_bloodspore_ruination_45997); - class spell_q11719_bloodspore_ruination_45997_SpellScript : public SpellScript + void HandleEffect(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_q11719_bloodspore_ruination_45997_SpellScript); + if (Unit* caster = GetCaster()) + if (Creature* laurith = caster->FindNearestCreature(NPC_BLOODMAGE_LAURITH, 100.0f)) + laurith->AI()->SetGUID(caster->GetGUID()); + } - void HandleEffect(SpellEffIndex /*effIndex*/) - { - if (Unit* caster = GetCaster()) - if (Creature* laurith = caster->FindNearestCreature(NPC_BLOODMAGE_LAURITH, 100.0f)) - laurith->AI()->SetGUID(caster->GetGUID()); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q11719_bloodspore_ruination_45997_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q11719_bloodspore_ruination_45997_SpellScript(); + OnEffectHit += SpellEffectFn(spell_q11719_bloodspore_ruination_45997::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); } }; @@ -2059,7 +2036,7 @@ public: void AddSC_borean_tundra() { // Ours - new spell_q11919_q11940_drake_hunt(); + RegisterSpellScript(spell_q11919_q11940_drake_hunt_aura); new npc_thassarian(); new npc_thassarian2(); new npc_leryssa(); @@ -2073,14 +2050,14 @@ void AddSC_borean_tundra() new npc_lurgglbr(); new npc_beryl_sorcerer(); new npc_captured_beryl_sorcerer(); - new spell_arcane_chains_character_force_cast(); + RegisterSpellScript(spell_arcane_chains_character_force_cast); new npc_imprisoned_beryl_sorcerer(); new npc_mootoo_the_younger(); new npc_bonker_togglevolt(); new npc_valiance_keep_cannoneer(); new npc_warmage_coldarra(); new npc_hidden_cultist(); - new spell_q11719_bloodspore_ruination_45997(); + RegisterSpellScript(spell_q11719_bloodspore_ruination_45997); new npc_bloodmage_laurith(); } diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 0fcc2a8ed..db8e98df7 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -931,71 +931,49 @@ enum eFrostmourneCavern NPC_PRINCE_ARTHAS = 27455, }; -class spell_q12478_frostmourne_cavern : public SpellScriptLoader +class spell_q12478_frostmourne_cavern : public SpellScript { -public: - spell_q12478_frostmourne_cavern() : SpellScriptLoader("spell_q12478_frostmourne_cavern") { } + PrepareSpellScript(spell_q12478_frostmourne_cavern); - class spell_q12478_frostmourne_cavern_SpellScript : public SpellScript + void HandleSendEvent(SpellEffIndex effIndex) { - PrepareSpellScript(spell_q12478_frostmourne_cavern_SpellScript); + PreventHitDefaultEffect(effIndex); + GetCaster()->SummonCreature(NPC_PRINCE_ARTHAS, 4821.3f, -580.14f, 163.541f, 4.57f); + } - void HandleSendEvent(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - GetCaster()->SummonCreature(NPC_PRINCE_ARTHAS, 4821.3f, -580.14f, 163.541f, 4.57f); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q12478_frostmourne_cavern_SpellScript::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q12478_frostmourne_cavern_SpellScript(); + OnEffectHit += SpellEffectFn(spell_q12478_frostmourne_cavern::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT); } }; -class spell_q12243_fire_upon_the_waters : public SpellScriptLoader +class spell_q12243_fire_upon_the_waters_aura : public AuraScript { -public: - spell_q12243_fire_upon_the_waters() : SpellScriptLoader("spell_q12243_fire_upon_the_waters") { } + PrepareAuraScript(spell_q12243_fire_upon_the_waters_aura); - class spell_q12243_fire_upon_the_waters_AuraScript : public AuraScript + void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - PrepareAuraScript(spell_q12243_fire_upon_the_waters_AuraScript); - - void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + std::list servants; + GetTarget()->GetCreatureListWithEntryInGrid(servants, 27233 /*NPC_ONSLAUGHT_DECKHAND*/, 40.0f); + for (std::list::const_iterator itr = servants.begin(); itr != servants.end(); ++itr) { - std::list servants; - GetTarget()->GetCreatureListWithEntryInGrid(servants, 27233 /*NPC_ONSLAUGHT_DECKHAND*/, 40.0f); - for (std::list::const_iterator itr = servants.begin(); itr != servants.end(); ++itr) - { - (*itr)->SetSpeed(MOVE_RUN, 0.7f, true); - (*itr)->GetMotionMaster()->MoveFleeing(GetTarget(), GetDuration()); - } + (*itr)->SetSpeed(MOVE_RUN, 0.7f, true); + (*itr)->GetMotionMaster()->MoveFleeing(GetTarget(), GetDuration()); } + } - void HandleRemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - std::list servants; - GetTarget()->GetCreatureListWithEntryInGrid(servants, 27233 /*NPC_ONSLAUGHT_DECKHAND*/, 100.0f); - for (std::list::const_iterator itr = servants.begin(); itr != servants.end(); ++itr) - (*itr)->SetSpeed(MOVE_RUN, 1.1f, true); - } - - void Register() override - { - OnEffectApply += AuraEffectApplyFn(spell_q12243_fire_upon_the_waters_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); - OnEffectRemove += AuraEffectRemoveFn(spell_q12243_fire_upon_the_waters_AuraScript::HandleRemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const override + void HandleRemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - return new spell_q12243_fire_upon_the_waters_AuraScript(); + std::list servants; + GetTarget()->GetCreatureListWithEntryInGrid(servants, 27233 /*NPC_ONSLAUGHT_DECKHAND*/, 100.0f); + for (std::list::const_iterator itr = servants.begin(); itr != servants.end(); ++itr) + (*itr)->SetSpeed(MOVE_RUN, 1.1f, true); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_q12243_fire_upon_the_waters_aura::HandleApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_q12243_fire_upon_the_waters_aura::HandleRemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); } }; @@ -1497,39 +1475,28 @@ private: bool _alive; }; -class spell_q24545_aod_special : public SpellScriptLoader +class spell_q24545_aod_special : public SpellScript { -public: - spell_q24545_aod_special() : SpellScriptLoader("spell_q24545_aod_special") { } + PrepareSpellScript(spell_q24545_aod_special); - class spell_q24545_aod_special_SpellScript : public SpellScript + void FilterTargets(std::list& targets) { - PrepareSpellScript(spell_q24545_aod_special_SpellScript); + targets.remove_if(GhoulTargetCheck(GetSpellInfo()->Id == 70790)); + Acore::Containers::RandomResize(targets, 2); + } - void FilterTargets(std::list& targets) - { - targets.remove_if(GhoulTargetCheck(GetSpellInfo()->Id == 70790)); - Acore::Containers::RandomResize(targets, 2); - } - - void HandleScript(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - if (Unit* target = GetHitUnit()) - if (target->GetTypeId() == TYPEID_UNIT) - target->ToCreature()->AI()->DoAction(GetSpellInfo()->Id == 70790 ? -2 : -1); - } - - void Register() override - { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_q24545_aod_special_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); - OnEffectHitTarget += SpellEffectFn(spell_q24545_aod_special_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override + void HandleScript(SpellEffIndex effIndex) { - return new spell_q24545_aod_special_SpellScript(); + PreventHitDefaultEffect(effIndex); + if (Unit* target = GetHitUnit()) + if (target->GetTypeId() == TYPEID_UNIT) + target->ToCreature()->AI()->DoAction(GetSpellInfo()->Id == 70790 ? -2 : -1); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_q24545_aod_special::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_q24545_aod_special::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -2077,82 +2044,65 @@ enum StrengthenAncientsMisc NPC_LOTHALOR = 26321 }; -class spell_q12096_q12092_dummy : public SpellScriptLoader // Strengthen the Ancients: On Interact Dummy to Woodlands Walker +class spell_q12096_q12092_dummy : public SpellScript { -public: - spell_q12096_q12092_dummy() : SpellScriptLoader("spell_q12096_q12092_dummy") { } + PrepareSpellScript(spell_q12096_q12092_dummy); - class spell_q12096_q12092_dummy_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_q12096_q12092_dummy_SpellScript); + return ValidateSpellInfo({ SPELL_CREATE_ITEM_BARK }); + } - void HandleDummy(SpellEffIndex /*effIndex*/) - { - uint32 roll = rand() % 2; - - Creature* tree = GetHitCreature(); - Player* player = GetCaster()->ToPlayer(); - - if (!tree || !player) - return; - - tree->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK); - - if (roll == 1) // friendly version - { - tree->CastSpell(player, SPELL_CREATE_ITEM_BARK); - tree->AI()->Talk(SAY_WALKER_FRIENDLY, player); - tree->DespawnOrUnsummon(1000); - } - else if (roll == 0) // enemy version - { - tree->AI()->Talk(SAY_WALKER_ENEMY, player); - tree->SetFaction(FACTION_MONSTER); - tree->Attack(player, true); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12096_q12092_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override + void HandleDummy(SpellEffIndex /*effIndex*/) { - return new spell_q12096_q12092_dummy_SpellScript(); + uint32 roll = rand() % 2; + + Creature* tree = GetHitCreature(); + Player* player = GetCaster()->ToPlayer(); + + if (!tree || !player) + return; + + tree->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK); + + if (roll == 1) // friendly version + { + tree->CastSpell(player, SPELL_CREATE_ITEM_BARK); + tree->AI()->Talk(SAY_WALKER_FRIENDLY, player); + tree->DespawnOrUnsummon(1000); + } + else if (roll == 0) // enemy version + { + tree->AI()->Talk(SAY_WALKER_ENEMY, player); + tree->SetFaction(FACTION_MONSTER); + tree->Attack(player, true); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12096_q12092_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; -class spell_q12096_q12092_bark : public SpellScriptLoader // Bark of the Walkers +class spell_q12096_q12092_bark : public SpellScript { -public: - spell_q12096_q12092_bark() : SpellScriptLoader("spell_q12096_q12092_bark") { } + PrepareSpellScript(spell_q12096_q12092_bark); - class spell_q12096_q12092_bark_SpellScript : public SpellScript + void HandleDummy(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_q12096_q12092_bark_SpellScript); + Creature* lothalor = GetHitCreature(); + if (!lothalor || lothalor->GetEntry() != NPC_LOTHALOR) + return; - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Creature* lothalor = GetHitCreature(); - if (!lothalor || lothalor->GetEntry() != NPC_LOTHALOR) - return; + lothalor->AI()->Talk(SAY_LOTHALOR); + lothalor->RemoveAura(SPELL_CONFUSED); + lothalor->DespawnOrUnsummon(4000); + } - lothalor->AI()->Talk(SAY_LOTHALOR); - lothalor->RemoveAura(SPELL_CONFUSED); - lothalor->DespawnOrUnsummon(4000); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12096_q12092_bark_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q12096_q12092_bark_SpellScript(); + OnEffectHitTarget += SpellEffectFn(spell_q12096_q12092_bark::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -2306,20 +2256,20 @@ void AddSC_dragonblight() RegisterSpellScript(spell_q12237_drop_off_villager); RegisterSpellScript(spell_call_wintergarde_gryphon); new npc_heated_battle(); - new spell_q12478_frostmourne_cavern(); - new spell_q12243_fire_upon_the_waters(); + RegisterSpellScript(spell_q12478_frostmourne_cavern); + RegisterSpellScript(spell_q12243_fire_upon_the_waters_aura); new npc_q24545_lich_king(); new at_q24545_frostmourne_cavern(); new npc_q24545_wretched_ghoul(); - new spell_q24545_aod_special(); + RegisterSpellScript(spell_q24545_aod_special); new npc_q24545_vegard_dummy(); new npc_q24545_vegard(); new npc_spiritual_insight(); // Theirs new npc_commander_eligor_dawnbringer(); - new spell_q12096_q12092_dummy(); - new spell_q12096_q12092_bark(); + RegisterSpellScript(spell_q12096_q12092_dummy); + RegisterSpellScript(spell_q12096_q12092_bark); new npc_torturer_lecraft(); RegisterSpellScript(spell_dragonblight_corrosive_spit); diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index 57dddf632..f39284d2c 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -961,35 +961,24 @@ enum ShredderDelivery NPC_BROKEN_DOWN_SHREDDER = 27354 }; -class spell_shredder_delivery : public SpellScriptLoader +class spell_shredder_delivery : public SpellScript { -public: - spell_shredder_delivery() : SpellScriptLoader("spell_shredder_delivery") { } + PrepareSpellScript(spell_shredder_delivery); - class spell_shredder_delivery_SpellScript : public SpellScript + bool Load() override { - PrepareSpellScript(spell_shredder_delivery_SpellScript); + return GetCaster()->GetTypeId() == TYPEID_UNIT; + } - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_UNIT; - } - - void HandleScript(SpellEffIndex /*effIndex*/) - { - if (GetCaster()->ToCreature()->GetEntry() == NPC_BROKEN_DOWN_SHREDDER) - GetCaster()->ToCreature()->DespawnOrUnsummon(); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_shredder_delivery_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void HandleScript(SpellEffIndex /*effIndex*/) { - return new spell_shredder_delivery_SpellScript(); + if (GetCaster()->ToCreature()->GetEntry() == NPC_BROKEN_DOWN_SHREDDER) + GetCaster()->ToCreature()->DespawnOrUnsummon(); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_shredder_delivery::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -999,35 +988,29 @@ enum InfectedWorgenBite SPELL_WORGENS_CALL = 53095 }; -class spell_infected_worgen_bite : public SpellScriptLoader +class spell_infected_worgen_bite_aura : public AuraScript { -public: - spell_infected_worgen_bite() : SpellScriptLoader("spell_infected_worgen_bite") { } + PrepareAuraScript(spell_infected_worgen_bite_aura); - class spell_infected_worgen_bite_AuraScript : public AuraScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareAuraScript(spell_infected_worgen_bite_AuraScript); + return ValidateSpellInfo({ SPELL_WORGENS_CALL }); + } - void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - if (target->GetTypeId() == TYPEID_PLAYER) - if (GetStackAmount() == GetSpellInfo()->StackAmount) - { - SetDuration(0); - target->CastSpell(target, SPELL_WORGENS_CALL, true); - } - } - - void Register() override - { - AfterEffectApply += AuraEffectApplyFn(spell_infected_worgen_bite_AuraScript::HandleAfterEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAPPLY); - } - }; - - AuraScript* GetAuraScript() const override + void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - return new spell_infected_worgen_bite_AuraScript(); + Unit* target = GetTarget(); + if (target->GetTypeId() == TYPEID_PLAYER) + if (GetStackAmount() == GetSpellInfo()->StackAmount) + { + SetDuration(0); + target->CastSpell(target, SPELL_WORGENS_CALL, true); + } + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_infected_worgen_bite_aura::HandleAfterEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAPPLY); } }; @@ -1123,44 +1106,33 @@ enum WarheadSpells SPELL_WARHEAD_FUSE = 49181 }; // 49107 - Vehicle: Warhead Fuse -class spell_vehicle_warhead_fuse : public SpellScriptLoader +class spell_vehicle_warhead_fuse : public SpellScript { -public: - spell_vehicle_warhead_fuse() : SpellScriptLoader("spell_vehicle_warhead_fuse") { } + PrepareSpellScript(spell_vehicle_warhead_fuse); - class spell_vehicle_warhead_fuse_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_vehicle_warhead_fuse_SpellScript); + return sSpellMgr->GetSpellInfo(SPELL_WARHEAD_Z_CHECK) + && sSpellMgr->GetSpellInfo(SPELL_WARHEAD_SEEKING_LUMBERSHIP) + && sSpellMgr->GetSpellInfo(SPELL_WARHEAD_FUSE); + } - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return sSpellMgr->GetSpellInfo(SPELL_WARHEAD_Z_CHECK) - && sSpellMgr->GetSpellInfo(SPELL_WARHEAD_SEEKING_LUMBERSHIP) - && sSpellMgr->GetSpellInfo(SPELL_WARHEAD_FUSE); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (!caster) - { - return; - } - - caster->CastSpell(caster, SPELL_WARHEAD_Z_CHECK, true); - caster->CastSpell(caster, SPELL_WARHEAD_SEEKING_LUMBERSHIP, true); - caster->CastSpell(caster, SPELL_WARHEAD_FUSE, true); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_vehicle_warhead_fuse_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void HandleDummy(SpellEffIndex /*effIndex*/) { - return new spell_vehicle_warhead_fuse_SpellScript(); + Unit* caster = GetCaster(); + if (!caster) + { + return; + } + + caster->CastSpell(caster, SPELL_WARHEAD_Z_CHECK, true); + caster->CastSpell(caster, SPELL_WARHEAD_SEEKING_LUMBERSHIP, true); + caster->CastSpell(caster, SPELL_WARHEAD_FUSE, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_vehicle_warhead_fuse::HandleDummy, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -1171,132 +1143,96 @@ enum WarheadDenonate NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS = 27689 }; // 49250 - Detonate -class spell_warhead_detonate : public SpellScriptLoader +class spell_warhead_detonate : public SpellScript { -public: - spell_warhead_detonate() : SpellScriptLoader("spell_warhead_detonate") { } + PrepareSpellScript(spell_warhead_detonate); - class spell_warhead_detonate_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_warhead_detonate_SpellScript); + return sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) && sSpellMgr->GetSpellInfo(SPELL_TORPEDO_EXPLOSION); + } - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) && sSpellMgr->GetSpellInfo(SPELL_TORPEDO_EXPLOSION); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - Player* player = GetHitPlayer(); - if (!player || !caster) - { - return; - } - - player->ExitVehicle(); - float horizontalSpeed = 3.0f; - float verticalSpeed = 40.0f; - player->KnockbackFrom(caster->GetPositionX(), caster->GetPositionY(), horizontalSpeed, verticalSpeed); - player->RemoveAurasDueToSpell(SPELL_WARHEAD_FUSE); - - std::list explosionBunnys; - caster->GetCreatureListWithEntryInGrid(explosionBunnys, NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS, 90.0f); - for (auto itr = explosionBunnys.begin(); itr != explosionBunnys.end(); ++itr) - { - (*itr)->CastSpell((*itr), SPELL_TORPEDO_EXPLOSION, true); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_warhead_detonate_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void HandleDummy(SpellEffIndex /*effIndex*/) { - return new spell_warhead_detonate_SpellScript(); + Unit* caster = GetCaster(); + Player* player = GetHitPlayer(); + if (!player || !caster) + { + return; + } + + player->ExitVehicle(); + float horizontalSpeed = 3.0f; + float verticalSpeed = 40.0f; + player->KnockbackFrom(caster->GetPositionX(), caster->GetPositionY(), horizontalSpeed, verticalSpeed); + player->RemoveAurasDueToSpell(SPELL_WARHEAD_FUSE); + + std::list explosionBunnys; + caster->GetCreatureListWithEntryInGrid(explosionBunnys, NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS, 90.0f); + for (auto itr = explosionBunnys.begin(); itr != explosionBunnys.end(); ++itr) + { + (*itr)->CastSpell((*itr), SPELL_TORPEDO_EXPLOSION, true); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_warhead_detonate::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; // 61678 - Z Check -class spell_z_check : public SpellScriptLoader +class spell_z_check_aura : public AuraScript { -public: - spell_z_check() : SpellScriptLoader("spell_z_check") { } + PrepareAuraScript(spell_z_check_aura); - class spell_z_check_AuraScript : public AuraScript + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - public: - spell_z_check_AuraScript() : AuraScript(), _posZ(0) {} + _posZ = GetTarget()->GetPositionZ(); + } - PrepareAuraScript(spell_z_check_AuraScript); + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + if (_posZ != GetTarget()->GetPositionZ()) { - _posZ = GetTarget()->GetPositionZ(); - } - - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - PreventDefaultAction(); - - if (_posZ != GetTarget()->GetPositionZ()) + if (Creature* target = GetTarget()->ToCreature()) { - if (Creature* target = GetTarget()->ToCreature()) - { - target->AI()->DoAction(0); - } + target->AI()->DoAction(0); } } + } private: - float _posZ; + float _posZ; - void Register() override - { - OnEffectApply += AuraEffectApplyFn(spell_z_check_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); - OnEffectPeriodic += AuraEffectPeriodicFn(spell_z_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_z_check_AuraScript(); + OnEffectApply += AuraEffectApplyFn(spell_z_check_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_z_check_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; // 49181 - Warhead Fuse -class spell_warhead_fuse : public SpellScriptLoader +class spell_warhead_fuse_aura : public AuraScript { -public: - spell_warhead_fuse() : SpellScriptLoader("spell_warhead_fuse") { } + PrepareAuraScript(spell_warhead_fuse_aura); - class spell_warhead_fuse_AuraScript : public AuraScript + void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - PrepareAuraScript(spell_warhead_fuse_AuraScript); - - void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + if (Unit* rocketUnit = GetTarget()->GetVehicleBase()) { - if (Unit* rocketUnit = GetTarget()->GetVehicleBase()) + if (Creature* rocketCrea = rocketUnit->ToCreature()) { - if (Creature* rocketCrea = rocketUnit->ToCreature()) - { - rocketCrea->AI()->DoAction(0); - } + rocketCrea->AI()->DoAction(0); } } + } - void Register() override - { - OnEffectRemove += AuraEffectRemoveFn(spell_warhead_fuse_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_warhead_fuse_AuraScript(); + OnEffectRemove += AuraEffectRemoveFn(spell_warhead_fuse_aura::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; @@ -1336,13 +1272,13 @@ void AddSC_grizzly_hills() RegisterSpellScript(spell_renew_skirmisher); new npc_venture_co_straggler(); new npc_lake_frog(); - new spell_shredder_delivery(); - new spell_infected_worgen_bite(); + RegisterSpellScript(spell_shredder_delivery); + RegisterSpellScript(spell_infected_worgen_bite_aura); new npc_rocket_propelled_warhead(); - new spell_z_check(); - new spell_warhead_detonate(); - new spell_vehicle_warhead_fuse(); - new spell_warhead_fuse(); + RegisterSpellScript(spell_z_check_aura); + RegisterSpellScript(spell_warhead_detonate); + RegisterSpellScript(spell_vehicle_warhead_fuse); + RegisterSpellScript(spell_warhead_fuse_aura); RegisterSpellScript(spell_q12227_outhouse_groans); RegisterSpellScript(spell_q12227_camera_shake); RegisterSpellScript(spell_frog_kiss); diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index ff8cb5f94..1e973f179 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -1063,203 +1063,164 @@ enum infraGreenBomberQuests SEAT_ENGINEERING = 2 }; -class spell_switch_infragreen_bomber_station : public SpellScriptLoader +class spell_switch_infragreen_bomber_station : public SpellScript { -public: - spell_switch_infragreen_bomber_station() : SpellScriptLoader("spell_switch_infragreen_bomber_station") { } + PrepareSpellScript(spell_switch_infragreen_bomber_station); - class spell_switch_infragreen_bomber_station_SpellScript : public SpellScript + uint8 GetSeatNumber(uint32 spellId) { - PrepareSpellScript(spell_switch_infragreen_bomber_station_SpellScript) + if (spellId == SPELL_ENGINEERING) + return 2; + else if (spellId == SPELL_ANTI_AIR_TURRET) + return 1; + else + return 0; + } - uint8 GetSeatNumber(uint32 spellId) - { - if (spellId == SPELL_ENGINEERING) - return 2; - else if (spellId == SPELL_ANTI_AIR_TURRET) - return 1; - else - return 0; - } - - void HandleDummy(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - Vehicle* kit = GetCaster()->GetVehicle(); - Unit* charmer = GetCaster()->GetCharmer(); // Player controlling station - if (!kit || !charmer) - return; - - uint8 seatNumber = GetSeatNumber(GetSpellInfo()->Id); - SeatMap::iterator itr = kit->GetSeatIteratorForPassenger(GetCaster()); - if (itr == kit->Seats.end()) - return; - - // Xinef: Same seat, no change required - if (seatNumber == itr->first) - return; - - if (Unit* station = kit->GetPassenger(seatNumber)) - station->HandleSpellClick(charmer, 0); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_switch_infragreen_bomber_station_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override + void HandleDummy(SpellEffIndex effIndex) { - return new spell_switch_infragreen_bomber_station_SpellScript(); + PreventHitDefaultEffect(effIndex); + Vehicle* kit = GetCaster()->GetVehicle(); + Unit* charmer = GetCaster()->GetCharmer(); // Player controlling station + if (!kit || !charmer) + return; + + uint8 seatNumber = GetSeatNumber(GetSpellInfo()->Id); + SeatMap::iterator itr = kit->GetSeatIteratorForPassenger(GetCaster()); + if (itr == kit->Seats.end()) + return; + + // Xinef: Same seat, no change required + if (seatNumber == itr->first) + return; + + if (Unit* station = kit->GetPassenger(seatNumber)) + station->HandleSpellClick(charmer, 0); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_switch_infragreen_bomber_station::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; -class spell_charge_shield_bomber : public SpellScriptLoader +class spell_charge_shield_bomber : public SpellScript { -public: - spell_charge_shield_bomber() : SpellScriptLoader("spell_charge_shield_bomber") { } + PrepareSpellScript(spell_charge_shield_bomber); - class spell_charge_shield_bomber_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_charge_shield_bomber_SpellScript) - - void HandleDummy(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - Unit* ship = GetCaster()->GetVehicleBase(); - if (!ship) - return; - - ship->CastSpell(ship, SPELL_INFRA_GREEN_SHIELD, true); - Aura* aura = ship->GetAura(SPELL_INFRA_GREEN_SHIELD); - if (!aura) - return; - - aura->ModStackAmount(GetEffectValue() - 1); - } - - void Register() override - { - if (m_scriptSpellId == SPELL_CHARGE_SHIELD) - OnEffectHitTarget += SpellEffectFn(spell_charge_shield_bomber_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_charge_shield_bomber_SpellScript(); + return ValidateSpellInfo({ SPELL_INFRA_GREEN_SHIELD }); } - class spell_charge_shield_bomber_AuraScript : public AuraScript + void HandleDummy(SpellEffIndex effIndex) { - PrepareAuraScript(spell_charge_shield_bomber_AuraScript); + PreventHitDefaultEffect(effIndex); + Unit* ship = GetCaster()->GetVehicleBase(); + if (!ship) + return; - void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; - } + ship->CastSpell(ship, SPELL_INFRA_GREEN_SHIELD, true); + Aura* aura = ship->GetAura(SPELL_INFRA_GREEN_SHIELD); + if (!aura) + return; - void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount) - { - uint32 absorbPct = GetStackAmount() / 2; - absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); - ModStackAmount(-1); - } + aura->ModStackAmount(GetEffectValue() - 1); + } - void Register() override - { - if (m_scriptSpellId == SPELL_INFRA_GREEN_SHIELD) - { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_charge_shield_bomber_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_charge_shield_bomber_AuraScript::Absorb, EFFECT_0); - } - } - }; - - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_charge_shield_bomber_AuraScript(); + if (m_scriptSpellId == SPELL_CHARGE_SHIELD) + OnEffectHitTarget += SpellEffectFn(spell_charge_shield_bomber::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; -class spell_fight_fire_bomber : public SpellScriptLoader +class spell_charge_shield_bomber_aura : public AuraScript { -public: - spell_fight_fire_bomber() : SpellScriptLoader("spell_fight_fire_bomber") { } + PrepareAuraScript(spell_charge_shield_bomber_aura); - class spell_fight_fire_bomber_SpellScript : public SpellScript + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - PrepareSpellScript(spell_fight_fire_bomber_SpellScript) + // Set absorbtion amount to unlimited + amount = -1; + } - void HandleDummy(SpellEffIndex effIndex) + void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount) + { + uint32 absorbPct = GetStackAmount() / 2; + absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); + ModStackAmount(-1); + } + + void Register() override + { + if (m_scriptSpellId == SPELL_INFRA_GREEN_SHIELD) { - PreventHitDefaultEffect(effIndex); - Vehicle* kit = GetCaster()->GetVehicle(); - if (!kit) - return; + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_charge_shield_bomber_aura::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_charge_shield_bomber_aura::Absorb, EFFECT_0); + } + } +}; - bool extinguished = false; - uint8 fireCount = 0; - for (uint8 seat = 3; seat <= 5; ++seat) - if (Unit* banner = kit->GetPassenger(seat)) - if (banner->HasAura(SPELL_COSMETIC_FIRE)) +class spell_fight_fire_bomber : public SpellScript +{ + PrepareSpellScript(spell_fight_fire_bomber); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_COSMETIC_FIRE, SPELL_EXTINGUISH_FIRE, SPELL_BURNING }); + } + + void HandleDummy(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + Vehicle* kit = GetCaster()->GetVehicle(); + if (!kit) + return; + + bool extinguished = false; + uint8 fireCount = 0; + for (uint8 seat = 3; seat <= 5; ++seat) + if (Unit* banner = kit->GetPassenger(seat)) + if (banner->HasAura(SPELL_COSMETIC_FIRE)) + { + if (!extinguished) { - if (!extinguished) + GetCaster()->CastSpell(banner, SPELL_EXTINGUISH_FIRE, true); + extinguished = true; + if (urand(0, 2)) { - GetCaster()->CastSpell(banner, SPELL_EXTINGUISH_FIRE, true); - extinguished = true; - if (urand(0, 2)) - { - banner->RemoveAurasDueToSpell(SPELL_COSMETIC_FIRE); - continue; - } + banner->RemoveAurasDueToSpell(SPELL_COSMETIC_FIRE); + continue; } - fireCount++; } + fireCount++; + } - if (fireCount == 0) - GetCaster()->RemoveAurasDueToSpell(SPELL_BURNING); - } + if (fireCount == 0) + GetCaster()->RemoveAurasDueToSpell(SPELL_BURNING); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_fight_fire_bomber_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_fight_fire_bomber_SpellScript(); + OnEffectHitTarget += SpellEffectFn(spell_fight_fire_bomber::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; -class spell_anti_air_rocket_bomber : public SpellScriptLoader +class spell_anti_air_rocket_bomber : public SpellScript { -public: - spell_anti_air_rocket_bomber() : SpellScriptLoader("spell_anti_air_rocket_bomber") { } + PrepareSpellScript(spell_anti_air_rocket_bomber); - class spell_anti_air_rocket_bomber_SpellScript : public SpellScript + void HandleDummy(SpellEffIndex effIndex) { - PrepareSpellScript(spell_anti_air_rocket_bomber_SpellScript) + PreventHitDefaultEffect(effIndex); + const WorldLocation* loc = GetExplTargetDest(); + GetCaster()->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), GetSpellInfo()->Effects[effIndex].CalcValue(), true); + } - void HandleDummy(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - const WorldLocation* loc = GetExplTargetDest(); - GetCaster()->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), GetSpellInfo()->Effects[effIndex].CalcValue(), true); - } - - void Register() override - { - OnEffectLaunch += SpellEffectFn(spell_anti_air_rocket_bomber_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_anti_air_rocket_bomber_SpellScript(); + OnEffectLaunch += SpellEffectFn(spell_anti_air_rocket_bomber::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -1439,33 +1400,22 @@ public: } }; -class spell_onslaught_or_call_bone_gryphon : public SpellScriptLoader +class spell_onslaught_or_call_bone_gryphon : public SpellScript { -public: - spell_onslaught_or_call_bone_gryphon() : SpellScriptLoader("spell_onslaught_or_call_bone_gryphon") { } + PrepareSpellScript(spell_onslaught_or_call_bone_gryphon); - class spell_onslaught_or_call_bone_gryphon_SpellScript : public SpellScript + void ChangeSummonPos(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_onslaught_or_call_bone_gryphon_SpellScript); + WorldLocation summonPos = *GetExplTargetDest(); + Position offset = { 0.0f, 0.0f, 3.0f, 0.0f }; + summonPos.RelocateOffset(offset); + SetExplTargetDest(summonPos); + GetHitDest()->RelocateOffset(offset); + } - void ChangeSummonPos(SpellEffIndex /*effIndex*/) - { - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, 3.0f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_onslaught_or_call_bone_gryphon_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_onslaught_or_call_bone_gryphon_SpellScript(); + OnEffectHit += SpellEffectFn(spell_onslaught_or_call_bone_gryphon::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); } }; @@ -2192,12 +2142,12 @@ void AddSC_icecrown() new npc_lord_arete(); new npc_boneguard_footman(); new npc_tirions_gambit_tirion(); - new spell_switch_infragreen_bomber_station(); - new spell_charge_shield_bomber(); - new spell_fight_fire_bomber(); - new spell_anti_air_rocket_bomber(); + RegisterSpellScript(spell_switch_infragreen_bomber_station); + RegisterSpellAndAuraScriptPair(spell_charge_shield_bomber, spell_charge_shield_bomber_aura); + RegisterSpellScript(spell_fight_fire_bomber); + RegisterSpellScript(spell_anti_air_rocket_bomber); new npc_infra_green_bomber_generic(); - new spell_onslaught_or_call_bone_gryphon(); + RegisterSpellScript(spell_onslaught_or_call_bone_gryphon); RegisterSpellScript(spell_deliver_gryphon); // Theirs diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 24e92b9d2..265041205 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -38,42 +38,31 @@ enum songOfWindandWater NPC_SOWAW_WATER_MODEL = 20076, }; -class spell_q12726_song_of_wind_and_water : public SpellScriptLoader +class spell_q12726_song_of_wind_and_water : public SpellScript { -public: - spell_q12726_song_of_wind_and_water() : SpellScriptLoader("spell_q12726_song_of_wind_and_water") { } + PrepareSpellScript(spell_q12726_song_of_wind_and_water); - class spell_q12726_song_of_wind_and_water_SpellScript : public SpellScript + void HandleHealPct(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_q12726_song_of_wind_and_water_SpellScript); - - void HandleHealPct(SpellEffIndex /*effIndex*/) + if (Creature* cr = GetHitCreature()) { - if (Creature* cr = GetHitCreature()) + //cr->UpdateEntry((cr->GetEntry() == NPC_SOWAW_WATER_ELEMENTAL ? NPC_SOWAW_WIND_ELEMENTAL : NPC_SOWAW_WATER_ELEMENTAL)); + cr->SetDisplayId(cr->GetDisplayId() == NPC_SOWAW_WATER_MODEL ? NPC_SOWAW_WIND_MODEL : NPC_SOWAW_WATER_MODEL); + if (Player* player = cr->GetCharmerOrOwnerPlayerOrPlayerItself()) { - //cr->UpdateEntry((cr->GetEntry() == NPC_SOWAW_WATER_ELEMENTAL ? NPC_SOWAW_WIND_ELEMENTAL : NPC_SOWAW_WATER_ELEMENTAL)); - cr->SetDisplayId(cr->GetDisplayId() == NPC_SOWAW_WATER_MODEL ? NPC_SOWAW_WIND_MODEL : NPC_SOWAW_WATER_MODEL); - if (Player* player = cr->GetCharmerOrOwnerPlayerOrPlayerItself()) - { - player->KilledMonsterCredit(cr->GetDisplayId() == NPC_SOWAW_WATER_MODEL ? 29008 : 29009); - CreatureTemplate const* ct = sObjectMgr->GetCreatureTemplate(cr->GetDisplayId() == NPC_SOWAW_WIND_MODEL ? NPC_SOWAW_WIND_ELEMENTAL : NPC_SOWAW_WATER_ELEMENTAL); - for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i) - cr->m_spells[i] = ct->spells[i]; + player->KilledMonsterCredit(cr->GetDisplayId() == NPC_SOWAW_WATER_MODEL ? 29008 : 29009); + CreatureTemplate const* ct = sObjectMgr->GetCreatureTemplate(cr->GetDisplayId() == NPC_SOWAW_WIND_MODEL ? NPC_SOWAW_WIND_ELEMENTAL : NPC_SOWAW_WATER_ELEMENTAL); + for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i) + cr->m_spells[i] = ct->spells[i]; - player->VehicleSpellInitialize(); - } + player->VehicleSpellInitialize(); } } + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12726_song_of_wind_and_water_SpellScript::HandleHealPct, EFFECT_2, SPELL_EFFECT_HEAL_PCT); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q12726_song_of_wind_and_water_SpellScript(); + OnEffectHitTarget += SpellEffectFn(spell_q12726_song_of_wind_and_water::HandleHealPct, EFFECT_2, SPELL_EFFECT_HEAL_PCT); } }; @@ -1140,64 +1129,58 @@ enum MiscLifewarden SPELL_WILD_GROWTH = 52948, }; -class spell_q12620_the_lifewarden_wrath : public SpellScriptLoader +class spell_q12620_the_lifewarden_wrath : public SpellScript { -public: - spell_q12620_the_lifewarden_wrath() : SpellScriptLoader("spell_q12620_the_lifewarden_wrath") { } + PrepareSpellScript(spell_q12620_the_lifewarden_wrath); - class spell_q12620_the_lifewarden_wrath_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_q12620_the_lifewarden_wrath_SpellScript); + return ValidateSpellInfo({ SPELL_FREYA_DUMMY, SPELL_FREYA_DUMMY_TRIGGER, SPELL_LASHER_EMERGE, SPELL_WILD_GROWTH, SPELL_LIFEFORCE }); + } - void HandleSendEvent(SpellEffIndex effIndex) + void HandleSendEvent(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + if (Unit* caster = GetCaster()) { - PreventHitDefaultEffect(effIndex); - - if (Unit* caster = GetCaster()) + if (Creature* presence = caster->FindNearestCreature(NPC_PRESENCE, 50.0f)) { - if (Creature* presence = caster->FindNearestCreature(NPC_PRESENCE, 50.0f)) + presence->AI()->Talk(WHISPER_ACTIVATE, caster); + presence->CastSpell(presence, SPELL_FREYA_DUMMY, true); // will target plants + // Freya Dummy could be scripted with the following code + + // Revive plants + std::list servants; + GetCaster()->GetCreatureListWithEntryInGrid(servants, NPC_SERVANT, 200.0f); + for (std::list::iterator itr = servants.begin(); itr != servants.end(); ++itr) { - presence->AI()->Talk(WHISPER_ACTIVATE, caster); - presence->CastSpell(presence, SPELL_FREYA_DUMMY, true); // will target plants - // Freya Dummy could be scripted with the following code + // Couldn't find a spell that does this + if ((*itr)->isDead()) + (*itr)->Respawn(true); - // Revive plants - std::list servants; - GetCaster()->GetCreatureListWithEntryInGrid(servants, NPC_SERVANT, 200.0f); - for (std::list::iterator itr = servants.begin(); itr != servants.end(); ++itr) - { - // Couldn't find a spell that does this - if ((*itr)->isDead()) - (*itr)->Respawn(true); + (*itr)->CastSpell(*itr, SPELL_FREYA_DUMMY_TRIGGER, true); + (*itr)->CastSpell(*itr, SPELL_LASHER_EMERGE, false); + (*itr)->CastSpell(*itr, SPELL_WILD_GROWTH, false); - (*itr)->CastSpell(*itr, SPELL_FREYA_DUMMY_TRIGGER, true); - (*itr)->CastSpell(*itr, SPELL_LASHER_EMERGE, false); - (*itr)->CastSpell(*itr, SPELL_WILD_GROWTH, false); - - if (Unit* target = (*itr)->SelectNearestTarget(150.0f)) - (*itr)->AI()->AttackStart(target); - } - - // Kill nearby enemies - std::list saboteurs; - caster->GetCreatureListWithEntryInGrid(saboteurs, NPC_SABOTEUR, 200.0f); - for (std::list::iterator itr = saboteurs.begin(); itr != saboteurs.end(); ++itr) - if ((*itr)->IsAlive()) - // Lifeforce has a cast duration, it should be cast at all saboteurs one by one - presence->CastSpell((*itr), SPELL_LIFEFORCE, false); + if (Unit* target = (*itr)->SelectNearestTarget(150.0f)) + (*itr)->AI()->AttackStart(target); } + + // Kill nearby enemies + std::list saboteurs; + caster->GetCreatureListWithEntryInGrid(saboteurs, NPC_SABOTEUR, 200.0f); + for (std::list::iterator itr = saboteurs.begin(); itr != saboteurs.end(); ++itr) + if ((*itr)->IsAlive()) + // Lifeforce has a cast duration, it should be cast at all saboteurs one by one + presence->CastSpell((*itr), SPELL_LIFEFORCE, false); } } + } - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q12620_the_lifewarden_wrath_SpellScript::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q12620_the_lifewarden_wrath_SpellScript(); + OnEffectHit += SpellEffectFn(spell_q12620_the_lifewarden_wrath::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT); } }; @@ -1228,101 +1211,95 @@ enum KickWhatKick SAY_DROSTAN_REPLY_MISS = 0, }; -class spell_q12589_shoot_rjr : public SpellScriptLoader +class spell_q12589_shoot_rjr : public SpellScript { -public: - spell_q12589_shoot_rjr() : SpellScriptLoader("spell_q12589_shoot_rjr") { } + PrepareSpellScript(spell_q12589_shoot_rjr); - class spell_q12589_shoot_rjr_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_q12589_shoot_rjr_SpellScript); + return ValidateSpellInfo({ SPELL_MISS_BIRD_APPLE, SPELL_BIRD_FALL, SPELL_MISS_APPLE, SPELL_HIT_APPLE, SPELL_APPLE_FALL }); + } - SpellCastResult CheckCast() + SpellCastResult CheckCast() + { + if (Unit* target = GetExplTargetUnit()) + if (target->GetEntry() == NPC_LUCKY_WILHELM) + return SPELL_CAST_OK; + + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_TARGET_WILHELM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 roll = urand(1, 100); + + uint8 ev; + if (roll <= 50) + ev = EVENT_MISS; + else if (roll <= 83) + ev = EVENT_HIT; + else + ev = EVENT_MISS_BIRD; + + Unit* shooter = GetCaster(); + Creature* wilhelm = GetHitUnit()->ToCreature(); + Creature* apple = shooter->FindNearestCreature(NPC_APPLE, 30); + Creature* drostan = shooter->FindNearestCreature(NPC_DROSTAN, 30); + + if (!wilhelm || !apple || !drostan) + return; + + switch (ev) { - if (Unit* target = GetExplTargetUnit()) - if (target->GetEntry() == NPC_LUCKY_WILHELM) - return SPELL_CAST_OK; + case EVENT_MISS_BIRD: + { + Creature* crunchy = shooter->FindNearestCreature(NPC_CRUNCHY, 30); + Creature* bird = shooter->FindNearestCreature(NPC_THICKBIRD, 30); - SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_TARGET_WILHELM); - return SPELL_FAILED_CUSTOM_ERROR; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - uint32 roll = urand(1, 100); - - uint8 ev; - if (roll <= 50) - ev = EVENT_MISS; - else if (roll <= 83) - ev = EVENT_HIT; - else - ev = EVENT_MISS_BIRD; - - Unit* shooter = GetCaster(); - Creature* wilhelm = GetHitUnit()->ToCreature(); - Creature* apple = shooter->FindNearestCreature(NPC_APPLE, 30); - Creature* drostan = shooter->FindNearestCreature(NPC_DROSTAN, 30); - - if (!wilhelm || !apple || !drostan) - return; - - switch (ev) - { - case EVENT_MISS_BIRD: + if (!bird || !crunchy) + ; // fall to EVENT_MISS + else { - Creature* crunchy = shooter->FindNearestCreature(NPC_CRUNCHY, 30); - Creature* bird = shooter->FindNearestCreature(NPC_THICKBIRD, 30); - - if (!bird || !crunchy) - ; // fall to EVENT_MISS - else - { - shooter->CastSpell(bird, SPELL_MISS_BIRD_APPLE); - bird->CastSpell(bird, SPELL_BIRD_FALL); - wilhelm->AI()->Talk(SAY_WILHELM_MISS); - drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS); - - Unit::Kill(bird, bird); - crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(), - bird->GetMapWaterOrGroundLevel(bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ())); - /// @todo Make crunchy perform emote eat when he reaches the bird - - break; - } - [[fallthrough]]; - } - case EVENT_MISS: - { - shooter->CastSpell(wilhelm, SPELL_MISS_APPLE); + shooter->CastSpell(bird, SPELL_MISS_BIRD_APPLE); + bird->CastSpell(bird, SPELL_BIRD_FALL); wilhelm->AI()->Talk(SAY_WILHELM_MISS); drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS); - break; - } - case EVENT_HIT: - { - shooter->CastSpell(apple, SPELL_HIT_APPLE); - apple->CastSpell(apple, SPELL_APPLE_FALL); - wilhelm->AI()->Talk(SAY_WILHELM_HIT); - if (Player* player = shooter->ToPlayer()) - player->KilledMonsterCredit(NPC_APPLE); - //apple->DespawnOrUnsummon(); zomg! + + Unit::Kill(bird, bird); + crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(), + bird->GetMapWaterOrGroundLevel(bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ())); + /// @todo Make crunchy perform emote eat when he reaches the bird break; } - } - } + [[fallthrough]]; + } + case EVENT_MISS: + { + shooter->CastSpell(wilhelm, SPELL_MISS_APPLE); + wilhelm->AI()->Talk(SAY_WILHELM_MISS); + drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS); + break; + } + case EVENT_HIT: + { + shooter->CastSpell(apple, SPELL_HIT_APPLE); + apple->CastSpell(apple, SPELL_APPLE_FALL); + wilhelm->AI()->Talk(SAY_WILHELM_HIT); + if (Player* player = shooter->ToPlayer()) + player->KilledMonsterCredit(NPC_APPLE); + //apple->DespawnOrUnsummon(); zomg! - void Register() override - { - OnCheckCast += SpellCheckCastFn(spell_q12589_shoot_rjr_SpellScript::CheckCast); - OnEffectHitTarget += SpellEffectFn(spell_q12589_shoot_rjr_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + break; + } } - }; + } - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q12589_shoot_rjr_SpellScript(); + OnCheckCast += SpellCheckCastFn(spell_q12589_shoot_rjr::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_q12589_shoot_rjr::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -1450,42 +1427,31 @@ enum ShangoTracks SAY_INCORRECT_TRACKS = 28635 }; -class spell_shango_tracks : public SpellScriptLoader +class spell_shango_tracks : public SpellScript { -public: - spell_shango_tracks() : SpellScriptLoader("spell_shango_tracks") { } + PrepareSpellScript(spell_shango_tracks); - class spell_shango_tracks_SpellScript : public SpellScript + void HandleScript(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_shango_tracks_SpellScript); - - void HandleScript(SpellEffIndex /*effIndex*/) + if (Unit* target = GetHitUnit()) { - if (Unit* target = GetHitUnit()) + switch (GetSpellInfo()->Id) { - switch (GetSpellInfo()->Id) - { - case SPELL_CORRECT_TRACKS: - target->Say(SAY_CORRECT_TRACKS, target); - break; - case SPELL_INCORRECT_TRACKS: - target->Say(SAY_INCORRECT_TRACKS, target); - break; - default: - break; - } + case SPELL_CORRECT_TRACKS: + target->Say(SAY_CORRECT_TRACKS, target); + break; + case SPELL_INCORRECT_TRACKS: + target->Say(SAY_INCORRECT_TRACKS, target); + break; + default: + break; } } + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_shango_tracks_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_shango_tracks_SpellScript(); + OnEffectHitTarget += SpellEffectFn(spell_shango_tracks::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -1524,7 +1490,7 @@ class spell_q12611_deathbolt : public SpellScript void AddSC_sholazar_basin() { // Ours - new spell_q12726_song_of_wind_and_water(); + RegisterSpellScript(spell_q12726_song_of_wind_and_water); new npc_artruis_the_hearthless(); new npc_still_at_it_trigger(); new npc_mcmanus(); @@ -1538,10 +1504,10 @@ void AddSC_sholazar_basin() new npc_engineer_helice(); new npc_adventurous_dwarf(); new npc_jungle_punch_target(); - new spell_q12620_the_lifewarden_wrath(); - new spell_q12589_shoot_rjr(); + RegisterSpellScript(spell_q12620_the_lifewarden_wrath); + RegisterSpellScript(spell_q12589_shoot_rjr); new npc_vics_flying_machine(); - new spell_shango_tracks(); + RegisterSpellScript(spell_shango_tracks); RegisterSpellScript(spell_q12611_deathbolt); } diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 94b38bd75..802f65eb3 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -586,48 +586,37 @@ public: } }; -class spell_q13003_thursting_hodirs_spear : public SpellScriptLoader +class spell_q13003_thursting_hodirs_spear_aura : public AuraScript { -public: - spell_q13003_thursting_hodirs_spear() : SpellScriptLoader("spell_q13003_thursting_hodirs_spear") { } + PrepareAuraScript(spell_q13003_thursting_hodirs_spear_aura); - class spell_q13003_thursting_hodirs_spear_AuraScript : public AuraScript + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - PrepareAuraScript(spell_q13003_thursting_hodirs_spear_AuraScript); + ModStackAmount(60); + } - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Creature* creature = GetUnitOwner()->ToCreature()) { - ModStackAmount(60); - } - - void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Creature* creature = GetUnitOwner()->ToCreature()) + if (!creature->IsInEvadeMode()) { - if (!creature->IsInEvadeMode()) - { - creature->RemoveAllAuras(); - creature->AI()->EnterEvadeMode(); - } + creature->RemoveAllAuras(); + creature->AI()->EnterEvadeMode(); } } + } - void HandlePeriodic(AuraEffect const* /* aurEff */) - { - ModStackAmount(-1); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_q13003_thursting_hodirs_spear_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - OnEffectApply += AuraEffectApplyFn(spell_q13003_thursting_hodirs_spear_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_q13003_thursting_hodirs_spear_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const override + void HandlePeriodic(AuraEffect const* /* aurEff */) { - return new spell_q13003_thursting_hodirs_spear_AuraScript(); + ModStackAmount(-1); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q13003_thursting_hodirs_spear_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + OnEffectApply += AuraEffectApplyFn(spell_q13003_thursting_hodirs_spear_aura::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_q13003_thursting_hodirs_spear_aura::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; @@ -639,59 +628,53 @@ enum q13007IronColossus SPELL_COLOSSUS_GROUND_SLAM = 61673 }; -class spell_q13007_iron_colossus : public SpellScriptLoader +class spell_q13007_iron_colossus : public SpellScript { -public: - spell_q13007_iron_colossus() : SpellScriptLoader("spell_q13007_iron_colossus") { } + PrepareSpellScript(spell_q13007_iron_colossus); - class spell_q13007_iron_colossus_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_q13007_iron_colossus_SpellScript); + return ValidateSpellInfo({ SPELL_JORMUNGAR_SUBMERGE_VISUAL, SPELL_COLOSSUS_GROUND_SLAM }); + } - void HandleDummy(SpellEffIndex effIndex) + void HandleDummy(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + Creature* caster = GetCaster()->ToCreature(); + if (!caster) + return; + + if (GetSpellInfo()->Id == SPELL_JORMUNGAR_SUBMERGE) { - PreventHitDefaultEffect(effIndex); - Creature* caster = GetCaster()->ToCreature(); - if (!caster) - return; + caster->CastSpell(caster, SPELL_JORMUNGAR_SUBMERGE_VISUAL, true); + caster->ApplySpellImmune(SPELL_COLOSSUS_GROUND_SLAM, IMMUNITY_ID, SPELL_COLOSSUS_GROUND_SLAM, true); + caster->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE); + caster->SetControlled(false, UNIT_STATE_ROOT); + for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i) + caster->m_spells[i] = 0; - if (GetSpellInfo()->Id == SPELL_JORMUNGAR_SUBMERGE) - { - caster->CastSpell(caster, SPELL_JORMUNGAR_SUBMERGE_VISUAL, true); - caster->ApplySpellImmune(SPELL_COLOSSUS_GROUND_SLAM, IMMUNITY_ID, SPELL_COLOSSUS_GROUND_SLAM, true); - caster->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE); - caster->SetControlled(false, UNIT_STATE_ROOT); + caster->m_spells[0] = SPELL_JORMUNGAR_EMERGE; + } + else + { + caster->RemoveAurasDueToSpell(SPELL_JORMUNGAR_SUBMERGE_VISUAL); + caster->ApplySpellImmune(SPELL_COLOSSUS_GROUND_SLAM, IMMUNITY_ID, SPELL_COLOSSUS_GROUND_SLAM, false); + caster->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE); + caster->SetControlled(true, UNIT_STATE_ROOT); + + if (CreatureTemplate const* ct = sObjectMgr->GetCreatureTemplate(caster->GetEntry())) for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i) - caster->m_spells[i] = 0; - - caster->m_spells[0] = SPELL_JORMUNGAR_EMERGE; - } - else - { - caster->RemoveAurasDueToSpell(SPELL_JORMUNGAR_SUBMERGE_VISUAL); - caster->ApplySpellImmune(SPELL_COLOSSUS_GROUND_SLAM, IMMUNITY_ID, SPELL_COLOSSUS_GROUND_SLAM, false); - caster->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE); - caster->SetControlled(true, UNIT_STATE_ROOT); - - if (CreatureTemplate const* ct = sObjectMgr->GetCreatureTemplate(caster->GetEntry())) - for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i) - caster->m_spells[i] = ct->spells[i]; - } - - if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) - player->VehicleSpellInitialize(); + caster->m_spells[i] = ct->spells[i]; } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q13007_iron_colossus_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) + player->VehicleSpellInitialize(); + } - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q13007_iron_colossus_SpellScript(); - }; + OnEffectHitTarget += SpellEffectFn(spell_q13007_iron_colossus::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // Theirs @@ -1026,45 +1009,34 @@ enum CloseRift SPELL_DESPAWN_RIFT = 61665 }; -class spell_close_rift : public SpellScriptLoader +class spell_close_rift_aura : public AuraScript { -public: - spell_close_rift() : SpellScriptLoader("spell_close_rift") { } + PrepareAuraScript(spell_close_rift_aura); - class spell_close_rift_AuraScript : public AuraScript + bool Load() override { - PrepareAuraScript(spell_close_rift_AuraScript); - - bool Load() override - { - _counter = 0; - return true; - } - - bool Validate(SpellInfo const* /*spell*/) override - { - return ValidateSpellInfo({ SPELL_DESPAWN_RIFT }); - } - - void HandlePeriodic(AuraEffect const* /* aurEff */) - { - if (++_counter == 5) - GetTarget()->CastSpell((Unit*)nullptr, SPELL_DESPAWN_RIFT, true); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_close_rift_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - - private: - uint8 _counter; - }; - - AuraScript* GetAuraScript() const override - { - return new spell_close_rift_AuraScript(); + _counter = 0; + return true; } + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_DESPAWN_RIFT }); + } + + void HandlePeriodic(AuraEffect const* /* aurEff */) + { + if (++_counter == 5) + GetTarget()->CastSpell((Unit*)nullptr, SPELL_DESPAWN_RIFT, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_close_rift_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + +private: + uint8 _counter; }; enum CollapsingCave @@ -1204,14 +1176,14 @@ void AddSC_storm_peaks() new npc_iron_watcher(); new npc_time_lost_proto_drake(); new npc_wild_wyrm(); - new spell_q13003_thursting_hodirs_spear(); - new spell_q13007_iron_colossus(); + RegisterSpellScript(spell_q13003_thursting_hodirs_spear_aura); + RegisterSpellScript(spell_q13007_iron_colossus); new npc_roxi_ramrocket(); new npc_brunnhildar_prisoner(); new npc_freed_protodrake(); new npc_icefang(); new npc_hyldsmeet_protodrake(); - new spell_close_rift(); + RegisterSpellScript(spell_close_rift_aura); new npc_vehicle_d16_propelled_delivery(); RegisterSpellScript(spell_q12823_remove_collapsing_cave_aura); } diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index fd925a1fb..3a4ea4d30 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -904,265 +904,198 @@ public: /* 56662, 61409 - Build Siege Vehicle (Force) 56664 - Build Catapult (Force) 56659 - Build Demolisher (Force) */ -class spell_wintergrasp_force_building : public SpellScriptLoader +class spell_wintergrasp_force_building : public SpellScript { -public: - spell_wintergrasp_force_building() : SpellScriptLoader("spell_wintergrasp_force_building") { } + PrepareSpellScript(spell_wintergrasp_force_building); - class spell_wintergrasp_force_building_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spell*/) override { - PrepareSpellScript(spell_wintergrasp_force_building_SpellScript); + return ValidateSpellInfo( + { + SPELL_BUILD_CATAPULT_FORCE, + SPELL_BUILD_DEMOLISHER_FORCE, + SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE, + SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE + }); + } - bool Validate(SpellInfo const* /*spell*/) override - { - return ValidateSpellInfo( - { - SPELL_BUILD_CATAPULT_FORCE, - SPELL_BUILD_DEMOLISHER_FORCE, - SPELL_BUILD_SIEGE_VEHICLE_FORCE_HORDE, - SPELL_BUILD_SIEGE_VEHICLE_FORCE_ALLIANCE - }); - } - - void HandleScript(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - if (Unit* target = GetHitUnit()) - target->CastSpell(target, GetEffectValue(), false, nullptr, nullptr, target->GetGUID()); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_wintergrasp_force_building_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void HandleScript(SpellEffIndex effIndex) { - return new spell_wintergrasp_force_building_SpellScript(); + PreventHitDefaultEffect(effIndex); + if (Unit* target = GetHitUnit()) + target->CastSpell(target, GetEffectValue(), false, nullptr, nullptr, target->GetGUID()); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_wintergrasp_force_building::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; /* 56661, 61408 - Build Siege Engine 56663 - Build Catapult 56575 - Build Demolisher */ -class spell_wintergrasp_create_vehicle : public SpellScriptLoader +class spell_wintergrasp_create_vehicle : public SpellScript { -public: - spell_wintergrasp_create_vehicle() : SpellScriptLoader("spell_wintergrasp_create_vehicle") { } + PrepareSpellScript(spell_wintergrasp_create_vehicle); - class spell_wintergrasp_create_vehicle_SpellScript : public SpellScript + void HandleSummon(SpellEffIndex effIndex) { - PrepareSpellScript(spell_wintergrasp_create_vehicle_SpellScript); + PreventHitEffect(effIndex); - void HandleSummon(SpellEffIndex effIndex) + if (Unit* caster = GetCaster()) { - PreventHitEffect(effIndex); - - if (Unit* caster = GetCaster()) + Unit* originalCaster = GetOriginalCaster(); + if (!originalCaster) { - Unit* originalCaster = GetOriginalCaster(); - if (!originalCaster) - { - return; - } + return; + } - SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(GetSpellInfo()->Effects[effIndex].MiscValueB); - if (!properties) - { - return; - } + SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(GetSpellInfo()->Effects[effIndex].MiscValueB); + if (!properties) + { + return; + } - uint32 entry = GetSpellInfo()->Effects[effIndex].MiscValue; - int32 duration = GetSpellInfo()->GetDuration(); - if (TempSummon* summon = caster->GetMap()->SummonCreature(entry, *GetHitDest(), properties, duration, originalCaster, GetSpellInfo()->Id)) + uint32 entry = GetSpellInfo()->Effects[effIndex].MiscValue; + int32 duration = GetSpellInfo()->GetDuration(); + if (TempSummon* summon = caster->GetMap()->SummonCreature(entry, *GetHitDest(), properties, duration, originalCaster, GetSpellInfo()->Id)) + { + if (summon->IsInMap(caster)) { - if (summon->IsInMap(caster)) - { - summon->SetCreatorGUID(originalCaster->GetGUID()); - summon->HandleSpellClick(caster); - } + summon->SetCreatorGUID(originalCaster->GetGUID()); + summon->HandleSpellClick(caster); } } } + } - void Register() override - { - OnEffectHit += SpellEffectFn(spell_wintergrasp_create_vehicle_SpellScript::HandleSummon, EFFECT_1, SPELL_EFFECT_SUMMON); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_wintergrasp_create_vehicle_SpellScript; + OnEffectHit += SpellEffectFn(spell_wintergrasp_create_vehicle::HandleSummon, EFFECT_1, SPELL_EFFECT_SUMMON); } }; // 49761 - Rocket-Propelled Goblin Grenade -class spell_wintergrasp_rp_gg : public SpellScriptLoader +class spell_wintergrasp_rp_gg : public SpellScript { -public: - spell_wintergrasp_rp_gg() : SpellScriptLoader("spell_wintergrasp_rp_gg") { } + PrepareSpellScript(spell_wintergrasp_rp_gg); - class spell_wintergrasp_rp_gg_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_wintergrasp_rp_gg_SpellScript); + return ValidateSpellInfo({ SPELL_RP_GG_TRIGGER_MISSILE }); + } - bool handled; - bool Load() override - { - handled = false; - return true; - } - - void HandleFinish() - { - if (!GetExplTargetDest()) - return; - - GetCaster()->CastSpell(GetExplTargetDest()->GetPositionX(), GetExplTargetDest()->GetPositionY(), GetExplTargetDest()->GetPositionZ(), SPELL_RP_GG_TRIGGER_MISSILE, true); - } - - void Register() override - { - AfterCast += SpellCastFn(spell_wintergrasp_rp_gg_SpellScript::HandleFinish); - } - }; - - SpellScript* GetSpellScript() const override + bool handled; + bool Load() override { - return new spell_wintergrasp_rp_gg_SpellScript(); + handled = false; + return true; + } + + void HandleFinish() + { + if (!GetExplTargetDest()) + return; + + GetCaster()->CastSpell(GetExplTargetDest()->GetPositionX(), GetExplTargetDest()->GetPositionY(), GetExplTargetDest()->GetPositionZ(), SPELL_RP_GG_TRIGGER_MISSILE, true); + } + + void Register() override + { + AfterCast += SpellCastFn(spell_wintergrasp_rp_gg::HandleFinish); } }; // 58622 - Teleport to Lake Wintergrasp -class spell_wintergrasp_portal : public SpellScriptLoader +class spell_wintergrasp_portal : public SpellScript { -public: - spell_wintergrasp_portal() : SpellScriptLoader("spell_wintergrasp_portal") { } + PrepareSpellScript(spell_wintergrasp_portal); - class spell_wintergrasp_portal_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareSpellScript(spell_wintergrasp_portal_SpellScript); + return ValidateSpellInfo({ SPELL_TELEPORT_TO_FORTRESS }); + } - void HandleScript(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - Player* target = GetHitPlayer(); - Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); - if (!wintergrasp || !target || target->GetLevel() < 75 || (wintergrasp->GetDefenderTeam() != target->GetTeamId())) - return; - - target->CastSpell(target, SPELL_TELEPORT_TO_FORTRESS, true); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_wintergrasp_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void HandleScript(SpellEffIndex effIndex) { - return new spell_wintergrasp_portal_SpellScript(); + PreventHitDefaultEffect(effIndex); + Player* target = GetHitPlayer(); + Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); + if (!wintergrasp || !target || target->GetLevel() < 75 || (wintergrasp->GetDefenderTeam() != target->GetTeamId())) + return; + + target->CastSpell(target, SPELL_TELEPORT_TO_FORTRESS, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_wintergrasp_portal::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; // 36444 - Wintergrasp Water -class spell_wintergrasp_water : public SpellScriptLoader +class spell_wintergrasp_water : public SpellScript { -public: - spell_wintergrasp_water() : SpellScriptLoader("spell_wintergrasp_water") { } + PrepareSpellScript(spell_wintergrasp_water); - class spell_wintergrasp_water_SpellScript : public SpellScript + SpellCastResult CheckCast() { - PrepareSpellScript(spell_wintergrasp_water_SpellScript); + Unit* target = GetCaster(); + if (!target || !target->IsVehicle()) + return SPELL_FAILED_DONT_REPORT; - SpellCastResult CheckCast() - { - Unit* target = GetCaster(); - if (!target || !target->IsVehicle()) - return SPELL_FAILED_DONT_REPORT; + return SPELL_CAST_OK; + } - return SPELL_CAST_OK; - } - - void Register() override - { - OnCheckCast += SpellCheckCastFn(spell_wintergrasp_water_SpellScript::CheckCast); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_wintergrasp_water_SpellScript(); + OnCheckCast += SpellCheckCastFn(spell_wintergrasp_water::CheckCast); } }; // 52107 - (Spell not exist in DBC) -class spell_wintergrasp_hide_small_elementals : public SpellScriptLoader +class spell_wintergrasp_hide_small_elementals_aura : public AuraScript { -public: - spell_wintergrasp_hide_small_elementals() : SpellScriptLoader("spell_wintergrasp_hide_small_elementals") { } + PrepareAuraScript(spell_wintergrasp_hide_small_elementals_aura); - class spell_wintergrasp_hide_small_elementals_AuraScript : public AuraScript + void HandlePeriodicDummy(AuraEffect const* /*aurEff*/) { - PrepareAuraScript(spell_wintergrasp_hide_small_elementals_AuraScript); + Unit* target = GetTarget(); + Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()); + bool enable = !Bf || !Bf->IsWarTime(); + target->SetPhaseMask(enable ? 1 : 512, true); + PreventDefaultAction(); + } - void HandlePeriodicDummy(AuraEffect const* /*aurEff*/) - { - Unit* target = GetTarget(); - Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()); - bool enable = !Bf || !Bf->IsWarTime(); - target->SetPhaseMask(enable ? 1 : 512, true); - PreventDefaultAction(); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_wintergrasp_hide_small_elementals_AuraScript::HandlePeriodicDummy, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_wintergrasp_hide_small_elementals_AuraScript(); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_wintergrasp_hide_small_elementals_aura::HandlePeriodicDummy, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); } }; /* 57610, 51422 - Cannon 50999 - Boulder 57607 - Plague Slime */ -class spell_wg_reduce_damage_by_distance : public SpellScriptLoader +class spell_wg_reduce_damage_by_distance : public SpellScript { -public: - spell_wg_reduce_damage_by_distance() : SpellScriptLoader("spell_wg_reduce_damage_by_distance") { } + PrepareSpellScript(spell_wg_reduce_damage_by_distance); - class spell_wg_reduce_damage_by_distance_SpellScript : public SpellScript + void RecalculateDamage() { - PrepareSpellScript(spell_wg_reduce_damage_by_distance_SpellScript); + if (!GetExplTargetDest() || !GetHitUnit()) + return; - void RecalculateDamage() - { - if (!GetExplTargetDest() || !GetHitUnit()) - return; + float maxDistance = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); // Xinef: always stored in EFFECT_0 + float distance = std::min(GetHitUnit()->GetDistance(*GetExplTargetDest()), maxDistance); - float maxDistance = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); // Xinef: always stored in EFFECT_0 - float distance = std::min(GetHitUnit()->GetDistance(*GetExplTargetDest()), maxDistance); + int32 damage = std::max(0, int32(GetHitDamage() - floor(GetHitDamage() * (distance / maxDistance)))); + SetHitDamage(damage); + } - int32 damage = std::max(0, int32(GetHitDamage() - floor(GetHitDamage() * (distance / maxDistance)))); - SetHitDamage(damage); - } - - void Register() override - { - OnHit += SpellHitFn(spell_wg_reduce_damage_by_distance_SpellScript::RecalculateDamage); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_wg_reduce_damage_by_distance_SpellScript(); + OnHit += SpellHitFn(spell_wg_reduce_damage_by_distance::RecalculateDamage); } }; @@ -1242,13 +1175,13 @@ void AddSC_wintergrasp() new go_wg_vehicle_teleporter(); // SPELLs - new spell_wintergrasp_force_building(); - new spell_wintergrasp_create_vehicle(); - new spell_wintergrasp_rp_gg(); - new spell_wintergrasp_portal(); - new spell_wintergrasp_water(); - new spell_wintergrasp_hide_small_elementals(); - new spell_wg_reduce_damage_by_distance(); + RegisterSpellScript(spell_wintergrasp_force_building); + RegisterSpellScript(spell_wintergrasp_create_vehicle); + RegisterSpellScript(spell_wintergrasp_rp_gg); + RegisterSpellScript(spell_wintergrasp_portal); + RegisterSpellScript(spell_wintergrasp_water); + RegisterSpellScript(spell_wintergrasp_hide_small_elementals_aura); + RegisterSpellScript(spell_wg_reduce_damage_by_distance); // ACHIEVEMENTs new achievement_wg_didnt_stand_a_chance(); diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index 9acc357fa..9cf5638f0 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -38,6 +38,7 @@ enum Spells enum Misc { + GROUP_BITE = 1, ENTRY_FOCUS_FIRE = 18374, EMOTE_FOCUSED = 0 }; @@ -105,14 +106,11 @@ struct boss_shirrak_the_dead_watcher : public BossAI }).Schedule(28s, [this](TaskContext context) { DoCastSelf(SPELL_ATTRACT_MAGIC); + context.RescheduleGroup(GROUP_BITE, 1500ms); context.Repeat(30s); - scheduler.Schedule(1500ms, [this](TaskContext context) - { - DoCastSelf(SPELL_CARNIVOROUS_BITE); - context.Repeat(10s); - }); }).Schedule(10s, [this](TaskContext context) { + context.SetGroup(GROUP_BITE); DoCastSelf(SPELL_CARNIVOROUS_BITE); context.Repeat(10s); }).Schedule(17s, [this](TaskContext context) diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index eb642e0a5..c0e99e6ad 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -57,118 +57,80 @@ enum Spells enum Misc { - EVENT_KILL_TALK = 1, - EVENT_CHECK_HEALTH = 2, - EVENT_RANDOM_TALK = 3, - EVENT_SPELL_ENRAGE = 4, - EVENT_SPELL_PRISMATIC_AURA = 5, - EVENT_SPELL_SILENCING_SHRIEK = 6, - EVENT_SPELL_FATAL_ATTRACTION = 7, - EVENT_SPELL_SABER_LASH = 8 + GROUP_ENRAGE = 1 }; -class boss_mother_shahraz : public CreatureScript +struct boss_mother_shahraz : public BossAI { -public: - boss_mother_shahraz() : CreatureScript("boss_mother_shahraz") { } + boss_mother_shahraz(Creature* creature) : BossAI(creature, DATA_MOTHER_SHAHRAZ), _canTalk(true) { } - CreatureAI* GetAI(Creature* creature) const override + void Reset() override { - return GetBlackTempleAI(creature); + _Reset(); + me->m_Events.CancelEventGroup(GROUP_ENRAGE); + _canTalk = true; + + ScheduleHealthCheckEvent(10, [&] { + DoCastSelf(SPELL_FRENZY, true); + Talk(SAY_EMOTE_FRENZY); + }); } - struct boss_shahrazAI : public BossAI + void JustEngagedWith(Unit* who) override { - boss_shahrazAI(Creature* creature) : BossAI(creature, DATA_MOTHER_SHAHRAZ) + BossAI::JustEngagedWith(who); + Talk(SAY_AGGRO); + DoCastSelf(SPELL_SABER_LASH_AURA, true); + DoCastSelf(SPELL_RANDOM_PERIODIC, true); + + ScheduleTimedEvent(4s, [&] { + DoCastVictim(SPELL_SABER_LASH); + }, 30s); + + ScheduleTimedEvent(1min, [&] { + Talk(SAY_TAUNT); + }, 1min, 2min); + + ScheduleTimedEvent(0s, [&] { + DoCastSelf(RAND(SPELL_PRISMATIC_AURA_SHADOW, SPELL_PRISMATIC_AURA_FIRE, SPELL_PRISMATIC_AURA_NATURE, SPELL_PRISMATIC_AURA_ARCANE, SPELL_PRISMATIC_AURA_FROST, SPELL_PRISMATIC_AURA_HOLY)); + }, 15s); + + ScheduleTimedEvent(30s, [&] { + DoCastAOE(SPELL_SILENCING_SHRIEK); + }, 30s); + + ScheduleTimedEvent(50s, [&] { + Talk(SAY_SPELL); + me->CastCustomSpell(SPELL_FATAL_ATTRACTION, SPELLVALUE_MAX_TARGETS, 3, me, false); + }, 1min); + + me->m_Events.AddEventAtOffset([&] { + DoCastSelf(SPELL_ENRAGE, true); + Talk(SAY_ENRAGE); + }, 10min); + } + + void KilledUnit(Unit* /*victim*/) override + { + if (_canTalk) { + Talk(SAY_SLAY); + _canTalk = false; + + ScheduleUniqueTimedEvent(6s, [&] { + _canTalk = true; + }, 1); } + } - void Reset() override - { - BossAI::Reset(); - } + void JustDied(Unit* killer) override + { + BossAI::JustDied(killer); + Talk(SAY_DEATH); + } - void JustEngagedWith(Unit* who) override - { - BossAI::JustEngagedWith(who); - Talk(SAY_AGGRO); - - me->CastSpell(me, SPELL_SABER_LASH_AURA, true); - me->CastSpell(me, SPELL_RANDOM_PERIODIC, true); - events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000); - events.ScheduleEvent(EVENT_RANDOM_TALK, 60000); - events.ScheduleEvent(EVENT_SPELL_PRISMATIC_AURA, 0); - events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000); - events.ScheduleEvent(EVENT_SPELL_SILENCING_SHRIEK, 30000); - events.ScheduleEvent(EVENT_SPELL_FATAL_ATTRACTION, 50000); - events.ScheduleEvent(EVENT_SPELL_SABER_LASH, 4000); - } - - void KilledUnit(Unit* /*victim*/) override - { - if (events.GetNextEventTime(EVENT_KILL_TALK) == 0) - { - Talk(SAY_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6000); - } - } - - void JustDied(Unit* killer) override - { - BossAI::JustDied(killer); - Talk(SAY_DEATH); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - switch (events.ExecuteEvent()) - { - case EVENT_CHECK_HEALTH: - if (HealthBelowPct(10)) - { - me->CastSpell(me, SPELL_FRENZY, true); - Talk(SAY_EMOTE_FRENZY); - break; - } - events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000); - break; - case EVENT_SPELL_ENRAGE: - me->CastSpell(me, SPELL_ENRAGE, true); - Talk(SAY_ENRAGE); - break; - case EVENT_RANDOM_TALK: - Talk(SAY_TAUNT); - events.ScheduleEvent(EVENT_RANDOM_TALK, urand(60000, 120000)); - break; - case EVENT_SPELL_SABER_LASH: - me->CastSpell(me->GetVictim(), SPELL_SABER_LASH, false); - events.ScheduleEvent(EVENT_SPELL_SABER_LASH, 30000); - break; - case EVENT_SPELL_PRISMATIC_AURA: - me->CastSpell(me, RAND(SPELL_PRISMATIC_AURA_SHADOW, SPELL_PRISMATIC_AURA_FIRE, SPELL_PRISMATIC_AURA_NATURE, SPELL_PRISMATIC_AURA_ARCANE, SPELL_PRISMATIC_AURA_FROST, SPELL_PRISMATIC_AURA_HOLY), false); - events.ScheduleEvent(EVENT_SPELL_PRISMATIC_AURA, 15000); - break; - case EVENT_SPELL_SILENCING_SHRIEK: - me->CastSpell(me, SPELL_SILENCING_SHRIEK, false); - events.ScheduleEvent(EVENT_SPELL_SILENCING_SHRIEK, 30000); - break; - case EVENT_SPELL_FATAL_ATTRACTION: - Talk(SAY_SPELL); - me->CastCustomSpell(SPELL_FATAL_ATTRACTION, SPELLVALUE_MAX_TARGETS, 3, me, false); - events.ScheduleEvent(EVENT_SPELL_FATAL_ATTRACTION, 60000); - break; - } - - DoMeleeAttackIfReady(); - } - }; + private: + bool _canTalk; }; class spell_mother_shahraz_random_periodic_aura : public AuraScript @@ -321,7 +283,7 @@ class spell_mother_shahraz_fatal_attraction_aura : public AuraScript void AddSC_boss_mother_shahraz() { - new boss_mother_shahraz(); + RegisterBlackTempleCreatureAI(boss_mother_shahraz); RegisterSpellScript(spell_mother_shahraz_random_periodic_aura); RegisterSpellScript(spell_mother_shahraz_beam_periodic_aura); RegisterSpellScript(spell_mother_shahraz_saber_lash_aura); diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index bccd14d26..ee667ba0a 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -308,7 +308,7 @@ struct npc_shattrath_daily_quest : public NullCreatureAI { Field *fields = result->Fetch(); int quest_id = fields[0].Get(); - uint32 templateID; + uint32 templateID = 0; if (creature == NPC_SHATTRATH_DAILY_H) { diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 47f95c91a..198b46952 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -5221,7 +5221,7 @@ class spell_gen_sober_up : public AuraScript if (!target && !target->ToPlayer()) return; - SpellEffIndex InebriateEffIndex; + SpellEffIndex InebriateEffIndex = EFFECT_0; if (Player* player = target->ToPlayer()) { switch (GetSpellInfo()->Id) diff --git a/src/server/shared/Network/Socket.h b/src/server/shared/Network/Socket.h index 51513ba97..e92f2c42e 100644 --- a/src/server/shared/Network/Socket.h +++ b/src/server/shared/Network/Socket.h @@ -261,7 +261,7 @@ private: const uint8 addressFamily = readPointer[13]; const uint16 len = (readPointer[14] << 8) | readPointer[15]; - if (len+16 > packet.GetActiveSize()) + if (static_cast(len+16) > packet.GetActiveSize()) { AsyncReadProxyHeader(); return;