From fa9718b737d836676b87142ad87c11cdee000c00 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Thu, 2 Jan 2025 00:24:39 +0100 Subject: [PATCH 01/29] fix(Core/Spells): Remove level scaling from Booming Voice (#21054) --- src/server/game/Spells/SpellInfoCorrections.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 5896ee978adfdb..51a63724afa8ed 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4862,6 +4862,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->RequiresSpellFocus = 0; }); + // Booming Voice + ApplySpellFix({ 40080 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; From 0594a8f5180701e33c52a6f69525a2314acf8348 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Thu, 2 Jan 2025 00:25:39 +0100 Subject: [PATCH 02/29] fix(Scripts/ZulAman): reset Nalorakk's intro on wipe (#21063) Co-authored-by: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> --- .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 40 ++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index d27394fdf6d2ff..22c405ed6280f0 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -72,10 +72,11 @@ enum Phases enum NalorakkGroups { GROUP_CHECK_DEAD = 1, - GROUP_MOVE = 2, - GROUP_BERSERK = 3, - GROUP_HUMAN = 4, - GROUP_BEAR = 5 + GROUP_CHECK_EVADE = 2, + GROUP_MOVE = 3, + GROUP_BERSERK = 4, + GROUP_HUMAN = 5, + GROUP_BEAR = 6 }; struct boss_nalorakk : public BossAI @@ -109,7 +110,7 @@ struct boss_nalorakk : public BossAI void MoveInLineOfSight(Unit* who) override { - if (who->IsPlayer() && _phase < PHASE_START_COMBAT && _active) + if (who->IsPlayer() && !who->ToPlayer()->IsGameMaster() && _phase < PHASE_START_COMBAT && _active) { _active = false; switch (_phase) @@ -199,6 +200,25 @@ struct boss_nalorakk : public BossAI me->SetHomePosition(me->GetPosition()); break; } + _introScheduler.Schedule(10s, GROUP_CHECK_EVADE, [this](TaskContext context) + { + if (CheckAnyEvadeGroup(_waveList)) + { + _introScheduler.CancelGroup(GROUP_CHECK_DEAD); + _introScheduler.Schedule(5s, GROUP_CHECK_EVADE, [this](TaskContext context) + { + for (Creature* member : _waveList) + if (member->isMoving()) + { + context.Repeat(1s); + return; + } + _active = true; + }); + } + else + context.Repeat(10s); + }); } BossAI::MoveInLineOfSight(who); } @@ -310,7 +330,7 @@ struct boss_nalorakk : public BossAI BossAI::UpdateAI(diff); } - bool CheckFullyDeadGroup(std::list groupToCheck) + bool CheckFullyDeadGroup(std::list groupToCheck) { for (Creature* member : groupToCheck) { @@ -322,6 +342,14 @@ struct boss_nalorakk : public BossAI return true; } + bool CheckAnyEvadeGroup(std::list groupToCheck) + { + for (Creature* member : groupToCheck) + if (member->IsAlive() && !member->IsInCombat()) + return true; + return false; + } + void JustDied(Unit* killer) override { BossAI::JustDied(killer); From 3c19ab5fde0b110472f666c48ecf514a1fc84866 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:28:56 -0300 Subject: [PATCH 03/29] fix(Scripts/ZulAman): Fix Jan'lai teleport spells (#21083) --- .../rev_1735913324331119200.sql | 4 ++ .../EasternKingdoms/ZulAman/boss_janalai.cpp | 42 ++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1735913324331119200.sql diff --git a/data/sql/updates/pending_db_world/rev_1735913324331119200.sql b/data/sql/updates/pending_db_world/rev_1735913324331119200.sql new file mode 100644 index 00000000000000..8e5c898bb63993 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1735913324331119200.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 43096; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(43096, 'spell_summon_all_players_dummy'); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 401b8f6f511b86..238e94e1e4d4d2 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -21,6 +21,8 @@ #include "GridNotifiersImpl.h" #include "PassiveAI.h" #include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellScriptLoader.h" #include "zulaman.h" enum Yells @@ -42,6 +44,7 @@ enum Spells SPELL_FLAME_BREATH = 43140, SPELL_FIRE_WALL = 43113, SPELL_ENRAGE = 44779, + SPELL_SUMMON_PLAYERS_DUMMY = 43096, SPELL_SUMMON_PLAYERS = 43097, SPELL_TELE_TO_CENTER = 43098, // coord SPELL_HATCH_ALL = 43144, @@ -323,11 +326,9 @@ struct boss_janalai : public BossAI SpawnBombs(); _isBombing = true; - me->GetMap()->DoForAllPlayers([&](Player* player) - { - if (player->IsAlive()) - DoTeleportPlayer(player, janalainPos.GetPositionX() - 5 + rand() % 10, janalainPos.GetPositionY() - 5 + rand() % 10, janalainPos.GetPositionZ(), 0.0f); - }); + DoCastSelf(SPELL_TELE_TO_CENTER); + DoCastAOE(SPELL_SUMMON_PLAYERS_DUMMY, true); + //DoCast(Temp, SPELL_SUMMON_PLAYERS, true) // core bug, spell does not work if too far ThrowBombs(); @@ -449,8 +450,39 @@ struct npc_janalai_hatcher : public ScriptedAI bool _isHatching; }; +class spell_summon_all_players_dummy: public SpellScript +{ + PrepareSpellScript(spell_summon_all_players_dummy); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_PLAYERS }); + } + + void FilterTargets(std::list& targets) + { + Position pos = GetCaster()->GetPosition(); + targets.remove_if([&, pos](WorldObject* target) -> bool + { + return target->IsWithinBox(pos, 18.0f, 18.0f, 18.0f); + }); + } + + void OnHit(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_SUMMON_PLAYERS, true); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_summon_all_players_dummy::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_summon_all_players_dummy::OnHit, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_boss_janalai() { RegisterZulAmanCreatureAI(boss_janalai); RegisterZulAmanCreatureAI(npc_janalai_hatcher); + RegisterSpellScript(spell_summon_all_players_dummy); } From fd4019c0741c810e3af5feba095e364c70098dfe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 3 Jan 2025 17:29:56 +0000 Subject: [PATCH 04/29] chore(DB): import pending files Referenced commit(s): 3c19ab5fde0b110472f666c48ecf514a1fc84866 --- .../rev_1735913324331119200.sql => db_world/2025_01_03_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1735913324331119200.sql => db_world/2025_01_03_00.sql} (79%) diff --git a/data/sql/updates/pending_db_world/rev_1735913324331119200.sql b/data/sql/updates/db_world/2025_01_03_00.sql similarity index 79% rename from data/sql/updates/pending_db_world/rev_1735913324331119200.sql rename to data/sql/updates/db_world/2025_01_03_00.sql index 8e5c898bb63993..4daf0941f80beb 100644 --- a/data/sql/updates/pending_db_world/rev_1735913324331119200.sql +++ b/data/sql/updates/db_world/2025_01_03_00.sql @@ -1,3 +1,4 @@ +-- DB update 2024_12_31_01 -> 2025_01_03_00 -- DELETE FROM `spell_script_names` WHERE `spell_id` = 43096; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES From 3193a5ba5adde3870d736c3386d6ee50e422167f Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Fri, 3 Jan 2025 23:01:54 +0100 Subject: [PATCH 05/29] fix(Scripts/ZulAman): make Zul'Jin p3 cyclones go to random targets (#21087) --- .../scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index 95de6bc404ec40..59b0686d157348 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -381,6 +381,8 @@ struct npc_zuljin_vortex : public ScriptedAI me->SetSpeed(MOVE_RUN, 1.0f); me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); DoZoneInCombat(); + // Start attacking random target + ChangeToNewPlayer(); } void SpellHit(Unit* caster, SpellInfo const* spell) override @@ -389,13 +391,22 @@ struct npc_zuljin_vortex : public ScriptedAI DoCast(caster, SPELL_ZAP_DAMAGE, true); } + void ChangeToNewPlayer() + { + DoResetThreatList(); + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) + { + me->AddThreat(target, 10000000.0f); + } + } + void UpdateAI(uint32 /*diff*/) override { UpdateVictim(); //if the vortex reach the target, it change his target to another player if (me->IsWithinMeleeRange(me->GetVictim())) - AttackStart(SelectTarget(SelectTargetMethod::Random, 0)); + ChangeToNewPlayer(); } }; From a907edb13c82d248ba9c8556cc6977ebd89d495a Mon Sep 17 00:00:00 2001 From: Trinitarius <84076297+trinitarius@users.noreply.github.com> Date: Sat, 4 Jan 2025 08:19:28 +0100 Subject: [PATCH 06/29] fix(DB/Locale): deDE fixes for quest offer reward entry 8346 (#21076) --- data/sql/updates/pending_db_world/fix_quest_offer_8346.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/fix_quest_offer_8346.sql diff --git a/data/sql/updates/pending_db_world/fix_quest_offer_8346.sql b/data/sql/updates/pending_db_world/fix_quest_offer_8346.sql new file mode 100644 index 00000000000000..2768825e0340fc --- /dev/null +++ b/data/sql/updates/pending_db_world/fix_quest_offer_8346.sql @@ -0,0 +1,3 @@ +DELETE FROM `quest_offer_reward_locale` WHERE `ID` IN (8346) AND `locale` = 'deDE'; +INSERT INTO `quest_offer_reward_locale` (`ID`, `locale`, `RewardText`, `VerifiedBuild`) VALUES +(8346,'deDE','Ihr habt Euch heute bewiesen, $N. Euer Wille zu lernen zeigt, dass Ihr Euch sehr wohl gegenüber dem endlosen Verlangen, welches jeden Blutelfen beherrscht, durchsetzen könnt.$B$BRuht Euch nicht auf Euren Lorbeeren aus, sondern versucht zu meistern, was Ihr gelernt habt. Nur durch Tatendrang können wir als Volk überleben.$B$BNehmt dies - es wird Euch von Nutzen sein. Geht nun und macht unserem Volk noch einmal Ehre.',0); From 86cd052abb5235f031f3f6f2c473a6f24b893ef0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 4 Jan 2025 07:20:28 +0000 Subject: [PATCH 07/29] chore(DB): import pending files Referenced commit(s): a907edb13c82d248ba9c8556cc6977ebd89d495a --- .../fix_quest_offer_8346.sql => db_world/2025_01_04_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/fix_quest_offer_8346.sql => db_world/2025_01_04_00.sql} (93%) diff --git a/data/sql/updates/pending_db_world/fix_quest_offer_8346.sql b/data/sql/updates/db_world/2025_01_04_00.sql similarity index 93% rename from data/sql/updates/pending_db_world/fix_quest_offer_8346.sql rename to data/sql/updates/db_world/2025_01_04_00.sql index 2768825e0340fc..737bf326c158b5 100644 --- a/data/sql/updates/pending_db_world/fix_quest_offer_8346.sql +++ b/data/sql/updates/db_world/2025_01_04_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_03_00 -> 2025_01_04_00 DELETE FROM `quest_offer_reward_locale` WHERE `ID` IN (8346) AND `locale` = 'deDE'; INSERT INTO `quest_offer_reward_locale` (`ID`, `locale`, `RewardText`, `VerifiedBuild`) VALUES (8346,'deDE','Ihr habt Euch heute bewiesen, $N. Euer Wille zu lernen zeigt, dass Ihr Euch sehr wohl gegenüber dem endlosen Verlangen, welches jeden Blutelfen beherrscht, durchsetzen könnt.$B$BRuht Euch nicht auf Euren Lorbeeren aus, sondern versucht zu meistern, was Ihr gelernt habt. Nur durch Tatendrang können wir als Volk überleben.$B$BNehmt dies - es wird Euch von Nutzen sein. Geht nun und macht unserem Volk noch einmal Ehre.',0); From 2f50923caf737f584bc53191a269e553f771fe3c Mon Sep 17 00:00:00 2001 From: daobashun <49193927+fangshun2004@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:31:22 +0800 Subject: [PATCH 08/29] fix(DB/SAI): Add dialogue between creature argah 27440 and creature sagai 27441 (#21075) --- .../rev_1735703152636383200.sql | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1735703152636383200.sql diff --git a/data/sql/updates/pending_db_world/rev_1735703152636383200.sql b/data/sql/updates/pending_db_world/rev_1735703152636383200.sql new file mode 100644 index 00000000000000..d74cf348709e9d --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1735703152636383200.sql @@ -0,0 +1,27 @@ +-- Argah smart ai +SET @ENTRY := 27440; +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = @ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type` = 0 AND `entryOrGuid` = @ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type` = 9 AND `entryOrGuid` IN (@ENTRY * 100, @ENTRY * 100 + 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`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ENTRY, 0, 0, 0, 60, 0, 100, 0, 0, 0, 120000, 330000, 0, 0, 87, 2744000, 2744001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Argah - On Update - Run Random Script'), +(@ENTRY * 100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Argah - Actionlist - Say Line 0'), +(@ENTRY * 100, 9, 1, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 27441, 5, 0, 0, 0, 0, 0, 'Closest alive creature Sagai (27441) in 5 yards: Talk 0 to invoker'), +(@ENTRY * 100, 9, 2, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Argah - Actionlist - Say Line 1'), +(@ENTRY * 100, 9, 3, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Argah - Actionlist - Say Line 2'), +(@ENTRY * 100, 9, 4, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 27441, 5, 0, 0, 0, 0, 0, 'Closest alive creature Sagai (27441) in 5 yards: Talk 1 to invoker'), +(@ENTRY * 100 + 1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Argah - Actionlist - Say Line 3'), +(@ENTRY * 100 + 1, 9, 1, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 27441, 5, 0, 0, 0, 0, 0, 'Closest alive creature Sagai (27441) in 5 yards: Talk 2 to invoker'); + +DELETE FROM `creature_text` WHERE `CreatureID` = 27440; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(27440, 0, 0, 'The nerubian siege outside is chilling, Sagai. There seems to be no end to them.', 12, 0, 100, 1, 0, 0, 26618, 0, 'Argah'), +(27440, 1, 0, 'That\'s right... I recovered munitions from the quarry just yesterday for that purpose.', 12, 0, 100, 1, 0, 0, 26620, 0, 'Argah'), +(27440, 2, 0, 'I hope the charges are set soon. Everyone could use a respite.', 12, 0, 100, 1, 0, 0, 26621, 0, 'Argah'), +(27440, 3, 0, 'Saurfang is here, Sagai! Saurfang! The brother of Broxigar himself, here to aid our efforts!', 12, 0, 100, 1, 0, 0, 26623, 0, 'Argah'); + +DELETE FROM `creature_text` WHERE `CreatureID` = 27441; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(27441, 0, 0, 'Yah. It be dem sinkholes. You see dem? Dere be talk of blowin\' dem up, cavin\' dem in.', 12, 0, 100, 1, 0, 0, 26619, 0, 'Sagai'), +(27441, 1, 0, 'You got dat right.', 12, 0, 100, 1, 0, 0, 26622, 0, 'Sagai'), +(27441, 2, 0, 'Yah. Hellscream, he be a fierce one, but too eager to prove himself, I be thinkin\'. It be good Saurfang be here, for sure.', 12, 0, 100, 1, 0, 0, 26688, 0, 'Sagai'); From 7084ebdceaeaad18b31c3041cbf2347395585651 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 4 Jan 2025 07:32:21 +0000 Subject: [PATCH 09/29] chore(DB): import pending files Referenced commit(s): 2f50923caf737f584bc53191a269e553f771fe3c --- .../rev_1735703152636383200.sql => db_world/2025_01_04_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1735703152636383200.sql => db_world/2025_01_04_01.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1735703152636383200.sql b/data/sql/updates/db_world/2025_01_04_01.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1735703152636383200.sql rename to data/sql/updates/db_world/2025_01_04_01.sql index d74cf348709e9d..0fc04b6b96ba32 100644 --- a/data/sql/updates/pending_db_world/rev_1735703152636383200.sql +++ b/data/sql/updates/db_world/2025_01_04_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_04_00 -> 2025_01_04_01 -- Argah smart ai SET @ENTRY := 27440; UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = @ENTRY; From 275ff66e297463b3b07a503c90581a3211eaf39f Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 4 Jan 2025 10:36:23 +0100 Subject: [PATCH 10/29] chore(Core/World): improve server restart/shutdown logging (#21046) --- src/server/game/World/World.cpp | 48 +++++++++++++++++++++------------ src/server/game/World/World.h | 5 ++-- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index e04627c0a4494f..f0893f3f16ab6e 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2683,7 +2683,7 @@ void World::_UpdateGameTime() } /// Shutdown the server -void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std::string& reason) +void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, std::string const& reason) { // ignore if server shutdown at next tick if (IsStopped()) @@ -2691,8 +2691,9 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std: _shutdownMask = options; _exitCode = exitcode; + _shutdownReason = reason; - LOG_WARN("server", "Time left until shutdown/restart: {}", time); + LOG_DEBUG("server.worldserver", "Server shutdown called with ShutdownMask {}, ExitCode {}, Time {}, Reason {}", ShutdownMask(options), ShutdownExitCode(exitcode), secsToTimeString(time), reason); ///- If the shutdown time is 0, set m_stopEvent (except if shutdown is 'idle' with remaining sessions) if (time == 0) @@ -2712,32 +2713,45 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std: sScriptMgr->OnShutdownInitiate(ShutdownExitCode(exitcode), ShutdownMask(options)); } -/// Display a shutdown message to the user(s) -void World::ShutdownMsg(bool show, Player* player, const std::string& reason) +/** + * @brief Displays a shutdown message at specific intervals or immediately if required. + * + * Show the time remaining for a server shutdown/restart with a reason appended if one is provided. + * Messages are displayed at regular intervals such as every + * 12 hours, 1 hour, 5 minutes, 1 minute, 30 seconds, 10 seconds, + * and every second in the last 10 seconds. + * + * @param show Forces the message to be displayed immediately. + * @param player The player who should recieve the message (can be nullptr for global messages). + * @param reason The reason for the shutdown, appended to the message if provided. + */ +void World::ShutdownMsg(bool show, Player* player, std::string const& reason) { - // not show messages for idle shutdown mode + // Do not show a message for idle shutdown if (_shutdownMask & SHUTDOWN_MASK_IDLE) return; - ///- Display a message every 12 hours, hours, 5 minutes, minute, 5 seconds and finally seconds - if (show || - (_shutdownTimer < 5 * MINUTE && (_shutdownTimer % 15) == 0) || // < 5 min; every 15 sec - (_shutdownTimer < 15 * MINUTE && (_shutdownTimer % MINUTE) == 0) || // < 15 min ; every 1 min - (_shutdownTimer < 30 * MINUTE && (_shutdownTimer % (5 * MINUTE)) == 0) || // < 30 min ; every 5 min - (_shutdownTimer < 12 * HOUR && (_shutdownTimer % HOUR) == 0) || // < 12 h ; every 1 h - (_shutdownTimer > 12 * HOUR && (_shutdownTimer % (12 * HOUR)) == 0)) // > 12 h ; every 12 h + bool twelveHours = (_shutdownTimer > 12 * HOUR && (_shutdownTimer % (12 * HOUR)) == 0); // > 12 h ; every 12 h + bool oneHour = (_shutdownTimer < 12 * HOUR && (_shutdownTimer % HOUR) == 0); // < 12 h ; every 1 h + bool fiveMin = (_shutdownTimer < 30 * MINUTE && (_shutdownTimer % (5 * MINUTE)) == 0); // < 30 min ; every 5 min + bool oneMin = (_shutdownTimer < 15 * MINUTE && (_shutdownTimer % MINUTE) == 0); // < 15 min ; every 1 min + bool thirtySec = (_shutdownTimer < 5 * MINUTE && (_shutdownTimer % 30) == 0); // < 5 min; every 30 sec + bool tenSec = (_shutdownTimer < 1 * MINUTE && (_shutdownTimer % 10) == 0); // < 1 min; every 10 sec + bool oneSec = (_shutdownTimer < 10 * SECOND && (_shutdownTimer % 1) == 0); // < 10 sec; every 1 sec + + ///- Display a message every 12 hours, hour, 5 minutes, minute, 30 seconds, 10 seconds and finally seconds + if (show || twelveHours || oneHour || fiveMin || oneMin || thirtySec || tenSec || oneSec) { std::string str = secsToTimeString(_shutdownTimer).append("."); - if (!reason.empty()) - { str += " - " + reason; - } + // Display the reason every 12 hours, hour, 5 minutes, minute. At 60 seconds and at 10 seconds + else if (!_shutdownReason.empty() && (twelveHours || oneHour || fiveMin || oneMin || _shutdownTimer == 60 || _shutdownTimer == 10)) + str += " - " + _shutdownReason; ServerMessageType msgid = (_shutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME; - SendServerMessage(msgid, str, player); - LOG_DEBUG("server.worldserver", "Server is {} in {}", (_shutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str); + LOG_WARN("server.worldserver", "Server {} in {}", (_shutdownMask & SHUTDOWN_MASK_RESTART ? "restarting" : "shutdown"), str); } } diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index bb62006011083c..76869e8f35c962 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -245,9 +245,9 @@ class World: public IWorld /// Are we in the middle of a shutdown? [[nodiscard]] bool IsShuttingDown() const override { return _shutdownTimer > 0; } [[nodiscard]] uint32 GetShutDownTimeLeft() const override { return _shutdownTimer; } - void ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std::string& reason = std::string()) override; + void ShutdownServ(uint32 time, uint32 options, uint8 exitcode, std::string const& reason = std::string()) override; void ShutdownCancel() override; - void ShutdownMsg(bool show = false, Player* player = nullptr, const std::string& reason = std::string()) override; + void ShutdownMsg(bool show = false, Player* player = nullptr, std::string const& reason = std::string()) override; static uint8 GetExitCode() { return _exitCode; } static void StopNow(uint8 exitcode) { _stopEvent = true; _exitCode = exitcode; } static bool IsStopped() { return _stopEvent; } @@ -366,6 +366,7 @@ class World: public IWorld static uint8 _exitCode; uint32 _shutdownTimer; uint32 _shutdownMask; + std::string _shutdownReason; uint32 _cleaningFlags; From 6598be59c58d453eb60168a34a2a1c63d12f31b5 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Sat, 4 Jan 2025 11:07:30 +0100 Subject: [PATCH 11/29] fix(Scripts/ZulAman): initial Amani'shi pack (#21084) --- .../pending_db_world/rev_1735913072331031069.sql | 12 ++++++++++++ .../scripts/EasternKingdoms/ZulAman/zulaman.cpp | 7 +++++++ src/server/scripts/EasternKingdoms/ZulAman/zulaman.h | 1 + 3 files changed, 20 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1735913072331031069.sql diff --git a/data/sql/updates/pending_db_world/rev_1735913072331031069.sql b/data/sql/updates/pending_db_world/rev_1735913072331031069.sql new file mode 100644 index 00000000000000..73766703d3f398 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1735913072331031069.sql @@ -0,0 +1,12 @@ +-- +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23889) AND (`source_type` = 0) AND (`id` = 3); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(23889, 0, 3, 0, 38, 0, 100, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Savage - On Data Set 0 0 - Start Attacking'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23597) AND (`source_type` = 0) AND (`id` IN (13, 19, 20, 21, 22)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(23597, 0, 13, 21, 1, 1, 100, 3, 7000, 7000, 7000, 7000, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Guardian - Out of Combat - Start Attacking (No Repeat) (Normal Dungeon)'), +(23597, 0, 19, 20, 1, 2, 100, 3, 7800, 7800, 7800, 7800, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Guardian - Out of Combat - Start Attacking (No Repeat) (Normal Dungeon)'), +(23597, 0, 20, 22, 61, 2, 100, 3, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Guardian - Out of Combat - Set Reactstate Aggressive (Phase 2) (No Repeat) (Normal Dungeon)'), +(23597, 0, 21, 22, 61, 1, 100, 3, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Guardian - Out of Combat - Set Reactstate Aggressive (Phase 2) (No Repeat) (Normal Dungeon)'), +(23597, 0, 22, 0, 61, 3, 100, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Guardian - Out of Combat - Set Home Position (Phase 1+2) (No Repeat) (Normal Dungeon)'); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 97dde689d398a5..9d079c17822cf1 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -410,6 +410,13 @@ struct npc_harrison_jones : public ScriptedAI scheduler.Schedule(1s, [this](TaskContext /*task*/) { me->SetStandState(UNIT_STAND_STATE_DEAD); + }).Schedule(2s, [this](TaskContext /*task*/) + { + // Send savages to attack players + std::list creatures; + me->GetCreatureListWithEntryInGrid(creatures, NPC_AMANISHI_SAVAGE, 100.0f); + for (Creature* creature : creatures) + creature->AI()->SetData(0, 0); }); _instance->StorePersistentData(DATA_TIMED_RUN, 21); _instance->DoAction(ACTION_START_TIMED_RUN); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h index 66e3b079af9052..1004be12fa3234 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -54,6 +54,7 @@ enum CreatureIds NPC_HALAZZI = 23577, NPC_NALORAKK = 23576, NPC_SPIRIT_LYNX = 24143, + NPC_AMANISHI_SAVAGE = 23889, NPC_AMANISHI_WARBRINGER = 23580, NPC_AMANISHI_TRIBESMAN = 23582, NPC_AMANISHI_MEDICINE_MAN = 23581, From 3cdbff009c184662bf1127990001a6cb12deda1c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 4 Jan 2025 10:08:32 +0000 Subject: [PATCH 12/29] chore(DB): import pending files Referenced commit(s): 6598be59c58d453eb60168a34a2a1c63d12f31b5 --- .../rev_1735913072331031069.sql => db_world/2025_01_04_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1735913072331031069.sql => db_world/2025_01_04_02.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1735913072331031069.sql b/data/sql/updates/db_world/2025_01_04_02.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1735913072331031069.sql rename to data/sql/updates/db_world/2025_01_04_02.sql index 73766703d3f398..34b5641a073b4d 100644 --- a/data/sql/updates/pending_db_world/rev_1735913072331031069.sql +++ b/data/sql/updates/db_world/2025_01_04_02.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_04_01 -> 2025_01_04_02 -- DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23889) AND (`source_type` = 0) AND (`id` = 3); INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES From 712e4af5c2c9826fc604aaea5e49073a4165678e Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:51:54 +0100 Subject: [PATCH 13/29] fix (Boss/Script) Increase Spell Hatch Egg cooldown by one second. (#21090) --- src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 238e94e1e4d4d2..04b09dca06674e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -401,7 +401,7 @@ struct npc_janalai_hatcher : public ScriptedAI ++_repeatCount; if (me->FindNearestCreature(NPC_EGG, 100.0f)) - context.Repeat(4s); + context.Repeat(5s); else { if (WorldObject* summoner = GetSummoner()) From 87bf90b9da19adc78777b591f1c3c23073dc2304 Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Sun, 5 Jan 2025 10:52:06 +0100 Subject: [PATCH 14/29] fix (DB/Creature) Remove some Amanshi Scouts and add a Waypoint for two of them. (#21092) --- .../Amanshi_Scouts_Cleaning.sql | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 data/sql/updates/pending_db_world/Amanshi_Scouts_Cleaning.sql diff --git a/data/sql/updates/pending_db_world/Amanshi_Scouts_Cleaning.sql b/data/sql/updates/pending_db_world/Amanshi_Scouts_Cleaning.sql new file mode 100644 index 00000000000000..25351cc0532e79 --- /dev/null +++ b/data/sql/updates/pending_db_world/Amanshi_Scouts_Cleaning.sql @@ -0,0 +1,52 @@ + +-- Remove unofficial Npcs +DELETE FROM `creature` WHERE (`id1` = 23586) AND (`guid` IN (89274, 89287, 89288, 89293, 89303, 89308, 89312, 89313, 89329)); +DELETE FROM `creature_addon` WHERE (`guid` IN (89274, 89287, 89288, 89293, 89303, 89308, 89312, 89313, 89329)); +DELETE FROM `linked_respawn` WHERE (`guid` IN (89274, 89287, 89288, 89293, 89303, 89308, 89312, 89313, 89329)); + +-- Update Positions, Wander Distance, Movement Type and pose for 89280 (sit). +UPDATE `creature` SET `position_x` = -138.5746, `position_y` = 1164.1141, `position_z` = 3.0369, `orientation` = 1.3761, `wander_distance` = 0, `MovementType` = 0 WHERE `guid` = 89284 AND `id1` = 23586; +UPDATE `creature` SET `position_x` = -219.4417, `position_y` = 1379.474, `position_z` = 0.0258, `orientation` = 0.9638, `wander_distance` = 0, `MovementType` = 0 WHERE `guid` = 89280 AND `id1` = 23586; +UPDATE `creature_addon` SET `bytes1` = 1 WHERE `guid` = 89280; + +-- Add Waypoints for two Scout Patrols +DELETE FROM `waypoint_data` WHERE `id` IN (8927800); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(8927800, 1, -197.76129, 1336.6729, 0.25522953, NULL, 0, 0, 0, 100, 0), +(8927800, 2, -195.18869, 1319.1761, 1.2445819, NULL, 0, 0, 0, 100, 0), +(8927800, 3, -194.77528, 1288.6068, 1.3654809, NULL, 0, 0, 0, 100, 0), +(8927800, 4, -199.99263, 1259.6373, 1.1474091, NULL, 0, 0, 0, 100, 0), +(8927800, 5, -191.13173, 1241.6224, 0.58376735, NULL, 0, 0, 0, 100, 0), +(8927800, 6, -148.23947, 1214.8658, 0.9682467, NULL, 0, 0, 0, 100, 0), +(8927800, 7, -141.05751, 1192.8319, 0.071034685, NULL, 0, 0, 0, 100, 0), +(8927800, 8, -141.5868, 1124.066, 0.026241792, NULL, 0, 0, 0, 100, 0), +(8927800, 9, -141.05751, 1192.8319, 0.071034685, NULL, 0, 0, 0, 100, 0), +(8927800, 10, -148.23947, 1214.8658, 0.9682467, NULL, 0, 0, 0, 100, 0), +(8927800, 11, -191.13173, 1241.6224, 0.58376735, NULL, 0, 0, 0, 100, 0), +(8927800, 12, -199.99263, 1259.6373, 1.1474091, NULL, 0, 0, 0, 100, 0), +(8927800, 13, -194.77528, 1288.6068, 1.3654809, NULL, 0, 0, 0, 100, 0), +(8927800, 14, -195.18869, 1319.1761, 1.2445819, NULL, 0, 0, 0, 100, 0), +(8927800, 15, -197.76129, 1336.6729, 0.25522953, NULL, 0, 0, 0, 100, 0), +(8927800, 16, -208.06369, 1379.98, -0.11678864, NULL, 0, 0, 0, 100, 0); + +DELETE FROM `waypoint_data` WHERE `id` IN (8928900); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(8928900, 1, -206.0561, 1178.5385, -0.56990623, NULL, 0, 0, 0, 100, 0), +(8928900, 2, -201.31548, 1195.815, -0.02255094, NULL, 0, 0, 0, 100, 0), +(8928900, 3, -177.1632, 1235.7587, 0.89132327, NULL, 0, 0, 0, 100, 0), +(8928900, 4, -142.62305, 1206.9307, 1.0594966, NULL, 0, 0, 0, 100, 0), +(8928900, 5, -136.43565, 1188.6288, 0.00022190076, NULL, 0, 0, 0, 100, 0), +(8928900, 6, -130.66829, 1163.2294, 0.48558202, NULL, 0, 0, 0, 100, 0), +(8928900, 7, -138.89366, 1149.0428, 0.025163397, NULL, 0, 0, 0, 100, 0), +(8928900, 8, -134.64996, 1118.2001, 0.48225334, NULL, 0, 0, 0, 100, 0), +(8928900, 9, -152.4376, 1100.2438, 0.32423848, NULL, 0, 0, 0, 100, 0), +(8928900, 10, -174.22884, 1083.7368, 0.10808088, NULL, 0, 0, 0, 100, 0), +(8928900, 11, -187.53537, 1094.5493, 1.7097571, NULL, 0, 0, 0, 100, 0), +(8928900, 12, -203.66646, 1117.7672, -0.08857499, NULL, 0, 0, 0, 100, 0), +(8928900, 13, -215.36795, 1135.6195, -1.8750997, NULL, 0, 0, 0, 100, 0), +(8928900, 14, -215.95822, 1155.653, -1.9799352, NULL, 0, 0, 0, 100, 0); + +-- Load WPs to the Patrols +UPDATE `creature` SET `wander_distance` = 0, `MovementType` = 2 WHERE `guid` IN (89278, 89289) AND `id1` = 23586; +UPDATE `creature_addon` SET `path_id` = 8927800 WHERE (`guid` IN (89278)); +UPDATE `creature_addon` SET `path_id` = 8928900 WHERE (`guid` IN (89289)); From 161c433cf0fe4a60f655acec1e120d4a9e613ffc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Jan 2025 09:53:11 +0000 Subject: [PATCH 15/29] chore(DB): import pending files Referenced commit(s): 87bf90b9da19adc78777b591f1c3c23073dc2304 --- .../Amanshi_Scouts_Cleaning.sql => db_world/2025_01_05_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/Amanshi_Scouts_Cleaning.sql => db_world/2025_01_05_00.sql} (98%) diff --git a/data/sql/updates/pending_db_world/Amanshi_Scouts_Cleaning.sql b/data/sql/updates/db_world/2025_01_05_00.sql similarity index 98% rename from data/sql/updates/pending_db_world/Amanshi_Scouts_Cleaning.sql rename to data/sql/updates/db_world/2025_01_05_00.sql index 25351cc0532e79..1d51ea7711ad01 100644 --- a/data/sql/updates/pending_db_world/Amanshi_Scouts_Cleaning.sql +++ b/data/sql/updates/db_world/2025_01_05_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_04_02 -> 2025_01_05_00 -- Remove unofficial Npcs DELETE FROM `creature` WHERE (`id1` = 23586) AND (`guid` IN (89274, 89287, 89288, 89293, 89303, 89308, 89312, 89313, 89329)); From 9ab46f81a1233535f05e4ba4b1439634f929b1a5 Mon Sep 17 00:00:00 2001 From: Exitare Date: Sun, 5 Jan 2025 07:31:33 -0800 Subject: [PATCH 16/29] fix(DB/Creature): Set respawn to 15s for Soul Fragments in the Shrine of Lost Souls (#20992) --- data/sql/updates/pending_db_world/rev_1734751988808151700.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1734751988808151700.sql diff --git a/data/sql/updates/pending_db_world/rev_1734751988808151700.sql b/data/sql/updates/pending_db_world/rev_1734751988808151700.sql new file mode 100644 index 00000000000000..18268f1fc0ba97 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1734751988808151700.sql @@ -0,0 +1,2 @@ +-- Angered, Suffering & Hungering Soul Fragment respawn +UPDATE `creature` SET `spawntimesecs` = 15 WHERE (`guid` BETWEEN 148424 AND 148488) and `id1` in (23398, 23399, 23401); From 5df6d2b15115213d8547abd55798c60d5c175b28 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Jan 2025 15:32:33 +0000 Subject: [PATCH 17/29] chore(DB): import pending files Referenced commit(s): 9ab46f81a1233535f05e4ba4b1439634f929b1a5 --- .../rev_1734751988808151700.sql => db_world/2025_01_05_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1734751988808151700.sql => db_world/2025_01_05_01.sql} (80%) diff --git a/data/sql/updates/pending_db_world/rev_1734751988808151700.sql b/data/sql/updates/db_world/2025_01_05_01.sql similarity index 80% rename from data/sql/updates/pending_db_world/rev_1734751988808151700.sql rename to data/sql/updates/db_world/2025_01_05_01.sql index 18268f1fc0ba97..c6f801751a2586 100644 --- a/data/sql/updates/pending_db_world/rev_1734751988808151700.sql +++ b/data/sql/updates/db_world/2025_01_05_01.sql @@ -1,2 +1,3 @@ +-- DB update 2025_01_05_00 -> 2025_01_05_01 -- Angered, Suffering & Hungering Soul Fragment respawn UPDATE `creature` SET `spawntimesecs` = 15 WHERE (`guid` BETWEEN 148424 AND 148488) and `id1` in (23398, 23399, 23401); From 15b11ae6e0142dc05d0d16e92b4d42ae6f380baf Mon Sep 17 00:00:00 2001 From: mostlynick3 Date: Sun, 5 Jan 2025 16:53:26 +0100 Subject: [PATCH 18/29] fix(DB/Creature): Correct behavior and emote of oil-covered birds (#20923) --- data/sql/updates/pending_db_world/hawkfix.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 data/sql/updates/pending_db_world/hawkfix.sql diff --git a/data/sql/updates/pending_db_world/hawkfix.sql b/data/sql/updates/pending_db_world/hawkfix.sql new file mode 100644 index 00000000000000..15423b208bfce5 --- /dev/null +++ b/data/sql/updates/pending_db_world/hawkfix.sql @@ -0,0 +1,6 @@ + +DELETE FROM `creature_template_movement` WHERE `CreatureId` IN (25817, 25748); + +UPDATE `creature` SET `MovementType` = 0, `wander_distance` = 0 WHERE `id1` IN (25817, 25748); +-- set to 'sitting' +UPDATE `creature_template_addon`SET `bytes1` = 1 WHERE `entry` IN (25817, 25748); From d5cb202735ee45e1a696f36a73a91c800f36729a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Jan 2025 15:54:30 +0000 Subject: [PATCH 19/29] chore(DB): import pending files Referenced commit(s): 15b11ae6e0142dc05d0d16e92b4d42ae6f380baf --- .../{pending_db_world/hawkfix.sql => db_world/2025_01_05_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/hawkfix.sql => db_world/2025_01_05_02.sql} (86%) diff --git a/data/sql/updates/pending_db_world/hawkfix.sql b/data/sql/updates/db_world/2025_01_05_02.sql similarity index 86% rename from data/sql/updates/pending_db_world/hawkfix.sql rename to data/sql/updates/db_world/2025_01_05_02.sql index 15423b208bfce5..a9e68a96578aec 100644 --- a/data/sql/updates/pending_db_world/hawkfix.sql +++ b/data/sql/updates/db_world/2025_01_05_02.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_05_01 -> 2025_01_05_02 DELETE FROM `creature_template_movement` WHERE `CreatureId` IN (25817, 25748); From 0b16bfa7ae74231187557463598eac805be6c305 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Sun, 5 Jan 2025 17:52:31 +0100 Subject: [PATCH 20/29] fix(DB/SmartAI): more consistent bear summon, despawn bear on reset (#21096) --- .../pending_db_world/rev_1736079931234163195.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1736079931234163195.sql diff --git a/data/sql/updates/pending_db_world/rev_1736079931234163195.sql b/data/sql/updates/pending_db_world/rev_1736079931234163195.sql new file mode 100644 index 00000000000000..5459416bf9e605 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1736079931234163195.sql @@ -0,0 +1,13 @@ +-- +-- Amani'shi Warbringer: Set MinHealth% to 0 for HEALTH_PCT +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23580) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(23580, 0, 0, 1, 2, 0, 100, 1, 0, 30, 0, 0, 0, 0, 11, 43274, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - Between 0-30% Health - Cast \'Dismount Bear\' (No Repeat)'), +(23580, 0, 1, 2, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - Between 0-30% Health - Set Flag Standstate Stand Up (No Repeat)'), +(23580, 0, 2, 3, 61, 0, 100, 3, 0, 0, 0, 0, 0, 0, 11, 40743, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - Between 0-30% Health - Cast \'Frenzy\' (No Repeat)'), +(23580, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - Between 0-30% Health - Set caster combat distance to 0 (RestToMax: 0) (No Repeat)'); +-- Amani Bear Mount +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24217; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24217) 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`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(24217, 0, 0, 0, 7, 0, 100, 1, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani Bear Mount - On Evade - Despawn Instant (No Repeat)'); From 956b48da216a7d7937518e4b825661cd3875bbc7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Jan 2025 16:53:31 +0000 Subject: [PATCH 21/29] chore(DB): import pending files Referenced commit(s): 0b16bfa7ae74231187557463598eac805be6c305 --- .../rev_1736079931234163195.sql => db_world/2025_01_05_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1736079931234163195.sql => db_world/2025_01_05_03.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1736079931234163195.sql b/data/sql/updates/db_world/2025_01_05_03.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1736079931234163195.sql rename to data/sql/updates/db_world/2025_01_05_03.sql index 5459416bf9e605..fdeed5fcdcd531 100644 --- a/data/sql/updates/pending_db_world/rev_1736079931234163195.sql +++ b/data/sql/updates/db_world/2025_01_05_03.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_05_02 -> 2025_01_05_03 -- -- Amani'shi Warbringer: Set MinHealth% to 0 for HEALTH_PCT DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23580) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3)); From df89704ab532ba153487a56c0a5a2cf7793cabe0 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Sun, 5 Jan 2025 18:54:43 +0100 Subject: [PATCH 22/29] fix(Scripts/ZulAman): add Scout run to drums (#21095) Co-authored-by: MantisLord --- .../rev_1736079931234163195.sql | 14 ++ .../EasternKingdoms/ZulAman/zulaman.cpp | 164 ++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1736079931234163195.sql diff --git a/data/sql/updates/pending_db_world/rev_1736079931234163195.sql b/data/sql/updates/pending_db_world/rev_1736079931234163195.sql new file mode 100644 index 00000000000000..33286710eeb763 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1736079931234163195.sql @@ -0,0 +1,14 @@ +-- +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23586) AND (`source_type` = 0); +UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'npc_amanishi_scout' WHERE (`entry` = 23586); +DELETE FROM `spell_script_names` WHERE `spell_id`=42177 AND `ScriptName`='spell_alert_drums'; +DELETE FROM `spell_script_names` WHERE `spell_id`=42179 AND `ScriptName`='spell_summon_amanishi_sentries'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(42177, 'spell_alert_drums'), +(42179, 'spell_summon_amanishi_sentries'); + +-- Reinforcement +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23587) AND (`source_type` = 0) AND (`id` IN (2, 3)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(23587, 0, 2, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Reinforcement - On Just Summoned - Set In Combat With Zone'), +(23587, 0, 3, 0, 1, 0, 100, 1, 10000, 10000, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Reinforcement - Out of Combat - Despawn Instant (No Repeat)'); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 9d079c17822cf1..8cc5551b51a296 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -20,6 +20,7 @@ #include "Player.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" +#include "SpellAuraEffects.h" #include "SpellInfo.h" #include "SpellScript.h" #include "SpellScriptLoader.h" @@ -681,6 +682,166 @@ struct npc_amanishi_tempest : public ScriptedAI SummonList _summons; }; +struct WorldTriggerHutPred +{ + bool operator()(Creature* trigger) const + { + return trigger->GetOrientation() > 2.7f || (trigger->GetOrientation() < 2.7f && 1270.0f < trigger->GetPositionY() && trigger->GetPositionY() < 1280.0f); + } +}; + +struct WorldTriggerDrumPred +{ + bool operator()(Creature* trigger) const + { + return !WorldTriggerHutPred()(trigger); + } +}; + +enum AmanishiScout +{ + NPC_WORLD_TRIGGER = 22515, + POINT_DRUM = 0, + SAY_AGGRO = 0, + SPELL_ALERT_DRUMS = 42177, + SPELL_MULTI_SHOT = 43205, + SPELL_SHOOT = 16496 +}; + +struct npc_amanishi_scout : public ScriptedAI +{ + npc_amanishi_scout(Creature* creature) : ScriptedAI(creature) { } + + void Reset() override + { + scheduler.CancelAll(); + me->SetCombatMovement(false); + } + + void JustEngagedWith(Unit* /*who*/) override + { + me->SetInCombatWithZone(); + Talk(SAY_AGGRO); + // Move to Drum + std::list triggers; + GetCreatureListWithEntryInGrid(triggers, me, NPC_WORLD_TRIGGER, 50.0f); + triggers.remove_if(WorldTriggerHutPred()); + triggers.sort(Acore::ObjectDistanceOrderPred(me)); + if (!triggers.empty()) + { + me->ClearTarget(); + Creature* closestDrum = triggers.front(); + me->GetMotionMaster()->MovePoint(POINT_DRUM, closestDrum->GetPositionX(), closestDrum->GetPositionY(), closestDrum->GetPositionZ()); + } + else + ScheduleCombat(); + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type == POINT_MOTION_TYPE && id == POINT_DRUM) + { + DoCastSelf(SPELL_ALERT_DRUMS); + scheduler.Schedule(5s, [this](TaskContext /*context*/) + { + ScheduleCombat(); + }); + } + } + + void ScheduleCombat() + { + me->SetCombatMovement(true); + if (Unit* victim = me->GetVictim()) + me->GetMotionMaster()->MoveChase(victim); + scheduler.Schedule(2s, [this](TaskContext context) + { + DoCastVictim(SPELL_SHOOT); + context.Repeat(4s, 5s); + }).Schedule(6s, [this](TaskContext context) + { + DoCastAOE(SPELL_MULTI_SHOT); + context.Repeat(20s, 24s); + }); + } + + void UpdateAI(uint32 diff) override + { + scheduler.Update(diff); + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +enum SpellAlertDrums +{ + SPELL_SUMMON_AMANISHI_SENTRIES = 42179 +}; + +class spell_alert_drums : public AuraScript +{ + PrepareAuraScript(spell_alert_drums); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_AMANISHI_SENTRIES }); + } + + void HandleTriggerSpell(AuraEffect const* aurEff) + { + PreventDefaultAction(); + if (aurEff->GetTickNumber() == 1) + GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_AMANISHI_SENTRIES, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_alert_drums::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + +enum AmanishiSentries +{ + SUMMON_AMANISHI_SENTRIES_1 = 42180, + SUMMON_AMANISHI_SENTRIES_2 = 42181, + SUMMON_AMANISHI_SENTRIES_3 = 42182, + SUMMON_AMANISHI_SENTRIES_4 = 42183, +}; + +class spell_summon_amanishi_sentries : public SpellScript +{ + PrepareSpellScript(spell_summon_amanishi_sentries); + + constexpr static uint32 spells[4] = { SUMMON_AMANISHI_SENTRIES_1, SUMMON_AMANISHI_SENTRIES_2, SUMMON_AMANISHI_SENTRIES_3, SUMMON_AMANISHI_SENTRIES_4 }; + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo(spells); + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + std::list triggers; + GetCreatureListWithEntryInGrid(triggers, GetHitUnit(), NPC_WORLD_TRIGGER, 50.0f); + triggers.remove_if(WorldTriggerDrumPred()); + if (triggers.empty()) + return; + Creature* trigger = Acore::Containers::SelectRandomContainerElement(triggers); + uint8 index_1 = urand(0, 3); + uint8 index_2 = (index_1 + 1) % 4; + trigger->CastSpell(trigger, spells[index_1], true); + trigger->CastSpell(trigger, spells[index_2], true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_summon_amanishi_sentries::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_zulaman() { RegisterZulAmanCreatureAI(npc_forest_frog); @@ -689,4 +850,7 @@ void AddSC_zulaman() RegisterSpellScript(spell_ritual_of_power); RegisterZulAmanCreatureAI(npc_amanishi_lookout); RegisterZulAmanCreatureAI(npc_amanishi_tempest); + RegisterZulAmanCreatureAI(npc_amanishi_scout); + RegisterSpellScript(spell_alert_drums); + RegisterSpellScript(spell_summon_amanishi_sentries); } From 460f86d4d2fd379349cefdcc35a873bb06b7ce41 Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Sun, 5 Jan 2025 18:55:38 +0100 Subject: [PATCH 23/29] fix(DB/Creature) Rain of Darkness and Saronite Arrows spawn. (#21094) --- .../pending_db_world/Rain_of_Darkness.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 data/sql/updates/pending_db_world/Rain_of_Darkness.sql diff --git a/data/sql/updates/pending_db_world/Rain_of_Darkness.sql b/data/sql/updates/pending_db_world/Rain_of_Darkness.sql new file mode 100644 index 00000000000000..c45ba291a40081 --- /dev/null +++ b/data/sql/updates/pending_db_world/Rain_of_Darkness.sql @@ -0,0 +1,25 @@ + +-- Remove unit flag "stunned" from Citizen of Havenshire +UPDATE `creature_template` SET `unit_flags`=`unit_flags`& ~262144 WHERE (`entry` = 28576); + +-- Update SmartAI for Citizens of Havenshire (rows 12-13 are Guid Reserved) +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28576; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28576) AND (`source_type` = 0) AND (`id` IN (14, 15)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(28576, 0, 14, 0, 1, 0, 30, 0, 5000, 20000, 5000, 20000, 0, 0, 11, 52149, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of Havenshire - Out of Combat - Cast \'Rain of Darkness\''), +(28576, 0, 15, 0, 8, 0, 100, 0, 52149, 0, 0, 0, 0, 0, 142, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of Havenshire - On Spellhit \'Rain of Darkness\' - Set HP to 10%'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28577; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28577) AND (`source_type` = 0) AND (`id` IN (14, 15)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(28577, 0, 14, 0, 1, 0, 30, 0, 5000, 20000, 5000, 20000, 0, 0, 11, 52149, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of Havenshire - Out of Combat - Cast \'Rain of Darkness\''), +(28577, 0, 15, 0, 8, 0, 100, 0, 52149, 0, 0, 0, 0, 0, 142, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of Havenshire - On Spellhit \'Rain of Darkness\' - Set HP to 10%'); + +-- Remove aura from Scourge Sky Darkeners +UPDATE `creature_template_addon` SET `visibilityDistanceType` = 0, `auras` = '' WHERE (`entry` = 28642); + +-- Add SmartAI for Scourge Sky Darkeners +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28642; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28642); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(28642, 0, 0, 0, 1, 0, 100, 0, 5000, 20000, 5000, 20000, 0, 0, 11, 52147, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scourge Sky Darkener - Out of Combat - Cast \'Sky Darkener Assault\''); From 84531500e56c8e40dfed1bbc54d9fe6f3143213f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Jan 2025 17:55:46 +0000 Subject: [PATCH 24/29] chore(DB): import pending files Referenced commit(s): df89704ab532ba153487a56c0a5a2cf7793cabe0 --- .../Rain_of_Darkness.sql => db_world/2025_01_05_04.sql} | 1 + .../rev_1736079931234163195.sql => db_world/2025_01_05_05.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/Rain_of_Darkness.sql => db_world/2025_01_05_04.sql} (98%) rename data/sql/updates/{pending_db_world/rev_1736079931234163195.sql => db_world/2025_01_05_05.sql} (97%) diff --git a/data/sql/updates/pending_db_world/Rain_of_Darkness.sql b/data/sql/updates/db_world/2025_01_05_04.sql similarity index 98% rename from data/sql/updates/pending_db_world/Rain_of_Darkness.sql rename to data/sql/updates/db_world/2025_01_05_04.sql index c45ba291a40081..03c3dbaa3538dd 100644 --- a/data/sql/updates/pending_db_world/Rain_of_Darkness.sql +++ b/data/sql/updates/db_world/2025_01_05_04.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_05_03 -> 2025_01_05_04 -- Remove unit flag "stunned" from Citizen of Havenshire UPDATE `creature_template` SET `unit_flags`=`unit_flags`& ~262144 WHERE (`entry` = 28576); diff --git a/data/sql/updates/pending_db_world/rev_1736079931234163195.sql b/data/sql/updates/db_world/2025_01_05_05.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1736079931234163195.sql rename to data/sql/updates/db_world/2025_01_05_05.sql index 33286710eeb763..a6804237308f5c 100644 --- a/data/sql/updates/pending_db_world/rev_1736079931234163195.sql +++ b/data/sql/updates/db_world/2025_01_05_05.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_05_04 -> 2025_01_05_05 -- DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23586) AND (`source_type` = 0); UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'npc_amanishi_scout' WHERE (`entry` = 23586); From f7d500c3f15666940f4994cd1ba75d360d167d24 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Sun, 5 Jan 2025 21:00:48 +0100 Subject: [PATCH 25/29] fix(DB/SmartAI): `HEALTH_PCT` where Min equals Max (#21097) --- .../rev_1736093307962776687.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1736093307962776687.sql diff --git a/data/sql/updates/pending_db_world/rev_1736093307962776687.sql b/data/sql/updates/pending_db_world/rev_1736093307962776687.sql new file mode 100644 index 00000000000000..09bef03e1b844f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1736093307962776687.sql @@ -0,0 +1,30 @@ +-- +-- Scarlet Medic +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28608) AND (`source_type` = 0) AND (`id` IN (3, 4)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(28608, 0, 3, 0, 0, 0, 100, 0, 0, 0, 3400, 4800, 0, 0, 11, 15498, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Medic - In Combat - Cast \'Holy Smite\''), +(28608, 0, 4, 0, 2, 0, 100, 1, 0, 15, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Medic - Between 0-15% Health - Flee For Assist (No Repeat)'); +-- Phantasmal ogre +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 27647) 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`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(27647, 0, 0, 0, 2, 0, 100, 0, 0, 30, 20000, 24000, 0, 0, 11, 50730, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Phantasmal Ogre - Between 0-30% Health - Cast \'Bloodlust\''); +-- Halfdan the Ice-Hearted +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23671) AND (`source_type` = 0) AND (`id` IN (9, 10, 11)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(23671, 0, 9, 10, 2, 0, 100, 1, 25, 75, 120000, 120000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Halfdan the Ice-Hearted - Between 25-75% Health - Say Line 2 (No Repeat)'), +(23671, 0, 10, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Halfdan the Ice-Hearted - Between 25-75% Health - Cast \'Enrage\' (No Repeat)'), +(23671, 0, 11, 0, 2, 0, 100, 1, 0, 25, 120000, 120000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Halfdan the Ice-Hearted - Between 0-25% Health - Say Line 3 (No Repeat)'); +-- Dalaran Spellscribe +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1920) AND (`source_type` = 0) AND (`id` IN (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`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(1920, 0, 2, 0, 2, 0, 100, 1, 0, 15, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Dalaran Spellscribe - Between 0-15% Health - Flee For Assist (No Repeat)'); +-- Makrinni Scrabbler +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 6370) 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`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(6370, 0, 0, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 12548, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Makrinni Scrabbler - On Aggro - Cast \'Frost Shock\''), +(6370, 0, 1, 0, 0, 0, 100, 0, 2100, 2300, 6100, 6300, 0, 0, 11, 20822, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Makrinni Scrabbler - In Combat - Cast \'Frostbolt\''), +(6370, 0, 2, 0, 2, 0, 100, 1, 0, 20, 0, 0, 0, 0, 11, 11642, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Makrinni Scrabbler - Between 0-20% Health - Cast \'Heal\' (No Repeat)'); +-- Alexandra Blazen +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 8378) AND (`source_type` = 0) AND (`id` IN (3)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(8378, 0, 3, 0, 2, 0, 100, 0, 0, 20, 20000, 20000, 0, 0, 11, 11640, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Alexandra Blazen - Between 0-20% Health - Cast \'Renew\''); From 43994e0fb1685aa71fd9e2b629b814233021252d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Jan 2025 20:01:50 +0000 Subject: [PATCH 26/29] chore(DB): import pending files Referenced commit(s): f7d500c3f15666940f4994cd1ba75d360d167d24 --- .../rev_1736093307962776687.sql => db_world/2025_01_05_06.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1736093307962776687.sql => db_world/2025_01_05_06.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1736093307962776687.sql b/data/sql/updates/db_world/2025_01_05_06.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1736093307962776687.sql rename to data/sql/updates/db_world/2025_01_05_06.sql index 09bef03e1b844f..723326a6d66c22 100644 --- a/data/sql/updates/pending_db_world/rev_1736093307962776687.sql +++ b/data/sql/updates/db_world/2025_01_05_06.sql @@ -1,3 +1,4 @@ +-- DB update 2025_01_05_05 -> 2025_01_05_06 -- -- Scarlet Medic DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28608) AND (`source_type` = 0) AND (`id` IN (3, 4)); From 5f81bdb25d200680a459895926beb1501074040b Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 5 Jan 2025 17:49:33 -0300 Subject: [PATCH 27/29] fix(Scripts/ZulAman): Fix initial pack not chasing distant players (#21098) --- data/sql/updates/pending_db_world/rev_1736106102651280100.sql | 2 ++ src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/rev_1736106102651280100.sql diff --git a/data/sql/updates/pending_db_world/rev_1736106102651280100.sql b/data/sql/updates/pending_db_world/rev_1736106102651280100.sql new file mode 100644 index 00000000000000..e77bff151097af --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1736106102651280100.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23889) AND (`source_type` = 0) AND (`id` = 3); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 8cc5551b51a296..88cd3e7381e846 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -417,7 +417,7 @@ struct npc_harrison_jones : public ScriptedAI std::list creatures; me->GetCreatureListWithEntryInGrid(creatures, NPC_AMANISHI_SAVAGE, 100.0f); for (Creature* creature : creatures) - creature->AI()->SetData(0, 0); + creature->SetInCombatWithZone(); }); _instance->StorePersistentData(DATA_TIMED_RUN, 21); _instance->DoAction(ACTION_START_TIMED_RUN); From e91176a5631d4c7663346e92cf29dba141082ac4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Jan 2025 20:50:36 +0000 Subject: [PATCH 28/29] chore(DB): import pending files Referenced commit(s): 5f81bdb25d200680a459895926beb1501074040b --- .../rev_1736106102651280100.sql => db_world/2025_01_05_07.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1736106102651280100.sql => db_world/2025_01_05_07.sql} (69%) diff --git a/data/sql/updates/pending_db_world/rev_1736106102651280100.sql b/data/sql/updates/db_world/2025_01_05_07.sql similarity index 69% rename from data/sql/updates/pending_db_world/rev_1736106102651280100.sql rename to data/sql/updates/db_world/2025_01_05_07.sql index e77bff151097af..e47224202279d2 100644 --- a/data/sql/updates/pending_db_world/rev_1736106102651280100.sql +++ b/data/sql/updates/db_world/2025_01_05_07.sql @@ -1,2 +1,3 @@ +-- DB update 2025_01_05_06 -> 2025_01_05_07 -- DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23889) AND (`source_type` = 0) AND (`id` = 3); From 131671d793bdd63c66dd03f903a09e036800d927 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:19:03 -0300 Subject: [PATCH 29/29] refactor(Scripts/ZulAman): clean up Helazzi code (#21101) --- .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 63 ++++++++++--------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index 43669101065634..d96450ca775d38 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -55,10 +55,9 @@ enum PhaseHalazzi { PHASE_NONE = 0, PHASE_LYNX = 1, - PHASE_SPLIT = 2, - PHASE_HUMAN = 3, - PHASE_MERGE = 4, - PHASE_ENRAGE = 5 + PHASE_HUMAN = 2, + PHASE_MERGE = 3, + PHASE_ENRAGE = 4 }; enum Yells @@ -118,15 +117,15 @@ struct boss_halazzi : public BossAI { BossAI::DamageTaken(attacker, damage, damagetype, damageSchoolMask); - if (_phase == PHASE_LYNX || _phase == PHASE_ENRAGE) + if (_phase == PHASE_LYNX) { uint32 _healthCheckPercentage = 25 * (3 - _transformCount); - if (!HealthAbovePct(_healthCheckPercentage)) - EnterPhase(PHASE_SPLIT); + if (me->HealthBelowPctDamaged(_healthCheckPercentage, damage)) + EnterPhase(PHASE_HUMAN); } else if (_phase == PHASE_HUMAN) { - if (!HealthAbovePct(20)) + if (me->HealthBelowPctDamaged(20, damage)) EnterPhase(PHASE_MERGE); } } @@ -153,20 +152,12 @@ struct boss_halazzi : public BossAI void EnterPhase(PhaseHalazzi nextPhase) { + _phase = nextPhase; + switch (nextPhase) { - case PHASE_ENRAGE: - SetInvincibility(false); - scheduler.Schedule(12s, GROUP_LYNX, [this](TaskContext context) - { - DoCastSelf(SPELL_SUMMON_TOTEM); - context.Repeat(20s); - }); - [[fallthrough]]; case PHASE_LYNX: { - if (_phase == PHASE_MERGE) - me->ResumeChasingVictim(); summons.DespawnAll(); if (_transformCount) @@ -188,6 +179,8 @@ struct boss_halazzi : public BossAI } } + me->ResumeChasingVictim(); + scheduler.CancelGroup(GROUP_MERGE); scheduler.Schedule(5s, 15s, GROUP_LYNX, [this](TaskContext context) { @@ -201,16 +194,15 @@ struct boss_halazzi : public BossAI }); break; } - case PHASE_SPLIT: + case PHASE_HUMAN: Talk(SAY_SPLIT); DoCastSelf(SPELL_TRANSFIGURE, true); scheduler.Schedule(3s, GROUP_SPLIT, [this](TaskContext /*context*/) { DoCastSelf(SPELL_SUMMON_LYNX, true); }); - nextPhase = PHASE_HUMAN; - [[fallthrough]]; - case PHASE_HUMAN: + _phase = PHASE_HUMAN; + scheduler.CancelGroup(GROUP_MERGE); scheduler.CancelGroup(GROUP_LYNX); scheduler.Schedule(10s, GROUP_HUMAN, [this](TaskContext context) @@ -240,24 +232,35 @@ struct boss_halazzi : public BossAI me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveFollow(lynx, 0, 0); ++_transformCount; - scheduler.Schedule(2s, GROUP_MERGE, [this](TaskContext context) + scheduler.Schedule(2s, GROUP_MERGE, [this, lynx](TaskContext context) { - if (Creature* lynx = instance->GetCreature(DATA_SPIRIT_LYNX)) + if (lynx) + { if (me->IsWithinDistInMap(lynx, 6.0f)) { - if (_transformCount < 3) - EnterPhase(PHASE_LYNX); - else - EnterPhase(PHASE_ENRAGE); + EnterPhase(PHASE_LYNX); + + // Enrage phase + if (_transformCount == 3) + { + _phase = PHASE_ENRAGE; + SetInvincibility(false); + scheduler.Schedule(12s, GROUP_LYNX, [this](TaskContext context) + { + DoCastSelf(SPELL_SUMMON_TOTEM); + context.Repeat(20s); + }); + } } - context.Repeat(2s); + else + context.Repeat(2s); + } }); } break; default: break; } - _phase = nextPhase; } void KilledUnit(Unit* victim) override