From c9d65d33d833c2ece475c57aced71815da61831d Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 10 Dec 2022 20:10:23 -0300 Subject: [PATCH 01/28] fix(DB/SAI): Script all of the Dark Portal opening event creatures (#14118) --- .../rev_1670679892928774900.sql | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1670679892928774900.sql diff --git a/data/sql/updates/pending_db_world/rev_1670679892928774900.sql b/data/sql/updates/pending_db_world/rev_1670679892928774900.sql new file mode 100644 index 000000000..8b1a995a0 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1670679892928774900.sql @@ -0,0 +1,95 @@ +-- +UPDATE `creature_template` SET `unit_class` = 2 WHERE `entry` IN (19287, 19288, 19290); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19391; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19391) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19391, 0, 0, 0, 0, 0, 100, 0, 3000, 6000, 10000, 15000, 0, 11, 3551, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Felguard Lieutenant - In Combat - Cast \'Skull Crack\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19288; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19288) AND (`source_type` = 0) AND (`id` IN (0, 1, 2)); +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 +(19288, 0, 0, 0, 0, 0, 100, 0, 15000, 15000, 30000, 30000, 0, 11, 9081, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Dreadknight - In Combat - Cast \'Shadow Bolt Volley\''), +(19288, 0, 1, 0, 0, 0, 100, 0, 5000, 10000, 5000, 10000, 0, 11, 16583, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Dreadknight - In Combat - Cast \'Shadow Shock\''), +(19288, 0, 2, 0, 0, 0, 100, 0, 8000, 16000, 8000, 16000, 0, 11, 20825, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Dreadknight - In Combat - Cast \'Shadow Bolt\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19290; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19290) AND (`source_type` = 0) AND (`id` IN (0, 1, 2)); +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 +(19290, 0, 0, 0, 0, 0, 100, 0, 5000, 10000, 30000, 30000, 0, 11, 12888, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Invading Anguisher - In Combat - Cast \'Cause Insanity\''), +(19290, 0, 1, 0, 0, 0, 100, 0, 3000, 6000, 30000, 35000, 0, 11, 19279, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Invading Anguisher - In Combat - Cast \'Devouring Plague\''), +(19290, 0, 2, 0, 0, 0, 100, 0, 5000, 5000, 20000, 25000, 0, 11, 11639, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Invading Anguisher - In Combat - Cast \'Shadow Word: Pain\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19286; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19286) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19286, 0, 0, 0, 0, 0, 100, 0, 3000, 3000, 15000, 20000, 0, 11, 32901, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Invading Fel Stalker - In Combat - Cast \'Carnivorous Bite\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19287; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19287) AND (`source_type` = 0) AND (`id` IN (0, 1)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `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 +(19287, 0, 0, 0, 0, 0, 100, 0, 3000, 6000, 12000, 24000, 0, 11, 11829, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Invading Voidwalker - In Combat - Cast \'Flamestrike\''), +(19287, 0, 1, 0, 0, 0, 100, 0, 5000, 10000, 5000, 10000, 0, 11, 20825, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Invading Voidwalker - In Combat - Cast \'Shadow Bolt\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19406; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19406) AND (`source_type` = 0) AND (`id` IN (0, 1)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `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 +(19406, 0, 0, 0, 0, 0, 100, 0, 2000, 6000, 4000, 8000, 0, 11, 11976, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Thunder Bluff Huntsman - In Combat - Cast \'Strike\''), +(19406, 0, 1, 0, 0, 0, 100, 0, 8000, 12000, 8000, 12000, 0, 11, 6253, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Thunder Bluff Huntsman - In Combat - Cast \'Backhand\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19407; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19407) AND (`source_type` = 0) AND (`id` IN (0, 1, 2)); +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 +(19407, 0, 0, 0, 2, 0, 100, 0, 30, 40, 0, 0, 0, 11, 13874, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Azuremyst Vindicator - Between 40-30% Health - Cast \'Divine Shield\''), +(19407, 0, 1, 0, 0, 0, 100, 0, 3000, 6000, 12000, 16000, 0, 11, 13005, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Azuremyst Vindicator - In Combat - Cast \'Hammer of Justice\''), +(19407, 0, 2, 0, 0, 0, 100, 0, 1000, 1000, 30000, 30000, 0, 11, 33127, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Azuremyst Vindicator - In Combat - Cast \'Seal of Command\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19320; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19320) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19320, 0, 0, 0, 0, 0, 100, 0, 3000, 6000, 6000, 12000, 0, 11, 11972, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Argent Protector - In Combat - Cast \'Shield Bash\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19365; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19365) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19365, 0, 0, 0, 0, 0, 100, 0, 3000, 3000, 3000, 3000, 0, 11, 6660, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Argent Bowman - In Combat - Cast \'Shoot\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19366; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19366) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19366, 0, 0, 0, 0, 0, 100, 0, 3000, 3000, 3000, 3000, 0, 11, 10277, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Argent Hunter - In Combat - Cast \'Throw\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19285; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19285) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19285, 0, 0, 0, 0, 0, 100, 0, 3000, 6000, 12000, 18000, 0, 11, 8873, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Invading Infernal - In Combat - Cast \'Flame Breath\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19284; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 19284); +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 +(19284, 0, 0, 0, 0, 0, 100, 0, 3000, 6000, 15000, 20000, 0, 11, 11977, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Invading Felguard - In Combat - Cast \'Rend\''); + +DELETE FROM `creature_text` WHERE `CreatureID` = 19385; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(19385, 0, 0, 'Marshals... brothers and sisters of the sword. I\'d rather fight alongside you than an army of thousands. We are lions! You know what\'s waiting through these demons and beyond that Dark Portal? Immortality! Take it! ', 14, 0, 100, 0, 0, 0, 16545, 0, 'Lord Marshal Raynor - On Spawn'), +(19385, 1, 0, 'Everyone fights. No one quits.', 12, 0, 100, 0, 0, 0, 16549, 0, 'Lord Marshal Raynor - On Spawn'), +(19385, 1, 1, 'Let us therefore brace ourselves to our duty, and so bear ourselves, that if the Humans of Azeroth last for a thousand years, men will still say, \'This was their finest hour..', 12, 0, 100, 0, 0, 0, 16546, 0, 'Lord Marshal Raynor - Random'), +(19385, 1, 2, 'This day we fight!! By all that you hold dear in these good lands, I bid you stand, heroes of Azeroth!', 12, 0, 100, 0, 0, 0, 16551, 0, 'Lord Marshal Raynor - Random'), +(19385, 1, 3, 'Yes. Fight and you may die. Run and you will live, but for how long? The devils are upon us! And those not here, dying in their villages weeks from now, would they be willing to trade all the days from this day to that, for one chance to come here and stop these horrors from invading our world?', 12, 0, 100, 0, 0, 0, 16548, 0, 'Lord Marshal Raynor - Random'), +(19385, 1, 4, 'Hold your ground! Hold your ground! Sons of the Alliance! Of the Horde! My brothers and sisters! I see in your eyes the same fear that would wither my own heart. A day may come when our courage fails, when we forsake our friends and break our fellowships... but it is not this day!', 12, 0, 100, 0, 0, 0, 16550, 0, 'Lord Marshal Raynor - Random'), +(19385, 1, 5, 'We few, we happy few, we band of brothers and sisters. For those today that shed their blood with me. Shall be my kin; be they never so vile, This day shall gentle their conditions.', 12, 0, 100, 0, 0, 0, 16552, 0, 'Lord Marshal Raynor - Random'), +(19385, 1, 6, 'And those in Azeroth now a-bed shall think themselves accursed they were not here, And hold their valor cheap whiles any speaks that fought with us upon this dark day.', 12, 0, 100, 0, 0, 0, 16553, 0, 'Lord Marshal Raynor - Random'), +(19385, 1, 7, 'It is time for us as kingdoms and as individuals to set aside our long-standing feuds and unite. The tides of an unwinnable war are upon us, and we must seek refuge on higher ground, lest we be swept away by the flood of darkness.', 12, 0, 100, 0, 0, 0, 16547, 0, 'Lord Marshal Raynor - Random'), +(19385, 2, 0, 'Argent Dawn! We go to gather more aid! Fight on, brothers and sisters. And know that you will not long fight alone!', 14, 0, 100, 0, 0, 0, 16934, 0, 'Lord Marshal Raynor - Despawn'); From f610b347ff277ac41646164a168eae25ae9995e1 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 10 Dec 2022 23:12:19 +0000 Subject: [PATCH 02/28] chore(DB): import pending files Referenced commit(s): c9d65d33d833c2ece475c57aced71815da61831d --- .../rev_1670679892928774900.sql => db_world/2022_12_10_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1670679892928774900.sql => db_world/2022_12_10_00.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1670679892928774900.sql b/data/sql/updates/db_world/2022_12_10_00.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1670679892928774900.sql rename to data/sql/updates/db_world/2022_12_10_00.sql index 8b1a995a0..c4fa0973e 100644 --- a/data/sql/updates/pending_db_world/rev_1670679892928774900.sql +++ b/data/sql/updates/db_world/2022_12_10_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_09_00 -> 2022_12_10_00 -- UPDATE `creature_template` SET `unit_class` = 2 WHERE `entry` IN (19287, 19288, 19290); From 35e4b935b8d59602e4936a730e31e2b9cd0dadca Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 10 Dec 2022 23:52:21 -0300 Subject: [PATCH 03/28] fix(DB/SAI): Stormwind Marshal (#14119) * fix(DB/SAI): Stormwind Marshal * Update rev_1670720346716286300.sql * Update rev_1670720346716286300.sql --- .../updates/pending_db_world/rev_1670720346716286300.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1670720346716286300.sql diff --git a/data/sql/updates/pending_db_world/rev_1670720346716286300.sql b/data/sql/updates/pending_db_world/rev_1670720346716286300.sql new file mode 100644 index 000000000..e7a4b8f73 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1670720346716286300.sql @@ -0,0 +1,7 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19386; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 19386) AND (`source_type` = 0) AND (`id` IN (0, 1)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `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 +(19386, 0, 0, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 11, 9128, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Marshal - On Aggro - Cast \'Battle Shout\''), +(19386, 0, 1, 0, 0, 0, 100, 0, 3000, 6000, 3000, 6000, 0, 11, 25710, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Marshal - In Combat - Cast \'Heroic Strike\''); From 19fa22ba929aa3ba3b022f2419f57f35f874298d Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 10 Dec 2022 23:53:09 -0300 Subject: [PATCH 04/28] Revert "refactor(Core/Movement): Naming convention" (#14100) Revert "refactor(Core/Movement): Naming convention (#13989)" This reverts commit d2f440c3e833a12c65049d681749b9268a3837f1. --- src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Movement/MotionMaster.cpp | 4 +- src/server/game/Movement/MotionMaster.h | 2 +- src/server/game/Movement/MovementGenerator.h | 2 +- .../ConfusedMovementGenerator.cpp | 44 ++++++------- .../ConfusedMovementGenerator.h | 8 +-- .../EscortMovementGenerator.cpp | 33 +++++----- .../EscortMovementGenerator.h | 10 +-- .../HomeMovementGenerator.cpp | 8 +-- .../HomeMovementGenerator.h | 4 +- .../IdleMovementGenerator.cpp | 4 +- .../IdleMovementGenerator.h | 4 +- .../PointMovementGenerator.cpp | 64 +++++++++--------- .../PointMovementGenerator.h | 20 +++--- .../RandomMovementGenerator.cpp | 4 +- .../RandomMovementGenerator.h | 2 +- .../WaypointMovementGenerator.cpp | 66 +++++++++---------- .../WaypointMovementGenerator.h | 14 ++-- .../HallsOfReflection/halls_of_reflection.cpp | 2 +- 19 files changed, 148 insertions(+), 149 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index f7d8bfa33..547e62b14 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2301,7 +2301,7 @@ public: void SendPetAIReaction(ObjectGuid guid); ///----------End of Pet responses methods---------- - void propagateSpeedChange() { GetMotionMaster()->PropagateSpeedChange(); } + void propagateSpeedChange() { GetMotionMaster()->propagateSpeedChange(); } // reactive attacks void ClearAllReactives(); diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 0e052633c..fe8075ddb 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -791,7 +791,7 @@ void MotionMaster::MoveRotate(uint32 time, RotateDirection direction) Mutate(new RotateMovementGenerator(time, direction), MOTION_SLOT_ACTIVE); } -void MotionMaster::PropagateSpeedChange() +void MotionMaster::propagateSpeedChange() { /*Impl::container_type::iterator it = Impl::c.begin(); for (; it != end(); ++it) @@ -801,7 +801,7 @@ void MotionMaster::PropagateSpeedChange() for (int i = 0; i <= _top; ++i) { if (Impl[i]) - Impl[i]->UnitSpeedChanged(); + Impl[i]->unitSpeedChanged(); } } diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index a32ac1e35..73d8144c6 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -238,7 +238,7 @@ public: [[nodiscard]] MovementGeneratorType GetMotionSlotType(int slot) const; [[nodiscard]] uint32 GetCurrentSplineId() const; // Xinef: Escort system - void PropagateSpeedChange(); + void propagateSpeedChange(); void ReinitializeMovement(); bool GetDestination(float& x, float& y, float& z); diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h index ce7875f38..2f317ec48 100644 --- a/src/server/game/Movement/MovementGenerator.h +++ b/src/server/game/Movement/MovementGenerator.h @@ -42,7 +42,7 @@ public: virtual uint32 GetSplineId() const { return 0; } // Xinef: Escort system - virtual void UnitSpeedChanged() { } + virtual void unitSpeedChanged() { } // timer in ms virtual void Pause(uint32 /* timer = 0*/) {} diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index cf2379183..2e36eb0d9 100644 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -54,9 +54,9 @@ void ConfusedMovementGenerator::DoInitialize(T* unit) float new_z = unit->GetMapHeight(wanderX, wanderY, z); if (new_z <= INVALID_HEIGHT || std::fabs(z - new_z) > 3.0f) // pussywizard { - _waypoints[idx][0] = idx > 0 ? _waypoints[idx - 1][0] : x; - _waypoints[idx][1] = idx > 0 ? _waypoints[idx - 1][1] : y; - _waypoints[idx][2] = idx > 0 ? _waypoints[idx - 1][2] : z; + i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx - 1][0] : x; + i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx - 1][1] : y; + i_waypoints[idx][2] = idx > 0 ? i_waypoints[idx - 1][2] : z; continue; } else if (unit->IsWithinLOS(wanderX, wanderY, z)) @@ -66,32 +66,32 @@ void ConfusedMovementGenerator::DoInitialize(T* unit) if ((is_water && !is_water_ok) || (!is_water && !is_land_ok)) { //! Cannot use coordinates outside our InhabitType. Use the current or previous position. - _waypoints[idx][0] = idx > 0 ? _waypoints[idx - 1][0] : x; - _waypoints[idx][1] = idx > 0 ? _waypoints[idx - 1][1] : y; - _waypoints[idx][2] = idx > 0 ? _waypoints[idx - 1][2] : z; + i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx - 1][0] : x; + i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx - 1][1] : y; + i_waypoints[idx][2] = idx > 0 ? i_waypoints[idx - 1][2] : z; continue; } } else { //! Trying to access path outside line of sight. Skip this by using the current or previous position. - _waypoints[idx][0] = idx > 0 ? _waypoints[idx - 1][0] : x; - _waypoints[idx][1] = idx > 0 ? _waypoints[idx - 1][1] : y; - _waypoints[idx][2] = idx > 0 ? _waypoints[idx - 1][2] : z; + i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx - 1][0] : x; + i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx - 1][1] : y; + i_waypoints[idx][2] = idx > 0 ? i_waypoints[idx - 1][2] : z; continue; } //unit->UpdateAllowedPositionZ(wanderX, wanderY, z); //! Positions are fine - apply them to this waypoint - _waypoints[idx][0] = wanderX; - _waypoints[idx][1] = wanderY; - _waypoints[idx][2] = new_z; + i_waypoints[idx][0] = wanderX; + i_waypoints[idx][1] = wanderY; + i_waypoints[idx][2] = new_z; } // Xinef: Call movement immediately to broadcast movement packet // Xinef: Initial timer is set to 1 so update with 1 - _nextMove = urand(1, MAX_CONF_WAYPOINTS); + i_nextMove = urand(1, MAX_CONF_WAYPOINTS); DoUpdate(unit, 1); unit->SetUnitFlag(UNIT_FLAG_CONFUSED); @@ -127,30 +127,30 @@ bool ConfusedMovementGenerator::DoUpdate(T* unit, uint32 diff) return true; } - if (_nextMoveTime.Passed()) + if (i_nextMoveTime.Passed()) { // currently moving, update location unit->AddUnitState(UNIT_STATE_CONFUSED_MOVE); if (unit->movespline->Finalized()) { - _nextMove = urand(1, MAX_CONF_WAYPOINTS); - _nextMoveTime.Reset(urand(600, 1200)); // Guessed + i_nextMove = urand(1, MAX_CONF_WAYPOINTS); + i_nextMoveTime.Reset(urand(600, 1200)); // Guessed } } else { // waiting for next move - _nextMoveTime.Update(diff); - if (_nextMoveTime.Passed()) + i_nextMoveTime.Update(diff); + if (i_nextMoveTime.Passed()) { // start moving unit->AddUnitState(UNIT_STATE_CONFUSED_MOVE); - ASSERT(_nextMove <= MAX_CONF_WAYPOINTS); - float x = _waypoints[_nextMove][0]; - float y = _waypoints[_nextMove][1]; - float z = _waypoints[_nextMove][2]; + ASSERT(i_nextMove <= MAX_CONF_WAYPOINTS); + float x = i_waypoints[i_nextMove][0]; + float y = i_waypoints[i_nextMove][1]; + float z = i_waypoints[i_nextMove][2]; Movement::MoveSplineInit init(unit); init.MoveTo(x, y, z, true); init.Launch(); diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h index ddc499757..73038a138 100644 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h @@ -27,7 +27,7 @@ template class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMovementGenerator > { public: - explicit ConfusedMovementGenerator() : _nextMoveTime(1) {} + explicit ConfusedMovementGenerator() : i_nextMoveTime(1) {} void DoInitialize(T*); void DoFinalize(T*); @@ -37,8 +37,8 @@ public: MovementGeneratorType GetMovementGeneratorType() { return CONFUSED_MOTION_TYPE; } private: void _InitSpecific(T*, bool&, bool&); - TimeTracker _nextMoveTime; - float _waypoints[MAX_CONF_WAYPOINTS + 1][3]; - uint32 _nextMove; + TimeTracker i_nextMoveTime; + float i_waypoints[MAX_CONF_WAYPOINTS + 1][3]; + uint32 i_nextMove; }; #endif diff --git a/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.cpp index 350bf93b0..2f85ced8c 100644 --- a/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.cpp @@ -22,7 +22,6 @@ #include "MoveSpline.h" #include "MoveSplineInit.h" #include "Player.h" -#include "Unit.h" #include "World.h" template @@ -32,13 +31,13 @@ void EscortMovementGenerator::DoInitialize(T* unit) unit->StopMoving(); unit->AddUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE); - _recalculateSpeed = false; + i_recalculateSpeed = false; Movement::MoveSplineInit init(unit); - if (_precomputedPath.size() == 2) // xinef: simple case, just call move to - init.MoveTo(_precomputedPath[1].x, _precomputedPath[1].y, _precomputedPath[1].z, true); - else if (_precomputedPath.size()) - init.MovebyPath(_precomputedPath); + if (m_precomputedPath.size() == 2) // xinef: simple case, just call move to + init.MoveTo(m_precomputedPath[1].x, m_precomputedPath[1].y, m_precomputedPath[1].z, true); + else if (m_precomputedPath.size()) + init.MovebyPath(m_precomputedPath); init.Launch(); @@ -61,26 +60,26 @@ bool EscortMovementGenerator::DoUpdate(T* unit, uint32 /*diff*/) bool arrived = unit->movespline->Finalized(); - if (_recalculateSpeed && !arrived) + if (i_recalculateSpeed && !arrived) { - _recalculateSpeed = false; + i_recalculateSpeed = false; Movement::MoveSplineInit init(unit); // xinef: speed changed during path execution, calculate remaining path and launch it once more - if (_precomputedPath.size()) + if (m_precomputedPath.size()) { - uint32 offset = std::min(uint32(unit->movespline->_currentSplineIdx()), uint32(_precomputedPath.size())); - Movement::PointsArray::iterator offsetItr = _precomputedPath.begin(); + uint32 offset = std::min(uint32(unit->movespline->_currentSplineIdx()), uint32(m_precomputedPath.size())); + Movement::PointsArray::iterator offsetItr = m_precomputedPath.begin(); std::advance(offsetItr, offset); - _precomputedPath.erase(_precomputedPath.begin(), offsetItr); + m_precomputedPath.erase(m_precomputedPath.begin(), offsetItr); // restore 0 element (current position) - _precomputedPath.insert(_precomputedPath.begin(), G3D::Vector3(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ())); + m_precomputedPath.insert(m_precomputedPath.begin(), G3D::Vector3(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ())); - if (_precomputedPath.size() > 2) - init.MovebyPath(_precomputedPath); - else if (_precomputedPath.size() == 2) - init.MoveTo(_precomputedPath[1].x, _precomputedPath[1].y, _precomputedPath[1].z, true); + if (m_precomputedPath.size() > 2) + init.MovebyPath(m_precomputedPath); + else if (m_precomputedPath.size() == 2) + init.MoveTo(m_precomputedPath[1].x, m_precomputedPath[1].y, m_precomputedPath[1].z, true); } init.Launch(); diff --git a/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.h b/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.h index 802ec48eb..edb410b8a 100644 --- a/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/EscortMovementGenerator.h @@ -24,10 +24,10 @@ template class EscortMovementGenerator : public MovementGeneratorMedium< T, EscortMovementGenerator > { public: - EscortMovementGenerator(Movement::PointsArray* _path = nullptr) : _recalculateSpeed(false) + EscortMovementGenerator(Movement::PointsArray* _path = nullptr) : i_recalculateSpeed(false) { if (_path) - _precomputedPath = *_path; + m_precomputedPath = *_path; } void DoInitialize(T*); @@ -35,15 +35,15 @@ public: void DoReset(T*); bool DoUpdate(T*, uint32); - void unitSpeedChanged() { _recalculateSpeed = true; } + void unitSpeedChanged() { i_recalculateSpeed = true; } MovementGeneratorType GetMovementGeneratorType() { return ESCORT_MOTION_TYPE; } uint32 GetSplineId() const { return _splineId; } private: - bool _recalculateSpeed; - Movement::PointsArray _precomputedPath; + bool i_recalculateSpeed; + Movement::PointsArray m_precomputedPath; uint32 _splineId; }; diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 4c29493be..818342744 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -30,7 +30,7 @@ void HomeMovementGenerator::DoInitialize(Creature* owner) void HomeMovementGenerator::DoFinalize(Creature* owner) { owner->ClearUnitState(UNIT_STATE_EVADE); - if (_arrived) + if (arrived) { // Xinef: npc run by default //owner->SetWalk(true); @@ -68,15 +68,15 @@ void HomeMovementGenerator::_setTargetLocation(Creature* owner) init.SetWalk(false); init.Launch(); - _arrived = false; + arrived = false; owner->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_POSSESSED | UNIT_STATE_EVADE | UNIT_STATE_IGNORE_PATHFINDING | UNIT_STATE_NO_ENVIRONMENT_UPD))); } bool HomeMovementGenerator::DoUpdate(Creature* owner, const uint32 /*time_diff*/) { - _arrived = owner->movespline->Finalized(); - if (_arrived) + arrived = owner->movespline->Finalized(); + if (arrived) return false; if (i_recalculateTravel) diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h index c97252d25..1b4395d36 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h @@ -29,7 +29,7 @@ template <> class HomeMovementGenerator : public MovementGeneratorMedium< Creature, HomeMovementGenerator > { public: - HomeMovementGenerator() : _arrived(false), i_recalculateTravel(false) {} + HomeMovementGenerator() : arrived(false), i_recalculateTravel(false) {} ~HomeMovementGenerator() {} void DoInitialize(Creature*); @@ -41,7 +41,7 @@ public: private: void _setTargetLocation(Creature*); - bool _arrived : 1; + bool arrived : 1; bool i_recalculateTravel : 1; }; #endif diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 1b4250632..5f64daef3 100644 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -99,10 +99,10 @@ void DistractMovementGenerator::Finalize(Unit* owner) bool DistractMovementGenerator::Update(Unit* owner, uint32 time_diff) { - if (owner->IsInCombat() || time_diff > _timer) + if (owner->IsInCombat() || time_diff > m_timer) return false; - _timer -= time_diff; + m_timer -= time_diff; return true; } diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h index fd9275e1c..293862bdd 100644 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h @@ -49,7 +49,7 @@ private: class DistractMovementGenerator : public MovementGenerator { public: - explicit DistractMovementGenerator(uint32 timer) : _timer(timer) {} + explicit DistractMovementGenerator(uint32 timer) : m_timer(timer) {} void Initialize(Unit*) override; void Finalize(Unit*) override; @@ -58,7 +58,7 @@ public: MovementGeneratorType GetMovementGeneratorType() override { return DISTRACT_MOTION_TYPE; } private: - uint32 _timer; + uint32 m_timer; }; class AssistanceDistractMovementGenerator : public DistractMovementGenerator diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 36f6cbeb8..5e06523fa 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -33,7 +33,7 @@ void PointMovementGenerator::DoInitialize(T* unit) { // the next line is to ensure that a new spline is created in DoUpdate() once the unit is no longer rooted/stunned // todo: rename this flag to something more appropriate since it is set to true even without speed change now. - _recalculateSpeed = true; + i_recalculateSpeed = true; return; } @@ -46,48 +46,48 @@ void PointMovementGenerator::DoInitialize(T* unit) unit->AddUnitState(UNIT_STATE_CHARGING); } - _recalculateSpeed = false; + i_recalculateSpeed = false; Movement::MoveSplineInit init(unit); - if (_precomputedPath.size() > 2) // pussywizard: for charge - init.MovebyPath(_precomputedPath); + if (m_precomputedPath.size() > 2) // pussywizard: for charge + init.MovebyPath(m_precomputedPath); else if (_generatePath) { PathGenerator path(unit); - bool result = path.CalculatePath(_x, _y, _z, _forceDestination); + bool result = path.CalculatePath(i_x, i_y, i_z, _forceDestination); if (result && !(path.GetPathType() & PATHFIND_NOPATH) && path.GetPath().size() > 2) { - _precomputedPath = path.GetPath(); - init.MovebyPath(_precomputedPath); + m_precomputedPath = path.GetPath(); + init.MovebyPath(m_precomputedPath); } else { // Xinef: fix strange client visual bug, moving on z coordinate only switches orientation by 180 degrees (visual only) - if (G3D::fuzzyEq(unit->GetPositionX(), _x) && G3D::fuzzyEq(unit->GetPositionY(), _y)) + if (G3D::fuzzyEq(unit->GetPositionX(), i_x) && G3D::fuzzyEq(unit->GetPositionY(), i_y)) { - _x += 0.2f * cos(unit->GetOrientation()); - _y += 0.2f * std::sin(unit->GetOrientation()); + i_x += 0.2f * cos(unit->GetOrientation()); + i_y += 0.2f * std::sin(unit->GetOrientation()); } - init.MoveTo(_x, _y, _z, true); + init.MoveTo(i_x, i_y, i_z, true); } } else { // Xinef: fix strange client visual bug, moving on z coordinate only switches orientation by 180 degrees (visual only) - if (G3D::fuzzyEq(unit->GetPositionX(), _x) && G3D::fuzzyEq(unit->GetPositionY(), _y)) + if (G3D::fuzzyEq(unit->GetPositionX(), i_x) && G3D::fuzzyEq(unit->GetPositionY(), i_y)) { - _x += 0.2f * cos(unit->GetOrientation()); - _y += 0.2f * std::sin(unit->GetOrientation()); + i_x += 0.2f * cos(unit->GetOrientation()); + i_y += 0.2f * std::sin(unit->GetOrientation()); } - init.MoveTo(_x, _y, _z, true); + init.MoveTo(i_x, i_y, i_z, true); } if (speed > 0.0f) init.SetVelocity(speed); - if (_orientation > 0.0f) + if (i_orientation > 0.0f) { - init.SetFacing(_orientation); + init.SetFacing(i_orientation); } init.Launch(); @@ -117,35 +117,35 @@ bool PointMovementGenerator::DoUpdate(T* unit, uint32 /*diff*/) unit->AddUnitState(UNIT_STATE_ROAMING_MOVE); - if (id != EVENT_CHARGE_PREPATH && _recalculateSpeed && !unit->movespline->Finalized()) + if (id != EVENT_CHARGE_PREPATH && i_recalculateSpeed && !unit->movespline->Finalized()) { - _recalculateSpeed = false; + i_recalculateSpeed = false; Movement::MoveSplineInit init(unit); // xinef: speed changed during path execution, calculate remaining path and launch it once more - if (_precomputedPath.size()) + if (m_precomputedPath.size()) { - uint32 offset = std::min(uint32(unit->movespline->_currentSplineIdx()), uint32(_precomputedPath.size())); - Movement::PointsArray::iterator offsetItr = _precomputedPath.begin(); + uint32 offset = std::min(uint32(unit->movespline->_currentSplineIdx()), uint32(m_precomputedPath.size())); + Movement::PointsArray::iterator offsetItr = m_precomputedPath.begin(); std::advance(offsetItr, offset); - _precomputedPath.erase(_precomputedPath.begin(), offsetItr); + m_precomputedPath.erase(m_precomputedPath.begin(), offsetItr); // restore 0 element (current position) - _precomputedPath.insert(_precomputedPath.begin(), G3D::Vector3(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ())); + m_precomputedPath.insert(m_precomputedPath.begin(), G3D::Vector3(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ())); - if (_precomputedPath.size() > 2) - init.MovebyPath(_precomputedPath); - else if (_precomputedPath.size() == 2) - init.MoveTo(_precomputedPath[1].x, _precomputedPath[1].y, _precomputedPath[1].z, true); + if (m_precomputedPath.size() > 2) + init.MovebyPath(m_precomputedPath); + else if (m_precomputedPath.size() == 2) + init.MoveTo(m_precomputedPath[1].x, m_precomputedPath[1].y, m_precomputedPath[1].z, true); } else - init.MoveTo(_x, _y, _z, true); + init.MoveTo(i_x, i_y, i_z, true); if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit init.SetVelocity(speed); - if (_orientation > 0.0f) + if (i_orientation > 0.0f) { - init.SetFacing(_orientation); + init.SetFacing(i_orientation); } init.Launch(); @@ -247,5 +247,5 @@ void EffectMovementGenerator::Finalize(Unit* unit) //} if (unit->ToCreature()->AI()) - unit->ToCreature()->AI()->MovementInform(EFFECT_MOTION_TYPE, _Id); + unit->ToCreature()->AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index 21dcc3250..fdff98725 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -27,11 +27,11 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG public: PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f, float orientation = 0.0f, const Movement::PointsArray* _path = nullptr, bool generatePath = false, bool forceDestination = false, ObjectGuid chargeTargetGUID = ObjectGuid::Empty) - : id(_id), _x(_x), _y(_y), _z(_z), speed(_speed), _orientation(orientation), _generatePath(generatePath), _forceDestination(forceDestination), + : id(_id), i_x(_x), i_y(_y), i_z(_z), speed(_speed), i_orientation(orientation), _generatePath(generatePath), _forceDestination(forceDestination), _chargeTargetGUID(chargeTargetGUID) { if (_path) - _precomputedPath = *_path; + m_precomputedPath = *_path; } void DoInitialize(T*); @@ -41,18 +41,18 @@ public: void MovementInform(T*); - void unitSpeedChanged() { _recalculateSpeed = true; } + void unitSpeedChanged() { i_recalculateSpeed = true; } MovementGeneratorType GetMovementGeneratorType() { return POINT_MOTION_TYPE; } - bool GetDestination(float& x, float& y, float& z) const { x = _x; y = _y; z = _z; return true; } + bool GetDestination(float& x, float& y, float& z) const { x = i_x; y = i_y; z = i_z; return true; } private: uint32 id; - float _x, _y, _z; + float i_x, i_y, i_z; float speed; - float _orientation; - bool _recalculateSpeed; - Movement::PointsArray _precomputedPath; + float i_orientation; + bool i_recalculateSpeed; + Movement::PointsArray m_precomputedPath; bool _generatePath; bool _forceDestination; ObjectGuid _chargeTargetGUID; @@ -72,14 +72,14 @@ public: class EffectMovementGenerator : public MovementGenerator { public: - explicit EffectMovementGenerator(uint32 Id) : _Id(Id) {} + explicit EffectMovementGenerator(uint32 Id) : m_Id(Id) {} void Initialize(Unit*) override {} void Finalize(Unit*) override; void Reset(Unit*) override {} bool Update(Unit*, uint32) override; MovementGeneratorType GetMovementGeneratorType() override { return EFFECT_MOTION_TYPE; } private: - uint32 _Id; + uint32 m_Id; }; #endif diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index b5f21d977..73ee0b5c3 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -36,7 +36,7 @@ RandomMovementGenerator::~RandomMovementGenerator() } template<> -void RandomMovementGenerator::SetRandomLocation(Creature* creature) +void RandomMovementGenerator::_setRandomLocation(Creature* creature) { if (creature->_moveState != MAP_OBJECT_CELL_MOVE_NONE) return; @@ -292,7 +292,7 @@ bool RandomMovementGenerator::DoUpdate(Creature* creature, const uint3 { _nextMoveTime.Update(diff); if (_nextMoveTime.Passed()) - SetRandomLocation(creature); + _setRandomLocation(creature); } return true; } diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h index 3d976e5fd..221aa81c1 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h @@ -49,7 +49,7 @@ public: } ~RandomMovementGenerator(); - void SetRandomLocation(T*); + void _setRandomLocation(T*); void DoInitialize(T*); void DoFinalize(T*); void DoReset(T*); diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index c755f2a7b..bd57f449f 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -75,22 +75,22 @@ void WaypointMovementGenerator::OnArrived(Creature* creature) creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE); m_isArrivalDone = true; - if (i_path->at(_currentNode)->event_id && urand(0, 99) < i_path->at(_currentNode)->event_chance) + if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) { LOG_DEBUG("maps.script", "Creature movement start script {} at point {} for {}.", - i_path->at(_currentNode)->event_id, _currentNode, creature->GetGUID().ToString()); + i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID().ToString()); creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE); - creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(_currentNode)->event_id, creature, nullptr); + creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, nullptr); } // Inform script MovementInform(creature); - creature->UpdateWaypointID(_currentNode); + creature->UpdateWaypointID(i_currentNode); - if (i_path->at(_currentNode)->delay) + if (i_path->at(i_currentNode)->delay) { creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE); - Stop(i_path->at(_currentNode)->delay); + Stop(i_path->at(i_currentNode)->delay); } } @@ -111,11 +111,11 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) if (m_isArrivalDone) { // Xinef: not true... update this at every waypoint! - //if ((_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint + //if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint { - float x = i_path->at(_currentNode)->x; - float y = i_path->at(_currentNode)->y; - float z = i_path->at(_currentNode)->z; + float x = i_path->at(i_currentNode)->x; + float y = i_path->at(i_currentNode)->y; + float z = i_path->at(i_currentNode)->z; float o = creature->GetOrientation(); if (!transportPath) @@ -136,14 +136,14 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) } // Xinef: moved the upper IF here - if ((_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint + if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint { creature->AI()->PathEndReached(path_id); creature->GetMotionMaster()->Initialize(); return false; } - _currentNode = (_currentNode + 1) % i_path->size(); + i_currentNode = (i_currentNode + 1) % i_path->size(); } // xinef: do not initialize motion if we got stunned in movementinform @@ -152,7 +152,7 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) return true; } - WaypointData const* node = i_path->at(_currentNode); + WaypointData const* node = i_path->at(i_currentNode); m_isArrivalDone = false; @@ -238,7 +238,7 @@ bool WaypointMovementGenerator::DoUpdate(Creature* creature, uint32 di bool finished = creature->movespline->Finalized(); // xinef: code to detect pre-empetively if we should start movement to next waypoint // xinef: do not start pre-empetive movement if current node has delay or we are ending waypoint movement - //if (!finished && !i_path->at(_currentNode)->delay && ((_currentNode != i_path->size() - 1) || repeating)) + //if (!finished && !i_path->at(i_currentNode)->delay && ((i_currentNode != i_path->size() - 1) || repeating)) // finished = (creature->movespline->_Spline().length(creature->movespline->_currentSplineIdx() + 1) - creature->movespline->timePassed()) < 200; if (finished) @@ -254,13 +254,13 @@ bool WaypointMovementGenerator::DoUpdate(Creature* creature, uint32 di void WaypointMovementGenerator::MovementInform(Creature* creature) { if (creature->AI()) - creature->AI()->MovementInform(WAYPOINT_MOTION_TYPE, _currentNode); + creature->AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode); if (Unit* owner = creature->GetCharmerOrOwner()) { if (UnitAI* AI = owner->GetAI()) { - AI->SummonMovementInform(creature, WAYPOINT_MOTION_TYPE, _currentNode); + AI->SummonMovementInform(creature, WAYPOINT_MOTION_TYPE, i_currentNode); } } } @@ -269,13 +269,13 @@ void WaypointMovementGenerator::MovementInform(Creature* creature) uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const { - if (_currentNode >= i_path.size()) + if (i_currentNode >= i_path.size()) { return i_path.size(); } - uint32 curMapId = i_path[_currentNode]->mapid; - for (uint32 i = _currentNode; i < i_path.size(); ++i) + uint32 curMapId = i_path[i_currentNode]->mapid; + for (uint32 i = i_currentNode; i < i_path.size(); ++i) { if (i_path[i]->mapid != curMapId) { @@ -401,15 +401,15 @@ bool FlightPathMovementGenerator::DoUpdate(Player* player, uint32 /*diff*/) { // skipping the first spline path point because it's our starting point and not a taxi path point uint32 pointId = player->movespline->currentPathIdx() <= 0 ? 0 : player->movespline->currentPathIdx() - 1; - if (pointId > _currentNode && _currentNode < i_path.size() - 1) + if (pointId > i_currentNode && i_currentNode < i_path.size() - 1) { bool departureEvent = true; do { - ASSERT(_currentNode < i_path.size(), "Point Id: {}\n{}", pointId, player->GetGUID().ToString().c_str()); + ASSERT(i_currentNode < i_path.size(), "Point Id: {}\n{}", pointId, player->GetGUID().ToString().c_str()); - DoEventIfAny(player, i_path[_currentNode], departureEvent); - while (!_pointsForPathSwitch.empty() && _pointsForPathSwitch.front().PathIndex <= _currentNode) + DoEventIfAny(player, i_path[i_currentNode], departureEvent); + while (!_pointsForPathSwitch.empty() && _pointsForPathSwitch.front().PathIndex <= i_currentNode) { _pointsForPathSwitch.pop_front(); player->m_taxi.NextTaxiDestination(); @@ -420,37 +420,37 @@ bool FlightPathMovementGenerator::DoUpdate(Player* player, uint32 /*diff*/) } } - if (pointId == _currentNode) + if (pointId == i_currentNode) { break; } - if (_currentNode == _preloadTargetNode) + if (i_currentNode == _preloadTargetNode) { PreloadEndGrid(); } - _currentNode += departureEvent ? 1 : 0; + i_currentNode += departureEvent ? 1 : 0; departureEvent = !departureEvent; - } while (_currentNode < i_path.size() - 1); + } while (i_currentNode < i_path.size() - 1); } - return _currentNode < (i_path.size() - 1); + return i_currentNode < (i_path.size() - 1); } void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() { - if (i_path.empty() || _currentNode >= i_path.size()) + if (i_path.empty() || i_currentNode >= i_path.size()) { return; } - uint32 map0 = i_path[_currentNode]->mapid; - for (size_t i = _currentNode + 1; i < i_path.size(); ++i) + uint32 map0 = i_path[i_currentNode]->mapid; + for (size_t i = i_currentNode + 1; i < i_path.size(); ++i) { if (i_path[i]->mapid != map0) { - _currentNode = i; + i_currentNode = i; return; } } @@ -467,7 +467,7 @@ void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry bool FlightPathMovementGenerator::GetResetPos(Player*, float& x, float& y, float& z) { - TaxiPathNodeEntry const* node = i_path[_currentNode]; + TaxiPathNodeEntry const* node = i_path[i_currentNode]; x = node->x; y = node->y; z = node->z; diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 0407310ee..1699a71a6 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -35,15 +35,15 @@ template class PathMovementBase { public: - PathMovementBase() : i_path(), _currentNode(0) {} - PathMovementBase(P path) : i_path(path), _currentNode(0) {} + PathMovementBase() : i_path(), i_currentNode(0) {} + PathMovementBase(P path) : i_path(path), i_currentNode(0) {} virtual ~PathMovementBase() {}; - uint32 GetCurrentNode() const { return _currentNode; } + uint32 GetCurrentNode() const { return i_currentNode; } protected: P i_path; - uint32 _currentNode; + uint32 i_currentNode; }; template @@ -104,7 +104,7 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, Flig public: explicit FlightPathMovementGenerator(uint32 startNode = 0) { - _currentNode = startNode; + i_currentNode = startNode; _endGridX = 0.0f; _endGridY = 0.0f; _endMapId = 0; @@ -119,9 +119,9 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, Flig TaxiPathNodeList const& GetPath() { return i_path; } uint32 GetPathAtMapEnd() const; - bool HasArrived() const { return (_currentNode >= i_path.size()); } + bool HasArrived() const { return (i_currentNode >= i_path.size()); } void SetCurrentNodeAfterTeleport(); - void SkipCurrentNode() { ++_currentNode; } + void SkipCurrentNode() { ++i_currentNode; } void DoEventIfAny(Player* player, TaxiPathNodeEntry const* node, bool departure); bool GetResetPos(Player*, float& x, float& y, float& z); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 2563ba906..f513dc46d 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -1562,7 +1562,7 @@ public: for (uint8 i = 3; i < PATH_WP_COUNT - 1; ++i) path.push_back(G3D::Vector3(PathWaypoints[i].GetPositionX(), PathWaypoints[i].GetPositionY(), PathWaypoints[i].GetPositionZ())); me->GetMotionMaster()->MoveSplinePath(&path); - me->GetMotionMaster()->PropagateSpeedChange(); + me->GetMotionMaster()->propagateSpeedChange(); events.ScheduleEvent(EVENT_LK_SUMMON, 1000); } break; From b87170a36fb6f185b3ab11257b9d8553c875d69f Mon Sep 17 00:00:00 2001 From: Synful-Syn Date: Sat, 10 Dec 2022 21:53:45 -0500 Subject: [PATCH 05/28] fix(DB/loot): `Black Pearl Ring` wrongly drops (#14065) * fix(DB/loot):Remove Black Pearl Ring from Red Sack * Backticks added --- .../pending_db_world/remove-black-pearl-ring-in-red-sack.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/remove-black-pearl-ring-in-red-sack.sql diff --git a/data/sql/updates/pending_db_world/remove-black-pearl-ring-in-red-sack.sql b/data/sql/updates/pending_db_world/remove-black-pearl-ring-in-red-sack.sql new file mode 100644 index 000000000..87659f94e --- /dev/null +++ b/data/sql/updates/pending_db_world/remove-black-pearl-ring-in-red-sack.sql @@ -0,0 +1 @@ +DELETE FROM `item_loot_template` WHERE `Entry` = 17969 AND `Item` = 6332; From 0f4e8f07ff097586ae1162b231f2afb7e6fb0c8d Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 11 Dec 2022 03:55:20 +0100 Subject: [PATCH 06/28] =?UTF-8?q?fix(Core/Movement):=20Falling/Jumping/Kno?= =?UTF-8?q?ckback=20effects=20should=20not=20make=E2=80=A6=20(#14044)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Movement): Falling/Jumping/Knockback effects should not make mobs to evade. --- .../TargetedMovementGenerator.cpp | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 591970330..cd7ab7252 100644 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -115,6 +115,10 @@ bool ChaseMovementGenerator::DoUpdate(T* owner, uint32 time_diff) if (owner->IsWithinMeleeRange(this->i_target.getTarget())) { owner->Attack(this->i_target.getTarget(), true); + if (Creature* cOwner2 = owner->ToCreature()) + { + cOwner2->SetCannotReachTarget(); + } } else if (i_path && i_path->GetPathType() & PATHFIND_INCOMPLETE) { @@ -134,7 +138,14 @@ bool ChaseMovementGenerator::DoUpdate(T* owner, uint32 time_diff) _lastTargetPosition = i_target->GetPosition(); if (PositionOkay(owner, target, maxRange, angle) && !owner->HasUnitState(UNIT_STATE_CHASE_MOVE)) + { + if (Creature* cOwner2 = owner->ToCreature()) + { + cOwner2->SetCannotReachTarget(); + } + return true; + } float tarX, tarY, tarZ; target->GetPosition(tarX, tarY, tarZ); @@ -207,15 +218,15 @@ bool ChaseMovementGenerator::DoUpdate(T* owner, uint32 time_diff) { switch (cOwner->GetMovementTemplate().GetChase()) { - case CreatureChaseMovementType::CanWalk: - if (owner->IsWalking()) + case CreatureChaseMovementType::CanWalk: + if (owner->IsWalking()) + walk = true; + break; + case CreatureChaseMovementType::AlwaysWalk: walk = true; - break; - case CreatureChaseMovementType::AlwaysWalk: - walk = true; - break; - default: - break; + break; + default: + break; } } From 6e79c807b242b2ff02f42fbc752dbcfbd13996e7 Mon Sep 17 00:00:00 2001 From: mpfans Date: Sun, 11 Dec 2022 10:55:34 +0800 Subject: [PATCH 07/28] fix(DB/creature): pr13832 delete the wrong table (#13982) * fix pr13832 * Delete the wrong table. It should be `creature_loot_template` * Update rev_1669689837407665196.sql --- data/sql/updates/pending_db_world/rev_1669689837407665196.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1669689837407665196.sql diff --git a/data/sql/updates/pending_db_world/rev_1669689837407665196.sql b/data/sql/updates/pending_db_world/rev_1669689837407665196.sql new file mode 100644 index 000000000..371c28651 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1669689837407665196.sql @@ -0,0 +1,4 @@ +-- fix pr13832 +-- https://github.com/azerothcore/azerothcore-wotlk/commit/c791e2080e287e052fcaf717e3106977c822d28f +DELETE FROM `creature_loot_template` WHERE `Entry` IN (17917, 20627) AND (`Item` IN (13926)); +UPDATE `creature_template` SET `lootid` = 0 WHERE (`entry` IN (17917, 20627)); From 90a8c303a44130f760fa70006fb81912c28415bc Mon Sep 17 00:00:00 2001 From: Pedro Antonio <37176834+Valdifer@users.noreply.github.com> Date: Sun, 11 Dec 2022 03:55:52 +0100 Subject: [PATCH 08/28] fix(DB/QuestGreeting): Krelding Ungor missing locale (#13935) * fix(DB/QuestGreeting): Krelding Ungor missing locale NPC ID: 5638 Close AC issue #13914 Valdifer * Update rev_1669303320334648300.sql Missing chars * Update rev_1669303320334648300.sql Missing ; * Update rev_1669303320334648300.sql Missing MX locale (Too much updates sry) * Update data/sql/updates/pending_db_world/rev_1669303320334648300.sql Co-authored-by: Angelo Venturini --- .../sql/updates/pending_db_world/rev_1669303320334648300.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1669303320334648300.sql diff --git a/data/sql/updates/pending_db_world/rev_1669303320334648300.sql b/data/sql/updates/pending_db_world/rev_1669303320334648300.sql new file mode 100644 index 000000000..c959dab10 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1669303320334648300.sql @@ -0,0 +1,5 @@ +-- Fix issue 13914 +DELETE FROM `quest_greeting_locale` WHERE `locale` IN ('esES', 'esMX') AND `ID` = 5638; +INSERT INTO `quest_greeting_locale` (`ID`, `type`, `locale`, `Greeting`) VALUES +(5638, 0, 'esES', 'Tengo muchas cosas que hacer por aquí en Desolace, $N. Roetten quiere que recojamos algunos componentes para uno de nuestros clientes y buscar alguno de esos objetos perdidos.$b$bViéndote que estás aquí para ayudar. ¿Por qué no empezamos?'), +(5638, 0, 'esMX', 'Tengo muchas cosas que hacer por aquí en Desolace, $N. Roetten quiere que recojamos algunos componentes para uno de nuestros clientes y buscar alguno de esos objetos perdidos.$b$bViéndote que estás aquí para ayudar. ¿Por qué no empezamos?'); From c5e9a68083057d1400728067815ce0b74fe37887 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 11 Dec 2022 03:56:21 +0100 Subject: [PATCH 09/28] fix(DB/Creatures): Added waypoint script to Black Stalker. (#13888) * fix(DB/Creatures): Added waypoint script to Black Stalker. Fixes #13794 * Update. Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> --- .../rev_1668944605510491900.sql | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1668944605510491900.sql diff --git a/data/sql/updates/pending_db_world/rev_1668944605510491900.sql b/data/sql/updates/pending_db_world/rev_1668944605510491900.sql new file mode 100644 index 000000000..574a463d5 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1668944605510491900.sql @@ -0,0 +1,27 @@ +-- +UPDATE `creature` SET `MovementType`=2 WHERE `id1`=17882; + +SET @CGUID := (SELECT `guid` FROM `creature` WHERE `id1`=17882); +DELETE FROM `creature_addon` WHERE `guid`=@CGUID; +INSERT INTO `creature_addon` VALUES +(@CGUID,@CGUID*10,0,0,1,0,0,''); + +DELETE FROM `waypoint_data` WHERE `id` IN (@CGUID*10); +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@CGUID*10,1,143.12927,24.530138,26.791546,0,0,0,0,100,0), +(@CGUID*10,2,147.65775,5.377345,26.791546,0,0,0,0,100,0), +(@CGUID*10,3,137.54929,3.156878,26.791546,NULL,15000,0,@CGUID*10,100,@CGUID), +(@CGUID*10,4,147.90135,15.377421,26.796476,0,0,0,0,100,0), +(@CGUID*10,5,151.38458,20.670511,26.857647,NULL,15000,0,@CGUID*10,100,@CGUID), +(@CGUID*10,6,143.12927,24.530138,26.791546,0,0,0,0,100,0), +(@CGUID*10,7,141.65916,32.419727,26.831083,NULL,15000,0,@CGUID*10,100,@CGUID), +(@CGUID*10,8,163.50163,11.745237,26.72663,0,0,0,0,100,0), +(@CGUID*10,9,168.98875,8.392987,26.64813,NULL,15000,0,@CGUID*10,100,@CGUID), +(@CGUID*10,10,147.65775,5.377345,26.791546,0,0,0,0,100,0), +(@CGUID*10,11,137.54929,3.156878,26.791546,NULL,15000,0,@CGUID*10,100,@CGUID), +(@CGUID*10,12,147.90135,15.377421,26.796476,0,0,0,0,100,0), +(@CGUID*10,13,151.38458,20.670511,26.857647,NULL,15000,0,@CGUID*10,100,@CGUID); + +DELETE FROM `waypoint_scripts` WHERE `id`=@CGUID*10; +INSERT INTO `waypoint_scripts` VALUES +(@CGUID*10,2,1,7,0,0,0,0,0,0,@CGUID); From f4ccf150917aea4ae288e17506fe7bc92dcef81a Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 11 Dec 2022 03:57:38 +0100 Subject: [PATCH 10/28] fix(Scripts/Underbog): Moved Gha'zan script to C++ file. (#13887) * fix(Scripts/Underbog)L Moved Gha'zan script to C++ file. Added scripted waypoints. Fixes #13793 * Update. * missing player include * Update. Co-authored-by: Angelo Venturini --- .../rev_1668941470853125700.sql | 62 ++++++ .../underbog/boss_ghazan.cpp | 182 ++++++++++++++++++ .../underbog/instance_the_underbog.cpp | 37 +++- .../CoilfangReservoir/underbog/the_underbog.h | 7 + .../scripts/Outland/outland_script_loader.cpp | 2 + 5 files changed, 283 insertions(+), 7 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1668941470853125700.sql create mode 100644 src/server/scripts/Outland/CoilfangReservoir/underbog/boss_ghazan.cpp diff --git a/data/sql/updates/pending_db_world/rev_1668941470853125700.sql b/data/sql/updates/pending_db_world/rev_1668941470853125700.sql new file mode 100644 index 000000000..572caaebf --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1668941470853125700.sql @@ -0,0 +1,62 @@ +-- +UPDATE `creature` SET `position_x`=193.68, `position_y`=-425.001, `position_z`=43.536, `orientation`=4.910, `MovementType`=2 WHERE `id1`=18105; + +SET @CGUID := (SELECT `guid` FROM `creature` WHERE `id1`=18105); +DELETE FROM `creature_addon` WHERE `guid`=@CGUID; +INSERT INTO `creature_addon` VALUES +(@CGUID,@CGUID*10,0,0,1,0,0,''); + +DELETE FROM `waypoint_data` WHERE `id` IN (@CGUID*10,(@CGUID*10)+1); +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@CGUID*10,1,220.287480,-447.83450,43.72291,0,0,0,0,100,0), +(@CGUID*10,2,217.265560,-424.75412,45.52847,0,0,0,0,100,0), +(@CGUID*10,3,225.281620,-398.65262,45.47290,0,0,0,0,100,0), +(@CGUID*10,4,253.491170,-397.89430,45.52849,0,0,0,0,100,0), +(@CGUID*10,5,253.131480,-414.29672,44.77849,0,0,0,0,100,0), +(@CGUID*10,6,234.916290,-424.61800,44.61180,0,0,0,0,100,0), +(@CGUID*10,7,223.580960,-426.78760,44.61183,0,0,0,0,100,0), +(@CGUID*10,8,204.304470,-431.26736,44.13958,0,0,0,0,100,0), +(@CGUID*10,9,196.254750,-456.66520,42.61182,0,0,0,0,100,0), +(@CGUID*10,10,223.04488,-479.07944,32.47294,0,0,0,0,100,0), +(@CGUID*10,11,263.47906,-480.66202,46.80626,0,0,0,0,100,0), +(@CGUID*10,12,278.39508,-477.34967,43.88961,0,0,0,0,100,0), +(@CGUID*10,13,276.92447,-457.94210,37.05632,0,0,0,0,100,0), +(@CGUID*10,14,276.92447,-457.94210,37.05632,0,0,0,0,100,0), +(@CGUID*10,15,275.60797,-469.67816,33.47302,0,0,0,0,100,0), +(@CGUID*10,16,276.92447,-457.94210,37.05631,0,0,0,0,100,0), +(@CGUID*10,17,278.24097,-446.20605,40.63961,0,0,0,0,100,0), +(@CGUID*10,18,260.68362,-421.50210,43.44514,0,0,0,0,100,0), +(@CGUID*10,19,233.34468,-409.80292,45.11180,0,0,0,0,100,0), +(@CGUID*10,20,193.74000,-423.40268,43.58399,0,0,0,0,100,0), + +((@CGUID*10)+1,1,276.92447,-457.9421,37.05632,0,0,0,0,100,0), +((@CGUID*10)+1,2,230.84842,-473.81586,44.384487,0,0,0,0,100,0), +((@CGUID*10)+1,3,223.15588,-474.34158,46.36878,0,0,0,0,100,0), +((@CGUID*10)+1,4,214.68163,-479.58606,52.51196,0,0,0,0,100,0), +((@CGUID*10)+1,5,200.88074,-483.32407,58.438652,0,0,0,0,100,0), +((@CGUID*10)+1,6,185.70932,-485.64243,64.15632,0,0,0,0,100,0), +((@CGUID*10)+1,7,175.2845,-486.21573,67.86781,0,0,0,0,100,0), +((@CGUID*10)+1,8,160.93648,-476.7256,74.70425,0,0,0,0,100,0), +((@CGUID*10)+1,9,158.37117,-472.06967,74.63962,0,0,0,0,100,0), +((@CGUID*10)+1,10,159.37047,-467.53186,75.40111,0,0,0,0,100,0), +((@CGUID*10)+1,11,180.78477,-471.30957,77.03179,0,0,0,0,100,0), +((@CGUID*10)+1,12,189.26646,-471.74365,77.766594,0,0,0,0,100,0), +((@CGUID*10)+1,13,200.31303,-472.0223,79.02495,0,0,0,0,100,0), +((@CGUID*10)+1,14,212.294,-480.27985,80.729095,0,0,0,0,100,0), +((@CGUID*10)+1,15,222.19577,-476.2322,81.27319,0,0,0,0,100,0), +((@CGUID*10)+1,16,233.52731,-471.28235,81.37284,0,0,0,0,100,0), +((@CGUID*10)+1,17,239.5655,-468.65033,81.37284,0,0,0,0,100,0), +((@CGUID*10)+1,18,248.33444,-465.86627,81.37284,0,0,0,0,100,0), +((@CGUID*10)+1,19,260.44455,-457.9094,81.37284,0,0,0,0,100,0), +((@CGUID*10)+1,20,256.2785,-458.73138,81.37284,3.543018341064453125,0,0,0,100,0); + +DELETE FROM `areatrigger_scripts` WHERE `entry`=4302; +INSERT INTO `areatrigger_scripts` VALUES +(4302,'at_underbog_ghazan'); + +DELETE FROM `spelldifficulty_dbc` WHERE `ID`=34267; +INSERT INTO `spelldifficulty_dbc` VALUES +(34267,34267,38737,0,0); + +UPDATE `creature_template` SET `AiName`='', `ScriptName`='boss_ghazan' WHERE `entry`=18105; +DELETE FROM `smart_scripts` WHERE `entryorguid`=18105; diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_ghazan.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_ghazan.cpp new file mode 100644 index 000000000..a70bc4e04 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_ghazan.cpp @@ -0,0 +1,182 @@ +/* + * 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 "Player.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "the_underbog.h" + +enum eBlackStalker +{ + SPELL_ACID_BREATH = 34268, + SPELL_ACID_SPIT = 34290, + SPELL_TAIL_SWEEP = 34267, + SPELL_ENRAGE = 15716, + + EVENT_ACID_BREATH = 1, + EVENT_ACID_SPIT = 2, + EVENT_TAIL_SWEEP = 3, + + ACTION_MOVE_TO_PLATFORM = 1 +}; + +struct boss_ghazan : public ScriptedAI +{ + boss_ghazan(Creature* creature) : ScriptedAI(creature) + { + } + + void InitializeAI() override + { + _movedToPlatform = false; + _reachedPlatform = false; + Reset(); + } + + void Reset() override + { + events.Reset(); + _enraged = false; + if (!_reachedPlatform) + { + _movedToPlatform = false; + } + } + + void EnterCombat(Unit*) override + { + events.ScheduleEvent(EVENT_ACID_BREATH, 3s); + events.ScheduleEvent(EVENT_ACID_SPIT, 1s); + events.ScheduleEvent(EVENT_TAIL_SWEEP, DUNGEON_MODE(5900ms, 10s)); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*type*/, SpellSchoolMask /*school*/) override + { + if (!_enraged && me->HealthBelowPctDamaged(20, damage)) + { + _enraged = true; + DoCastSelf(SPELL_ENRAGE); + } + } + + void DoAction(int32 type) override + { + if (type == ACTION_MOVE_TO_PLATFORM && !_movedToPlatform) + { + _movedToPlatform = true; + me->GetMotionMaster()->MovePath((me->GetSpawnId() * 10) + 1, false); + } + } + + void MovementInform(uint32 type, uint32 pointId) override + { + if (!_movedToPlatform || type != WAYPOINT_MOTION_TYPE || pointId != 19) + { + return; + } + + _reachedPlatform = true; + me->SetHomePosition(me->GetPosition()); + + me->m_Events.AddEventAtOffset([this]() + { + me->StopMoving(); + me->GetMotionMaster()->MoveRandom(12.f); + }, 1ms); + } + + void JustReachedHome() override + { + if (_reachedPlatform) + { + me->GetMotionMaster()->MoveRandom(12.f); + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + { + return; + } + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + { + return; + } + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ACID_BREATH: + DoCastVictim(SPELL_ACID_BREATH); + events.Repeat(7s, 9s); + break; + case EVENT_ACID_SPIT: + if (Unit* target = SelectTarget(SelectTargetMethod::Random)) + { + DoCast(target, SPELL_ACID_SPIT); + } + events.Repeat(7s, 9s); + break; + case EVENT_TAIL_SWEEP: + DoCastVictim(SPELL_TAIL_SWEEP); + events.Repeat(7s, 9s); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + bool _enraged; + bool _movedToPlatform; + bool _reachedPlatform; +}; + +class at_underbog_ghazan : public OnlyOnceAreaTriggerScript +{ +public: + at_underbog_ghazan() : OnlyOnceAreaTriggerScript("at_underbog_ghazan") {} + + bool _OnTrigger(Player* player, const AreaTrigger* /*at*/) override + { + if (InstanceScript* instance = player->GetInstanceScript()) + { + if (Creature* ghazan = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_GHAZAN))) + { + ghazan->AI()->DoAction(ACTION_MOVE_TO_PLATFORM); + return true; + } + } + + return false; + } +}; + +void AddSC_boss_ghazan() +{ + RegisterUnderbogCreatureAI(boss_ghazan); + new at_underbog_ghazan(); +} diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/instance_the_underbog.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/instance_the_underbog.cpp index b892e8a6b..b30f1915c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/instance_the_underbog.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/instance_the_underbog.cpp @@ -15,13 +15,6 @@ * with this program. If not, see . */ -/* - This placeholder for the instance is needed for dungeon finding to be able - to give credit after the boss defined in lastEncounterDungeon is killed. - Without it, the party doing random dungeon won't get satchel of spoils and - gets instead the deserter debuff. -*/ - #include "InstanceScript.h" #include "Map.h" #include "ScriptMgr.h" @@ -40,6 +33,36 @@ public: struct instance_the_underbog_InstanceMapScript : public InstanceScript { instance_the_underbog_InstanceMapScript(Map* map) : InstanceScript(map) { } + + void OnCreatureCreate(Creature* creature) override + { + InstanceScript::OnCreatureCreate(creature); + + switch (creature->GetEntry()) + { + case NPC_GHAZAN: + _ghazanGUID = creature->GetGUID(); + break; + default: + break; + } + } + + ObjectGuid GetGuidData(uint32 type) const override + { + switch (type) + { + case NPC_GHAZAN: + return _ghazanGUID; + default: + break; + } + + return ObjectGuid::Empty; + } + + private: + ObjectGuid _ghazanGUID; }; }; diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/the_underbog.h b/src/server/scripts/Outland/CoilfangReservoir/underbog/the_underbog.h index ecc1f5be5..9b0a51b1d 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/the_underbog.h +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/the_underbog.h @@ -22,10 +22,17 @@ #define TheUnderbogScriptName "instance_the_underbog" +enum NPCs +{ + NPC_GHAZAN = 18105 +}; + template inline AI* GetTheUnderbogAI(T* obj) { return GetInstanceAI(obj, TheUnderbogScriptName); } +#define RegisterUnderbogCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetTheUnderbogAI) + #endif // the_underbog_h__ diff --git a/src/server/scripts/Outland/outland_script_loader.cpp b/src/server/scripts/Outland/outland_script_loader.cpp index df02e86d3..bacda01c0 100644 --- a/src/server/scripts/Outland/outland_script_loader.cpp +++ b/src/server/scripts/Outland/outland_script_loader.cpp @@ -51,6 +51,7 @@ void AddSC_boss_mekgineer_steamrigger(); void AddSC_boss_warlord_kalithresh(); void AddSC_instance_steam_vault(); void AddSC_boss_the_black_stalker(); //CR Underbog +void AddSC_boss_ghazan(); void AddSC_instance_the_underbog(); void AddSC_boss_ahune(); void AddSC_instance_the_slave_pens(); @@ -144,6 +145,7 @@ void AddOutlandScripts() AddSC_boss_warlord_kalithresh(); AddSC_instance_steam_vault(); AddSC_boss_the_black_stalker(); //CR Underbog + AddSC_boss_ghazan(); AddSC_instance_the_underbog(); AddSC_boss_ahune(); AddSC_instance_the_slave_pens(); From f06d815909ef7e79e761ee24d75847212b70d7b5 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 11 Dec 2022 02:59:46 +0000 Subject: [PATCH 11/28] chore(DB): import pending files Referenced commit(s): f4ccf150917aea4ae288e17506fe7bc92dcef81a --- .../2022_12_11_00.sql} | 1 + .../rev_1668941470853125700.sql => db_world/2022_12_11_01.sql} | 1 + .../rev_1668944605510491900.sql => db_world/2022_12_11_02.sql} | 1 + .../rev_1669303320334648300.sql => db_world/2022_12_11_03.sql} | 1 + .../rev_1669689837407665196.sql => db_world/2022_12_11_04.sql} | 1 + .../rev_1670720346716286300.sql => db_world/2022_12_11_05.sql} | 1 + 6 files changed, 6 insertions(+) rename data/sql/updates/{pending_db_world/remove-black-pearl-ring-in-red-sack.sql => db_world/2022_12_11_00.sql} (62%) rename data/sql/updates/{pending_db_world/rev_1668941470853125700.sql => db_world/2022_12_11_01.sql} (98%) rename data/sql/updates/{pending_db_world/rev_1668944605510491900.sql => db_world/2022_12_11_02.sql} (97%) rename data/sql/updates/{pending_db_world/rev_1669303320334648300.sql => db_world/2022_12_11_03.sql} (94%) rename data/sql/updates/{pending_db_world/rev_1669689837407665196.sql => db_world/2022_12_11_04.sql} (86%) rename data/sql/updates/{pending_db_world/rev_1670720346716286300.sql => db_world/2022_12_11_05.sql} (95%) diff --git a/data/sql/updates/pending_db_world/remove-black-pearl-ring-in-red-sack.sql b/data/sql/updates/db_world/2022_12_11_00.sql similarity index 62% rename from data/sql/updates/pending_db_world/remove-black-pearl-ring-in-red-sack.sql rename to data/sql/updates/db_world/2022_12_11_00.sql index 87659f94e..e37d1694b 100644 --- a/data/sql/updates/pending_db_world/remove-black-pearl-ring-in-red-sack.sql +++ b/data/sql/updates/db_world/2022_12_11_00.sql @@ -1 +1,2 @@ +-- DB update 2022_12_10_00 -> 2022_12_11_00 DELETE FROM `item_loot_template` WHERE `Entry` = 17969 AND `Item` = 6332; diff --git a/data/sql/updates/pending_db_world/rev_1668941470853125700.sql b/data/sql/updates/db_world/2022_12_11_01.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1668941470853125700.sql rename to data/sql/updates/db_world/2022_12_11_01.sql index 572caaebf..aaa12e320 100644 --- a/data/sql/updates/pending_db_world/rev_1668941470853125700.sql +++ b/data/sql/updates/db_world/2022_12_11_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_00 -> 2022_12_11_01 -- UPDATE `creature` SET `position_x`=193.68, `position_y`=-425.001, `position_z`=43.536, `orientation`=4.910, `MovementType`=2 WHERE `id1`=18105; diff --git a/data/sql/updates/pending_db_world/rev_1668944605510491900.sql b/data/sql/updates/db_world/2022_12_11_02.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1668944605510491900.sql rename to data/sql/updates/db_world/2022_12_11_02.sql index 574a463d5..71829e6bf 100644 --- a/data/sql/updates/pending_db_world/rev_1668944605510491900.sql +++ b/data/sql/updates/db_world/2022_12_11_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_01 -> 2022_12_11_02 -- UPDATE `creature` SET `MovementType`=2 WHERE `id1`=17882; diff --git a/data/sql/updates/pending_db_world/rev_1669303320334648300.sql b/data/sql/updates/db_world/2022_12_11_03.sql similarity index 94% rename from data/sql/updates/pending_db_world/rev_1669303320334648300.sql rename to data/sql/updates/db_world/2022_12_11_03.sql index c959dab10..28b2afca3 100644 --- a/data/sql/updates/pending_db_world/rev_1669303320334648300.sql +++ b/data/sql/updates/db_world/2022_12_11_03.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_02 -> 2022_12_11_03 -- Fix issue 13914 DELETE FROM `quest_greeting_locale` WHERE `locale` IN ('esES', 'esMX') AND `ID` = 5638; INSERT INTO `quest_greeting_locale` (`ID`, `type`, `locale`, `Greeting`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1669689837407665196.sql b/data/sql/updates/db_world/2022_12_11_04.sql similarity index 86% rename from data/sql/updates/pending_db_world/rev_1669689837407665196.sql rename to data/sql/updates/db_world/2022_12_11_04.sql index 371c28651..11702d54d 100644 --- a/data/sql/updates/pending_db_world/rev_1669689837407665196.sql +++ b/data/sql/updates/db_world/2022_12_11_04.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_03 -> 2022_12_11_04 -- fix pr13832 -- https://github.com/azerothcore/azerothcore-wotlk/commit/c791e2080e287e052fcaf717e3106977c822d28f DELETE FROM `creature_loot_template` WHERE `Entry` IN (17917, 20627) AND (`Item` IN (13926)); diff --git a/data/sql/updates/pending_db_world/rev_1670720346716286300.sql b/data/sql/updates/db_world/2022_12_11_05.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1670720346716286300.sql rename to data/sql/updates/db_world/2022_12_11_05.sql index e7a4b8f73..ad67c3e63 100644 --- a/data/sql/updates/pending_db_world/rev_1670720346716286300.sql +++ b/data/sql/updates/db_world/2022_12_11_05.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_04 -> 2022_12_11_05 -- UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 19386; From 06c458e748f88b29383971462493eb642b7c1b94 Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Sat, 10 Dec 2022 20:53:10 -0700 Subject: [PATCH 12/28] feat(Core): EnableLowLevelRegenBoost config option (#13035) Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --- src/server/apps/worldserver/worldserver.conf.dist | 9 +++++++++ src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/World/IWorld.h | 1 + src/server/game/World/World.cpp | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 53b86d5c7..74889c9e6 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -2483,6 +2483,15 @@ Rate.Pet.LevelXP = 0.05 WaterBreath.Timer = 180000 +# +# EnableLowLevelRegenBoost +# Description: Greatly increase Health and Mana regen rates for players under level 15 (Added in patch 3.3) +# Default: 1 - Enabled +# 0 - Disabled +# + +EnableLowLevelRegenBoost = 1 + # # SkillGain.Crafting # SkillGain.Defense diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4057ed781..d2ef52e30 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1850,7 +1850,7 @@ void Player::Regenerate(Powers power) bool recentCast = IsUnderLastManaUseEffect(); float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA); - if (getLevel() < 15) + if (sWorld->getBoolConfig(CONFIG_LOW_LEVEL_REGEN_BOOST) && getLevel() < 15) ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA) * (2.066f - (getLevel() * 0.066f)); if (recentCast) // Trinity Updates Mana in intervals of 2s, which is correct @@ -1960,7 +1960,7 @@ void Player::RegenerateHealth() float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH); - if (getLevel() < 15) + if (sWorld->getBoolConfig(CONFIG_LOW_LEVEL_REGEN_BOOST) && getLevel() < 15) HealthIncreaseRate = sWorld->getRate(RATE_HEALTH) * (2.066f - (getLevel() * 0.066f)); float addvalue = 0.0f; diff --git a/src/server/game/World/IWorld.h b/src/server/game/World/IWorld.h index 2fca26a2a..e1017ebf3 100644 --- a/src/server/game/World/IWorld.h +++ b/src/server/game/World/IWorld.h @@ -176,6 +176,7 @@ enum WorldBoolConfigs CONFIG_LEAVE_GROUP_ON_LOGOUT, CONFIG_VMAP_BLIZZLIKE_PVP_LOS, CONFIG_OBJECT_SPARKLES, + CONFIG_LOW_LEVEL_REGEN_BOOST, CONFIG_OBJECT_QUEST_MARKERS, BOOL_CONFIG_VALUE_COUNT }; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index cf9efa628..357f4da28 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -942,6 +942,8 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_OBJECT_SPARKLES] = sConfigMgr->GetOption("Visibility.ObjectSparkles", true); + m_bool_configs[CONFIG_LOW_LEVEL_REGEN_BOOST] = sConfigMgr->GetOption("EnableLowLevelRegenBoost", true); + m_bool_configs[CONFIG_OBJECT_QUEST_MARKERS] = sConfigMgr->GetOption("Visibility.ObjectQuestMarkers", true); m_int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfigMgr->GetOption("MailDeliveryDelay", HOUR); From 4b266d493a47d45424934b03d54a24611efc772a Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sun, 11 Dec 2022 11:19:10 +0100 Subject: [PATCH 13/28] fix(build): build-db (#14121) * fix(build): build-db * Update build_dbimport.yml --- .github/workflows/build_dbimport.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_dbimport.yml b/.github/workflows/build_dbimport.yml index 45d988ff8..7f8a1696b 100644 --- a/.github/workflows/build_dbimport.yml +++ b/.github/workflows/build_dbimport.yml @@ -15,8 +15,8 @@ jobs: fail-fast: false matrix: # the result of the matrix will be the combination of all attributes, so we get os*compiler*modules builds - os: [ubuntu-latest] - compiler: [clang12] + os: [ubuntu-20.04] + compiler: [clang] runs-on: ${{ matrix.os }} name: ${{ matrix.compiler }} env: From a2ffce3e51fd38559d13dd82910535aca7b1771b Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 11 Dec 2022 12:58:48 +0100 Subject: [PATCH 14/28] =?UTF-8?q?fix(Core/Dungeons):=20Fixed=20displaying?= =?UTF-8?q?=20custom=20requirement=20texts=20from=20`d=E2=80=A6=20(#14125)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Dungeons): Fixed displaying custom requirement texts from `dungeon_access_requirement`. Fixes #14069 --- src/server/game/Entities/Player/PlayerStorage.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 09773fbcc..a0f8dce5f 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -6793,7 +6793,7 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map { Player* checkPlayer = this; std::vector* missingAchievements = &missingPlayerAchievements; - if(achievementRequirement->checkLeaderOnly) + if (achievementRequirement->checkLeaderOnly) { checkPlayer = partyLeader; missingAchievements = &missingLeaderAchievements; @@ -6859,15 +6859,20 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map //Just print out the requirements are not met ChatHandler(GetSession()).SendSysMessage(LANG_ACCESS_REQUIREMENT_NOT_MET); } - else if(requirementPrintMode == 1) + else if (requirementPrintMode == 1) { //Blizzlike method of printing out the requirements - if (missingLeaderQuests.size() && !missingLeaderQuests[0]->note.empty()) + if (missingPlayerQuests.size() && !missingPlayerQuests[0]->note.empty()) + { + ChatHandler(GetSession()).PSendSysMessage("%s", missingPlayerQuests[0]->note.c_str()); + } + else if (missingLeaderQuests.size() && !missingLeaderQuests[0]->note.empty()) { ChatHandler(GetSession()).PSendSysMessage("%s", missingLeaderQuests[0]->note.c_str()); } else if (mapDiff->hasErrorMessage) - { // if (missingAchievement) covered by this case + { + // if (missingAchievement) covered by this case SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty); } else if (missingPlayerItems.size()) From 189afd14092f7892c8028ddaf1ee5a6a97718c1d Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 11 Dec 2022 14:53:55 +0100 Subject: [PATCH 15/28] =?UTF-8?q?fix(Scripts/Instances):=20Fixed=20text=20?= =?UTF-8?q?during=20"Opening=20the=20Dark=20Portal"=20i=E2=80=A6=20(#13872?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/Instances): Fixed text during "Opening the Dark Portal" on Black Morass. Fixes #1999 --- .../updates/pending_db_world/rev_1668869079028371900.sql | 3 +++ .../CavernsOfTime/TheBlackMorass/the_black_morass.cpp | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1668869079028371900.sql diff --git a/data/sql/updates/pending_db_world/rev_1668869079028371900.sql b/data/sql/updates/pending_db_world/rev_1668869079028371900.sql new file mode 100644 index 000000000..febebea88 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1668869079028371900.sql @@ -0,0 +1,3 @@ +-- +UPDATE `creature_text` SET `text`='The shield is nearly gone! All that I have worked for is in danger!', `Sound`=10439, `BroadcastTextId`=16795 WHERE `CreatureID`=15608 AND `GroupId`=2; +UPDATE `creature_text` SET `text`='Champions! My shield grows weak!', `Sound`=10437, `BroadcastTextId`=16792 WHERE `CreatureID`=15608 AND `GroupId`=4; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 1ff0f2a0e..0fec969f0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -23,11 +23,7 @@ enum medivhSays { - SAY_WEAK75 = 0, - SAY_WEAK50 = 1, - SAY_WEAK25 = 2, - SAY_ENTER = 3, - SAY_INTRO = 4, + SAY_ENTER = 0, SAY_DEATH = 5, SAY_WIN = 6, SAY_ORCS_ENTER = 7, @@ -211,7 +207,7 @@ public: case EVENT_CHECK_HEALTH_75: if (instance && instance->GetData(DATA_SHIELD_PERCENT) <= eventId * 25) { - Talk(eventId - 1); + Talk(eventId + 1); break; } events.ScheduleEvent(eventId, 500); From 66e34d82785c400bf3761f13d3f42f5ed65f28a1 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 11 Dec 2022 13:56:03 +0000 Subject: [PATCH 16/28] chore(DB): import pending files Referenced commit(s): 189afd14092f7892c8028ddaf1ee5a6a97718c1d --- .../rev_1668869079028371900.sql => db_world/2022_12_11_06.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1668869079028371900.sql => db_world/2022_12_11_06.sql} (88%) diff --git a/data/sql/updates/pending_db_world/rev_1668869079028371900.sql b/data/sql/updates/db_world/2022_12_11_06.sql similarity index 88% rename from data/sql/updates/pending_db_world/rev_1668869079028371900.sql rename to data/sql/updates/db_world/2022_12_11_06.sql index febebea88..d9aaf6e44 100644 --- a/data/sql/updates/pending_db_world/rev_1668869079028371900.sql +++ b/data/sql/updates/db_world/2022_12_11_06.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_05 -> 2022_12_11_06 -- UPDATE `creature_text` SET `text`='The shield is nearly gone! All that I have worked for is in danger!', `Sound`=10439, `BroadcastTextId`=16795 WHERE `CreatureID`=15608 AND `GroupId`=2; UPDATE `creature_text` SET `text`='Champions! My shield grows weak!', `Sound`=10437, `BroadcastTextId`=16792 WHERE `CreatureID`=15608 AND `GroupId`=4; From 4992940453a3588b53bafd072534b8263375ec55 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Sun, 11 Dec 2022 10:58:20 -0300 Subject: [PATCH 17/28] fix(Core/Auras): Implement Roc form (#13959) Co-authored-by: Ariel Silva Co-authored-by: Ariel Silva --- src/server/game/Entities/Unit/Unit.cpp | 28 +++++++++++++++---- src/server/game/Entities/Unit/Unit.h | 2 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 4 +-- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ab8a0b2b3..95f67a636 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16870,11 +16870,11 @@ void Unit::RestoreDisplayId() AuraEffect* handledAura = nullptr; AuraEffect* handledAuraForced = nullptr; // try to receive model from transform auras - Unit::AuraEffectList const& transforms = GetAuraEffectsByType(SPELL_AURA_TRANSFORM); + AuraEffectList const& transforms = GetAuraEffectsByType(SPELL_AURA_TRANSFORM); if (!transforms.empty()) { // iterate over already applied transform auras - from newest to oldest - for (Unit::AuraEffectList::const_reverse_iterator i = transforms.rbegin(); i != transforms.rend(); ++i) + for (auto i = transforms.rbegin(); i != transforms.rend(); ++i) { if (AuraApplication const* aurApp = (*i)->GetBase()->GetApplicationOfTarget(GetGUID())) { @@ -16899,14 +16899,19 @@ void Unit::RestoreDisplayId() handledAura = *i; } + AuraEffectList const& shapeshiftAura = GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT); + // xinef: order of execution is important! // first forced transform auras, then shapeshifts, then normal transform // transform aura was found if (handledAuraForced) handledAuraForced->HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); - // we've found shapeshift - else if (uint32 modelId = GetModelForForm(GetShapeshiftForm())) - SetDisplayId(modelId); + else if (!shapeshiftAura.empty()) // we've found shapeshift + { + // only one such aura possible at a time + if (uint32 modelId = GetModelForForm(GetShapeshiftForm(), shapeshiftAura.front()->GetId())) + SetDisplayId(modelId); + } else if (handledAura) handledAura->HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); // no auras found - set modelid to default @@ -19253,8 +19258,19 @@ uint32 Unit::GetCombatRatingDamageReduction(CombatRating cr, float rate, float c return CalculatePct(damage, percent); } -uint32 Unit::GetModelForForm(ShapeshiftForm form) const +uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const { + // Hardcoded cases + switch (spellId) + { + case 7090: // Bear form + return 29414; + case 35200: // Roc form + return 4877; + default: + break; + } + if (GetTypeId() == TYPEID_PLAYER) { switch (form) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 547e62b14..739bab585 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2332,7 +2332,7 @@ public: void CastPetAura(PetAura const* aura); bool IsPetAura(Aura const* aura); - [[nodiscard]] uint32 GetModelForForm(ShapeshiftForm form) const; + [[nodiscard]] uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const; uint32 GetModelForTotem(PlayerTotemType totemType); // Redirect Threat diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1da935955..997e7e5bf 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1896,7 +1896,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo LOG_ERROR("spells.aura.effect", "Auras: Unknown Shapeshift Type: {}", GetMiscValue()); } - modelid = target->GetModelForForm(form); + modelid = target->GetModelForForm(form, GetId()); if (apply) { @@ -2135,7 +2135,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, if (apply) { // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case - if (GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !target->GetModelForForm(target->GetShapeshiftForm()) || !GetSpellInfo()->IsPositive()) + if (GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !target->GetModelForForm(target->GetShapeshiftForm(), GetId()) || !GetSpellInfo()->IsPositive()) { // special case (spell specific functionality) if (GetMiscValue() == 0) From 0a2a4c7f27983f8def71b81e8cd91988de5cbf89 Mon Sep 17 00:00:00 2001 From: Mathematical Date: Sun, 11 Dec 2022 09:01:48 -0500 Subject: [PATCH 18/28] fix(DB/SAI): Quest - Cleansing the Waters missing RP (#13703) --- .../rev_1667634141238677500.sql | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1667634141238677500.sql diff --git a/data/sql/updates/pending_db_world/rev_1667634141238677500.sql b/data/sql/updates/pending_db_world/rev_1667634141238677500.sql new file mode 100644 index 000000000..fb6c30804 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1667634141238677500.sql @@ -0,0 +1,24 @@ +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 17000; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 17000) AND (`id` IN (0, 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 +(17000, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 11, 24240, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Aggonis - On Just Summoned - Cast \'Spawn - Red Lightning\''), +(17000, 0, 1, 0, 54, 0, 100, 1, 0, 0, 0, 0, 0, 80, 1700000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Aggonis - On Just Summoned - Run Script (No Repeat)'), +(17000, 0, 2, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 18, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Aggonis - On Just Summoned - Set Flags Not Attackable'), +(17000, 0, 3, 0, 60, 0, 100, 0, 7000, 7000, 0, 0, 0, 19, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Aggonis - On Update - Remove Flags Not Attackable'), +(17000, 0, 4, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 18, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Aggonis - On Just Summoned - Set Flags Immune To Players'), +(17000, 0, 5, 0, 60, 0, 100, 0, 7000, 7000, 0, 0, 0, 19, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Aggonis - On Update - Remove Flags Immune To Players'), +(17000, 0, 6, 0, 60, 0, 100, 0, 7000, 7000, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 17, 0, 20, 0, 0, 0, 0, 0, 0, 'Aggonis - On Update - Start Attacking'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1700000) AND (`source_type` = 9) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(1700000, 9, 0, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Aggonis - Actionlist - Say Line 0'); + +DELETE FROM `creature_text` WHERE `CreatureID` = 17000 AND `GroupID` = 0; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(17000, 0, 0, "Fools! You seek to abjure my father's presence? Death awaits you, mortals!", 12, 0, 100, 0, 0, 0, 0, 0, 'Aggonis'); + +DELETE FROM `creature_text_locale` WHERE `CreatureID` = 17000 AND `GroupID` IN (0) AND `Locale` IN ('esES','esMX'); +INSERT INTO `creature_text_locale` (`CreatureID`, `GroupID`, `ID`, `Locale`, `Text`) VALUES +(17000 , 0, 0, 'esES',"¡Estúpidos! ¿Queréis repudiar la presencia de mi padre? ¡La muerte os espera, mortales!"), +(17000 , 0, 0, 'esMX',"¡Estúpidos! ¿Queréis repudiar la presencia de mi padre? ¡La muerte os espera, mortales!"); From 45be3720a543efb5bd50731fb64b06ed6fd05e2d Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 11 Dec 2022 14:03:39 +0000 Subject: [PATCH 19/28] chore(DB): import pending files Referenced commit(s): 0a2a4c7f27983f8def71b81e8cd91988de5cbf89 --- .../rev_1667634141238677500.sql => db_world/2022_12_11_07.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1667634141238677500.sql => db_world/2022_12_11_07.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1667634141238677500.sql b/data/sql/updates/db_world/2022_12_11_07.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1667634141238677500.sql rename to data/sql/updates/db_world/2022_12_11_07.sql index fb6c30804..0585e1962 100644 --- a/data/sql/updates/pending_db_world/rev_1667634141238677500.sql +++ b/data/sql/updates/db_world/2022_12_11_07.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_06 -> 2022_12_11_07 UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 17000; DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 17000) AND (`id` IN (0, 1, 2, 3, 4, 5, 6)); From 72b446fb127d9798cef5292b031b1e55bcfbb9b4 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Sun, 11 Dec 2022 11:35:08 -0300 Subject: [PATCH 20/28] fix(Core/Scripts): Bloodscale Enchantress/Rajis Fyashe freezing circle (#13963) Co-authored-by: Eridium Co-authored-by: Lucas Nascimento Co-authored-by: Eridium Co-authored-by: Lucas Nascimento --- .../rev_1669583140592514600.sql | 37 ++++++++++++++++ .../FrozenHalls/PitOfSaron/pit_of_saron.cpp | 43 ------------------ src/server/scripts/Spells/spell_generic.cpp | 44 +++++++++++++++++++ 3 files changed, 81 insertions(+), 43 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1669583140592514600.sql diff --git a/data/sql/updates/pending_db_world/rev_1669583140592514600.sql b/data/sql/updates/pending_db_world/rev_1669583140592514600.sql new file mode 100644 index 000000000..cf9da1589 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1669583140592514600.sql @@ -0,0 +1,37 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE (`entry` = 20061); +UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`|1|64|1024 WHERE `entry` = 18044; + +DELETE FROM `creature` WHERE `id1`=20061; +DELETE FROM `creature_template_movement` WHERE `CreatureId`=20061; +INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`) VALUES +(20061, 1, 1, 0, 1); +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (20061); +DELETE FROM `smart_scripts` WHERE `entryorguid`=20061 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=2006100 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 +(20061,0,0,0,54,0,100,0,0,0,0,0,0,80,2006100,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Just summoned - Action list"), +(2006100,9,0,0,0,0,100,0,0,0,0,0,0,11,34872,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,1,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,3.15,"Frostbite Invisible Stalker - Action list - Set Orientation"), +(2006100,9,2,0,0,0,100,0,1000,1000,0,0,0,11,34740,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,3,0,0,0,100,0,0,0,0,0,0,11,34746,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,4,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,2.3624,"Frostbite Invisible Stalker - Action list - Set Orientation"), +(2006100,9,5,0,0,0,100,0,1000,1000,0,0,0,11,34740,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,6,0,0,0,100,0,0,0,0,0,0,11,34746,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,7,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.575,"Frostbite Invisible Stalker - Action list - Set Orientation"), +(2006100,9,8,0,0,0,100,0,1000,1000,0,0,0,11,34740,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,9,0,0,0,100,0,0,0,0,0,0,11,34746,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,10,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,0.7875,"Frostbite Invisible Stalker - Action list - Set Orientation"), +(2006100,9,11,0,0,0,100,0,1000,1000,0,0,0,11,34740,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,12,0,0,0,100,0,0,0,0,0,0,11,34746,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Action list - cast spell"), +(2006100,9,13,0,0,0,100,0,1000,1000,0,0,0,11,34779,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Frostbite Invisible Stalker - Just Action list - cast spell"); + +DELETE FROM `spell_script_names` WHERE `ScriptName` ='spell_freezing_circle'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(34779,'spell_freezing_circle'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 18088) AND (`source_type` = 0) AND (`id` IN (0, 1, 2)); +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 +(18088, 0, 0, 0, 0, 0, 100, 0, 0, 0, 2400, 3800, 0, 11, 34447, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Bloodscale Enchantress - In Combat - Cast \'Arcane Missiles\''), +(18088, 0, 1, 2, 0, 0, 100, 0, 6000, 8000, 16000, 22000, 0, 11, 33245, 35, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bloodscale Enchantress - In Combat - Cast \'Ice Barrier\''), +(18088, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 11, 34787, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Bloodscale Enchantress - In Combat - Cast \'Freezing Circle\''); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index 4f7051cfa..1977fef62 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -1297,48 +1297,6 @@ public: } }; -class npc_frostbite_invisible_stalker : public CreatureScript -{ -public: - npc_frostbite_invisible_stalker() : CreatureScript("npc_frostbite_invisible_stalker") { } - - struct npc_frostbite_invisible_stalkerAI: public NullCreatureAI - { - npc_frostbite_invisible_stalkerAI(Creature* creature) : NullCreatureAI(creature) - { - timer = 3500; - for (uint8 i = 0; i < 3; ++i) - { - me->SetOrientation(i * M_PI / 3); - me->CastSpell(me, 34740, true); - me->CastSpell(me, 34746, true); - } - } - - uint16 timer; - - void UpdateAI(uint32 diff) override - { - if (timer) - { - if (timer <= diff) - { - int32 dmg = 2200; - me->CastCustomSpell(me, 34779, 0, &dmg, 0, true); - timer = 0; - } - else - timer -= diff; - } - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetPitOfSaronAI(creature); - } -}; - class spell_pos_empowered_blizzard : public SpellScriptLoader { public: @@ -1574,7 +1532,6 @@ void AddSC_pit_of_saron() new npc_pos_martin_or_gorkun_second(); new npc_pos_freed_slave(); new npc_pos_leader_second(); - new npc_frostbite_invisible_stalker(); new spell_pos_empowered_blizzard(); new spell_pos_slave_trigger_closest(); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 7e16ae4f6..fc801dfef 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -4594,6 +4594,49 @@ class spell_gen_basic_campfire : public SpellScript } }; +// 34779 - Freezing Circle +enum FreezingCircleSpells +{ + SPELL_FREEZING_CIRCLE_PIT_OF_SARON_NORMAL = 69574, + SPELL_FREEZING_CIRCLE_PIT_OF_SARON_HEROIC = 70276, + SPELL_FREEZING_CIRCLE = 34787, +}; + +class spell_freezing_circle : public SpellScript +{ + PrepareSpellScript(spell_freezing_circle); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_FREEZING_CIRCLE_PIT_OF_SARON_NORMAL, + SPELL_FREEZING_CIRCLE_PIT_OF_SARON_HEROIC, + SPELL_FREEZING_CIRCLE + }); + } + + void HandleDamage(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + uint32 spellId = 0; + Map* map = caster->GetMap(); + + if (map->IsDungeon()) + spellId = map->IsHeroic() ? SPELL_FREEZING_CIRCLE_PIT_OF_SARON_HEROIC : SPELL_FREEZING_CIRCLE_PIT_OF_SARON_NORMAL; + else + spellId = SPELL_FREEZING_CIRCLE; + + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId)) + SetHitDamage(spellInfo->Effects[EFFECT_0].CalcValue()); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_freezing_circle::HandleDamage, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + void AddSC_generic_spell_scripts() { RegisterSpellScript(spell_silithyst); @@ -4732,4 +4775,5 @@ void AddSC_generic_spell_scripts() RegisterSpellScriptWithArgs(spell_gen_apply_aura_after_expiration, "spell_itch_aq20", SPELL_HIVEZARA_CATALYST, EFFECT_0, SPELL_AURA_DUMMY); RegisterSpellScriptWithArgs(spell_gen_apply_aura_after_expiration, "spell_itch_aq40", SPELL_VEKNISS_CATALYST, EFFECT_0, SPELL_AURA_DUMMY); RegisterSpellScript(spell_gen_basic_campfire); + RegisterSpellScript(spell_freezing_circle); } From b615ccd9e978daab691a5a83bc9de996c8c560f5 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 11 Dec 2022 15:35:28 +0100 Subject: [PATCH 21/28] =?UTF-8?q?fix(Core/SmartScripts):=20Added=20new=20p?= =?UTF-8?q?arameter=20`onlyInCombat`=20to=20`SMART=5F=E2=80=A6=20(#13947)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Core/SmartScripts): Added new parameter `onlyInCombat` to `SMART_EVENT_FRIENDLY_MISSING_BUFF` event. Coilfang Scale-Healer should cast Power Word: Shield only in combat. Fixes #13838 * missing sql. --- .../rev_1669456032833719200.sql | 2 ++ .../game/AI/SmartScripts/SmartScript.cpp | 21 ++++++++++++------- .../game/AI/SmartScripts/SmartScriptMgr.h | 3 ++- 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1669456032833719200.sql diff --git a/data/sql/updates/pending_db_world/rev_1669456032833719200.sql b/data/sql/updates/pending_db_world/rev_1669456032833719200.sql new file mode 100644 index 000000000..bbc1c0022 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1669456032833719200.sql @@ -0,0 +1,2 @@ +-- +UPDATE `smart_scripts` SET `event_param5`=1 WHERE `entryorguid`=21126 AND `source_type`=0 AND `id` IN (5,6); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index edc439a65..240e0eeab 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3511,16 +3511,21 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui break; } case SMART_EVENT_FRIENDLY_MISSING_BUFF: + { + if (e.event.missingBuff.onlyInCombat && !me->IsEngaged()) { - std::vector creatures; - DoFindFriendlyMissingBuff(creatures, float(e.event.missingBuff.radius), e.event.missingBuff.spell); - - if (creatures.empty()) - return; - - ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Acore::Containers::SelectRandomContainerElement(creatures)); - break; + return; } + + std::vector creatures; + DoFindFriendlyMissingBuff(creatures, float(e.event.missingBuff.radius), e.event.missingBuff.spell); + + if (creatures.empty()) + return; + + ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Acore::Containers::SelectRandomContainerElement(creatures)); + break; + } case SMART_EVENT_HAS_AURA: { if (!me) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index e1bdfd60c..27cbca259 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -131,7 +131,7 @@ enum SMART_EVENT SMART_EVENT_VICTIM_CASTING = 13, // RepeatMin, RepeatMax, spellid SMART_EVENT_FRIENDLY_HEALTH = 14, // HPDeficit, Radius, RepeatMin, RepeatMax SMART_EVENT_FRIENDLY_IS_CC = 15, // Radius, RepeatMin, RepeatMax - SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax + SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax, onlyInCombat SMART_EVENT_SUMMONED_UNIT = 17, // CreatureId(0 all), CooldownMin, CooldownMax SMART_EVENT_TARGET_MANA_PCT = 18, // ManaMin%, ManaMax%, RepeatMin, RepeatMax SMART_EVENT_ACCEPTED_QUEST = 19, // QuestID (0 = any), CooldownMin, CooldownMax @@ -301,6 +301,7 @@ struct SmartEvent uint32 radius; uint32 repeatMin; uint32 repeatMax; + uint32 onlyInCombat; } missingBuff; struct From fc90cb3f2edb89c034c92cb4f27b47a937fa4b30 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 11 Dec 2022 14:37:27 +0000 Subject: [PATCH 22/28] chore(DB): import pending files Referenced commit(s): b615ccd9e978daab691a5a83bc9de996c8c560f5 --- .../rev_1669456032833719200.sql => db_world/2022_12_11_08.sql} | 1 + .../rev_1669583140592514600.sql => db_world/2022_12_11_09.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1669456032833719200.sql => db_world/2022_12_11_08.sql} (71%) rename data/sql/updates/{pending_db_world/rev_1669583140592514600.sql => db_world/2022_12_11_09.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1669456032833719200.sql b/data/sql/updates/db_world/2022_12_11_08.sql similarity index 71% rename from data/sql/updates/pending_db_world/rev_1669456032833719200.sql rename to data/sql/updates/db_world/2022_12_11_08.sql index bbc1c0022..a8a09f638 100644 --- a/data/sql/updates/pending_db_world/rev_1669456032833719200.sql +++ b/data/sql/updates/db_world/2022_12_11_08.sql @@ -1,2 +1,3 @@ +-- DB update 2022_12_11_07 -> 2022_12_11_08 -- UPDATE `smart_scripts` SET `event_param5`=1 WHERE `entryorguid`=21126 AND `source_type`=0 AND `id` IN (5,6); diff --git a/data/sql/updates/pending_db_world/rev_1669583140592514600.sql b/data/sql/updates/db_world/2022_12_11_09.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1669583140592514600.sql rename to data/sql/updates/db_world/2022_12_11_09.sql index cf9da1589..81c6bccd9 100644 --- a/data/sql/updates/pending_db_world/rev_1669583140592514600.sql +++ b/data/sql/updates/db_world/2022_12_11_09.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_08 -> 2022_12_11_09 -- UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE (`entry` = 20061); UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`|1|64|1024 WHERE `entry` = 18044; From 790f444ffac09bfb9193fbd18aa7c2d730a02600 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 11 Dec 2022 20:13:12 -0300 Subject: [PATCH 23/28] =?UTF-8?q?fix(Core/Unit):=20properly=20reset=20disp?= =?UTF-8?q?layIds=20when=20having=20a=20shapeshift=20au=E2=80=A6=20(#14134?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ariel Silva --- src/server/game/Entities/Unit/Unit.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 95f67a636..15af7bb09 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16905,18 +16905,27 @@ void Unit::RestoreDisplayId() // first forced transform auras, then shapeshifts, then normal transform // transform aura was found if (handledAuraForced) + { handledAuraForced->HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); + return; + } else if (!shapeshiftAura.empty()) // we've found shapeshift { // only one such aura possible at a time if (uint32 modelId = GetModelForForm(GetShapeshiftForm(), shapeshiftAura.front()->GetId())) + { SetDisplayId(modelId); + return; + } } else if (handledAura) + { handledAura->HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); + return; + } + // no auras found - set modelid to default - else - SetDisplayId(GetNativeDisplayId()); + SetDisplayId(GetNativeDisplayId()); } void Unit::AddComboPoints(Unit* target, int8 count) From 524761d0c3aad6421fd4ae30e62144ec9952002c Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Mon, 12 Dec 2022 07:45:20 -0500 Subject: [PATCH 24/28] fix(DB): Add some scourge invasion gobjects/creatures. (#14150) Create simple-scourge-invasion.sql --- .../simple-scourge-invasion.sql | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 data/sql/updates/pending_db_world/simple-scourge-invasion.sql diff --git a/data/sql/updates/pending_db_world/simple-scourge-invasion.sql b/data/sql/updates/pending_db_world/simple-scourge-invasion.sql new file mode 100644 index 000000000..8752f0ad0 --- /dev/null +++ b/data/sql/updates/pending_db_world/simple-scourge-invasion.sql @@ -0,0 +1,68 @@ +SET @CGUID := 248650; +SET @OGUID := 105000; + +DELETE FROM `creature` WHERE `guid` IN (@CGUID, @CGUID+1, @CGUID+2, @CGUID+3, @CGUID+4); +INSERT INTO `creature` (`guid`, `id1`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES +(@CGUID, 14686, 129, 722, 722, 1, 1, 0, 2583.18359375, 695.8612060546875, 56.80325698852539062, 1.867502331733703613, 7200, 0, 0, 8744, 4568, 0, 0, 0, 0, 46248), -- Lady Falther'ess +(@CGUID+1, 14690, 429, 2557, 2557, 1, 1, 0, -112.775787353515625, 583.8232421875, -3.47887182235717773, 5.602506637573242187, 7200, 0, 0, 24420, 4868, 0, 0, 0, 0, 46248), -- Revanchion +(@CGUID+2, 14693, 189, 796, 796, 1, 1, 0, 1797.8409423828125, 1233.681884765625, 18.31528472900390625, 1.58285677433013916, 7200, 0, 0, 7104, 5610, 0, 0, 0, 0, 46248), -- Scorn +(@CGUID+3, 14682, 33, 209, 209, 1, 1, 0, -225.131271362304687, 2302.951416015625, 94.75986480712890625, 6.021385669708251953, 7200, 0, 0, 4689, 0, 0, 0, 0, 0, 46248), -- Sever +(@CGUID+4, 14684, 329, 2017, 2017, 1, 1, 0, 3733.270751953125, -3480.114013671875, 131.0400848388671875, 3.054326057434082031, 7200, 0, 0, 14652, 14604, 0, 0, 0, 0, 46248); -- Balzaphon + +DELETE FROM `game_event_creature` WHERE `eventEntry` = 17 AND `guid` IN (@CGUID, @CGUID+1, @CGUID+2, @CGUID+3, @CGUID+4); +INSERT INTO `game_event_creature` (`eventEntry`, `guid`) VALUES +(17, @CGUID), +(17, @CGUID+1), +(17, @CGUID+2), +(17, @CGUID+3), +(17, @CGUID+4); + +DELETE FROM `gameobject` WHERE `guid` IN (@OGUID, @OGUID+1, @OGUID+2, @OGUID+3, @OGUID+4, @OGUID+5, @OGUID+6, @OGUID+7, @OGUID+8, @OGUID+9, @OGUID+10, @OGUID+11, @OGUID+12, @OGUID+13, @OGUID+14, @OGUID+15, @OGUID+16, @OGUID+17, @OGUID+18, @OGUID+19, @OGUID+20, @OGUID+21); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +(@OGUID, 181154, 0, 139, 2268, 1, 1, 2101.685791015625, -4930.03271484375, 168.280731201171875, 1.047197580337524414, 0, 0, 0.5, 0.866025388240814208, 120, 255, 1, 46248), +(@OGUID+1, 181154, 0, 139, 0, 1, 1, 1766.673583984375, -3033.34375, 132.804443359375, 5.183629035949707031, 0, 0, -0.52249813079833984, 0.852640450000762939, 120, 255, 1, 46248), +(@OGUID+2, 181154, 0, 46, 250, 1, 1, -7733.71533203125, -2432.741455078125, 190.785552978515625, 2.67034769058227539, 0, 0, 0.972369194030761718, 0.233448356389999389, 120, 255, 1, 46248), +(@OGUID+3, 181154, 0, 46, 0, 1, 1, -8232.78125, -1099.85595703125, 201.48846435546875, 5.183629035949707031, 0, 0, -0.52249813079833984, 0.852640450000762939, 120, 255, 1, 46248), +(@OGUID+4, 181154, 1, 16, 878, 1, 1, 3299.553955078125, -4301.30029296875, 177.8075714111328125, 5.811946868896484375, 0, 0, -0.2334451675415039, 0.972369968891143798, 120, 255, 1, 46248), +(@OGUID+5, 181154, 1, 16, 1221, 1, 1, 3544.9775390625, -5610.2587890625, 67.1126861572265625, 2.827429771423339843, 0, 0, 0.987688064575195312, 0.156436234712600708, 120, 255, 1, 46248), +(@OGUID+6, 181172, 0, 1537, 1537, 1, 1, -5122.8037109375, -725, 505.466796875, 0.034906249493360519, 0, 0, 0.017452239990234375, 0.999847710132598876, 120, 255, 1, 46248), -- Ironforge +(@OGUID+7, 181172, 0, 85, 159, 1, 1, 1869.017333984375, 266.873260498046875, 114.8150634765625, 0.541050612926483154, 0, 0, 0.267237663269042968, 0.96363067626953125, 120, 255, 1, 46248), -- Undercity +(@OGUID+8, 181172, 530, 3430, 3430, 1, 1, 9291.169921875, -7293.32373046875, 133.3386993408203125, 3.124123096466064453, 0, 0, 0.99996185302734375, 0.008734640665352344, 120, 255, 1, 46248), -- Silvermoon City +(@OGUID+9, 181172, 1, 1637, 1637, 1, 1, 1085.60595703125, -4346.095703125, 88.066192626953125, 3.804818391799926757, 0, 0, -0.94551849365234375, 0.325568377971649169, 120, 255, 1, 46248), -- Orgrimmar +(@OGUID+10, 181172, 1, 1638, 1638, 1, 1, -1511.828125, 101.7222213745117187, 108.5687103271484375, 1.832594871520996093, 0, 0, 0.793353080749511718, 0.608761727809906005, 120, 255, 1, 46248), -- Thunder Bluff +(@OGUID+11, 181172, 530, 3524, 0, 1, 1, -4077.8564453125, -12036.9033203125, 125.0732421875, 3.560472726821899414, 0, 0, -0.97814750671386718, 0.207912087440490722, 120, 255, 1, 46248), -- Exodar +(@OGUID+12, 181172, 1, 1657, 0, 1, 1, 9972.625, 1993.2760009765625, 1406.1517333984375, 4.345870018005371093, 0, 0, -0.82412624359130859, 0.566406130790710449, 120, 255, 1, 46248), -- Darnassus +(@OGUID+13, 181172, 0, 1519, 1519, 1, 1, -9159.76953125, 345.552093505859375, 156.4009552001953125, 3.560472726821899414, 0, 0, -0.97814750671386718, 0.207912087440490722, 120, 255, 1, 46248), -- Stormwind +(@OGUID+14, 181215, 1, 440, 0, 1, 1, -7399.953125, -3733.060791015625, 61.05036163330078125, 5.811946868896484375, 0, 0, -0.2334451675415039, 0.972369968891143798, 120, 255, 1, 46248), +(@OGUID+15, 181215, 1, 440, 1939, 1, 1, -8333.6806640625, -3966.395751953125, 77.8482666015625, 1.378809213638305664, 0, 0, 0.636077880859375, 0.771624863147735595, 120, 255, 1, 46248), +(@OGUID+16, 181215, 1, 440, 983, 1, 1, -8633.2119140625, -2499.8212890625, 114.0166397094726562, 2.827429771423339843, 0, 0, 0.987688064575195312, 0.156436234712600708, 120, 255, 1, 46248), +(@OGUID+17, 181223, 0, 4, 1438, 1, 1, -11402.095703125, -3316.55029296875, 111.1883392333984375, 4.468043327331542968, 0, 0, -0.7880105972290039, 0.615661680698394775, 120, 255, 1, 46248), +(@OGUID+18, 181223, 1, 618, 0, 1, 1, 7755.751953125, -4030.913330078125, 786.49627685546875, 0.471238493919372558, 0, 0, 0.233445167541503906, 0.972369968891143798, 120, 255, 1, 46248), +(@OGUID+19, 181223, 1, 618, 0, 1, 1, 6646.68603515625, -3442.364501953125, 792.91644287109375, 4.869470596313476562, 0, 0, -0.64944744110107421, 0.760406434535980224, 120, 255, 1, 46248), +(@OGUID+20, 181373, 1, 618, 2250, 1, 1, 6184.28125, -4913.3193359375, 807.67633056640625, 6.09120035171508789, 0, 0, -0.09584522247314453, 0.995396256446838378, 120, 255, 1, 46248), +(@OGUID+21, 181374, 0, 4, 1438, 1, 1, -11233.9111328125, -2841.7744140625, 185.6030731201171875, 4.45059061050415039, 0, 0, -0.79335308074951171, 0.608761727809906005, 120, 255, 1, 46248); + +DELETE FROM `game_event_gameobject` WHERE `eventEntry` = 17 AND `guid` IN (@OGUID, @OGUID+1, @OGUID+2, @OGUID+3, @OGUID+4, @OGUID+5, @OGUID+6, @OGUID+7, @OGUID+8, @OGUID+9, @OGUID+10, @OGUID+11, @OGUID+12, @OGUID+13, @OGUID+14, @OGUID+15, @OGUID+16, @OGUID+17, @OGUID+18, @OGUID+19, @OGUID+20, @OGUID+21); +INSERT INTO `game_event_gameobject` (`eventEntry`, `guid`) VALUES +(17, @OGUID), +(17, @OGUID+1), +(17, @OGUID+2), +(17, @OGUID+3), +(17, @OGUID+4), +(17, @OGUID+5), +(17, @OGUID+6), +(17, @OGUID+7), +(17, @OGUID+8), +(17, @OGUID+9), +(17, @OGUID+10), +(17, @OGUID+11), +(17, @OGUID+12), +(17, @OGUID+13), +(17, @OGUID+14), +(17, @OGUID+15), +(17, @OGUID+16), +(17, @OGUID+17), +(17, @OGUID+18), +(17, @OGUID+19), +(17, @OGUID+20), +(17, @OGUID+21); From 0511befdc462fb25291295eba9fde676a4d9d21c Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 12 Dec 2022 12:47:22 +0000 Subject: [PATCH 25/28] chore(DB): import pending files Referenced commit(s): 524761d0c3aad6421fd4ae30e62144ec9952002c --- .../simple-scourge-invasion.sql => db_world/2022_12_12_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/simple-scourge-invasion.sql => db_world/2022_12_12_00.sql} (99%) diff --git a/data/sql/updates/pending_db_world/simple-scourge-invasion.sql b/data/sql/updates/db_world/2022_12_12_00.sql similarity index 99% rename from data/sql/updates/pending_db_world/simple-scourge-invasion.sql rename to data/sql/updates/db_world/2022_12_12_00.sql index 8752f0ad0..dd92f84b4 100644 --- a/data/sql/updates/pending_db_world/simple-scourge-invasion.sql +++ b/data/sql/updates/db_world/2022_12_12_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_11_09 -> 2022_12_12_00 SET @CGUID := 248650; SET @OGUID := 105000; From 069864cda95616c18426671ef374c767aab35988 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 12 Dec 2022 13:56:53 +0100 Subject: [PATCH 26/28] =?UTF-8?q?fix(Core/Spells):=20Fixed=20auras=20with?= =?UTF-8?q?=20`AURA=5FSTATE=5FHEALTH=5FABOVE=5F75=5FPERCEN=E2=80=A6=20(#14?= =?UTF-8?q?110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Spells): Fixed auras with `AURA_STATE_HEALTH_ABOVE_75_PERCENT` state. Fixes #14102 --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 15af7bb09..28ed2ae35 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -530,7 +530,7 @@ void Unit::Update(uint32 p_time) ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, IsAlive() ? HealthBelowPct(20) : false); ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, IsAlive() ? HealthBelowPct(35) : false); - ModifyAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, IsAlive() ? HealthBelowPct(75) : false); + ModifyAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, IsAlive() ? HealthAbovePct(75) : false); UpdateSplineMovement(p_time); GetMotionMaster()->UpdateMotion(p_time); From 4860989242dbcdcdfe5918e86827367b732d36a7 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 12 Dec 2022 13:57:03 +0100 Subject: [PATCH 27/28] =?UTF-8?q?fix(Scripts/Spells):=20Fixed=20level=20re?= =?UTF-8?q?quirements=20for=20Blade=20Ward=20and=20Bloo=E2=80=A6=20(#14107?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/Spells): Fixed level requirements for Blade Ward and Blood Draining enchants. Fixed Blood Draining proc. Fixes #12131 --- .../pending_db_world/rev_1670666174473143000.sql | 3 +++ src/server/scripts/Spells/spell_generic.cpp | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1670666174473143000.sql diff --git a/data/sql/updates/pending_db_world/rev_1670666174473143000.sql b/data/sql/updates/pending_db_world/rev_1670666174473143000.sql new file mode 100644 index 000000000..990ee257f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1670666174473143000.sql @@ -0,0 +1,3 @@ +-- +UPDATE `spell_script_names` SET `spell_id`=64579 WHERE `spell_id`=64568 AND `ScriptName`='spell_gen_proc_above_75'; +UPDATE `spell_script_names` SET `spell_id`=64441 WHERE `spell_id`=64440 AND `ScriptName`='spell_gen_proc_above_75'; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index fc801dfef..7bbd294ff 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -850,18 +850,24 @@ class spell_gen_fixate_aura : public AuraScript /* 64440 - Blade Warding 64568 - Blood Reserve */ -class spell_gen_proc_above_75 : public AuraScript +class spell_gen_proc_above_75 : public SpellScript { - PrepareAuraScript(spell_gen_proc_above_75); + PrepareSpellScript(spell_gen_proc_above_75); - bool CheckProc(ProcEventInfo& eventInfo) + SpellCastResult CheckLevel() { - return eventInfo.GetActor() && eventInfo.GetActor()->getLevel() >= 75; + Unit* caster = GetCaster(); + if (caster->getLevel() < 75) + { + return SPELL_FAILED_LOWLEVEL; + } + + return SPELL_CAST_OK; } void Register() override { - DoCheckProc += AuraCheckProcFn(spell_gen_proc_above_75::CheckProc); + OnCheckCast += SpellCheckCastFn(spell_gen_proc_above_75::CheckLevel); } }; From a131d2f7e8deb7c6a913aab758b681b2db1ba4be Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 12 Dec 2022 12:59:07 +0000 Subject: [PATCH 28/28] chore(DB): import pending files Referenced commit(s): 4860989242dbcdcdfe5918e86827367b732d36a7 --- .../rev_1670666174473143000.sql => db_world/2022_12_12_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1670666174473143000.sql => db_world/2022_12_12_01.sql} (84%) diff --git a/data/sql/updates/pending_db_world/rev_1670666174473143000.sql b/data/sql/updates/db_world/2022_12_12_01.sql similarity index 84% rename from data/sql/updates/pending_db_world/rev_1670666174473143000.sql rename to data/sql/updates/db_world/2022_12_12_01.sql index 990ee257f..c9608740f 100644 --- a/data/sql/updates/pending_db_world/rev_1670666174473143000.sql +++ b/data/sql/updates/db_world/2022_12_12_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_12_12_00 -> 2022_12_12_01 -- UPDATE `spell_script_names` SET `spell_id`=64579 WHERE `spell_id`=64568 AND `ScriptName`='spell_gen_proc_above_75'; UPDATE `spell_script_names` SET `spell_id`=64441 WHERE `spell_id`=64440 AND `ScriptName`='spell_gen_proc_above_75';