From 1c523bd611934a780b222218d9f11c43cf43f233 Mon Sep 17 00:00:00 2001 From: Revision Date: Thu, 5 Jan 2023 00:30:57 +0100 Subject: [PATCH 01/39] feat(Core/Config): Allow disable points of interest for quests (#14501) --- src/server/apps/worldserver/worldserver.conf.dist | 8 ++++++++ src/server/game/Globals/ObjectMgr.cpp | 7 +++++++ src/server/game/World/IWorld.h | 1 + src/server/game/World/World.cpp | 2 ++ 4 files changed, 18 insertions(+) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 74889c9e6..576f80eba 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -3803,6 +3803,14 @@ JoinBGAndLFG.Enable = 0 LeaveGroupOnLogout.Enabled = 1 +# +# QuestPOI.Enabled +# Description: Show points of interest on the map +# Default: 1 - Enabled +# 0 - Disabled + +QuestPOI.Enabled = 1 + # # ChangeFaction.MaxMoney # Description: Maximum amount of gold allowed on the character to perform a faction change. diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 7b892dd64..8b95c93be 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7743,6 +7743,13 @@ void ObjectMgr::LoadPointsOfInterest() void ObjectMgr::LoadQuestPOI() { + if (!sWorld->getBoolConfig(CONFIG_QUEST_POI_ENABLED)) + { + LOG_INFO("server.loading", ">> Loaded 0 quest POI definitions. Disabled by config."); + LOG_INFO("server.loading", " "); + return; + } + uint32 oldMSTime = getMSTime(); _questPOIStore.clear(); // need for reload case diff --git a/src/server/game/World/IWorld.h b/src/server/game/World/IWorld.h index e1017ebf3..47d6e34ab 100644 --- a/src/server/game/World/IWorld.h +++ b/src/server/game/World/IWorld.h @@ -174,6 +174,7 @@ enum WorldBoolConfigs CONFIG_ALLOW_JOIN_BG_AND_LFG, CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS, CONFIG_LEAVE_GROUP_ON_LOGOUT, + CONFIG_QUEST_POI_ENABLED, CONFIG_VMAP_BLIZZLIKE_PVP_LOS, CONFIG_OBJECT_SPARKLES, CONFIG_LOW_LEVEL_REGEN_BOOST, diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 9aa0286d6..8310e9506 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1279,6 +1279,8 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_LEAVE_GROUP_ON_LOGOUT] = sConfigMgr->GetOption("LeaveGroupOnLogout.Enabled", true); + m_bool_configs[CONFIG_QUEST_POI_ENABLED] = sConfigMgr->GetOption("QuestPOI.Enabled", true); + m_int_configs[CONFIG_CHANGE_FACTION_MAX_MONEY] = sConfigMgr->GetOption("ChangeFaction.MaxMoney", 0); ///- Read the "Data" directory from the config file From f162af54b563661e19a9f8db5912a8b6e57e418f Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Thu, 5 Jan 2023 09:41:15 -0300 Subject: [PATCH 02/39] fix(DB/SAI): Implement Kel'Thuzad and Helcular RP event in Old Hillsbrad Foothills (#14385) Create rev_1672205660081542200.sql --- .../rev_1672205660081542200.sql | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1672205660081542200.sql diff --git a/data/sql/updates/pending_db_world/rev_1672205660081542200.sql b/data/sql/updates/pending_db_world/rev_1672205660081542200.sql new file mode 100644 index 000000000..94b153996 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1672205660081542200.sql @@ -0,0 +1,82 @@ +-- Pathing for Kel'Thuzad Entry: 20350 +UPDATE `creature` SET `wander_distance`=0,`MovementType`=0,`position_x`=1777.6586,`position_y`=1058.5917,`position_z`=7.1008496 WHERE `id1`=20350; -- Kel'Thuzad +UPDATE `creature` SET `wander_distance`=0,`MovementType`=0,`position_x`=1777.6586,`position_y`=1058.5917,`position_z`=7.1008496 WHERE `id1`=20353; -- Helcular +DELETE FROM `waypoints` WHERE `entry`=20350; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`point_comment`) VALUES +(20350,1,1777.6586,1058.5917,7.1008496,NULL,0,'Kel\'Thuzad'), +(20350,2,1785.8223,1057.3224,7.46938,NULL,0,'Kel\'Thuzad'), +(20350,3,1802.3959,1061.4431,8.593266,NULL,0,'Kel\'Thuzad'), +(20350,4,1816.5465,1069.8398,10.483082,NULL,0,'Kel\'Thuzad'), +(20350,5,1829.2474,1075.3346,11.50713,NULL,0,'Kel\'Thuzad'), +(20350,6,1840.346,1076.9652,13.023953,NULL,0,'Kel\'Thuzad'), +(20350,7,1854.4879,1072.2803,15.144437,NULL,0,'Kel\'Thuzad'), +(20350,8,1864.5223,1065.2603,15.909603,NULL,0,'Kel\'Thuzad'), +(20350,9,1883.5319,1056.9219,18.170403,NULL,0,'Kel\'Thuzad'), +(20350,10,1896.4857,1052.8398,17.920403,NULL,0,'Kel\'Thuzad'), +(20350,11,1917.8785,1051.4784,19.08978,NULL,0,'Kel\'Thuzad'), +(20350,12,1930.2494,1051.6864,19.907164,NULL,0,'Kel\'Thuzad'), +(20350,13,1947.8518,1045.3527,21.082039,NULL,0,'Kel\'Thuzad'), +(20350,14,1958.8525,1035.1572,23.207039,NULL,0,'Kel\'Thuzad'), +(20350,15,1969.4431,1028.3741,24.45784,NULL,0,'Kel\'Thuzad'), +(20350,16,1980.2985,1028.6941,25.294388,NULL,0,'Kel\'Thuzad'), +(20350,17,1969.4431,1028.3741,24.45784,NULL,0,'Kel\'Thuzad'), +(20350,18,1958.8616,1035.1549,23.17591,NULL,0,'Kel\'Thuzad'), +(20350,19,1947.8604,1045.3506,20.957039,NULL,0,'Kel\'Thuzad'), +(20350,20,1930.2494,1051.6864,19.907164,NULL,0,'Kel\'Thuzad'), +(20350,21,1917.8785,1051.4784,19.08978,NULL,0,'Kel\'Thuzad'), +(20350,22,1896.4857,1052.8398,17.920403,NULL,0,'Kel\'Thuzad'), +(20350,23,1883.5319,1056.9219,18.170403,NULL,0,'Kel\'Thuzad'), +(20350,24,1864.5223,1065.2603,15.909603,NULL,0,'Kel\'Thuzad'), +(20350,25,1854.4879,1072.2803,15.144437,NULL,0,'Kel\'Thuzad'), +(20350,26,1840.346,1076.9652,13.023953,NULL,0,'Kel\'Thuzad'), +(20350,27,1829.2474,1075.3346,11.50713,NULL,0,'Kel\'Thuzad'), +(20350,28,1816.5465,1069.8398,10.483082,NULL,0,'Kel\'Thuzad'), +(20350,29,1802.3959,1061.4431,8.593266,NULL,0,'Kel\'Thuzad'), +(20350,30,1785.8223,1057.3224,7.46938,NULL,0,'Kel\'Thuzad'); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 20350); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(20350, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 53, 0, 20350, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Reset - Start Waypoint'), +(20350, 0, 1, 0, 40, 0, 2, 0, 0, 20350, 0, 0, 0, 80, 2035000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Waypoint 0 Reached - Run Script (2% Chance)'); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2035000); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2035000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 54, 49200, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Pause Waypoint'), +(2035000, 9, 1, 0, 0, 0, 100, 0, 2400, 2400, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 20353, 10, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Set Data 1 1'), -- Intentionally delayed so that Helcular can catch up and Orientation is set correctly +(2035000, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 20353, 10, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Set Orientation Closest Creature \'Helcular\''), +(2035000, 9, 3, 0, 0, 0, 100, 0, 2600, 2600, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Say Line 0'), +(2035000, 9, 4, 0, 0, 0, 100, 0, 8400, 8400, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Say Line 1'), +(2035000, 9, 5, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Say Line 2'), +(2035000, 9, 6, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Say Line 3'), +(2035000, 9, 7, 0, 0, 0, 100, 0, 11000, 11000, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Say Line 4'), +(2035000, 9, 8, 0, 0, 0, 100, 0, 1200, 1200, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Kel\'Thuzad - On Script - Say Line 5'); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 20353); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(20353, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 29, 0.05, 90, 0, 0, 0, 0, 19, 20350, 10, 0, 0, 0, 0, 0, 0, 'Helcular - On Reset - Start Follow Closest Creature \'Kel\'Thuzad\''), +(20353, 0, 1, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 80, 2035300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Helcular - On Data Set 1 1 - Run Script'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2035300) AND (`source_type` = 9); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2035300, 9, 0, 0, 0, 0, 100, 0, 2400, 2400, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 20350, 10, 0, 0, 0, 0, 0, 0, 'Helcular - On Script - Set Orientation Closest Creature \'Kel\'Thuzad\''), +(2035300, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Helcular - On Script - Say Line 0'), +(2035300, 9, 2, 0, 0, 0, 100, 0, 1200, 1200, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Helcular - On Script - Say Line 1'), +(2035300, 9, 3, 0, 0, 0, 100, 0, 8400, 8400, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Helcular - On Script - Say Line 2'), +(2035300, 9, 4, 0, 0, 0, 100, 0, 17000, 17000, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Helcular - On Script - Say Line 3'), +(2035300, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Helcular - On Script - Set Data 1 0'); + +DELETE FROM `creature_text` WHERE `CreatureID`=20350; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(20350, 0, 0, 'Keep your voice down, Helcular. Strangers abound...', 12, 0, 100, 1, 0, 0, 18033, 0, 'Kel\'Thuzad'), +(20350, 1, 0, 'Necromancy. It is called necromancy. And yes, I have it within my power to bless you with this gift.', 12, 0, 100, 1, 0, 0, 18042, 0, 'Kel\'Thuzad'), +(20350, 2, 0, 'That is none of your concern, Helcular, as you are neither Kirin Tor nor a necromancer.', 12, 0, 100, 274, 0, 0, 18044, 0, 'Kel\'Thuzad'), +(20350, 3, 0, 'But to be perfectly frank, I do not give a damn what the Kirin Tor think! They are fools, set in their archaic ways.', 12, 0, 100, 1, 0, 0, 18050, 0, 'Kel\'Thuzad'), +(20350, 4, 0, '%s nods.', 16, 0, 100, 0, 0, 0, 18034, 0, 'Kel\'Thuzad'), +(20350, 5, 0, 'In due time, Helcular... All in due time...', 12, 0, 100, 1, 0, 0, 18052, 0, 'Kel\'Thuzad'); + +DELETE FROM `creature_text` WHERE `CreatureID`=20353; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(20353, 0, 0, '%s nods.', 16, 0, 100, 273, 0, 0, 18034, 0, 'Helcular'), +(20353, 1, 0, 'So you can teach me this... this...', 12, 0, 100, 6, 0, 0, 18041, 0, 'Helcular'), +(20353, 2, 0, 'And the Kirin Tor? What have they to say of necromancy?', 12, 0, 100, 6, 0, 0, 18043, 0, 'Helcular'), +(20353, 3, 0, 'Then teach me, Kel\'Thuzad. Teach me everything you know...', 12, 0, 100, 1, 0, 0, 18051, 0, 'Helcular'); From 25971eedb65ef4bb2992802d45b9e0af0abfefc1 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Thu, 5 Jan 2023 09:41:27 -0300 Subject: [PATCH 03/39] fix(DB/SAI): Implement Captain Sanders and Edward Hanes RP event in Old Hillsbrad Foothills (#14396) Create rev_1672240491963126000.sql --- .../rev_1672240491963126000.sql | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1672240491963126000.sql diff --git a/data/sql/updates/pending_db_world/rev_1672240491963126000.sql b/data/sql/updates/pending_db_world/rev_1672240491963126000.sql new file mode 100644 index 000000000..1202193a2 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1672240491963126000.sql @@ -0,0 +1,178 @@ +-- Set correct spawn pos +UPDATE `creature` SET `position_x`=1815.927978515625, `position_y`=1020.21331787109375, `position_z`=11.68548202514648437, `orientation`=4.817108631134033203, `equipment_id`=1, `VerifiedBuild`=47187 WHERE `id1`=20351; +UPDATE `creature` SET `position_x`=1814.1473388671875, `position_y`=1018.730712890625, `position_z`=11.68548202514648437, `orientation`=6.2657318115234375, `equipment_id`=1, `VerifiedBuild`=47187 WHERE `id1`=20400; + +-- Set Equipment (previously empty) +DELETE FROM `creature_equip_template` WHERE (`CreatureID` IN (20351, 20400)); +INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `ItemID2`, `ItemID3`, `VerifiedBuild`) VALUES +(20351, 1, 2704, 0, 0, 0), +(20400, 1, 2704, 0, 0, 0); + +DELETE FROM `creature_template_addon` WHERE (`entry` IN (20351, 20400)); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(20351, 0, 0, 0, 1, 0, 0, ''), +(20400, 0, 0, 0, 1, 0, 0, ''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 20351; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 20351); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(20351, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Reset - Set Event Phase 1'), +(20351, 0, 1, 0, 60, 1, 100, 0, 3600, 3600, 3600, 3600, 0, 5, 92, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Update - Play Emote 92 (Phase 1)'), +(20351, 0, 2, 3, 60, 1, 100, 0, 180000, 180000, 180000, 180000, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Update - Set Event Phase 0 (Phase 1)'), +(20351, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 80, 2035100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Update - Run Script'), +(20351, 0, 4, 0, 40, 0, 100, 0, 11, 20351, 0, 0, 0, 80, 2035101, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Waypoint 11 Reached - Run Script'), +(20351, 0, 5, 0, 40, 0, 100, 0, 14, 20351, 0, 0, 0, 80, 2035102, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Waypoint 14 Reached - Run Script'), +(20351, 0, 6, 0, 58, 0, 100, 0, 29, 20351, 0, 0, 0, 80, 2035103, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Waypoint Finished - Run Script'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 20400; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 20400); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(20400, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Reset - Set Event Phase 1'), +(20400, 0, 1, 0, 60, 1, 100, 0, 3600, 3600, 3600, 3600, 0, 5, 92, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Update - Play Emote 92 (Phase 1)'), +(20400, 0, 2, 3, 38, 0, 100, 0, 1, 1, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Data Set 1 1 - Set Event Phase 0'), +(20400, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 80, 2040000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Data Set 1 1 - Run Script'), +(20400, 0, 4, 0, 38, 0, 100, 0, 1, 2, 0, 0, 0, 80, 2040001, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Data Set 1 2 - Run Script'), +(20400, 0, 5, 0, 38, 0, 100, 0, 1, 3, 0, 0, 0, 80, 2040002, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Data Set 1 3 - Run Script'), +(20400, 0, 6, 0, 38, 0, 100, 0, 1, 4, 0, 0, 0, 80, 2040003, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Data Set 1 4 - Run Script'); + +-- Pathing for Captain Sanders Entry: 20351 +DELETE FROM `waypoints` WHERE `entry`=20351; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`point_comment`) VALUES +(20351,1,1811.1932,1025.7975,11.685483,NULL,0,'Captain Sanders'), +(20351,2,1811.046,1035.7515,11.413217,NULL,0,'Captain Sanders'), +(20351,3,1810.3229,1043.4323,11.685482,NULL,0,'Captain Sanders'), +(20351,4,1817.0609,1043.4369,11.67465,NULL,0,'Captain Sanders'), +(20351,5,1817.4949,1053.8794,11.11829,NULL,0,'Captain Sanders'), +(20351,6,1811.2274,1060.154,9.906864,NULL,0,'Captain Sanders'), +(20351,7,1800.7808,1061.7118,8.49329,NULL,0,'Captain Sanders'), +(20351,8,1791.0525,1057.8472,7.8332715,NULL,0,'Captain Sanders'), +(20351,9,1787.0084,1046.652,9.74416,NULL,0,'Captain Sanders'), +(20351,10,1781.4646,1033.0979,9.537182,NULL,0,'Captain Sanders'), +(20351,11,1775.1431,1014.3824,6.5410886,NULL,0,'Captain Sanders'), -- Intermediate Event +(20351,12,1758.1819,1016.2374,5.8595204,NULL,0,'Captain Sanders'), +(20351,13,1739.5063,1016.105,2.416039,NULL,0,'Captain Sanders'), +(20351,14,1731.3119,1014.4211,1.5693786,NULL,0,'Captain Sanders'), -- Boat Scene +(20351,15,1757.7401,1016.1464,5.8391347,NULL,0,'Captain Sanders'), +(20351,16,1768.027,1016.7231,6.1815915,NULL,0,'Captain Sanders'), +(20351,17,1775.2412,1017.6554,6.0808835,NULL,0,'Captain Sanders'), +(20351,18,1784.6741,1026.9069,10.753368,NULL,0,'Captain Sanders'), +(20351,19,1790.1174,1049.2361,9.626728,NULL,0,'Captain Sanders'), +(20351,20,1799.3375,1057.9951,8.322407,NULL,0,'Captain Sanders'), +(20351,21,1810.4957,1058.3661,10.12952,NULL,0,'Captain Sanders'), +(20351,22,1816.9808,1056.8551,11.11829,NULL,0,'Captain Sanders'), +(20351,23,1817.2922,1043.6241,11.674123,NULL,0,'Captain Sanders'), +(20351,24,1810.0059,1042.9373,11.685482,NULL,0,'Captain Sanders'), +(20351,25,1809.8413,1038.6426,11.685481,NULL,0,'Captain Sanders'), +(20351,26,1811.0175,1032.7227,11.060482,NULL,0,'Captain Sanders'), +(20351,27,1811.5898,1024.587,11.685483,NULL,0,'Captain Sanders'), +(20351,28,1814.4944,1020.6591,11.685482,NULL,0,'Captain Sanders'), +(20351,29,1815.928,1020.2133,11.685482,NULL,0,'Captain Sanders'); -- End +-- 0x204214460013DFC000618C0000233C55 .go xyz 1811.1932 1025.7975 11.685483 + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2035100) AND (`source_type` = 9); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2035100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Set Event Phase 0'), +(2035100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Set Data 1 1'), +(2035100, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Set Orientation Closest Creature \'Captain Edward Hanes\''), +(2035100, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 0'), +(2035100, 9, 4, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 0, 53, 0, 20351, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Start Waypoint'); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2040000); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2040000, 9, 0, 0, 0, 0, 100, 0, 2500, 2500, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Set Orientation Closest Creature \'Captain Sanders\''), +(2040000, 9, 1, 0, 0, 0, 100, 0, 7500, 7500, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Say Line 0'), +(2040000, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 29, 1, 180, 0, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Start Follow Closest Creature \'Captain Sanders\''); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2035101); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2035101, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 54, 14000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Pause Waypoint'), +(2035101, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 45, 1, 2, 0, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Set Data 1 2'), +(2035101, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1.0995573997497559, 'Captain Sanders - On Script - Set Orientation 1.0995573997497559'), +(2035101, 9, 3, 0, 0, 0, 100, 0, 1600, 1600, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 5.777040004730225, 'Captain Sanders - On Script - Set Orientation 5.777040004730225'), +(2035101, 9, 4, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Set Orientation Closest Creature \'Captain Edward Hanes\''), +(2035101, 9, 5, 0, 0, 0, 100, 0, 1400, 1400, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 1'), +(2035101, 9, 6, 0, 0, 0, 100, 0, 3600, 3600, 0, 0, 0, 1, 2, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 2'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2040001) AND (`source_type` = 9); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2040001, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Start Follow Self'), +(2040001, 9, 1, 0, 0, 0, 100, 0, 3600, 3600, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Set Orientation Closest Creature \'Captain Sanders\''), +(2040001, 9, 2, 0, 0, 0, 100, 0, 1400, 1400, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Say Line 1'), +(2040001, 9, 3, 0, 0, 0, 100, 0, 8600, 8600, 0, 0, 0, 5, 273, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Play Emote 273'), +(2040001, 9, 4, 0, 0, 0, 100, 0, 1400, 1400, 0, 0, 0, 29, 1, 180, 0, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Start Follow Closest Creature \'Captain Sanders\''); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2040002) AND (`source_type` = 9); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2040002, 9, 0 , 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Start Follow Self'), +(2040002, 9, 1 , 0, 0, 0, 100, 0, 100, 100, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 1729.3556, 1014.00525, 1.151654, 1.7166426181793213, 'Captain Edward Hanes - On Script - Move To Position'), +(2040002, 9, 2 , 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 0, 1, 2, 0, 1, 0, 0, 0, 19, 20351, 1, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Say Line 2'), +(2040002, 9, 3 , 0, 0, 0, 100, 0, 9700, 9700, 0, 0, 0, 1, 3, 0, 1, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Say Line 3'), +(2040002, 9, 4 , 0, 0, 0, 100, 0, 9600, 9600, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 2.8274333477020264, 'Captain Edward Hanes - On Script - Set Orientation 2.8274333477020264'), +(2040002, 9, 5 , 0, 0, 0, 100, 0, 1400, 1400, 0, 0, 0, 1, 4, 0, 1, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Say Line 4'), +(2040002, 9, 6 , 0, 0, 0, 100, 0, 10600, 10600, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Set Orientation Closest Creature \'Captain Sanders\''), +(2040002, 9, 7 , 0, 0, 0, 100, 0, 1400, 1400, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Say Line 5'), +(2040002, 9, 8 , 0, 0, 0, 100, 0, 23000, 23000, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Say Line 6'), +(2040002, 9, 9 , 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 0, 1, 7, 0, 1, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Say Line 7'), +(2040002, 9, 10, 0, 0, 0, 100, 0, 9500, 9500, 0, 0, 0, 5, 273, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Play Emote 273'), +(2040002, 9, 11, 0, 0, 0, 100, 0, 3600, 3600, 0, 0, 0, 29, 1, 180, 0, 0, 0, 0, 19, 20351, 10, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Start Follow Closest Creature \'Captain Sanders\''); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2035102); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2035102, 9, 0 , 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 45, 1, 3, 0, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Set Data 1 3'), +(2035102, 9, 1 , 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 54, 84900, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Pause Waypoint'), +(2035102, 9, 2 , 0, 0, 0, 100, 0, 100, 100, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 2.4434609413146973, 'Captain Sanders - On Script - Set Orientation 2.4434609413146973'), +(2035102, 9, 3 , 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 1, 3, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 3'), +(2035102, 9, 4 , 0, 0, 0, 100, 0, 2100, 2100, 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Play Emote 6'), +(2035102, 9, 5 , 0, 0, 0, 100, 0, 2400, 2400, 0, 0, 0, 5, 92, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Play Emote 92'), +(2035102, 9, 6 , 0, 0, 0, 100, 0, 4900, 4900, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1.780235767364502, 'Captain Sanders - On Script - Set Orientation 1.780235767364502'), +(2035102, 9, 7 , 0, 0, 0, 100, 0, 1400, 1400, 0, 0, 0, 1, 4, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 4'), +(2035102, 9, 8 , 0, 0, 0, 100, 0, 2200, 2200, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Play Emote 5'), +(2035102, 9, 9 , 0, 0, 0, 100, 0, 7400, 7400, 0, 0, 0, 1, 5, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 5'), +(2035102, 9, 10, 0, 0, 0, 100, 0, 9600, 9600, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 2.9146997928619385, 'Captain Sanders - On Script - Set Orientation 2.9146997928619385'), +(2035102, 9, 11, 0, 0, 0, 100, 0, 3800, 3800, 0, 0, 0, 1, 6, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 6'), +(2035102, 9, 12, 0, 0, 0, 100, 0, 7300, 7300, 0, 0, 0, 1, 7, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 7'), +(2035102, 9, 13, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 0, 1, 8, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 8'), +(2035102, 9, 14, 0, 0, 0, 100, 0, 7300, 7300, 0, 0, 0, 1, 9, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 9'), +(2035102, 9, 15, 0, 0, 0, 100, 0, 2200, 2200, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Play Emote 5'), +(2035102, 9, 16, 0, 0, 0, 100, 0, 6300, 6300, 0, 0, 0, 1, 10, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 10'), +(2035102, 9, 17, 0, 0, 0, 100, 0, 13300, 13300, 0, 0, 0, 1, 11, 0, 1, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Say Line 11'), +(2035102, 9, 18, 0, 0, 0, 100, 0, 3400, 3400, 0, 0, 0, 5, 273, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Play Emote 273'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2035103) AND (`source_type` = 9); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2035103, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 45, 1, 4, 0, 0, 0, 0, 19, 20400, 10, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Set Data 1 4'), +(2035103, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 1815.927978515625, 1020.2133178710938, 11.685482025146484, 4.817108631134033, 'Captain Sanders - On Script - Move To Position'), +(2035103, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Sanders - On Script - Set Event Phase 1'); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2040003); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2040003, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Start Follow Self'), +(2040003, 9, 1, 0, 0, 0, 100, 0, 200, 200, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 1814.1473388671875, 1018.730712890625, 11.685482025146484, 6.2657318115234375, 'Captain Edward Hanes - On Script - Move To Position'), +(2040003, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Set Data 1 0'), +(2040003, 9, 3, 0, 0, 0, 100, 0, 4800, 4800, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Edward Hanes - On Script - Set Event Phase 1'); + +DELETE FROM `creature_text` WHERE `CreatureID`=20351; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(20351, 0 , 0, 'Avast, Ed! Lemme show ye me ship! *hic*', 12, 0, 100, 1, 0, 0, 18064, 0, 'Captain Sanders'), +(20351, 1 , 0, 'I just be makin\' sure we wasn\'t followed! *hic*', 12, 0, 100, 5, 0, 0, 18067, 0, 'Captain Sanders'), +(20351, 2 , 0, 'It be clear...', 12, 0, 100, 273, 0, 0, 18068, 0, 'Captain Sanders'), +(20351, 3 , 0, 'Thar she be! Ain\'t she a beaut?', 12, 0, 100, 25, 0, 0, 18069, 0, 'Captain Sanders'), +(20351, 4 , 0, 'That thar monster be yers, Ed? Arrr... She\'s a big\'un!', 12, 0, 100, 25, 0, 0, 18071, 0, 'Captain Sanders'), +(20351, 5 , 0, 'Arrr, Ed! She definitely be seaworthy!', 12, 0, 100, 5, 0, 0, 18073, 0, 'Captain Sanders'), +(20351, 6 , 0, 'Can ye keep a secret, Ed? Arr, dead men tell no tales!', 12, 0, 100, 6, 0, 0, 18075, 0, 'Captain Sanders'), +(20351, 7 , 0, 'It be me treasure, Ed. Me life\'s work! Arrr... One white shirt fit fer a pirate king to be wearin\'!', 12, 0, 100, 1, 0, 0, 18077, 0, 'Captain Sanders'), +(20351, 8 , 0, 'One red sash that ye can put on yer head or your britches. Pride o\' the fleet, that sash is...', 12, 0, 100, 1, 0, 0, 18078, 0, 'Captain Sanders'), +(20351, 9 , 0, 'An\' last but certainly not least, one enormous bag! Big enough to fit eight whole apples! Eight, Ed! Can ye believe it!?', 12, 0, 100, 1, 0, 0, 18079, 0, 'Captain Sanders'), +(20351, 10, 0, 'Yarrr! Keep it down, Ed! Thar be scallywags about! Their scallywag ears be listenin\' for gasps like the one that just escaped yer lips!', 12, 0, 100, 1, 0, 0, 18081, 0, 'Captain Sanders'), +(20351, 11, 0, 'It be alright, Ed. Me booty be locked away good in that thar chest. No fool will ever have Cap\'n Sanders\'s treasure! Let\'s go get another drink. The spirits be runnin\' low.', 12, 0, 100, 1, 0, 0, 18083, 0, 'Captain Sanders'); + +DELETE FROM `creature_text` WHERE `CreatureID`=20400; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(20400, 0, 0, 'Lead the way, Sanders!', 12, 0, 100, 1, 0, 0, 18065, 0, 'Captain Edward Hanes'), +(20400, 1, 0, 'What are you doing, Sanders?', 12, 0, 100, 1, 0, 0, 18066, 0, 'Captain Edward Hanes'), +(20400, 2, 0, 'Aye, she\'s a beaut alright. And you parked her right next to my frigate! *hic*', 12, 0, 100, 1, 0, 0, 18070, 0, 'Captain Edward Hanes'), +(20400, 3, 0, 'Ayep! She\'s all mine... I\'m gonna sail her around the world. Across the sea!', 12, 0, 100, 1, 0, 0, 18072, 0, 'Captain Edward Hanes'), +(20400, 4, 0, 'Sanders, what have you got in that chest?', 12, 0, 100, 1, 0, 0, 18074, 0, 'Captain Edward Hanes'), +(20400, 5, 0, '%s nods.', 16, 0, 100, 0, 0, 0, 18076, 0, 'Captain Edward Hanes'), +(20400, 6, 0, '%s gasps.', 16, 0, 100, 0, 0, 0, 18080, 0, 'Captain Edward Hanes'), +(20400, 7, 0, 'I\'m sorry, Sanders. I\'ve just never seen such a bounty. It took me by surprise.', 12, 0, 100, 1, 0, 0, 18082, 0, 'Captain Edward Hanes'); From ac2466030e26ce27df922cfd55a115c0f4233525 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 5 Jan 2023 12:43:38 +0000 Subject: [PATCH 04/39] chore(DB): import pending files Referenced commit(s): 25971eedb65ef4bb2992802d45b9e0af0abfefc1 --- .../rev_1672205660081542200.sql => db_world/2023_01_05_00.sql} | 1 + .../rev_1672240491963126000.sql => db_world/2023_01_05_01.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1672205660081542200.sql => db_world/2023_01_05_00.sql} (99%) rename data/sql/updates/{pending_db_world/rev_1672240491963126000.sql => db_world/2023_01_05_01.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1672205660081542200.sql b/data/sql/updates/db_world/2023_01_05_00.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1672205660081542200.sql rename to data/sql/updates/db_world/2023_01_05_00.sql index 94b153996..e8114c057 100644 --- a/data/sql/updates/pending_db_world/rev_1672205660081542200.sql +++ b/data/sql/updates/db_world/2023_01_05_00.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_04_02 -> 2023_01_05_00 -- Pathing for Kel'Thuzad Entry: 20350 UPDATE `creature` SET `wander_distance`=0,`MovementType`=0,`position_x`=1777.6586,`position_y`=1058.5917,`position_z`=7.1008496 WHERE `id1`=20350; -- Kel'Thuzad UPDATE `creature` SET `wander_distance`=0,`MovementType`=0,`position_x`=1777.6586,`position_y`=1058.5917,`position_z`=7.1008496 WHERE `id1`=20353; -- Helcular diff --git a/data/sql/updates/pending_db_world/rev_1672240491963126000.sql b/data/sql/updates/db_world/2023_01_05_01.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1672240491963126000.sql rename to data/sql/updates/db_world/2023_01_05_01.sql index 1202193a2..3a4460802 100644 --- a/data/sql/updates/pending_db_world/rev_1672240491963126000.sql +++ b/data/sql/updates/db_world/2023_01_05_01.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_05_00 -> 2023_01_05_01 -- Set correct spawn pos UPDATE `creature` SET `position_x`=1815.927978515625, `position_y`=1020.21331787109375, `position_z`=11.68548202514648437, `orientation`=4.817108631134033203, `equipment_id`=1, `VerifiedBuild`=47187 WHERE `id1`=20351; UPDATE `creature` SET `position_x`=1814.1473388671875, `position_y`=1018.730712890625, `position_z`=11.68548202514648437, `orientation`=6.2657318115234375, `equipment_id`=1, `VerifiedBuild`=47187 WHERE `id1`=20400; From 96fa9c5c7b7274baa71f55a63dd40859d94d1aa2 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:50:53 +0100 Subject: [PATCH 05/39] fix(Core/Spells): Ignite and Revitalize should not prelong combat. (#13812) Fixes #13330 --- src/server/game/Entities/Unit/Unit.cpp | 25 +++++++++++-------- src/server/game/Entities/Unit/Unit.h | 2 +- .../game/Spells/SpellInfoCorrections.cpp | 7 ++++++ src/server/scripts/Spells/spell_druid.cpp | 2 +- src/server/scripts/Spells/spell_mage.cpp | 4 +-- src/server/scripts/Spells/spell_shaman.cpp | 2 +- src/server/scripts/Spells/spell_warrior.cpp | 2 +- 7 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2cef6e643..5025c9147 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7317,7 +7317,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (!blessHealing || !victim) return false; basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].Amplitude)); - victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_HEAL, basepoints0); + victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_HEAL, basepoints0, triggeredByAura); return true; } break; @@ -7707,7 +7707,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere basepoints0 = triggerAmount * damage / 400; triggered_spell_id = 61840; // Add remaining ticks to damage done - victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0); + victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0, triggeredByAura); return true; } // Sheath of Light @@ -8385,7 +8385,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere AddPct(basepoints0, glyph->GetAmount()); basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].Amplitude); - victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0); + victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0, triggeredByAura); return true; } // Vendetta @@ -9053,7 +9053,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg basepoints0 = CalculatePct(int32(damage), triggerAmount) / 3; target = this; // Add remaining ticks to healing done - CastDelayedSpellWithPeriodicAmount(this, trigger_spell_id, SPELL_AURA_PERIODIC_HEAL, basepoints0); + CastDelayedSpellWithPeriodicAmount(this, trigger_spell_id, SPELL_AURA_PERIODIC_HEAL, basepoints0, triggeredByAura); return true; } break; @@ -9133,7 +9133,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].Amplitude); - victim->CastDelayedSpellWithPeriodicAmount(this, trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0); + victim->CastDelayedSpellWithPeriodicAmount(this, trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0, triggeredByAura); return true; } // Item - Hunter T9 4P Bonus (Steady Shot) @@ -20335,13 +20335,17 @@ void Unit::OutDebugInfo() const class AuraMunchingQueue : public BasicEvent { public: - AuraMunchingQueue(Unit& owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId) : _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId) { } + AuraMunchingQueue(Unit& owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId, AuraEffect const* aurEff) : + _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId) + { + _aurEff = aurEff->GetBase()->GetDuration() > 400 ? aurEff : nullptr; + } bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override { if (_owner.IsInWorld() && _owner.FindMap()) if (Unit* target = ObjectAccessor::GetUnit(_owner, _targetGUID)) - _owner.CastCustomSpell(_spellId, SPELLVALUE_BASE_POINT0, _basePoints, target, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, _owner.GetGUID()); + _owner.CastCustomSpell(_spellId, SPELLVALUE_BASE_POINT0, _basePoints, target, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, _aurEff, _owner.GetGUID()); return true; } @@ -20351,9 +20355,10 @@ private: ObjectGuid _targetGUID; int32 _basePoints; uint32 _spellId; + AuraEffect const* _aurEff; }; -void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex) +void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, AuraEffect const* aurEff, uint8 effectIndex) { for (AuraEffectList::iterator i = m_modAuras[auraType].begin(); i != m_modAuras[auraType].end(); ++i) { @@ -20367,9 +20372,9 @@ void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, Aura // xinef: delay only for casting on different unit if (this == caster) - caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, addAmount, this, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, caster->GetGUID()); + caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, addAmount, this, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, aurEff, caster->GetGUID()); else - caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId), caster->m_Events.CalculateQueueTime(400)); + caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId, aurEff), caster->m_Events.CalculateQueueTime(400)); } void Unit::SendClearTarget() diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 2db7c364b..449194597 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2221,7 +2221,7 @@ public: uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const; float CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffectType damagetype) const; - void CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex = 0); + void CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, AuraEffect const* aurEff, uint8 effectIndex = 0); void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType = SPELL_BLOCK_TYPE_ALL); void ApplySpellDispelImmunity(SpellInfo const* spellProto, DispelType type, bool apply); diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index febeb19a9..91834cf73 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4465,6 +4465,13 @@ void SpellMgr::LoadSpellInfoCorrections() } }); + // Revitalize + ApplySpellFix({ 48540, 48541, 48542, 48543 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT; + spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 5f17b9633..fbfc19dcf 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -126,7 +126,7 @@ class spell_dru_t10_balance_4p_bonus : public AuraScript SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); int32 amount = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()) / triggeredSpell->GetMaxTicks(); - eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(GetTarget(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, amount, EFFECT_0); + eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(GetTarget(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, amount, aurEff, EFFECT_0); //GetTarget()->CastCustomSpell(triggered_spell_id, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 1d96eccb2..0aff531f6 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -701,7 +701,7 @@ class spell_mage_ignite : public AuraScript return true; } - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); @@ -711,7 +711,7 @@ class spell_mage_ignite : public AuraScript int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks()); // Xinef: implement ignite bug - eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(eventInfo.GetActor(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE, amount); + eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(eventInfo.GetActor(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE, amount, aurEff); //GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 6977a0824..05119a0e6 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -133,7 +133,7 @@ class spell_sha_t10_restoration_4p_bonus : public AuraScript } int32 amount = CalculatePct(healInfo->GetHeal(), aurEff->GetAmount()) / triggeredSpell->GetMaxTicks(); - eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(GetTarget(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL, amount, EFFECT_0); + eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(GetTarget(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL, amount, aurEff, EFFECT_0); } void Register() override diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 35aec6db2..539216fee 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -267,7 +267,7 @@ class spell_warr_deep_wounds : public SpellScript damage = target->MeleeDamageBonusTaken(caster, damage, BASE_ATTACK, GetSpellInfo()); // apply percent damage mods ApplyPct(damage, 16.0f * GetSpellInfo()->GetRank() / 6.0f); - target->CastDelayedSpellWithPeriodicAmount(caster, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, SPELL_AURA_PERIODIC_DAMAGE, damage, EFFECT_0); + target->CastDelayedSpellWithPeriodicAmount(caster, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, SPELL_AURA_PERIODIC_DAMAGE, damage, nullptr, EFFECT_0); //caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, &damage, nullptr, nullptr, true); } From 4b31a4dfc0cc882746802d1ca37933caf83911e1 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:51:08 +0100 Subject: [PATCH 06/39] fix(Scripts/Karazhan): Barnes should respawn on wipe. (#13953) * fix(Scripts/Karazhan): Barnes should respawn on wipe. Fixes #4437 * Update. --- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 28 +++++++++++++++++++ .../Karazhan/instance_karazhan.cpp | 19 +++++++++++++ .../EasternKingdoms/Karazhan/karazhan.h | 3 +- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 482a3b0c5..a9be06b0a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -709,6 +709,13 @@ public: DoZoneInCombat(); } + void EnterEvadeMode(EvadeReason reason) override + { + ScriptedAI::EnterEvadeMode(reason); + + instance->SetBossState(DATA_OPERA_PERFORMANCE, FAIL); + } + void JustDied(Unit* /*killer*/) override { Talk(SAY_CRONE_DEATH); @@ -891,6 +898,13 @@ public: me->DespawnOrUnsummon(); } + void EnterEvadeMode(EvadeReason reason) override + { + ScriptedAI::EnterEvadeMode(reason); + + instance->SetBossState(DATA_OPERA_PERFORMANCE, FAIL); + } + void JustDied(Unit* /*killer*/) override { DoPlaySoundToSet(me, SOUND_WOLF_DEATH); @@ -1138,6 +1152,13 @@ public: void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override; + void EnterEvadeMode(EvadeReason reason) override + { + ScriptedAI::EnterEvadeMode(reason); + + instance->SetBossState(DATA_OPERA_PERFORMANCE, FAIL); + } + void JustDied(Unit*) override { Talk(SAY_JULIANNE_DEATH02); @@ -1287,6 +1308,13 @@ public: ScriptedAI::MoveInLineOfSight(who); } + void EnterEvadeMode(EvadeReason reason) override + { + ScriptedAI::EnterEvadeMode(reason); + + instance->SetBossState(DATA_OPERA_PERFORMANCE, FAIL); + } + void JustDied(Unit* /*killer*/) override { Talk(SAY_ROMULO_DEATH); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index 0f29956ee..2d116dc85 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -73,7 +73,18 @@ public: case NPC_RELAY: m_uiRelayGUID = creature->GetGUID(); break; + case NPC_BARNES: + _barnesGUID = creature->GetGUID(); + if (GetBossState(DATA_OPERA_PERFORMANCE) != DONE && !creature->IsAlive()) + { + creature->Respawn(true); + } + break; + default: + break; } + + InstanceScript::OnCreatureCreate(creature); } void OnUnitDeath(Unit* unit) override @@ -162,6 +173,13 @@ public: sideEntrance->RemoveGameObjectFlag(GO_FLAG_LOCKED); instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, nullptr); } + else if (state == FAIL) + { + HandleGameObject(m_uiStageDoorLeftGUID, false); + HandleGameObject(m_uiStageDoorRightGUID, false); + HandleGameObject(m_uiCurtainGUID, false); + DoRespawnCreature(_barnesGUID, true); + } break; case DATA_CHESS: if (state == DONE) @@ -336,6 +354,7 @@ public: ObjectGuid ImageGUID; ObjectGuid DustCoveredChest; ObjectGuid m_uiRelayGUID; + ObjectGuid _barnesGUID; GuidVector _operaDecorations[EVENT_RAJ]; }; }; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h index cc0a72878..e9fd06e8a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h @@ -90,7 +90,8 @@ enum KZMiscCreatures NPC_DREADBEAST = 16177, NPC_SHADOWBEAST = 16176, NPC_KILREK = 17229, - NPC_RELAY = 17645 + NPC_RELAY = 17645, + NPC_BARNES = 16812 }; enum KZGameObjectIds From 0e1e8f27de6e9618235250c39915664b3add1ce7 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:51:54 +0100 Subject: [PATCH 07/39] fix(Core/Spells): Every spell casted by player should tap the creature. (#14037) Fixes #11888 --- src/server/game/Spells/Spell.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2053b4e50..411da01b6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2917,6 +2917,15 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) { m_caster->CombatStart(effectUnit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_SUPRESS_TARGET_PROCS)); + // Patch 3.0.8: All player spells which cause a creature to become aggressive to you will now also immediately cause the creature to be tapped. + if (Creature* creature = effectUnit->ToCreature()) + { + if (!creature->hasLootRecipient() && m_caster->IsPlayer()) + { + creature->SetLootRecipient(m_caster); + } + } + // Unsure if there are more spells that are not supposed to stop enemy from // regenerating HP from food, so for now it stays as an ID. const uint32 SPELL_PREMEDITATION = 14183; From 14f3b444ae3ecc76698931a205a9114c44e18c13 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:52:05 +0100 Subject: [PATCH 08/39] =?UTF-8?q?fix(Core/Creatures):=20Implemented=20`SUM?= =?UTF-8?q?MON=5FPROP=5FFLAG=5FONLY=5FVISIBLE=5FTO=5FSU=E2=80=A6=20(#14054?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Core/Creatures): Implemented `SUMMON_PROP_FLAG_ONLY_VISIBLE_TO_SUMMONER` summon flag. Fixes #6674 * Update. --- .../game/AI/SmartScripts/SmartScript.cpp | 10 ++++-- .../game/AI/SmartScripts/SmartScriptMgr.h | 14 +++++++- src/server/game/Combat/ThreatMgr.cpp | 18 ++++++++++- .../Entities/Creature/TemporarySummon.cpp | 2 +- .../game/Entities/Creature/TemporarySummon.h | 5 +++ src/server/game/Entities/Object/Object.cpp | 24 +++++++++++--- src/server/game/Entities/Object/Object.h | 4 +-- .../game/Grids/Notifiers/GridNotifiers.h | 2 +- src/server/game/Maps/Map.h | 2 +- src/server/game/Spells/Spell.h | 2 +- src/server/game/Spells/SpellEffects.cpp | 25 ++++++++------- src/server/shared/DataStores/DBCEnums.h | 32 +++++++++---------- 12 files changed, 96 insertions(+), 44 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 240e0eeab..753ba9022 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1267,10 +1267,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } case SMART_ACTION_SUMMON_CREATURE: { - WorldObject* summoner = GetBaseObject() ? GetBaseObject() : unit; + EnumFlag flags(static_cast(e.action.summonCreature.flags)); + bool preferUnit = flags.HasFlag(SmartActionSummonCreatureFlags::PreferUnit); + WorldObject* summoner = preferUnit ? unit : Coalesce(GetBaseObject(), unit); if (!summoner) break; + bool personalSpawn = flags.HasFlag(SmartActionSummonCreatureFlags::PersonalSpawn); + if (e.GetTargetType() == SMART_TARGET_RANDOM_POINT) { float range = (float)e.target.randomPoint.range; @@ -1282,7 +1286,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u randomPoint = me->GetRandomPoint(me->GetPosition(), range); else randomPoint = me->GetRandomPoint(srcPos, range); - if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, randomPoint, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) + if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, randomPoint, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration, 0, nullptr, personalSpawn)) { if (unit && e.action.summonCreature.attackInvoker) summon->AI()->AttackStart(unit); @@ -1301,7 +1305,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u y += e.target.y; z += e.target.z; o += e.target.o; - if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) + if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration, nullptr, personalSpawn)) { if (e.action.summonCreature.attackInvoker == 2) // pussywizard: proper attackInvoker implementation summon->AI()->AttackStart(unit); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index f37577f17..8e670c191 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -534,7 +534,7 @@ enum SMART_ACTION SMART_ACTION_ACTIVATE_GOBJECT = 9, // SMART_ACTION_RANDOM_EMOTE = 10, // EmoteId1, EmoteId2, EmoteId3... SMART_ACTION_CAST = 11, // SpellId, CastFlags, LimitTargets - SMART_ACTION_SUMMON_CREATURE = 12, // CreatureID, summonType, duration in ms, attackInvoker, attackScriptOwner + SMART_ACTION_SUMMON_CREATURE = 12, // CreatureID, summonType, duration in ms, attackInvoker, attackScriptOwner, flags(SmartActionSummonCreatureFlags) SMART_ACTION_THREAT_SINGLE_PCT = 13, // Threat% SMART_ACTION_THREAT_ALL_PCT = 14, // Threat% SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS = 15, // QuestID @@ -696,6 +696,17 @@ enum SMART_ACTION SMART_ACTION_AC_END = 225, // placeholder }; +enum class SmartActionSummonCreatureFlags +{ + None = 0, + PersonalSpawn = 1, + PreferUnit = 2, + + All = PersonalSpawn | PreferUnit +}; + +DEFINE_ENUM_FLAG(SmartActionSummonCreatureFlags); + struct SmartAction { SMART_ACTION type; @@ -820,6 +831,7 @@ struct SmartAction uint32 duration; SAIBool attackInvoker; uint32 attackScriptOwner; + uint32 flags; // SmartActionSummonCreatureFlags } summonCreature; struct diff --git a/src/server/game/Combat/ThreatMgr.cpp b/src/server/game/Combat/ThreatMgr.cpp index 91751f22a..87e9725a4 100644 --- a/src/server/game/Combat/ThreatMgr.cpp +++ b/src/server/game/Combat/ThreatMgr.cpp @@ -454,11 +454,27 @@ void ThreatMgr::AddThreat(Unit* victim, float threat, SpellSchoolMask schoolMask void ThreatMgr::DoAddThreat(Unit* victim, float threat) { uint32 redirectThreadPct = victim->GetRedirectThreatPercent(); + Unit* redirectTarget = victim->GetRedirectThreatTarget(); + + // Personal Spawns from same summoner can aggro each other + if (TempSummon* tempSummonVictim = victim->ToTempSummon()) + { + if (tempSummonVictim->IsVisibleBySummonerOnly()) + { + if (!GetOwner()->ToTempSummon() || + !GetOwner()->ToTempSummon()->IsVisibleBySummonerOnly() || + tempSummonVictim->GetSummonerGUID() != GetOwner()->ToTempSummon()->GetSummonerGUID()) + { + redirectThreadPct = 100; + redirectTarget = tempSummonVictim->GetSummonerUnit(); + } + } + } // must check > 0.0f, otherwise dead loop if (threat > 0.0f && redirectThreadPct) { - if (Unit* redirectTarget = victim->GetRedirectThreatTarget()) + if (redirectTarget) { float redirectThreat = CalculatePct(threat, redirectThreadPct); threat -= redirectThreat; diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index a741d9638..57957734c 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -25,7 +25,7 @@ TempSummon::TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) : Creature(isWorldObject), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN), - m_timer(0), m_lifetime(0) + m_timer(0), m_lifetime(0), _visibleBySummonerOnly(false) { if (owner) { diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index 3e005270f..e5bc369bd 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -57,14 +57,19 @@ public: uint32 GetTimer() { return m_timer; } void SetTimer(uint32 t) { m_timer = t; } + void SetVisibleBySummonerOnly(bool visibleBySummonerOnly) { _visibleBySummonerOnly = visibleBySummonerOnly; } + [[nodiscard]] bool IsVisibleBySummonerOnly() const { return _visibleBySummonerOnly; } + const SummonPropertiesEntry* const m_Properties; std::string GetDebugInfo() const override; + private: TempSummonType m_type; uint32 m_timer; uint32 m_lifetime; ObjectGuid m_summonerGUID; + bool _visibleBySummonerOnly; }; class Minion : public TempSummon diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 8c8511c5a..2f1e6bc27 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1773,6 +1773,17 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo WorldObject const* viewpoint = this; if (Player const* thisPlayer = ToPlayer()) { + if (Creature const* creature = obj->ToCreature()) + { + if (TempSummon const* tempSummon = creature->ToTempSummon()) + { + if (tempSummon->IsVisibleBySummonerOnly() && GetGUID() != tempSummon->GetSummonerGUID()) + { + return false; + } + } + } + if (thisPlayer->isDead() && thisPlayer->GetHealth() > 0 && // Cheap way to check for ghost state !(obj->m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GHOST) & m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GHOST) & GHOST_VISIBILITY_GHOST)) { @@ -2115,7 +2126,7 @@ void WorldObject::AddObjectToRemoveList() map->AddObjectToRemoveList(this); } -TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties /*= nullptr*/, uint32 duration /*= 0*/, WorldObject* summoner /*= nullptr*/, uint32 spellId /*= 0*/, uint32 vehId /*= 0*/) +TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties /*= nullptr*/, uint32 duration /*= 0*/, WorldObject* summoner /*= nullptr*/, uint32 spellId /*= 0*/, uint32 vehId /*= 0*/, bool visibleBySummonerOnly /*= false*/) { uint32 mask = UNIT_MASK_SUMMON; if (properties) @@ -2204,6 +2215,9 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert summon->SetHomePosition(pos); summon->InitStats(duration); + + summon->SetVisibleBySummonerOnly(visibleBySummonerOnly); + if (!AddToMap(summon->ToCreature(), summon->GetOwnerGUID().IsPlayer() || (summoner && summoner->GetTransport()))) { delete summon; @@ -2236,7 +2250,7 @@ void Map::SummonCreatureGroup(uint8 group, std::list* list /*= null list->push_back(summon); } -TempSummon* WorldObject::SummonCreature(uint32 id, float x, float y, float z, float ang, TempSummonType spwtype, uint32 despwtime, SummonPropertiesEntry const* properties) +TempSummon* WorldObject::SummonCreature(uint32 id, float x, float y, float z, float ang, TempSummonType spwtype, uint32 despwtime, SummonPropertiesEntry const* properties, bool visibleBySummonerOnly) { if (!x && !y && !z) { @@ -2245,7 +2259,7 @@ TempSummon* WorldObject::SummonCreature(uint32 id, float x, float y, float z, fl } Position pos; pos.Relocate(x, y, z, ang); - return SummonCreature(id, pos, spwtype, despwtime, 0, properties); + return SummonCreature(id, pos, spwtype, despwtime, 0, properties, visibleBySummonerOnly); } GameObject* Map::SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport) @@ -2301,11 +2315,11 @@ void WorldObject::ClearZoneScript() m_zoneScript = nullptr; } -TempSummon* WorldObject::SummonCreature(uint32 entry, const Position& pos, TempSummonType spwtype, uint32 duration, uint32 /*vehId*/, SummonPropertiesEntry const* properties) const +TempSummon* WorldObject::SummonCreature(uint32 entry, const Position& pos, TempSummonType spwtype, uint32 duration, uint32 /*vehId*/, SummonPropertiesEntry const* properties, bool visibleBySummonerOnly /*= false*/) const { if (Map* map = FindMap()) { - if (TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, (WorldObject*) this)) + if (TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, (WorldObject*)this, 0, 0, visibleBySummonerOnly)) { summon->SetTempSummonType(spwtype); return summon; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index da57d6f04..ac72ba3b0 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -522,8 +522,8 @@ public: void ClearZoneScript(); [[nodiscard]] ZoneScript* GetZoneScript() const { return m_zoneScript; } - TempSummon* SummonCreature(uint32 id, const Position& pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0, SummonPropertiesEntry const* properties = nullptr) const; - TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, SummonPropertiesEntry const* properties = nullptr); + TempSummon* SummonCreature(uint32 id, const Position& pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0, SummonPropertiesEntry const* properties = nullptr, bool visibleBySummonerOnly = false) const; + TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, SummonPropertiesEntry const* properties = nullptr, bool visibleBySummonerOnly = false); GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport = true, GOSummonType summonType = GO_SUMMON_TIMED_OR_CORPSE_DESPAWN); Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel = false, CreatureAI * (*GetAI)(Creature*) = nullptr); void SummonCreatureGroup(uint8 group, std::list* list = nullptr); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 2b3b51b44..46871dfbb 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -597,7 +597,7 @@ namespace Acore void Visit(PlayerMapType& m) { for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr) - if (itr->GetSource()->InSamePhase(i_searcher) && itr->GetSource()->IsWithinDist(i_searcher, i_dist)) + if (itr->GetSource()->HaveAtClient(i_searcher) && itr->GetSource()->IsWithinDist(i_searcher, i_dist)) i_do(itr->GetSource()); } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 0f5f73929..0bf6b9c18 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -500,7 +500,7 @@ public: void UpdateIteratorBack(Player* player); - TempSummon* SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties = nullptr, uint32 duration = 0, WorldObject* summoner = nullptr, uint32 spellId = 0, uint32 vehId = 0); + TempSummon* SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties = nullptr, uint32 duration = 0, WorldObject* summoner = nullptr, uint32 spellId = 0, uint32 vehId = 0, bool visibleBySummonerOnly = false); GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport = true); GameObject* SummonGameObject(uint32 entry, Position const& pos, float rotation0 = 0.0f, float rotation1 = 0.0f, float rotation2 = 0.0f, float rotation3 = 0.0f, uint32 respawnTime = 100, bool checkTransport = true); void SummonCreatureGroup(uint8 group, std::list* list = nullptr); diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index f28361b88..e6e302460 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -753,7 +753,7 @@ public: HitTriggerSpellList m_hitTriggerSpells; // effect helpers - void SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numSummons); + void SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numSummons, bool personalSpawn); void CalculateJumpSpeeds(uint8 i, float dist, float& speedxy, float& speedz); SpellCastResult CanOpenLock(uint32 effIndex, uint32 lockid, SkillType& skillid, int32& reqSkillValue, int32& skillValue); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 7b7995f3c..4c4b6d6e7 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2354,6 +2354,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (!m_originalCaster) return; + bool personalSpawn = (properties->Flags & SUMMON_PROP_FLAG_ONLY_VISIBLE_TO_SUMMONER) != 0; int32 duration = m_spellInfo->GetDuration(); if (Player* modOwner = m_originalCaster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); @@ -2398,7 +2399,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) case SUMMON_CATEGORY_UNK: if (properties->Flags & 512) { - SummonGuardian(effIndex, entry, properties, numSummons); + SummonGuardian(effIndex, entry, properties, numSummons, personalSpawn); break; } switch (properties->Type) @@ -2407,18 +2408,18 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) case SUMMON_TYPE_GUARDIAN: case SUMMON_TYPE_GUARDIAN2: case SUMMON_TYPE_MINION: - SummonGuardian(effIndex, entry, properties, numSummons); + SummonGuardian(effIndex, entry, properties, numSummons, personalSpawn); break; // Summons a vehicle, but doesn't force anyone to enter it (see SUMMON_CATEGORY_VEHICLE) case SUMMON_TYPE_VEHICLE: case SUMMON_TYPE_VEHICLE2: - summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id, 0, personalSpawn); break; case SUMMON_TYPE_LIGHTWELL: case SUMMON_TYPE_TOTEM: { // protection code - summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id, 0, personalSpawn); if (!summon || !summon->IsTotem()) return; @@ -2436,7 +2437,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) case SUMMON_TYPE_JEEVES: case SUMMON_TYPE_MINIPET: { - summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id, 0, personalSpawn); if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION)) return; @@ -2470,7 +2471,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) // randomize position for multiple summons pos = m_caster->GetRandomPoint(*destTarget, radius); - summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration); + summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration, 0, nullptr, personalSpawn); if (!summon) continue; @@ -2492,10 +2493,10 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) // Xinef: SummonGuardian function can summon a few npcs of same type, remove old summons with same entry here if (m_originalCaster) m_originalCaster->RemoveAllMinionsByEntry(entry); - SummonGuardian(effIndex, entry, properties, numSummons); + SummonGuardian(effIndex, entry, properties, numSummons, personalSpawn); break; case SUMMON_CATEGORY_PUPPET: - summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id, 0, personalSpawn); break; case SUMMON_CATEGORY_VEHICLE: // Summoning spells (usually triggered by npc_spellclick) that spawn a vehicle and that cause the clicker @@ -2506,7 +2507,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (std::fabs(m_caster->GetPositionZ() - destTarget->GetPositionZ()) > 6.0f) destTarget->m_positionZ = m_caster->GetPositionZ(); - summon = m_originalCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_caster, m_spellInfo->Id); + summon = m_originalCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_caster, m_spellInfo->Id, 0, personalSpawn); if (!summon || !summon->IsVehicle()) return; @@ -3176,7 +3177,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) // Xinef: unsummon old guardian if (Guardian* oldPet = m_originalCaster->GetGuardianPet()) oldPet->UnSummon(); - SummonGuardian(effIndex, petentry, properties, 1); + SummonGuardian(effIndex, petentry, properties, 1, false); } return; } @@ -6005,7 +6006,7 @@ void Spell::EffectGameObjectSetDestructionState(SpellEffIndex effIndex) gameObjTarget->SetDestructibleState(GameObjectDestructibleState(m_spellInfo->Effects[effIndex].MiscValue), player, true); } -void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numGuardians) +void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numGuardians, bool personalSpawn) { Unit* caster = m_originalCaster; if (!caster) @@ -6105,7 +6106,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* pos = m_caster->GetRandomPoint(*destTarget, radius); } - summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id); + summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id, 0, personalSpawn); if (!summon) return; diff --git a/src/server/shared/DataStores/DBCEnums.h b/src/server/shared/DataStores/DBCEnums.h index 4b6e31204..00430847e 100644 --- a/src/server/shared/DataStores/DBCEnums.h +++ b/src/server/shared/DataStores/DBCEnums.h @@ -426,22 +426,22 @@ enum SummonPropGroup enum SummonPropFlags { SUMMON_PROP_FLAG_NONE = 0x00000000, // 1342 spells in 3.0.3 - SUMMON_PROP_FLAG_ATTACK_SUMMONER = 0x00000001, // 75 spells in 3.0.3, something unfriendly TODO: Needs implementation - SUMMON_PROP_FLAG_ASSIST_COMBAT_SUMMON = 0x00000002, // 616 spells in 3.0.3, something friendly TODO: Needs implementation - SUMMON_PROP_FLAG_USE_LEVEL_OFFSET = 0x00000004, // 22 spells in 3.0.3, no idea... TODO: Needs implementation - SUMMON_PROP_FLAG_DESPAWN_ON_SUMMONER_DEATH = 0x00000008, // 49 spells in 3.0.3, some mounts TODO: Needs implementation - SUMMON_PROP_FLAG_ONLY_VISIBLE_TO_SUMMONER = 0x00000010, // 25 spells in 3.0.3, quest related? TODO: Needs implementation - SUMMON_PROP_FLAG_CANNOT_DISMISS_PET = 0x00000020, // 0 spells in 3.3.5, unused TODO: Needs implementation - SUMMON_PROP_FLAG_USE_DEMON_TIMEOUT = 0x00000040, // 12 spells in 3.0.3, no idea TODO: Needs implementation - SUMMON_PROP_FLAG_UNLIMITED_SUMMONS = 0x00000080, // 4 spells in 3.0.3, no idea TODO: Needs implementation - SUMMON_PROP_FLAG_USE_CREATURE_LEVEL = 0x00000100, // 51 spells in 3.0.3, no idea, many quest related TODO: Needs implementation - SUMMON_PROP_FLAG_JOIN_SUMMONER_SPAWN_GROUP = 0x00000200, // 51 spells in 3.0.3, something defensive TODO: Needs implementation - SUMMON_PROP_FLAG_DO_NOT_TOGGLE = 0x00000400, // 3 spells, requires something near? TODO: Needs implementation - SUMMON_PROP_FLAG_DESPAWN_WHEN_EXPIRED = 0x00000800, // 30 spells in 3.0.3, no idea TODO: Needs implementation - SUMMON_PROP_FLAG_USE_SUMMONER_FACTION = 0x00001000, // Lightwell, Jeeves, Gnomish Alarm-o-bot, Build vehicles(wintergrasp) TODO: Needs implementation - SUMMON_PROP_FLAG_DO_NOT_FOLLOW_MOUNTED_SUMMONER = 0x00002000, // Guides, player follows TODO: Needs implementation - SUMMON_PROP_FLAG_SAVE_PET_AUTOCAST = 0x00004000, // Force of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental TODO: Needs implementation - SUMMON_PROP_FLAG_IGNORE_SUMMONER_PHASE = 0x00008000, // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related? TODO: Needs implementation + SUMMON_PROP_FLAG_ATTACK_SUMMONER = 0x00000001, // NYI 75 spells in 3.0.3, something unfriendly + SUMMON_PROP_FLAG_ASSIST_COMBAT_SUMMON = 0x00000002, // NYI 616 spells in 3.0.3, something friendly + SUMMON_PROP_FLAG_USE_LEVEL_OFFSET = 0x00000004, // NYI 22 spells in 3.0.3, no idea... + SUMMON_PROP_FLAG_DESPAWN_ON_SUMMONER_DEATH = 0x00000008, // NYI 49 spells in 3.0.3, some mounts + SUMMON_PROP_FLAG_ONLY_VISIBLE_TO_SUMMONER = 0x00000010, // 25 spells in 3.0.3, quest related? + SUMMON_PROP_FLAG_CANNOT_DISMISS_PET = 0x00000020, // NYI 0 spells in 3.3.5, unused + SUMMON_PROP_FLAG_USE_DEMON_TIMEOUT = 0x00000040, // NYI 12 spells in 3.0.3, no idea + SUMMON_PROP_FLAG_UNLIMITED_SUMMONS = 0x00000080, // NYI 4 spells in 3.0.3, no idea + SUMMON_PROP_FLAG_USE_CREATURE_LEVEL = 0x00000100, // NYI 51 spells in 3.0.3, no idea, many quest related + SUMMON_PROP_FLAG_JOIN_SUMMONER_SPAWN_GROUP = 0x00000200, // NYI 51 spells in 3.0.3, something defensive + SUMMON_PROP_FLAG_DO_NOT_TOGGLE = 0x00000400, // NYI 3 spells, requires something near? + SUMMON_PROP_FLAG_DESPAWN_WHEN_EXPIRED = 0x00000800, // NYI 30 spells in 3.0.3, no idea + SUMMON_PROP_FLAG_USE_SUMMONER_FACTION = 0x00001000, // NYI Lightwell, Jeeves, Gnomish Alarm-o-bot, Build vehicles(wintergrasp) + SUMMON_PROP_FLAG_DO_NOT_FOLLOW_MOUNTED_SUMMONER = 0x00002000, // NYI Guides, player follows + SUMMON_PROP_FLAG_SAVE_PET_AUTOCAST = 0x00004000, // NYI Force of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental + SUMMON_PROP_FLAG_IGNORE_SUMMONER_PHASE = 0x00008000, // NYI Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related? }; enum VehicleSeatFlags From 6889ed4f2a9c4db7c527944d54e39c7dadfee2e2 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:52:23 +0100 Subject: [PATCH 09/39] =?UTF-8?q?fix(Core/Items):=20Players=20should=20dis?= =?UTF-8?q?mount=20upon=20using=20Brazier=20of=20Dancin=E2=80=A6=20(#14055?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Core/Items): Players should dismount upon using Brazier of Dancing Flames. Fixes #10327 * Update. --- src/server/scripts/World/npcs_special.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index b5900487e..13b704f65 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -840,7 +840,10 @@ public: break; case TEXT_EMOTE_DANCE: if (!player->HasAura(SPELL_SEDUCTION)) + { + player->RemoveAurasByType(SPELL_AURA_MOUNTED); DoCast(player, SPELL_SEDUCTION, true); + } break; } } From 171b05a70cfe91965bf4a7749de957468d8f7086 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:52:40 +0100 Subject: [PATCH 10/39] =?UTF-8?q?fix(Scripts/OnyxiaLair):=20All=20Onyxia's?= =?UTF-8?q?=20adds=20should=20attack=20player=20on=20su=E2=80=A6=20(#14108?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/OnyxiaLair): All Onyxia's adds should attack player on summon. Fixes #14075 * Update. --- src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index c8f5bc090..33b1a0210 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -211,7 +211,7 @@ public: return; } - if (summon->GetEntry() == NPC_ONYXIAN_LAIR_GUARD && Phase != PHASE_LANDED) + if (summon->GetEntry() == NPC_ONYXIAN_LAIR_GUARD && Phase < PHASE_AIRPHASE) { return; } @@ -221,8 +221,6 @@ public: summon->AI()->AttackStart(target); DoZoneInCombat(summon); } - - summons.Summon(summon); } void MovementInform(uint32 type, uint32 id) override From 7a03130b94439f912ed235d3773d39a6038f4817 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:53:10 +0100 Subject: [PATCH 11/39] =?UTF-8?q?fix(Core/Spells):=20Regen=20auras=20shoul?= =?UTF-8?q?d=20not=20be=20removed=20by=20Rapid=20Recupera=E2=80=A6=20(#142?= =?UTF-8?q?69)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Spells): Regen auras should not be removed by Rapid Recuperation. Fixes #14263 --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 8ec38060c..955506172 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6177,7 +6177,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) case 56654: case 58882: int32 amount = int32(target->GetMaxPower(POWER_MANA) * GetAmount() / 100.0f); - target->CastCustomSpell(target, triggerSpellId, &amount, nullptr, nullptr, true); + target->CastCustomSpell(target, triggerSpellId, &amount, nullptr, nullptr, true, nullptr, this); return; } } From c3b8df8cb2acf3ba46f8900e2fe3d7ee7cdb2658 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 6 Jan 2023 00:53:37 +0100 Subject: [PATCH 12/39] =?UTF-8?q?fix(Core/Spells):=20Aura=20with=20`SPELL?= =?UTF-8?q?=5FAURA=5FMOD=5FFEAR`=20effect=20are=20always=20c=E2=80=A6=20(#?= =?UTF-8?q?14450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Spells): Aura with `SPELL_AURA_MOD_FEAR` effect are always considered as negative. Fixes #14297 --- src/server/game/Spells/SpellInfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 8851d3613..3a91dc994 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2725,6 +2725,7 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const return true; return false; case SPELL_AURA_MOD_ROOT: + case SPELL_AURA_MOD_FEAR: case SPELL_AURA_MOD_SILENCE: case SPELL_AURA_GHOST: case SPELL_AURA_PERIODIC_LEECH: From d45e9e7390b7bf7c3bbc3739aabbc96e8a514ae2 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Thu, 5 Jan 2023 18:53:55 -0500 Subject: [PATCH 13/39] fix(DB/quest_greeting_locale): Add esES/esMX quest greeting to Apothecary Helbrim. (#14482) * Create helgrim-esesmx.sql * We need to come together and ban semicolons. --- data/sql/updates/pending_db_world/helgrim-esesmx.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/helgrim-esesmx.sql diff --git a/data/sql/updates/pending_db_world/helgrim-esesmx.sql b/data/sql/updates/pending_db_world/helgrim-esesmx.sql new file mode 100644 index 000000000..dad0624e5 --- /dev/null +++ b/data/sql/updates/pending_db_world/helgrim-esesmx.sql @@ -0,0 +1,3 @@ +INSERT INTO `quest_greeting_locale` (`ID`, `type`, `locale`, `Greeting`, `VerifiedBuild`) VALUES +(3390, 0, 'esES', 'Los Baldíos cuentan con una gran riqueza de sustancias de las que nosotros, los boticarios de Lordaeron, podemos aprovecharnos.', 47014), +(3390, 0, 'esMX', 'Los Baldíos cuentan con una gran riqueza de sustancias de las que nosotros, los boticarios de Lordaeron, podemos aprovecharnos.', 47014); From 56d9bc8a3dd5155914e1f9a2215dd228eaeabfb2 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 5 Jan 2023 23:55:59 +0000 Subject: [PATCH 14/39] chore(DB): import pending files Referenced commit(s): d45e9e7390b7bf7c3bbc3739aabbc96e8a514ae2 --- .../helgrim-esesmx.sql => db_world/2023_01_05_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/helgrim-esesmx.sql => db_world/2023_01_05_02.sql} (90%) diff --git a/data/sql/updates/pending_db_world/helgrim-esesmx.sql b/data/sql/updates/db_world/2023_01_05_02.sql similarity index 90% rename from data/sql/updates/pending_db_world/helgrim-esesmx.sql rename to data/sql/updates/db_world/2023_01_05_02.sql index dad0624e5..74470d9eb 100644 --- a/data/sql/updates/pending_db_world/helgrim-esesmx.sql +++ b/data/sql/updates/db_world/2023_01_05_02.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_05_01 -> 2023_01_05_02 INSERT INTO `quest_greeting_locale` (`ID`, `type`, `locale`, `Greeting`, `VerifiedBuild`) VALUES (3390, 0, 'esES', 'Los Baldíos cuentan con una gran riqueza de sustancias de las que nosotros, los boticarios de Lordaeron, podemos aprovecharnos.', 47014), (3390, 0, 'esMX', 'Los Baldíos cuentan con una gran riqueza de sustancias de las que nosotros, los boticarios de Lordaeron, podemos aprovecharnos.', 47014); From 0ccd9309becd861aa4faf4495a7cf6c4b1fe8fed Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Fri, 6 Jan 2023 01:50:11 +0100 Subject: [PATCH 15/39] fix(DB/Quest): Make query rerunnable (#14512) --- data/sql/updates/db_world/2023_01_05_02.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/data/sql/updates/db_world/2023_01_05_02.sql b/data/sql/updates/db_world/2023_01_05_02.sql index 74470d9eb..87a448312 100644 --- a/data/sql/updates/db_world/2023_01_05_02.sql +++ b/data/sql/updates/db_world/2023_01_05_02.sql @@ -1,4 +1,5 @@ -- DB update 2023_01_05_01 -> 2023_01_05_02 +DELETE FROM `quest_greeting_locale` WHERE `ID` = 3390 AND `locale` IN ('esES', 'esMX'); INSERT INTO `quest_greeting_locale` (`ID`, `type`, `locale`, `Greeting`, `VerifiedBuild`) VALUES (3390, 0, 'esES', 'Los Baldíos cuentan con una gran riqueza de sustancias de las que nosotros, los boticarios de Lordaeron, podemos aprovecharnos.', 47014), (3390, 0, 'esMX', 'Los Baldíos cuentan con una gran riqueza de sustancias de las que nosotros, los boticarios de Lordaeron, podemos aprovecharnos.', 47014); From 6b4ef50e7a33fb6f5ffd5e563a964d4e330be132 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Thu, 5 Jan 2023 23:14:56 -0300 Subject: [PATCH 16/39] =?UTF-8?q?Revert=20"fix(Core/Spells):=20Ignite=20an?= =?UTF-8?q?d=20Revitalize=20should=20not=20prelong=20co=E2=80=A6=20(#14513?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "fix(Core/Spells): Ignite and Revitalize should not prelong combat. (#13812)" This reverts commit 96fa9c5c7b7274baa71f55a63dd40859d94d1aa2. --- src/server/game/Entities/Unit/Unit.cpp | 25 ++++++++----------- src/server/game/Entities/Unit/Unit.h | 2 +- .../game/Spells/SpellInfoCorrections.cpp | 7 ------ src/server/scripts/Spells/spell_druid.cpp | 2 +- src/server/scripts/Spells/spell_mage.cpp | 4 +-- src/server/scripts/Spells/spell_shaman.cpp | 2 +- src/server/scripts/Spells/spell_warrior.cpp | 2 +- 7 files changed, 16 insertions(+), 28 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5025c9147..2cef6e643 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7317,7 +7317,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (!blessHealing || !victim) return false; basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].Amplitude)); - victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_HEAL, basepoints0, triggeredByAura); + victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_HEAL, basepoints0); return true; } break; @@ -7707,7 +7707,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere basepoints0 = triggerAmount * damage / 400; triggered_spell_id = 61840; // Add remaining ticks to damage done - victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0, triggeredByAura); + victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0); return true; } // Sheath of Light @@ -8385,7 +8385,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere AddPct(basepoints0, glyph->GetAmount()); basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].Amplitude); - victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0, triggeredByAura); + victim->CastDelayedSpellWithPeriodicAmount(this, triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0); return true; } // Vendetta @@ -9053,7 +9053,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg basepoints0 = CalculatePct(int32(damage), triggerAmount) / 3; target = this; // Add remaining ticks to healing done - CastDelayedSpellWithPeriodicAmount(this, trigger_spell_id, SPELL_AURA_PERIODIC_HEAL, basepoints0, triggeredByAura); + CastDelayedSpellWithPeriodicAmount(this, trigger_spell_id, SPELL_AURA_PERIODIC_HEAL, basepoints0); return true; } break; @@ -9133,7 +9133,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].Amplitude); - victim->CastDelayedSpellWithPeriodicAmount(this, trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0, triggeredByAura); + victim->CastDelayedSpellWithPeriodicAmount(this, trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE, basepoints0); return true; } // Item - Hunter T9 4P Bonus (Steady Shot) @@ -20335,17 +20335,13 @@ void Unit::OutDebugInfo() const class AuraMunchingQueue : public BasicEvent { public: - AuraMunchingQueue(Unit& owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId, AuraEffect const* aurEff) : - _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId) - { - _aurEff = aurEff->GetBase()->GetDuration() > 400 ? aurEff : nullptr; - } + AuraMunchingQueue(Unit& owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId) : _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId) { } bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override { if (_owner.IsInWorld() && _owner.FindMap()) if (Unit* target = ObjectAccessor::GetUnit(_owner, _targetGUID)) - _owner.CastCustomSpell(_spellId, SPELLVALUE_BASE_POINT0, _basePoints, target, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, _aurEff, _owner.GetGUID()); + _owner.CastCustomSpell(_spellId, SPELLVALUE_BASE_POINT0, _basePoints, target, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, _owner.GetGUID()); return true; } @@ -20355,10 +20351,9 @@ private: ObjectGuid _targetGUID; int32 _basePoints; uint32 _spellId; - AuraEffect const* _aurEff; }; -void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, AuraEffect const* aurEff, uint8 effectIndex) +void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex) { for (AuraEffectList::iterator i = m_modAuras[auraType].begin(); i != m_modAuras[auraType].end(); ++i) { @@ -20372,9 +20367,9 @@ void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, Aura // xinef: delay only for casting on different unit if (this == caster) - caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, addAmount, this, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, aurEff, caster->GetGUID()); + 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, aurEff), caster->m_Events.CalculateQueueTime(400)); + caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId), caster->m_Events.CalculateQueueTime(400)); } void Unit::SendClearTarget() diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 449194597..2db7c364b 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2221,7 +2221,7 @@ public: uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const; float CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffectType damagetype) const; - void CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, AuraEffect const* aurEff, uint8 effectIndex = 0); + void CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex = 0); void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType = SPELL_BLOCK_TYPE_ALL); void ApplySpellDispelImmunity(SpellInfo const* spellProto, DispelType type, bool apply); diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 91834cf73..febeb19a9 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4465,13 +4465,6 @@ void SpellMgr::LoadSpellInfoCorrections() } }); - // Revitalize - ApplySpellFix({ 48540, 48541, 48542, 48543 }, [](SpellInfo* spellInfo) - { - spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT; - spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS; - }); - for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index fbfc19dcf..5f17b9633 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -126,7 +126,7 @@ class spell_dru_t10_balance_4p_bonus : public AuraScript SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); int32 amount = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()) / triggeredSpell->GetMaxTicks(); - eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(GetTarget(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, amount, aurEff, EFFECT_0); + eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(GetTarget(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE, amount, EFFECT_0); //GetTarget()->CastCustomSpell(triggered_spell_id, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 0aff531f6..1d96eccb2 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -701,7 +701,7 @@ class spell_mage_ignite : public AuraScript return true; } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { PreventDefaultAction(); @@ -711,7 +711,7 @@ class spell_mage_ignite : public AuraScript int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks()); // Xinef: implement ignite bug - eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(eventInfo.GetActor(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE, amount, aurEff); + eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(eventInfo.GetActor(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE, amount); //GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 05119a0e6..6977a0824 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -133,7 +133,7 @@ class spell_sha_t10_restoration_4p_bonus : public AuraScript } int32 amount = CalculatePct(healInfo->GetHeal(), aurEff->GetAmount()) / triggeredSpell->GetMaxTicks(); - eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(GetTarget(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL, amount, aurEff, EFFECT_0); + eventInfo.GetProcTarget()->CastDelayedSpellWithPeriodicAmount(GetTarget(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL, amount, EFFECT_0); } void Register() override diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 539216fee..35aec6db2 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -267,7 +267,7 @@ class spell_warr_deep_wounds : public SpellScript damage = target->MeleeDamageBonusTaken(caster, damage, BASE_ATTACK, GetSpellInfo()); // apply percent damage mods ApplyPct(damage, 16.0f * GetSpellInfo()->GetRank() / 6.0f); - target->CastDelayedSpellWithPeriodicAmount(caster, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, SPELL_AURA_PERIODIC_DAMAGE, damage, nullptr, EFFECT_0); + target->CastDelayedSpellWithPeriodicAmount(caster, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, SPELL_AURA_PERIODIC_DAMAGE, damage, EFFECT_0); //caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, &damage, nullptr, nullptr, true); } From 8d2dda24ed85e835953156d1df429567bfc6fea8 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Fri, 6 Jan 2023 03:23:21 +0100 Subject: [PATCH 17/39] fix(Core/Pets): Correct Pet size for bigger pets (#14511) * closes https://github.com/azerothcore/azerothcore-wotlk/issues/14488 --- src/server/game/Entities/Pet/Pet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 1a519a37a..23878020f 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -2441,6 +2441,10 @@ float Pet::GetNativeObjectScale() const else scale = creatureFamily->minScale + float(GetLevel() - creatureFamily->minScaleLevel) / creatureFamily->maxScaleLevel * (creatureFamily->maxScale - creatureFamily->minScale); + if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId())) + if (displayInfo->scale > 1.f) + scale *= displayInfo->scale; + return scale; } From 587d504ea0726530b607394189f5cad0a1134ac7 Mon Sep 17 00:00:00 2001 From: neifion-00000000 <91289495+neifion-00000000@users.noreply.github.com> Date: Fri, 6 Jan 2023 13:50:28 -0600 Subject: [PATCH 18/39] fix(DB/creature_loot): fix two quest rates in EK (#14520) Worn Stone Tokens are 100% Encrusted Tail Fins should be 100% and only off Saltscale Murlocs --- .../updates/pending_db_world/rev_1672995772284756600.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1672995772284756600.sql diff --git a/data/sql/updates/pending_db_world/rev_1672995772284756600.sql b/data/sql/updates/pending_db_world/rev_1672995772284756600.sql new file mode 100644 index 000000000..a124632fd --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1672995772284756600.sql @@ -0,0 +1,7 @@ +-- +-- Worn Stone Tokens are 100% +UPDATE `creature_loot_template` SET `Chance`=100 WHERE `Item`=3714 AND `entry` IN (2271, 2272, 2358, 2415, 2628); + +-- Encrusted Tail Fins should be 100% and only off Saltscale Murlocs +UPDATE `creature_loot_template` SET `Chance`=100 WHERE `Item`=5796 AND `entry` IN (871, 873, 875, 877, 879); +DELETE FROM `creature_loot_template` WHERE `Entry` IN (4457, 4458, 4459, 4460, 4461) AND `Item`=5796 AND `Reference`=0 AND `GroupId`=0; From 1b2c1600f5091c0a81e021e08b81a7ba37d704d4 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Fri, 6 Jan 2023 14:51:04 -0500 Subject: [PATCH 19/39] fix(DB/SAI): Add a few item restoration gossips/conditions/smart_scripts for Betina Bigglezink. (#14476) Create betina-quest-items.sql --- .../pending_db_world/betina-quest-items.sql | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 data/sql/updates/pending_db_world/betina-quest-items.sql diff --git a/data/sql/updates/pending_db_world/betina-quest-items.sql b/data/sql/updates/pending_db_world/betina-quest-items.sql new file mode 100644 index 000000000..8326fde65 --- /dev/null +++ b/data/sql/updates/pending_db_world/betina-quest-items.sql @@ -0,0 +1,32 @@ +DELETE FROM `gossip_menu_option` WHERE `MenuID` = 3651 AND `OptionID` IN (0, 1, 2); +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES +(3651, 0, 0, 'May I have another Dawn\'s Gambit, Betina? I want to test it again...', 7198, 1, 1, 0, 0, 0, 0, '', 0, 0), +(3651, 1, 0, 'Betina, I\'d like a replacement Seal of the Dawn please!', 10458, 1, 1, 0, 0, 0, 0, '', 0, 0), +(3651, 2, 0, 'Betina, I\'d like a replacement Rune of the Dawn please!', 10462, 1, 1, 0, 0, 0, 0, '', 0, 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 3651 AND `SourceId` IN (0, 1, 2); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 3651, 0, 0, 0, 2, 0, 12368, 1, 0, 1, 0, 0, '', 'If player does not have \'Dawn\'s Gambit\' in inventory'), +(15, 3651, 0, 0, 0, 2, 0, 12368, 1, 1, 1, 0, 0, '', 'If player does not have \'Dawn\'s Gambit\' in bank'), +(15, 3651, 0, 0, 0, 8, 0, 4771, 0, 0, 0, 0, 0, '', 'If player has quest \'Dawn\'s Gambit\' rewarded'), +(15, 3651, 1, 0, 0, 2, 0, 13209, 1, 0, 1, 0, 0, '', 'If player does not have \'Seal of the Dawn\' in inventory'), +(15, 3651, 1, 0, 0, 2, 0, 13209, 1, 1, 1, 0, 0, '', 'If player does not have \'Seal of the Dawn\' in bank'), +(15, 3651, 1, 0, 0, 2, 0, 19812, 1, 0, 1, 0, 0, '', 'If player does not have \'Rune of the Dawn\' in inventory'), +(15, 3651, 1, 0, 0, 2, 0, 19812, 1, 1, 1, 0, 0, '', 'If player does not have \'Rune of the Dawn\' in bank'), +(15, 3651, 1, 0, 0, 8, 0, 5213, 0, 0, 0, 0, 0, '', 'If player has quest \'The Active Agent\' rewarded'), +(15, 3651, 2, 0, 0, 2, 0, 13209, 1, 0, 1, 0, 0, '', 'If player does not have \'Seal of the Dawn\' in inventory'), +(15, 3651, 2, 0, 0, 2, 0, 13209, 1, 1, 1, 0, 0, '', 'If player does not have \'Seal of the Dawn\' in bank'), +(15, 3651, 2, 0, 0, 2, 0, 19812, 1, 0, 1, 0, 0, '', 'If player does not have \'Rune of the Dawn\' in inventory'), +(15, 3651, 2, 0, 0, 2, 0, 19812, 1, 1, 1, 0, 0, '', 'If player does not have \'Rune of the Dawn\' in bank'), +(15, 3651, 2, 0, 0, 8, 0, 5213, 0, 0, 0, 0, 0, '', 'If player has quest \'The Active Agent\' rewarded'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 11035; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 11035 AND `source_type` = 0 AND `id` IN (1, 2, 3, 4, 5, 6); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11035, 0, 1, 2, 62, 0, 100, 0, 3651, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Betina Bigglezink - On Gossip Option 0 Selected - Close Gossip'), +(11035, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 11, 18367, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Betina Bigglezink - On Link - Cast \'Create Dawn\'s Gambit\''), +(11035, 0, 3, 4, 62, 0, 100, 0, 3651, 1, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Betina Bigglezink - On Gossip Option 1 Selected - Close Gossip'), +(11035, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 11, 24179, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Betina Bigglezink - On Link - Cast \'Create Rune of the Dawn\''), +(11035, 0, 5, 6, 62, 0, 100, 0, 3651, 2, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Betina Bigglezink - On Gossip Option 2 Selected - Close Gossip'), +(11035, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 11, 24201, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Betina Bigglezink - On Link - Cast \'Create Seal of the Dawn\''); From e65e04d957ccf22efe5e4764c2680d25f6ee2ae5 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Fri, 6 Jan 2023 19:53:09 +0000 Subject: [PATCH 20/39] chore(DB): import pending files Referenced commit(s): 1b2c1600f5091c0a81e021e08b81a7ba37d704d4 --- .../betina-quest-items.sql => db_world/2023_01_06_00.sql} | 1 + .../rev_1672995772284756600.sql => db_world/2023_01_06_01.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/betina-quest-items.sql => db_world/2023_01_06_00.sql} (98%) rename data/sql/updates/{pending_db_world/rev_1672995772284756600.sql => db_world/2023_01_06_01.sql} (91%) diff --git a/data/sql/updates/pending_db_world/betina-quest-items.sql b/data/sql/updates/db_world/2023_01_06_00.sql similarity index 98% rename from data/sql/updates/pending_db_world/betina-quest-items.sql rename to data/sql/updates/db_world/2023_01_06_00.sql index 8326fde65..3e3d77d9e 100644 --- a/data/sql/updates/pending_db_world/betina-quest-items.sql +++ b/data/sql/updates/db_world/2023_01_06_00.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_05_02 -> 2023_01_06_00 DELETE FROM `gossip_menu_option` WHERE `MenuID` = 3651 AND `OptionID` IN (0, 1, 2); INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES (3651, 0, 0, 'May I have another Dawn\'s Gambit, Betina? I want to test it again...', 7198, 1, 1, 0, 0, 0, 0, '', 0, 0), diff --git a/data/sql/updates/pending_db_world/rev_1672995772284756600.sql b/data/sql/updates/db_world/2023_01_06_01.sql similarity index 91% rename from data/sql/updates/pending_db_world/rev_1672995772284756600.sql rename to data/sql/updates/db_world/2023_01_06_01.sql index a124632fd..08015c89b 100644 --- a/data/sql/updates/pending_db_world/rev_1672995772284756600.sql +++ b/data/sql/updates/db_world/2023_01_06_01.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_06_00 -> 2023_01_06_01 -- -- Worn Stone Tokens are 100% UPDATE `creature_loot_template` SET `Chance`=100 WHERE `Item`=3714 AND `entry` IN (2271, 2272, 2358, 2415, 2628); From b89eea668a28f608b71cc4289bc2d76b237fe294 Mon Sep 17 00:00:00 2001 From: Revision Date: Fri, 6 Jan 2023 20:54:59 +0100 Subject: [PATCH 21/39] fix(Apps): Update client data version (#14527) Update functions.sh --- apps/installer/includes/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/installer/includes/functions.sh b/apps/installer/includes/functions.sh index ea901c288..b9bdd9550 100644 --- a/apps/installer/includes/functions.sh +++ b/apps/installer/includes/functions.sh @@ -223,7 +223,7 @@ function inst_simple_restarter { function inst_download_client_data { # change the following version when needed - local VERSION=v15 + local VERSION=v16 echo "#######################" echo "Client data downloader" From 21700f2760fb22a85bd668462f32c643b402d3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Mauger?= Date: Sat, 7 Jan 2023 17:27:28 +0100 Subject: [PATCH 22/39] fix(Core/Loot): Fix too many quest items visible by master looter (#14510) * Fix too many quest items visible by master looter * Fix typo --- src/server/game/Loot/LootMgr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 2be3a9a69..e78bd0cc3 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -414,12 +414,13 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const } bool isMasterLooter = player->GetGroup() && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID(); + bool itemVisibleForMasterLooter = !needs_quest && (!follow_loot_rules || !is_underthreshold); // DB conditions check if (!sConditionMgr->IsObjectMeetToConditions(const_cast(player), conditions)) { // Master Looter can see conditioned recipes - if (isMasterLooter && (!follow_loot_rules || !is_underthreshold)) + if (isMasterLooter && itemVisibleForMasterLooter) { if ((pProto->Flags & ITEM_FLAG_HIDE_UNUSABLE_RECIPE) || (pProto->Class == ITEM_CLASS_RECIPE && pProto->Bonding == BIND_WHEN_PICKED_UP && pProto->Spells[1].SpellId != 0)) { @@ -442,7 +443,7 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const } // Master looter can see all items even if the character can't loot them - if (isMasterLooter && (!follow_loot_rules || !is_underthreshold)) + if (isMasterLooter && itemVisibleForMasterLooter) { return true; } From 7b774c8141128adf9d69bf7d0920e047fd15610d Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 7 Jan 2023 20:05:42 +0100 Subject: [PATCH 23/39] fix(Core/Spell): Roll 'dem Bones (#14522) * fix(Core/Spell): Roll 'dem Bones * closes https://github.com/azerothcore/azerothcore-wotlk/issues/14357 * Partial cp of https://github.com/TrinityCore/TrinityCore/commit/029527365f1763c45e8668c16ecd25ba7553bb22 Co-Authored-By: joschiwald <736792+joschiwald@users.noreply.github.com> * newline pleb Co-authored-by: joschiwald <736792+joschiwald@users.noreply.github.com> --- .../rev_1673000690518893100.sql | 4 ++ src/server/game/Spells/SpellEffects.cpp | 11 ----- src/server/scripts/Spells/spell_item.cpp | 42 +++++++++++++++++++ 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1673000690518893100.sql diff --git a/data/sql/updates/pending_db_world/rev_1673000690518893100.sql b/data/sql/updates/pending_db_world/rev_1673000690518893100.sql new file mode 100644 index 000000000..8fd7583a9 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1673000690518893100.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 47776 AND `ScriptName` = 'spell_item_worn_troll_dice'; +INSERT INTO `spell_script_names` VALUES +(47776, 'spell_item_worn_troll_dice'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4c4b6d6e7..68b2c5bd5 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3904,17 +3904,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) m_caster->TextEmote(buf); break; } - // Roll 'dem Bones - Worn Troll Dice - case 47776: - { - char buf[128]; - const char* gender = "his"; - if (m_caster->getGender() > 0) - gender = "her"; - sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName().c_str(), gender, urand(1, 6), urand(1, 6)); - m_caster->TextEmote(buf); - break; - } case 52173: // Coyote Spirit Despawn case 60243: // Blood Parrot Despawn if (unitTarget->GetTypeId() == TYPEID_UNIT && unitTarget->ToCreature()->IsSummon()) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index c085e64cf..9d527e6fe 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -23,6 +23,7 @@ #include "Battleground.h" #include "GameTime.h" +#include "ObjectMgr.h" #include "Player.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" @@ -3757,6 +3758,46 @@ class spell_item_green_whelp_armor : public AuraScript } }; +enum TrollDice +{ + TEXT_WORN_TROLL_DICE = 26152 +}; + +// 47776 - Roll 'dem Bones +class spell_item_worn_troll_dice : public SpellScript +{ + PrepareSpellScript(spell_item_worn_troll_dice); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sObjectMgr->GetBroadcastText(TEXT_WORN_TROLL_DICE)) + return false; + return true; + } + + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->TextEmote(TEXT_WORN_TROLL_DICE, GetHitUnit()); + + static uint32 const minimum = 1; + static uint32 const maximum = 6; + + // roll twice + GetCaster()->ToPlayer()->DoRandomRoll(minimum, maximum); + GetCaster()->ToPlayer()->DoRandomRoll(minimum, maximum); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_item_worn_troll_dice::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_item_spell_scripts() { RegisterSpellScript(spell_item_massive_seaforium_charge); @@ -3873,4 +3914,5 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_snowman); RegisterSpellScript(spell_item_freeze_rookery_egg); RegisterSpellScript(spell_item_green_whelp_armor); + RegisterSpellScript(spell_item_worn_troll_dice); } From 6788c7eace391064513041c4c5d74441fbbefa41 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 7 Jan 2023 20:06:17 +0100 Subject: [PATCH 24/39] fix(DB/Creature): Infested Root-Walker (#14515) * closes https://github.com/azerothcore/azerothcore-wotlk/issues/14490 Co-authored-by: Andrew Letson --- .../rev_1672970916826961100.sql | 7 ++++ .../scripts/Outland/zone_terokkar_forest.cpp | 34 ------------------- 2 files changed, 7 insertions(+), 34 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1672970916826961100.sql diff --git a/data/sql/updates/pending_db_world/rev_1672970916826961100.sql b/data/sql/updates/pending_db_world/rev_1672970916826961100.sql new file mode 100644 index 000000000..260d19950 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1672970916826961100.sql @@ -0,0 +1,7 @@ +-- +UPDATE `creature_template` SET `ScriptName` = '', `AIName` = 'SmartAI' WHERE `Entry` = 22095; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=22095; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22095, 0, 0, 0, 6, 0, 75, 0, 0, 0, 0, 0, 0, 11, 39130, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Infested Root-Walker - On Just Died - Cast \'Summon Wood Mites\''), +(22095, 0, 1, 0, 0, 0, 100, 0, 15000, 20000, 32000, 38000, 0, 11, 39000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Infested Root-Walker - In Combat - Cast \'Regrowth\' (No Repeat)'); diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index 567072a6c..f538ef0fd 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -24,7 +24,6 @@ EndScriptData */ /* ContentData npc_unkor_the_ruthless -npc_infested_root_walker npc_rotting_forest_rager npc_netherweb_victim npc_floon @@ -446,38 +445,6 @@ public: }; }; -/*###### -## npc_infested_root_walker -######*/ - -class npc_infested_root_walker : public CreatureScript -{ -public: - npc_infested_root_walker() : CreatureScript("npc_infested_root_walker") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_infested_root_walkerAI(creature); - } - - struct npc_infested_root_walkerAI : public ScriptedAI - { - npc_infested_root_walkerAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override { } - void EnterCombat(Unit* /*who*/) override { } - - void DamageTaken(Unit* done_by, uint32& damage, DamageEffectType, SpellSchoolMask) override - { - if (done_by && done_by->GetTypeId() == TYPEID_PLAYER) - if (me->GetHealth() <= damage) - if (rand() % 100 < 75) - //Summon Wood Mites - DoCast(me, 39130, true); - } - }; -}; - /*###### ## npc_rotting_forest_rager ######*/ @@ -872,7 +839,6 @@ void AddSC_terokkar_forest() // Theirs new npc_unkor_the_ruthless(); - new npc_infested_root_walker(); new npc_rotting_forest_rager(); new npc_floon(); new npc_isla_starmane(); From 992b977e194165e32d164cac08995cfa7cc872ea Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 7 Jan 2023 19:08:27 +0000 Subject: [PATCH 25/39] chore(DB): import pending files Referenced commit(s): 6788c7eace391064513041c4c5d74441fbbefa41 --- .../rev_1672970916826961100.sql => db_world/2023_01_07_00.sql} | 1 + .../rev_1673000690518893100.sql => db_world/2023_01_07_01.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1672970916826961100.sql => db_world/2023_01_07_00.sql} (95%) rename data/sql/updates/{pending_db_world/rev_1673000690518893100.sql => db_world/2023_01_07_01.sql} (81%) diff --git a/data/sql/updates/pending_db_world/rev_1672970916826961100.sql b/data/sql/updates/db_world/2023_01_07_00.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1672970916826961100.sql rename to data/sql/updates/db_world/2023_01_07_00.sql index 260d19950..979aea7de 100644 --- a/data/sql/updates/pending_db_world/rev_1672970916826961100.sql +++ b/data/sql/updates/db_world/2023_01_07_00.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_06_01 -> 2023_01_07_00 -- UPDATE `creature_template` SET `ScriptName` = '', `AIName` = 'SmartAI' WHERE `Entry` = 22095; diff --git a/data/sql/updates/pending_db_world/rev_1673000690518893100.sql b/data/sql/updates/db_world/2023_01_07_01.sql similarity index 81% rename from data/sql/updates/pending_db_world/rev_1673000690518893100.sql rename to data/sql/updates/db_world/2023_01_07_01.sql index 8fd7583a9..562c1f6b8 100644 --- a/data/sql/updates/pending_db_world/rev_1673000690518893100.sql +++ b/data/sql/updates/db_world/2023_01_07_01.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_07_00 -> 2023_01_07_01 -- DELETE FROM `spell_script_names` WHERE `spell_id` = 47776 AND `ScriptName` = 'spell_item_worn_troll_dice'; INSERT INTO `spell_script_names` VALUES From 9798ccd8c5a105396cb9bd97a930670ca0073ef0 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 7 Jan 2023 20:18:04 +0100 Subject: [PATCH 26/39] =?UTF-8?q?fix(Scripts/Hellfire=20Ramparts):=20Nazan?= =?UTF-8?q?=20should=20walk=20on=20the=20surface=20afte=E2=80=A6=20(#14539?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/Hellfire Ramparts): Nazan should walk on the surface after descending. Nazan should keep using Fireball after descending. Nazan should chase its victims properly after descending. Fixes #14468 --- .../updates/pending_db_world/rev_1673086888979134900.sql | 2 ++ .../HellfireRamparts/boss_vazruden_the_herald.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/rev_1673086888979134900.sql diff --git a/data/sql/updates/pending_db_world/rev_1673086888979134900.sql b/data/sql/updates/pending_db_world/rev_1673086888979134900.sql new file mode 100644 index 000000000..41fe57b87 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1673086888979134900.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x00000200 WHERE `entry` IN (17536,18432); diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 24e0d42a8..6a8c48374 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -196,6 +196,8 @@ public: { Talk(EMOTE_NAZAN); events.Reset(); + me->SetReactState(REACT_PASSIVE); + me->InterruptNonMeleeSpells(true); me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 81.2f, false); } } @@ -206,8 +208,10 @@ public: { me->SetCanFly(false); me->SetDisableGravity(false); - events.ScheduleEvent(EVENT_RESTORE_COMBAT, 0); + me->SetReactState(REACT_AGGRESSIVE); + events.ScheduleEvent(EVENT_RESTORE_COMBAT, 1); events.ScheduleEvent(EVENT_SPELL_CONE_OF_FIRE, 5000); + events.ScheduleEvent(EVENT_SPELL_FIREBALL, 6000); if (IsHeroic()) events.ScheduleEvent(EVENT_SPELL_BELLOWING_ROAR, 10000); } From de92ae1d3155b21bd1c877c0b959285c9d4b64f1 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 7 Jan 2023 19:20:03 +0000 Subject: [PATCH 27/39] chore(DB): import pending files Referenced commit(s): 9798ccd8c5a105396cb9bd97a930670ca0073ef0 --- .../rev_1673086888979134900.sql => db_world/2023_01_07_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1673086888979134900.sql => db_world/2023_01_07_02.sql} (70%) diff --git a/data/sql/updates/pending_db_world/rev_1673086888979134900.sql b/data/sql/updates/db_world/2023_01_07_02.sql similarity index 70% rename from data/sql/updates/pending_db_world/rev_1673086888979134900.sql rename to data/sql/updates/db_world/2023_01_07_02.sql index 41fe57b87..8a8fe6ad1 100644 --- a/data/sql/updates/pending_db_world/rev_1673086888979134900.sql +++ b/data/sql/updates/db_world/2023_01_07_02.sql @@ -1,2 +1,3 @@ +-- DB update 2023_01_07_01 -> 2023_01_07_02 -- UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x00000200 WHERE `entry` IN (17536,18432); From e322c017ea62906af7bfc2839da1e6b0a23b5863 Mon Sep 17 00:00:00 2001 From: Alvin Zhu Date: Sun, 8 Jan 2023 03:21:47 +0800 Subject: [PATCH 28/39] fix(Core/Gossip): quest_greeting_locale doesn't work #10913 (#14532) * fix issue #10913 fix GetQuestGreetingLocale typeIndex just like GetQuestGreeting * Update ObjectMgr.h * fix Core/Gossip: gossipMenuLocale doesn't work * Revert "fix Core/Gossip: gossipMenuLocale doesn't work" This reverts commit f59f07d1504f21cf2ae1eaa37aa088100c352e3b. --- src/server/game/Globals/ObjectMgr.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 72e8488a0..41ca797c6 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1263,7 +1263,21 @@ public: } [[nodiscard]] QuestGreetingLocale const* GetQuestGreetingLocale(TypeID type, uint32 id) const { - QuestGreetingLocaleContainer::const_iterator itr = _questGreetingLocaleStore.find(MAKE_PAIR32(type, id)); + uint32 typeIndex; + if (type == TYPEID_UNIT) + { + typeIndex = 0; + } + else if (type == TYPEID_GAMEOBJECT) + { + typeIndex = 1; + } + else + { + return nullptr; + } + + QuestGreetingLocaleContainer::const_iterator itr = _questGreetingLocaleStore.find(MAKE_PAIR32(typeIndex, id)); if (itr == _questGreetingLocaleStore.end()) return nullptr; return &itr->second; } From 777a1be39467c3b0718c2b7038f47dced2e28260 Mon Sep 17 00:00:00 2001 From: lineagedr Date: Sat, 7 Jan 2023 21:27:49 +0200 Subject: [PATCH 29/39] fix(Core/Packets): Fix a crash in MSG_RANDOM_ROLL. (#14545) --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Handlers/GroupHandler.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2109d1372..ba8ad1c2a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16047,7 +16047,7 @@ void Player::RemoveRestFlag(RestFlag restFlag) uint32 Player::DoRandomRoll(uint32 minimum, uint32 maximum) { - ASSERT(minimum <= maximum || maximum <= 10000); + ASSERT(minimum <= maximum); uint32 roll = urand(minimum, maximum); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index cf0e23b26..69bde972a 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -567,6 +567,12 @@ void WorldSession::HandleRandomRollOpcode(WorldPackets::Misc::RandomRollClient& minimum = packet.Min; maximum = packet.Max; + /** error handling **/ + if (minimum > maximum || maximum > 10000) // < 32768 for urand call + { + return; + } + GetPlayer()->DoRandomRoll(minimum, maximum); } From 8cb88cce520d4cf7d900cfee506ff7160e447256 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 7 Jan 2023 20:28:22 +0100 Subject: [PATCH 30/39] =?UTF-8?q?fix(Scripts/The=20Underbog):=20Rewritten?= =?UTF-8?q?=20The=20Black=20Stalker's=20Levitate=20mec=E2=80=A6=20(#14541)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/The Underbog): Rewritten The Black Stalker's Levitate mechanic. Fixes #13988 * buildfix. * Update src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp Co-authored-by: offl Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --- .../rev_1673089237816039500.sql | 11 ++ src/server/game/Spells/SpellEffects.cpp | 2 +- .../underbog/boss_the_black_stalker.cpp | 167 +++++++++++++----- 3 files changed, 132 insertions(+), 48 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1673089237816039500.sql diff --git a/data/sql/updates/pending_db_world/rev_1673089237816039500.sql b/data/sql/updates/pending_db_world/rev_1673089237816039500.sql new file mode 100644 index 000000000..95d0f7f5c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1673089237816039500.sql @@ -0,0 +1,11 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` IN (31704,31701,31702,31703); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(31704,'spell_the_black_stalker_levitate'), +(31701,'spell_the_black_stalker_levitation_pulse'), +(31702,'spell_the_black_stalker_someone_grab_me'), +(31703,'spell_the_black_stalker_magnetic_pull'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` = 31702; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,31702,0,0,31,0,3,17992,0,0,0,0,"","Group 0: Spell 'Someone Grab Me' (Effect 0) targets creature 'Coilfang Invisible Vacuum Dummy'"); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 68b2c5bd5..3a92f0472 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5176,7 +5176,7 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex) pos.Relocate(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ() + 1.0f, m_caster->GetOrientation()); } - float speedXY = float(m_spellInfo->Effects[effIndex].MiscValue) * 0.1f; + float speedXY = float(m_spellInfo->Effects[effIndex].MiscValue) ? float(m_spellInfo->Effects[effIndex].MiscValue) * 0.1f : 30.f; float speedZ = unitTarget->GetDistance(pos) / speedXY * 0.5f * Movement::gravity; unitTarget->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ); diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp index 631060c1c..862f27301 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -20,16 +20,33 @@ #include "SpellScript.h" #include "the_underbog.h" +/* +How levitation sequence works: boss casts Levitate and it triggers a chain of spells, target(any target, player or pet, any position in +threat list) eventually gets pulled towards by randomly selected trigger. Then target becomes protected from Pull Towards by Suspension +aura which is triggered every 1 sec up to 4 times. Since it has stun mechanic, diminishing returns cuts off its duration every cast in +half (20 > 10 > 5 > 0). Eventually player becomes immune to Suspension and vulnerable to another pull towards. +Whole levitate sequence is designed to pull player towards up to 3 times. Usually it works like this: player gets pulled towards, +gets protected by Suspension from Pull Towards next 2 times. If player is unlucky, boss can cast Levitate on same player again, in that case +player can be pulled towards 2 times in a row without any protection from fall damage by Suspension(case from sniffs). +However currently diminishing returns affects Suspension after first cast, its duration is 10 instead of 20 seconds and player will be +immune to 4th cast. That allows to pull player towards when levitation sequence ends. Levitation sequence has sensetive design and looks +like lack of delays between packets makes it work differently too. +Of course as was said above player can be pulled towards 2 times in a row but that looks like a rare case. +*/ + enum eBlackStalker { SPELL_LEVITATE = 31704, - SPELL_SUSPENSION = 31719, - SPELL_LEVITATION_PULSE = 31701, - SPELL_MAGNETIC_PULL = 31705, SPELL_CHAIN_LIGHTNING = 31717, SPELL_STATIC_CHARGE = 31715, SPELL_SUMMON_SPORE_STRIDER = 38755, + SPELL_LEVITATION_PULSE = 31701, + SPELL_SOMEONE_GRAB_ME = 31702, + SPELL_MAGNETIC_PULL = 31703, + SPELL_SUSPENSION_PRIMER = 31720, + SPELL_SUSPENSION = 31719, + EVENT_LEVITATE = 1, EVENT_SPELL_CHAIN = 2, EVENT_SPELL_STATIC = 3, @@ -47,15 +64,9 @@ struct boss_the_black_stalker : public BossAI { } - void Reset() override - { - lTarget.Clear(); - BossAI::Reset(); - } - void EnterCombat(Unit* who) override { - events.ScheduleEvent(EVENT_LEVITATE, 12000); + events.ScheduleEvent(EVENT_LEVITATE, urand(8000, 12000)); events.ScheduleEvent(EVENT_SPELL_CHAIN, 6000); events.ScheduleEvent(EVENT_SPELL_STATIC, 10000); events.ScheduleEvent(EVENT_CHECK, 5000); @@ -88,6 +99,10 @@ struct boss_the_black_stalker : public BossAI return; events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + switch (events.ExecuteEvent()) { case EVENT_CHECK: @@ -107,7 +122,6 @@ struct boss_the_black_stalker : public BossAI case EVENT_SPELL_CHAIN: if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false); - events.DelayEvents(3000); events.RepeatEvent(9000); break; case EVENT_SPELL_STATIC: @@ -116,46 +130,16 @@ struct boss_the_black_stalker : public BossAI events.RepeatEvent(10000); break; case EVENT_LEVITATE: - events.RepeatEvent(15000); - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1)) - { - me->CastSpell(target, SPELL_LEVITATE, false); - lTarget = target->GetGUID(); - events.DelayEvents(5000); - events.ScheduleEvent(EVENT_LEVITATE_TARGET_1, 2000); - } + DoCastSelf(SPELL_LEVITATE); + events.RepeatEvent(urand(18000, 24000)); break; - case EVENT_LEVITATE_TARGET_1: - if (Unit* target = ObjectAccessor::GetUnit(*me, lTarget)) - { - if (!target->HasAura(SPELL_LEVITATE)) - lTarget.Clear(); - else - { - target->CastSpell(target, SPELL_MAGNETIC_PULL, true); - events.ScheduleEvent(EVENT_LEVITATE_TARGET_2, 1500); - } - } - break; - case EVENT_LEVITATE_TARGET_2: - if (Unit* target = ObjectAccessor::GetUnit(*me, lTarget)) - { - if (!target->HasAura(SPELL_LEVITATE)) - lTarget.Clear(); - else - { - target->AddAura(SPELL_SUSPENSION, target); - lTarget.Clear(); - } - } - break; - } + } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; DoMeleeAttackIfReady(); } - -private: - ObjectGuid lTarget; }; class spell_gen_allergies : public AuraScript @@ -180,8 +164,97 @@ class spell_gen_allergies : public AuraScript } }; +// 31704 - Levitate +class spell_the_black_stalker_levitate : public SpellScript +{ + PrepareSpellScript(spell_the_black_stalker_levitate); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_LEVITATION_PULSE }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_LEVITATION_PULSE, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_the_black_stalker_levitate::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 31701 - Levitation Pulse +class spell_the_black_stalker_levitation_pulse : public SpellScript +{ + PrepareSpellScript(spell_the_black_stalker_levitation_pulse); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SOMEONE_GRAB_ME }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), SPELL_SOMEONE_GRAB_ME, true); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_the_black_stalker_levitation_pulse::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 31702 - Someone Grab Me +class spell_the_black_stalker_someone_grab_me : public SpellScript +{ + PrepareSpellScript(spell_the_black_stalker_someone_grab_me); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAGNETIC_PULL, SPELL_SUSPENSION }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (!GetCaster()->HasAura(SPELL_SUSPENSION)) + GetHitUnit()->CastSpell(GetCaster(), SPELL_MAGNETIC_PULL); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_the_black_stalker_someone_grab_me::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 31703 - Magnetic Pull +class spell_the_black_stalker_magnetic_pull : public SpellScript +{ + PrepareSpellScript(spell_the_black_stalker_magnetic_pull); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SUSPENSION_PRIMER }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_SUSPENSION_PRIMER, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_the_black_stalker_magnetic_pull::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_boss_the_black_stalker() { RegisterUnderbogCreatureAI(boss_the_black_stalker); RegisterSpellScript(spell_gen_allergies); + RegisterSpellScript(spell_the_black_stalker_levitate); + RegisterSpellScript(spell_the_black_stalker_levitation_pulse); + RegisterSpellScript(spell_the_black_stalker_someone_grab_me); + RegisterSpellScript(spell_the_black_stalker_magnetic_pull); } From 312c1eac3e3d053cd72eef42486ec7fc8d65074b Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 7 Jan 2023 20:29:03 +0100 Subject: [PATCH 31/39] fix(Scripts/Underbog): Fixed Fungal Decay spells. (#14543) Fixes #13977 --- .../rev_1673095047755497100.sql | 4 ++ .../CoilfangReservoir/underbog/underbog.cpp | 46 +++++++++++++++++++ .../scripts/Outland/outland_script_loader.cpp | 6 ++- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1673095047755497100.sql create mode 100644 src/server/scripts/Outland/CoilfangReservoir/underbog/underbog.cpp diff --git a/data/sql/updates/pending_db_world/rev_1673095047755497100.sql b/data/sql/updates/pending_db_world/rev_1673095047755497100.sql new file mode 100644 index 000000000..9ceb943cc --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1673095047755497100.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`=32065; +INSERT INTO `spell_script_names` VALUES +(32065,'spell_fungal_decay'); diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/underbog.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/underbog.cpp new file mode 100644 index 000000000..978b64ca5 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/underbog.cpp @@ -0,0 +1,46 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "the_underbog.h" + +class spell_fungal_decay : public AuraScript +{ + PrepareAuraScript(spell_fungal_decay); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + ModStackAmount(5); + } + + void PeriodicTick(AuraEffect const* /*aurEff*/) + { + ModStackAmount(-1); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_fungal_decay::OnApply, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_fungal_decay::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE); + } +}; + +void AddSC_underbog() +{ + RegisterSpellScript(spell_fungal_decay); +} diff --git a/src/server/scripts/Outland/outland_script_loader.cpp b/src/server/scripts/Outland/outland_script_loader.cpp index 310ee1e7a..dc084c74a 100644 --- a/src/server/scripts/Outland/outland_script_loader.cpp +++ b/src/server/scripts/Outland/outland_script_loader.cpp @@ -50,7 +50,8 @@ void AddSC_boss_hydromancer_thespia(); //CR Steam Vault void AddSC_boss_mekgineer_steamrigger(); void AddSC_boss_warlord_kalithresh(); void AddSC_instance_steam_vault(); -void AddSC_boss_hungarfen(); //CR Underbog +void AddSC_underbog(); //CR Underbog +void AddSC_boss_hungarfen(); void AddSC_boss_ghazan(); void AddSC_boss_the_black_stalker(); void AddSC_instance_the_underbog(); @@ -145,7 +146,8 @@ void AddOutlandScripts() AddSC_boss_mekgineer_steamrigger(); AddSC_boss_warlord_kalithresh(); AddSC_instance_steam_vault(); - AddSC_boss_hungarfen(); //CR Underbog + AddSC_underbog(); //CR Underbog + AddSC_boss_hungarfen(); AddSC_boss_ghazan(); AddSC_boss_the_black_stalker(); AddSC_instance_the_underbog(); From 9ba464a12bcd45d23a62b86d6032c73d005a19c7 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 7 Jan 2023 20:30:01 +0100 Subject: [PATCH 32/39] fix(Core/Spells): Fixed applying some proc ex flags to melee attacks. (#14254) Fixes #14216 --- src/server/game/Entities/Unit/Unit.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2cef6e643..2a124c523 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1698,6 +1698,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, Weapon if (fullBlockMask == ((1 << 0) | (1 << 1))) { damageInfo->TargetState = VICTIMSTATE_BLOCKS; + damageInfo->procEx |= PROC_EX_FULL_BLOCK; damageInfo->blocked_amount -= remainingBlock; } break; @@ -1804,6 +1805,16 @@ void Unit::CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, Weapon { damageInfo->HitInfo |= (tmpHitInfo[0] & HITINFO_PARTIAL_RESIST); } + + if (damageInfo->HitInfo & (HITINFO_PARTIAL_ABSORB | HITINFO_FULL_ABSORB)) + { + damageInfo->procEx |= PROC_EX_ABSORB; + } + + if (damageInfo->HitInfo & HITINFO_FULL_RESIST) + { + damageInfo->procEx |= PROC_EX_RESIST; + } } void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) From dbeffd146666e6008d29af5ef00f442e2af0230b Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 7 Jan 2023 20:30:09 +0100 Subject: [PATCH 33/39] fix(DB/Texts): Added texts to Halazzi. (#14124) * fix(DB/Texts): Added texts to Halazzi. Fixes #8744 * Update. --- .../pending_db_world/rev_1670753866467974200.sql | 11 +++++++++++ .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 13 ++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1670753866467974200.sql diff --git a/data/sql/updates/pending_db_world/rev_1670753866467974200.sql b/data/sql/updates/pending_db_world/rev_1670753866467974200.sql new file mode 100644 index 000000000..fb4600aa9 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1670753866467974200.sql @@ -0,0 +1,11 @@ +-- +DELETE FROM `creature_text` WHERE `CreatureID`=23577; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(23577,0,0,'Get on ya knees and bow.... to da fang and claw!',14,0,100,0,0,12020,0,0,'Halazzi - SAY_AGGRO'), +(23577,1,0,'You can\t fight da power!',14,0,100,0,0,12026,0,0,'Halazzi - SAY_KILL'), +(23577,1,1,'Ya all gonna fail!',14,0,100,0,0,12027,0,0,'Halazzi - SAY_KILL'), +(23577,2,0,'Me gonna carve ya now!',14,0,100,0,0,12023,0,0,'Halazzi - SAY_SABER'), +(23577,2,1,'You gonna leave in pieces!',14,0,100,0,0,12024,0,0,'Halazzi - SAY_SABER'), +(23577,3,0,'I fight wit\ untamed spirit....',14,0,100,0,0,12021,0,0,'Halazzi - SAY_SPLIT'), +(23577,4,0,'Spirit, come back to me!',14,0,100,0,0,12022,0,0,'Halazzi - SAY_MERGE'), +(23577,5,0,'Chaga... choka\jinn.',14,0,100,0,0,12028,0,0,'Halazzi - SAY_DEATH'); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index 0bfc8b7a3..ee104d45e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -56,12 +56,11 @@ enum PhaseHalazzi enum Yells { SAY_AGGRO = 0, - SAY_SABER = 1, - SAY_SPLIT = 2, - SAY_MERGE = 3, - SAY_KILL = 4, - SAY_DEATH = 5, - SAY_BERSERK = 6 + SAY_KILL = 1, + SAY_SABER = 2, + SAY_SPLIT = 3, + SAY_MERGE = 4, + SAY_DEATH = 5 }; class boss_halazzi : public CreatureScript @@ -197,7 +196,6 @@ public: if (BerserkTimer <= diff) { - Talk(SAY_BERSERK); DoCast(me, SPELL_BERSERK, true); BerserkTimer = 60000; } @@ -207,6 +205,7 @@ public: { if (SaberlashTimer <= diff) { + Talk(SAY_SABER); // A tank with more than 490 defense skills should receive no critical hit //DoCast(me, 41296, true); DoCastVictim(SPELL_SABER_LASH, true); From c0ce43a383d641fe5149c78c8e958e8e085ebf8c Mon Sep 17 00:00:00 2001 From: BeefSteak Date: Sat, 7 Jan 2023 19:30:47 +0000 Subject: [PATCH 34/39] fix(DB/Creature): Cho'war the Pillager (#13896) Create changes.sql --- data/sql/updates/pending_db_world/changes.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 data/sql/updates/pending_db_world/changes.sql diff --git a/data/sql/updates/pending_db_world/changes.sql b/data/sql/updates/pending_db_world/changes.sql new file mode 100644 index 000000000..6ce3b5fca --- /dev/null +++ b/data/sql/updates/pending_db_world/changes.sql @@ -0,0 +1,8 @@ +-- Immunities +UPDATE `creature_template` SET `mechanic_immune_mask` = 6292 WHERE (`entry` = 18423); +-- Spawn time +UPDATE `creature` SET `spawntimesecs`=60 WHERE `guid`=31747 AND `id1`=18423; +-- Mortal strike +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 18423) 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`, `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 +(18423, 0, 3, 0, 2, 0, 100, 0, 20, 80, 5000, 15000, 0, 11, 15708, 32, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Cho\'war the Pillager - Between 20-80% Health - Cast \'15708\' (No Repeat)'); From 8d4dd950144cb98c974e02c756aed7351e14d939 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 7 Jan 2023 19:34:42 +0000 Subject: [PATCH 35/39] chore(DB): import pending files Referenced commit(s): c0ce43a383d641fe5149c78c8e958e8e085ebf8c --- .../{pending_db_world/changes.sql => db_world/2023_01_07_03.sql} | 1 + .../rev_1670753866467974200.sql => db_world/2023_01_07_04.sql} | 1 + .../rev_1673089237816039500.sql => db_world/2023_01_07_05.sql} | 1 + .../rev_1673095047755497100.sql => db_world/2023_01_07_06.sql} | 1 + 4 files changed, 4 insertions(+) rename data/sql/updates/{pending_db_world/changes.sql => db_world/2023_01_07_03.sql} (95%) rename data/sql/updates/{pending_db_world/rev_1670753866467974200.sql => db_world/2023_01_07_04.sql} (95%) rename data/sql/updates/{pending_db_world/rev_1673089237816039500.sql => db_world/2023_01_07_05.sql} (95%) rename data/sql/updates/{pending_db_world/rev_1673095047755497100.sql => db_world/2023_01_07_06.sql} (74%) diff --git a/data/sql/updates/pending_db_world/changes.sql b/data/sql/updates/db_world/2023_01_07_03.sql similarity index 95% rename from data/sql/updates/pending_db_world/changes.sql rename to data/sql/updates/db_world/2023_01_07_03.sql index 6ce3b5fca..f5f200c68 100644 --- a/data/sql/updates/pending_db_world/changes.sql +++ b/data/sql/updates/db_world/2023_01_07_03.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_07_02 -> 2023_01_07_03 -- Immunities UPDATE `creature_template` SET `mechanic_immune_mask` = 6292 WHERE (`entry` = 18423); -- Spawn time diff --git a/data/sql/updates/pending_db_world/rev_1670753866467974200.sql b/data/sql/updates/db_world/2023_01_07_04.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1670753866467974200.sql rename to data/sql/updates/db_world/2023_01_07_04.sql index fb4600aa9..3c318dc99 100644 --- a/data/sql/updates/pending_db_world/rev_1670753866467974200.sql +++ b/data/sql/updates/db_world/2023_01_07_04.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_07_03 -> 2023_01_07_04 -- DELETE FROM `creature_text` WHERE `CreatureID`=23577; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1673089237816039500.sql b/data/sql/updates/db_world/2023_01_07_05.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1673089237816039500.sql rename to data/sql/updates/db_world/2023_01_07_05.sql index 95d0f7f5c..c4f03c162 100644 --- a/data/sql/updates/pending_db_world/rev_1673089237816039500.sql +++ b/data/sql/updates/db_world/2023_01_07_05.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_07_04 -> 2023_01_07_05 -- DELETE FROM `spell_script_names` WHERE `spell_id` IN (31704,31701,31702,31703); INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1673095047755497100.sql b/data/sql/updates/db_world/2023_01_07_06.sql similarity index 74% rename from data/sql/updates/pending_db_world/rev_1673095047755497100.sql rename to data/sql/updates/db_world/2023_01_07_06.sql index 9ceb943cc..f6b50c778 100644 --- a/data/sql/updates/pending_db_world/rev_1673095047755497100.sql +++ b/data/sql/updates/db_world/2023_01_07_06.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_07_05 -> 2023_01_07_06 -- DELETE FROM `spell_script_names` WHERE `spell_id`=32065; INSERT INTO `spell_script_names` VALUES From ed2997ab10c4ce1c7011f6859857f10145576488 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 7 Jan 2023 20:36:39 +0100 Subject: [PATCH 36/39] fix(Core/Creature): Check model increase only for Exotic creatures (#14526) * closes https://github.com/azerothcore/azerothcore-wotlk/issues/14525 --- src/server/game/Entities/Pet/Pet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 23878020f..55537b8a6 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -2442,7 +2442,7 @@ float Pet::GetNativeObjectScale() const scale = creatureFamily->minScale + float(GetLevel() - creatureFamily->minScaleLevel) / creatureFamily->maxScaleLevel * (creatureFamily->maxScale - creatureFamily->minScale); if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId())) - if (displayInfo->scale > 1.f) + if (displayInfo->scale > 1.f && GetCreatureTemplate()->IsExotic()) scale *= displayInfo->scale; return scale; From 97a01b430dd3f2b0ba4d6c63bb5c0d7c4f5c5cab Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 7 Jan 2023 23:08:19 +0100 Subject: [PATCH 37/39] fix(Script/Item): Elixir of Shadows for pets (#14514) * closes https://github.com/azerothcore/azerothcore-wotlk/issues/13067 --- .../rev_1672970116654820600.sql | 4 ++++ src/server/scripts/Spells/spell_item.cpp | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1672970116654820600.sql diff --git a/data/sql/updates/pending_db_world/rev_1672970116654820600.sql b/data/sql/updates/pending_db_world/rev_1672970116654820600.sql new file mode 100644 index 000000000..3e56b2b54 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1672970116654820600.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`=37678 AND `ScriptName`='spell_item_elixir_of_shadows'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(37678, 'spell_item_elixir_of_shadows'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 9d527e6fe..973c38622 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -25,6 +25,7 @@ #include "GameTime.h" #include "ObjectMgr.h" #include "Player.h" +#include "Pet.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SkillDiscovery.h" @@ -3758,6 +3759,26 @@ class spell_item_green_whelp_armor : public AuraScript } }; +// 37678 - elixir of shadows +/// @todo Temporary fix until pet restrictions vs player restrictions are investigated +class spell_item_elixir_of_shadows : public SpellScript +{ + PrepareSpellScript(spell_item_elixir_of_shadows); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Player* player = GetCaster()->ToPlayer()) + if (Pet* pet = player->GetPet()) + pet->AddAura(37678 /*Elixir of Shadows*/, pet); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_item_elixir_of_shadows::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + OnEffectHitTarget += SpellEffectFn(spell_item_elixir_of_shadows::HandleEffect, EFFECT_1, SPELL_EFFECT_APPLY_AURA); + } +}; + enum TrollDice { TEXT_WORN_TROLL_DICE = 26152 @@ -3914,5 +3935,6 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_snowman); RegisterSpellScript(spell_item_freeze_rookery_egg); RegisterSpellScript(spell_item_green_whelp_armor); + RegisterSpellScript(spell_item_elixir_of_shadows); RegisterSpellScript(spell_item_worn_troll_dice); } From cdcb0ceff7249e072d53c6e4a4f2460ff3442463 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 7 Jan 2023 22:10:23 +0000 Subject: [PATCH 38/39] chore(DB): import pending files Referenced commit(s): 97a01b430dd3f2b0ba4d6c63bb5c0d7c4f5c5cab --- .../rev_1672970116654820600.sql => db_world/2023_01_07_07.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1672970116654820600.sql => db_world/2023_01_07_07.sql} (83%) diff --git a/data/sql/updates/pending_db_world/rev_1672970116654820600.sql b/data/sql/updates/db_world/2023_01_07_07.sql similarity index 83% rename from data/sql/updates/pending_db_world/rev_1672970116654820600.sql rename to data/sql/updates/db_world/2023_01_07_07.sql index 3e56b2b54..51f8ca2f5 100644 --- a/data/sql/updates/pending_db_world/rev_1672970116654820600.sql +++ b/data/sql/updates/db_world/2023_01_07_07.sql @@ -1,3 +1,4 @@ +-- DB update 2023_01_07_06 -> 2023_01_07_07 -- DELETE FROM `spell_script_names` WHERE `spell_id`=37678 AND `ScriptName`='spell_item_elixir_of_shadows'; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES From 592a26cb8c46a9db92a70c275f1d8625f8949c1d Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Wed, 11 Jan 2023 06:40:03 +0100 Subject: [PATCH 39/39] fix(Core): Crashfix. (#14536) --- src/server/game/Movement/Spline/MovementPacketBuilder.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index b7ccda009..b360c6b3d 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -191,7 +191,10 @@ namespace Movement uint32 nodes = move_spline.getPath().size(); data << nodes; - data.append(&move_spline.getPath()[0], nodes); + if (nodes) + { + data.append(&move_spline.getPath()[0], nodes); + } data << uint8(move_spline.spline.mode()); // added in 3.1 data << (move_spline.isCyclic() ? Vector3::zero() : move_spline.FinalDestination()); }