From cc051272762b21b6050589ab8b4bd1b53f7a5c6d Mon Sep 17 00:00:00 2001 From: NoxMax <50133316+NoxMax@users.noreply.github.com> Date: Fri, 18 Apr 2025 22:59:06 -0600 Subject: [PATCH 01/53] fix(Battlefield/WG): set default maxplayer 120, minlevel 75 (#21937) --- src/server/apps/worldserver/worldserver.conf.dist | 12 ++++++------ src/server/game/Battlefield/Battlefield.h | 4 ++-- src/server/game/World/World.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 6853dd54b..c21cbf667 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -3436,14 +3436,14 @@ Wintergrasp.Enable = 1 # # Wintergrasp.PlayerMax -# Description: Maximum number of players allowed in Wintergrasp. -# Default: 100 +# Description: Maximum number of players allowed in Wintergrasp per team. +# Default: 120 -Wintergrasp.PlayerMax = 100 +Wintergrasp.PlayerMax = 120 # # Wintergrasp.PlayerMin -# Description: Minimum number of players required for Wintergrasp. +# Description: Minimum number of players required for Wintergrasp per team. # Default: 0 Wintergrasp.PlayerMin = 0 @@ -3451,9 +3451,9 @@ Wintergrasp.PlayerMin = 0 # # Wintergrasp.PlayerMinLvl # Description: Required character level for the Wintergrasp battle. -# Default: 77 +# Default: 75 -Wintergrasp.PlayerMinLvl = 77 +Wintergrasp.PlayerMinLvl = 75 # # Wintergrasp.BattleTimer diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 28c3cd062..ab00697c3 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -383,8 +383,8 @@ protected: uint32 m_ZoneId; // ZoneID of Wintergrasp = 4197 uint32 m_MapId; // MapId where is Battlefield Map* m_Map; - uint32 m_MaxPlayer; // Maximum number of player that participated to Battlefield - uint32 m_MinPlayer; // Minimum number of player for Battlefield start + uint32 m_MaxPlayer; // Maximum number of players per team that participated to Battlefield + uint32 m_MinPlayer; // Minimum number of players per team for Battlefield start uint32 m_MinLevel; // Required level to participate at Battlefield uint32 m_BattleTime; // Length of a battle uint32 m_NoWarBattleTime; // Time between two battles diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index f0fd69346..b9d740d15 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1167,9 +1167,9 @@ void World::LoadConfigSettings(bool reload) // Wintergrasp _int_configs[CONFIG_WINTERGRASP_ENABLE] = sConfigMgr->GetOption("Wintergrasp.Enable", 1); - _int_configs[CONFIG_WINTERGRASP_PLR_MAX] = sConfigMgr->GetOption("Wintergrasp.PlayerMax", 100); + _int_configs[CONFIG_WINTERGRASP_PLR_MAX] = sConfigMgr->GetOption("Wintergrasp.PlayerMax", 120); _int_configs[CONFIG_WINTERGRASP_PLR_MIN] = sConfigMgr->GetOption("Wintergrasp.PlayerMin", 0); - _int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = sConfigMgr->GetOption("Wintergrasp.PlayerMinLvl", 77); + _int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = sConfigMgr->GetOption("Wintergrasp.PlayerMinLvl", 75); _int_configs[CONFIG_WINTERGRASP_BATTLETIME] = sConfigMgr->GetOption("Wintergrasp.BattleTimer", 30); _int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = sConfigMgr->GetOption("Wintergrasp.NoBattleTimer", 150); _int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = sConfigMgr->GetOption("Wintergrasp.CrashRestartTimer", 10); From 704f7f070532718e88a64989979729f632b365ec Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 19 Apr 2025 05:01:46 -0300 Subject: [PATCH 02/53] fix(Scripts/SunwellPlateau): Correct Felmyst landing pos variable names (#21954) --- .../scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 3b7c4fdc2..c9b0ad3f1 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -108,8 +108,8 @@ const Position RightSideLanes[3] = const Position RightSide = { 1458.5555f, 502.1995f, 59.899513f, 1.605702f }; const Position LeftSide = { 1469.0642f, 729.5854f, 59.823853f, 4.6774f }; -const Position LandingRightPos = { 1476.77f, 665.094f, 20.6423f }; -const Position LandingLeftPos = { 1469.93f, 557.009f, 22.631699f }; +const Position LandingLeftPos = { 1476.77f, 665.094f, 20.6423f }; +const Position LandingRightPos = { 1469.93f, 557.009f, 22.631699f }; class CorruptTriggers : public BasicEvent { From 68558e8626064de33864cf86214072438d43b1c0 Mon Sep 17 00:00:00 2001 From: sudlud Date: Sat, 19 Apr 2025 13:15:33 +0200 Subject: [PATCH 03/53] fix(Scripts/Noblegarden): fix bunny transformation on egg looting (#21957) --- .../rev_1745009912305741300.sql | 6 ++ .../scripts/Events/events_script_loader.cpp | 2 + src/server/scripts/Events/noblegarden.cpp | 61 +++++++++++++++++++ src/server/scripts/World/go_scripts.cpp | 16 ----- 4 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1745009912305741300.sql create mode 100644 src/server/scripts/Events/noblegarden.cpp diff --git a/data/sql/updates/pending_db_world/rev_1745009912305741300.sql b/data/sql/updates/pending_db_world/rev_1745009912305741300.sql new file mode 100644 index 000000000..8be409c4f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1745009912305741300.sql @@ -0,0 +1,6 @@ +-- replace noblegarden gameobject script by spell script +UPDATE `gameobject_template` SET `ScriptName` = '' WHERE (`ScriptName` = 'go_noblegarden_colored_egg') AND (`entry` BETWEEN 113768 AND 113772); + +-- 61712 Summon Noblegarden Bunny Controller +DELETE FROM `spell_script_names` WHERE (`spell_id` = 61712) AND (`ScriptName` = 'spell_summon_noblegarden_bunny_controller'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (61712, 'spell_summon_noblegarden_bunny_controller'); diff --git a/src/server/scripts/Events/events_script_loader.cpp b/src/server/scripts/Events/events_script_loader.cpp index 529ce2410..e6ade3a6c 100644 --- a/src/server/scripts/Events/events_script_loader.cpp +++ b/src/server/scripts/Events/events_script_loader.cpp @@ -24,6 +24,7 @@ void AddSC_event_love_in_the_air(); void AddSC_event_midsummer_scripts(); void AddSC_event_childrens_week(); void AddSC_event_firework_show_scripts(); +void AddSC_event_noblegarden_scripts(); // The name of this function should match: // void Add${NameOfDirectory}Scripts() @@ -37,4 +38,5 @@ void AddEventsScripts() AddSC_event_midsummer_scripts(); AddSC_event_childrens_week(); AddSC_event_firework_show_scripts(); + AddSC_event_noblegarden_scripts(); } diff --git a/src/server/scripts/Events/noblegarden.cpp b/src/server/scripts/Events/noblegarden.cpp new file mode 100644 index 000000000..df04be6c1 --- /dev/null +++ b/src/server/scripts/Events/noblegarden.cpp @@ -0,0 +1,61 @@ +/* + * 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 "SpellScript.h" +#include "SpellScriptLoader.h" + +enum eNoblegarden +{ + SPELL_NOBLEGARDEN_BUNNY = 61734 +}; + +// 61712 Summon Noblegarden Bunny Controller +class spell_summon_noblegarden_bunny_controller : public SpellScript +{ + PrepareSpellScript(spell_summon_noblegarden_bunny_controller); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_NOBLEGARDEN_BUNNY }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Player* player = GetHitPlayer()) + player->CastSpell(player, SPELL_NOBLEGARDEN_BUNNY, true); + } + + SpellCastResult CheckCast() + { + if (roll_chance_i(5)) + return SPELL_CAST_OK; + + return SPELL_FAILED_UNKNOWN; + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_summon_noblegarden_bunny_controller::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnCheckCast += SpellCheckCastFn(spell_summon_noblegarden_bunny_controller::CheckCast); + } +}; + +void AddSC_event_noblegarden_scripts() +{ + RegisterSpellScript(spell_summon_noblegarden_bunny_controller); +} diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 567850c00..f458cbbd5 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -28,21 +28,6 @@ #include "Spell.h" // Ours -/*###### -## go_noblegarden_colored_egg -######*/ -class go_noblegarden_colored_egg : public GameObjectScript -{ -public: - go_noblegarden_colored_egg() : GameObjectScript("go_noblegarden_colored_egg") { } - - bool OnGossipHello(Player* player, GameObject* /*go*/) override - { - if (roll_chance_i(5)) - player->CastSpell(player, 61734, true); // SPELL NOBLEGARDEN BUNNY - return false; - } -}; class go_seer_of_zebhalak : public GameObjectScript { @@ -1948,7 +1933,6 @@ public: void AddSC_go_scripts() { // Ours - new go_noblegarden_colored_egg(); new go_seer_of_zebhalak(); new go_mistwhisper_treasure(); new go_witherbark_totem_bundle(); From 0ddce17a4f614022b89387daaf75732e71da94d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 19 Apr 2025 11:16:33 +0000 Subject: [PATCH 04/53] chore(DB): import pending files Referenced commit(s): 68558e8626064de33864cf86214072438d43b1c0 --- .../rev_1745009912305741300.sql => db_world/2025_04_19_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1745009912305741300.sql => db_world/2025_04_19_00.sql} (91%) diff --git a/data/sql/updates/pending_db_world/rev_1745009912305741300.sql b/data/sql/updates/db_world/2025_04_19_00.sql similarity index 91% rename from data/sql/updates/pending_db_world/rev_1745009912305741300.sql rename to data/sql/updates/db_world/2025_04_19_00.sql index 8be409c4f..a57a6e185 100644 --- a/data/sql/updates/pending_db_world/rev_1745009912305741300.sql +++ b/data/sql/updates/db_world/2025_04_19_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_17_01 -> 2025_04_19_00 -- replace noblegarden gameobject script by spell script UPDATE `gameobject_template` SET `ScriptName` = '' WHERE (`ScriptName` = 'go_noblegarden_colored_egg') AND (`entry` BETWEEN 113768 AND 113772); From 7162294f1b0c567a927074fc85417cc16b9d75d6 Mon Sep 17 00:00:00 2001 From: Anton Popovichenko Date: Sat, 19 Apr 2025 21:01:40 +0200 Subject: [PATCH 05/53] fix(Deps/Boost): Fix build for boost 1.88. (#21952) --- src/common/Utilities/StartProcess.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/common/Utilities/StartProcess.cpp b/src/common/Utilities/StartProcess.cpp index 7f745d6ff..5218b6b3a 100644 --- a/src/common/Utilities/StartProcess.cpp +++ b/src/common/Utilities/StartProcess.cpp @@ -22,10 +22,21 @@ #include "Util.h" #include #include -#include "boost/process.hpp" #include +#if BOOST_VERSION < 108800 +#include using namespace boost::process; +#else +#include +#include +#include +#include +#include +#include +using namespace boost::process::v1; +#endif + using namespace boost::iostreams; namespace Acore @@ -118,7 +129,11 @@ namespace Acore exe = std::filesystem::absolute(executable).string(), args = argsVector, env = environment(boost::this_process::environment()), +#if BOOST_VERSION < 108800 std_in = boost::process::close, +#else + std_in = boost::process::v1::close, +#endif std_out = outStream, std_err = errStream }; From 534d07ec1b29a5b9d628fc52179c949bd862cd4a Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Sun, 20 Apr 2025 00:12:17 +0200 Subject: [PATCH 06/53] fix(Core/Spells): Suppress Crystal Spire of Karabor procs (#21961) --- 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 0a4dabc1b..3fa396707 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4910,6 +4910,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AttributesEx7 |= SPELL_ATTR7_TREAT_AS_NPC_AOE; }); + // Heal (Crystal Spire of Karabor) + ApplySpellFix({ 40972 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; From 4c19d51286fea42bb2638cdb847ca1d678ddcf92 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Sun, 20 Apr 2025 05:47:55 -0400 Subject: [PATCH 07/53] fix(DB/Loot): Consolidate Sunwell trash recipe drops into one reference table and update chance. (#21962) --- .../sunwell-trash-recipes.sql | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 data/sql/updates/pending_db_world/sunwell-trash-recipes.sql diff --git a/data/sql/updates/pending_db_world/sunwell-trash-recipes.sql b/data/sql/updates/pending_db_world/sunwell-trash-recipes.sql new file mode 100644 index 000000000..0ce926912 --- /dev/null +++ b/data/sql/updates/pending_db_world/sunwell-trash-recipes.sql @@ -0,0 +1,39 @@ +DELETE FROM `creature_loot_template` WHERE `Reference` = 34092; +UPDATE `creature_loot_template` SET `Chance` = 10 WHERE `Reference` = 34091; + +DELETE FROM `reference_loot_template` WHERE `Entry` IN (34091, 34092); +INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(34091, 35186, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Annihilator Holo-Gogs'), +(34091, 35187, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Justicebringer 3000 Specs'), +(34091, 35189, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Powerheal 9000 Lens'), +(34091, 35190, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Hyper-Magnified Moon Specs'), +(34091, 35191, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Wonderheal XT68 Shades'), +(34091, 35192, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Primal-Attuned Goggles'), +(34091, 35193, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Lightning Etched Specs'), +(34091, 35194, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Surestrike Goggles v3.0'), +(34091, 35195, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Mayhem Projection Goggles'), +(34091, 35196, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Hard Khorium Goggles'), +(34091, 35197, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Quad Deathblow X44 Goggles'), +(34091, 35198, 0, 0, 0, 1, 1, 1, 1, 'Design: Loop of Forged Power'), +(34091, 35199, 0, 0, 0, 1, 1, 1, 1, 'Design: Ring of Flowing Life'), +(34091, 35200, 0, 0, 0, 1, 1, 1, 1, 'Design: Hard Khorium Band'), +(34091, 35201, 0, 0, 0, 1, 1, 1, 1, 'Design: Pendant of Sunfire'), +(34091, 35202, 0, 0, 0, 1, 1, 1, 1, 'Design: Amulet of Flowing Life'), +(34091, 35203, 0, 0, 0, 1, 1, 1, 1, 'Design: Hard Khorium Choker'), +(34091, 35204, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Sunfire Handwraps'), +(34091, 35205, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Hands of Eternal Light'), +(34091, 35206, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Sunfire Robe'), +(34091, 35207, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Robe of Eternal Light'), +(34091, 35208, 0, 0, 0, 1, 1, 1, 1, 'Plans: Sunblessed Gauntlets'), +(34091, 35209, 0, 0, 0, 1, 1, 1, 1, 'Plans: Hard Khorium Battlefists'), +(34091, 35210, 0, 0, 0, 1, 1, 1, 1, 'Plans: Sunblessed Breastplate'), +(34091, 35211, 0, 0, 0, 1, 1, 1, 1, 'Plans: Hard Khorium Battleplate'), +(34091, 35212, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Leather Gauntlets of the Sun'), +(34091, 35213, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Flethcher''s Gloves of the Phoenix'), +(34091, 35214, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Gloves of Immortal Dusk'), +(34091, 35215, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Sun-Drenched Scale Gloves'), +(34091, 35216, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Leather Chestguard of the Sun'), +(34091, 35217, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Embrace of the Phoenix'), +(34091, 35218, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Carapace of Sun and Shadow'), +(34091, 35219, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Sun-Drenched Scale Chestguard'), +(34091, 35273, 0, 0, 0, 1, 1, 1, 1, 'Study of Advanced Smelting'); From 384577b9230fab7b230dae07a6cd0eaccaecab7b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 20 Apr 2025 09:48:57 +0000 Subject: [PATCH 08/53] chore(DB): import pending files Referenced commit(s): 4c19d51286fea42bb2638cdb847ca1d678ddcf92 --- .../sunwell-trash-recipes.sql => db_world/2025_04_20_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/sunwell-trash-recipes.sql => db_world/2025_04_20_00.sql} (98%) diff --git a/data/sql/updates/pending_db_world/sunwell-trash-recipes.sql b/data/sql/updates/db_world/2025_04_20_00.sql similarity index 98% rename from data/sql/updates/pending_db_world/sunwell-trash-recipes.sql rename to data/sql/updates/db_world/2025_04_20_00.sql index 0ce926912..b385a04cb 100644 --- a/data/sql/updates/pending_db_world/sunwell-trash-recipes.sql +++ b/data/sql/updates/db_world/2025_04_20_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_19_00 -> 2025_04_20_00 DELETE FROM `creature_loot_template` WHERE `Reference` = 34092; UPDATE `creature_loot_template` SET `Chance` = 10 WHERE `Reference` = 34091; From 6f8566d838035907035987440efb9d4f39530a83 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Sun, 20 Apr 2025 15:36:38 -0400 Subject: [PATCH 09/53] fix(DB): Add and correct arena season rewards. (#21960) --- .../pending_db_world/arena-rewards.sql | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 data/sql/updates/pending_db_world/arena-rewards.sql diff --git a/data/sql/updates/pending_db_world/arena-rewards.sql b/data/sql/updates/pending_db_world/arena-rewards.sql new file mode 100644 index 000000000..9183bc466 --- /dev/null +++ b/data/sql/updates/pending_db_world/arena-rewards.sql @@ -0,0 +1,72 @@ +DELETE FROM `arena_season_reward_group` WHERE `arena_season` IN (1, 2, 3, 4); +INSERT INTO `arena_season_reward_group` (`id`, `arena_season`, `criteria_type`, `min_criteria`, `max_criteria`, `reward_mail_template_id`, `reward_mail_subject`, `reward_mail_body`, `gold_reward`) VALUES +-- Season 4 (Brutal) +(21, 4, 'abs', 1, 1, 0, '', '', 0), +(22, 4, 'pct', 0, 0.5, 262, '', '', 0), +(23, 4, 'pct', 0.5, 3, 0, '', '', 0), +(24, 4, 'pct', 3, 10, 0, '', '', 0), +(25, 4, 'pct', 10, 35, 0, '', '', 0), +-- Season 3 (Vengeful) +(26, 3, 'abs', 1, 1, 0, '', '', 0), +(27, 3, 'pct', 0, 0.5, 211, '', '', 0), +(28, 3, 'pct', 0.5, 3, 0, '', '', 0), +(29, 3, 'pct', 3, 10, 0, '', '', 0), +(30, 3, 'pct', 10, 35, 0, '', '', 0), +-- Season 2 (Merciless) +(31, 2, 'abs', 1, 1, 0, '', '', 0), +(32, 2, 'pct', 0, 0.5, 0, 'Congratulations!', 'On behalf of the Steamwheedle Fighting Circuit, we congratulate you for your successes in this arena season.$B$BIn recognition of your skill and savagery, we hereby bestow upon you this Merciless Nether Drake. May it serve you well.', 0), +(33, 2, 'pct', 0.5, 3, 0, '', '', 0), +(34, 2, 'pct', 3, 10, 0, '', '', 0), +(35, 2, 'pct', 10, 35, 0, '', '', 0), +-- Season 1 +(36, 1, 'pct', 0, 0.5, 0, 'Congratulations!', 'On behalf of the Steamwheedle Fighting Circuit, we congratulate you for your successes in this arena season.$B$BIn recognition of your skill and savagery, we hereby bestow upon you this Swift Nether Drake. May it serve you well.', 0), +(37, 1, 'pct', 0.5, 3, 0, '', '', 0), +(38, 1, 'pct', 3, 10, 0, '', '', 0), +(39, 1, 'pct', 10, 35, 0, '', '', 0); + +DELETE FROM `arena_season_reward` WHERE `group_id` IN (1, 6, 11, 16, 21, 22, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36, 37, 38, 39); +INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES +-- Season 8 (Wrathful) +(1, 'achievement', 4599), +-- Season 7 (Relentless) +(6, 'achievement', 3758), +-- Season 6 (Furious) +(11, 'achievement', 3436), +-- Season 5 (Deadly) +(16, 'achievement', 3336), +-- Season 4 (Brutal) +(21, 'achievement', 420), +(22, 'item', 43516), +(22, 'achievement', 2091), +(23, 'achievement', 2092), +(24, 'achievement', 2093), +(25, 'achievement', 2090), +-- Season 3 (Vengeful) +(26, 'achievement', 419), +(27, 'item', 37676), +(27, 'achievement', 2091), +(28, 'achievement', 2092), +(29, 'achievement', 2093), +(30, 'achievement', 2090), +-- Season 2 (Merciless) +(31, 'achievement', 418), +(32, 'item', 34092), +(32, 'achievement', 2091), +(33, 'achievement', 2092), +(34, 'achievement', 2093), +(35, 'achievement', 2090), +-- Season 1 +(36, 'item', 30609), +(36, 'achievement', 2091), +(37, 'achievement', 2092), +(38, 'achievement', 2093), +(39, 'achievement', 2090); + +DELETE FROM `achievement_reward` WHERE `ID` IN (418, 419, 420, 3436, 3758, 4599); +INSERT INTO `achievement_reward` (`ID`, `TitleA`, `TitleH`, `ItemID`, `Sender`, `Subject`, `Body`, `MailTemplateID`) VALUES +(418, 62, 62, 0, 0, '', '', 0), +(419, 71, 71, 0, 0, '', '', 0), +(420, 80, 80, 0, 0, '', '', 0), +(3436, 167, 167, 0, 0, '', '', 0), +(3758, 169, 169, 0, 0, '', '', 0), +(4599, 177, 177, 0, 0, '', '', 0); From 3baadd06378d61df5478656483ff3bd0cf9b0f84 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 20 Apr 2025 19:37:39 +0000 Subject: [PATCH 10/53] chore(DB): import pending files Referenced commit(s): 6f8566d838035907035987440efb9d4f39530a83 --- .../arena-rewards.sql => db_world/2025_04_20_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/arena-rewards.sql => db_world/2025_04_20_01.sql} (98%) diff --git a/data/sql/updates/pending_db_world/arena-rewards.sql b/data/sql/updates/db_world/2025_04_20_01.sql similarity index 98% rename from data/sql/updates/pending_db_world/arena-rewards.sql rename to data/sql/updates/db_world/2025_04_20_01.sql index 9183bc466..cc66e0e47 100644 --- a/data/sql/updates/pending_db_world/arena-rewards.sql +++ b/data/sql/updates/db_world/2025_04_20_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_20_00 -> 2025_04_20_01 DELETE FROM `arena_season_reward_group` WHERE `arena_season` IN (1, 2, 3, 4); INSERT INTO `arena_season_reward_group` (`id`, `arena_season`, `criteria_type`, `min_criteria`, `max_criteria`, `reward_mail_template_id`, `reward_mail_subject`, `reward_mail_body`, `gold_reward`) VALUES -- Season 4 (Brutal) From 9ced420849ae875e1d8d448505e474818925830c Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Mon, 21 Apr 2025 03:40:56 -0400 Subject: [PATCH 11/53] fix(Core/AI): Ignore PvP flagged players for aggressive pets if owner is not PvP flagged. (#21922) --- src/server/game/AI/CoreAI/PetAI.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 33fff5f74..59c39a9ee 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -514,9 +514,22 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const // To prevent aggressive pets from chain selecting targets and running off, we // only select a random target if certain conditions are met. if (allowAutoSelect) + { if (!me->GetCharmInfo()->IsReturning() || me->GetCharmInfo()->IsFollowing() || me->GetCharmInfo()->IsAtStay()) + { if (Unit* nearTarget = me->ToCreature()->SelectNearestTargetInAttackDistance(MAX_AGGRO_RADIUS)) - return nearTarget; + { + if (nearTarget->IsPlayer() && nearTarget->ToPlayer()->IsPvP() && !owner->IsPvP()) // If owner is not PvP flagged and target is PvP flagged, do not attack + { + return nullptr; /// @todo: try for another target + } + else + { + return nearTarget; + } + } + } + } // Default - no valid targets return nullptr; From f1df2c21d2c513ac88ebd3593df78d2907548aa7 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Mon, 21 Apr 2025 13:47:05 -0500 Subject: [PATCH 12/53] chore(Deps/Zlib): Upgrade zlib to 1.3.1 (#21940) --- deps/PackageList.txt | 4 +- deps/zlib/adler32.c | 32 +- deps/zlib/compress.c | 21 +- deps/zlib/crc32.c | 255 +++++--------- deps/zlib/deflate.c | 796 ++++++++++++++++++++----------------------- deps/zlib/deflate.h | 55 ++- deps/zlib/gzclose.c | 4 +- deps/zlib/gzguts.h | 31 +- deps/zlib/gzlib.c | 113 ++---- deps/zlib/gzread.c | 96 ++---- deps/zlib/gzwrite.c | 84 ++--- deps/zlib/infback.c | 47 +-- deps/zlib/inffast.c | 5 +- deps/zlib/inffast.h | 2 +- deps/zlib/inflate.c | 137 ++------ deps/zlib/inftrees.c | 17 +- deps/zlib/inftrees.h | 12 +- deps/zlib/trees.c | 645 ++++++++++++++++------------------- deps/zlib/uncompr.c | 16 +- deps/zlib/zconf.h | 37 +- deps/zlib/zlib.h | 401 +++++++++++----------- deps/zlib/zutil.c | 62 +--- deps/zlib/zutil.h | 46 +-- 23 files changed, 1211 insertions(+), 1707 deletions(-) diff --git a/deps/PackageList.txt b/deps/PackageList.txt index 2e90f5969..323cc9f75 100644 --- a/deps/PackageList.txt +++ b/deps/PackageList.txt @@ -46,7 +46,7 @@ utf8-cpp (UTF-8 with C++ in a Portable Way) zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library) http://www.zlib.net/ - Version: 1.2.12 + Version: 1.3.1 gSOAP (a portable development toolkit for C and C++ XML Web services and XML data bindings) http://gsoap2.sourceforge.net/ @@ -58,4 +58,4 @@ recastnavigation (Recast is state of the art navigation mesh construction toolse {fmt} is an open-source formatting library providing a fast and safe alternative to C stdio and C++ iostreams. https://github.com/fmtlib/fmt - Version: 7.1.3 \ No newline at end of file + Version: 7.1.3 diff --git a/deps/zlib/adler32.c b/deps/zlib/adler32.c index d0be4380a..04b81d29b 100644 --- a/deps/zlib/adler32.c +++ b/deps/zlib/adler32.c @@ -7,8 +7,6 @@ #include "zutil.h" -local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); - #define BASE 65521U /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ @@ -60,11 +58,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #endif /* ========================================================================= */ -uLong ZEXPORT adler32_z(adler, buf, len) - uLong adler; - const Bytef *buf; - z_size_t len; -{ +uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) { unsigned long sum2; unsigned n; @@ -131,20 +125,12 @@ uLong ZEXPORT adler32_z(adler, buf, len) } /* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; -{ +uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) { return adler32_z(adler, buf, len); } /* ========================================================================= */ -local uLong adler32_combine_(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off64_t len2; -{ +local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) { unsigned long sum1; unsigned long sum2; unsigned rem; @@ -169,18 +155,10 @@ local uLong adler32_combine_(adler1, adler2, len2) } /* ========================================================================= */ -uLong ZEXPORT adler32_combine(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off_t len2; -{ +uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) { return adler32_combine_(adler1, adler2, len2); } -uLong ZEXPORT adler32_combine64(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off64_t len2; -{ +uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) { return adler32_combine_(adler1, adler2, len2); } diff --git a/deps/zlib/compress.c b/deps/zlib/compress.c index e2db404ab..f43bacf7a 100644 --- a/deps/zlib/compress.c +++ b/deps/zlib/compress.c @@ -19,13 +19,8 @@ memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; - int level; -{ +int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen, int level) { z_stream stream; int err; const uInt max = (uInt)-1; @@ -65,12 +60,8 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) /* =========================================================================== */ -int ZEXPORT compress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ +int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen) { return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); } @@ -78,9 +69,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen) If the default memLevel or windowBits for deflateInit() is changed, then this function needs to be updated. */ -uLong ZEXPORT compressBound (sourceLen) - uLong sourceLen; -{ +uLong ZEXPORT compressBound(uLong sourceLen) { return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13; } diff --git a/deps/zlib/crc32.c b/deps/zlib/crc32.c index a1bdce5c2..6c38f5c04 100644 --- a/deps/zlib/crc32.c +++ b/deps/zlib/crc32.c @@ -98,10 +98,6 @@ # endif #endif -/* Local functions. */ -local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); -local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); - /* If available, use the ARM processor CRC32 instruction. */ #if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 # define ARMCRC32 @@ -114,9 +110,7 @@ local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); instruction, if one is available. This assumes that word_t is either 32 bits or 64 bits. */ -local z_word_t byte_swap(word) - z_word_t word; -{ +local z_word_t byte_swap(z_word_t word) { # if W == 8 return (word & 0xff00000000000000) >> 56 | @@ -137,24 +131,77 @@ local z_word_t byte_swap(word) } #endif +#ifdef DYNAMIC_CRC_TABLE +/* ========================================================================= + * Table of powers of x for combining CRC-32s, filled in by make_crc_table() + * below. + */ + local z_crc_t FAR x2n_table[32]; +#else +/* ========================================================================= + * Tables for byte-wise and braided CRC-32 calculations, and a table of powers + * of x for combining CRC-32s, all made by make_crc_table(). + */ +# include "crc32.h" +#endif + /* CRC polynomial. */ #define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */ -#ifdef DYNAMIC_CRC_TABLE +/* + Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, + reflected. For speed, this requires that a not be zero. + */ +local z_crc_t multmodp(z_crc_t a, z_crc_t b) { + z_crc_t m, p; + m = (z_crc_t)1 << 31; + p = 0; + for (;;) { + if (a & m) { + p ^= b; + if ((a & (m - 1)) == 0) + break; + } + m >>= 1; + b = b & 1 ? (b >> 1) ^ POLY : b >> 1; + } + return p; +} + +/* + Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been + initialized. + */ +local z_crc_t x2nmodp(z_off64_t n, unsigned k) { + z_crc_t p; + + p = (z_crc_t)1 << 31; /* x^0 == 1 */ + while (n) { + if (n & 1) + p = multmodp(x2n_table[k & 31], p); + n >>= 1; + k++; + } + return p; +} + +#ifdef DYNAMIC_CRC_TABLE +/* ========================================================================= + * Build the tables for byte-wise and braided CRC-32 calculations, and a table + * of powers of x for combining CRC-32s. + */ local z_crc_t FAR crc_table[256]; -local z_crc_t FAR x2n_table[32]; -local void make_crc_table OF((void)); #ifdef W local z_word_t FAR crc_big_table[256]; local z_crc_t FAR crc_braid_table[W][256]; local z_word_t FAR crc_braid_big_table[W][256]; - local void braid OF((z_crc_t [][256], z_word_t [][256], int, int)); + local void braid(z_crc_t [][256], z_word_t [][256], int, int); #endif #ifdef MAKECRCH - local void write_table OF((FILE *, const z_crc_t FAR *, int)); - local void write_table32hi OF((FILE *, const z_word_t FAR *, int)); - local void write_table64 OF((FILE *, const z_word_t FAR *, int)); + local void write_table(FILE *, const z_crc_t FAR *, int); + local void write_table32hi(FILE *, const z_word_t FAR *, int); + local void write_table64(FILE *, const z_word_t FAR *, int); #endif /* MAKECRCH */ /* @@ -167,7 +214,6 @@ local void make_crc_table OF((void)); /* Definition of once functionality. */ typedef struct once_s once_t; -local void once OF((once_t *, void (*)(void))); /* Check for the availability of atomics. */ #if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \ @@ -187,10 +233,7 @@ struct once_s { invoke once() at the same time. The state must be a once_t initialized with ONCE_INIT. */ -local void once(state, init) - once_t *state; - void (*init)(void); -{ +local void once(once_t *state, void (*init)(void)) { if (!atomic_load(&state->done)) { if (atomic_flag_test_and_set(&state->begun)) while (!atomic_load(&state->done)) @@ -213,10 +256,7 @@ struct once_s { /* Test and set. Alas, not atomic, but tries to minimize the period of vulnerability. */ -local int test_and_set OF((int volatile *)); -local int test_and_set(flag) - int volatile *flag; -{ +local int test_and_set(int volatile *flag) { int was; was = *flag; @@ -225,10 +265,7 @@ local int test_and_set(flag) } /* Run the provided init() function once. This is not thread-safe. */ -local void once(state, init) - once_t *state; - void (*init)(void); -{ +local void once(once_t *state, void (*init)(void)) { if (!state->done) { if (test_and_set(&state->begun)) while (!state->done) @@ -270,8 +307,7 @@ local once_t made = ONCE_INIT; combinations of CRC register values and incoming bytes. */ -local void make_crc_table() -{ +local void make_crc_table(void) { unsigned i, j, n; z_crc_t p; @@ -438,11 +474,7 @@ local void make_crc_table() Write the 32-bit values in table[0..k-1] to out, five per line in hexadecimal separated by commas. */ -local void write_table(out, table, k) - FILE *out; - const z_crc_t FAR *table; - int k; -{ +local void write_table(FILE *out, const z_crc_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -455,11 +487,7 @@ local void write_table(out, table, k) Write the high 32-bits of each value in table[0..k-1] to out, five per line in hexadecimal separated by commas. */ -local void write_table32hi(out, table, k) -FILE *out; -const z_word_t FAR *table; -int k; -{ +local void write_table32hi(FILE *out, const z_word_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -475,11 +503,7 @@ int k; bits. If not, then the type cast and format string can be adjusted accordingly. */ -local void write_table64(out, table, k) - FILE *out; - const z_word_t FAR *table; - int k; -{ +local void write_table64(FILE *out, const z_word_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -489,8 +513,7 @@ local void write_table64(out, table, k) } /* Actually do the deed. */ -int main() -{ +int main(void) { make_crc_table(); return 0; } @@ -502,12 +525,7 @@ int main() Generate the little and big-endian braid tables for the given n and z_word_t size w. Each array must have room for w blocks of 256 elements. */ -local void braid(ltl, big, n, w) - z_crc_t ltl[][256]; - z_word_t big[][256]; - int n; - int w; -{ +local void braid(z_crc_t ltl[][256], z_word_t big[][256], int n, int w) { int k; z_crc_t i, p, q; for (k = 0; k < w; k++) { @@ -522,69 +540,13 @@ local void braid(ltl, big, n, w) } #endif -#else /* !DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Tables for byte-wise and braided CRC-32 calculations, and a table of powers - * of x for combining CRC-32s, all made by make_crc_table(). - */ -#include "crc32.h" #endif /* DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Routines used for CRC calculation. Some are also required for the table - * generation above. - */ - -/* - Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, - reflected. For speed, this requires that a not be zero. - */ -local z_crc_t multmodp(a, b) - z_crc_t a; - z_crc_t b; -{ - z_crc_t m, p; - - m = (z_crc_t)1 << 31; - p = 0; - for (;;) { - if (a & m) { - p ^= b; - if ((a & (m - 1)) == 0) - break; - } - m >>= 1; - b = b & 1 ? (b >> 1) ^ POLY : b >> 1; - } - return p; -} - -/* - Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been - initialized. - */ -local z_crc_t x2nmodp(n, k) - z_off64_t n; - unsigned k; -{ - z_crc_t p; - - p = (z_crc_t)1 << 31; /* x^0 == 1 */ - while (n) { - if (n & 1) - p = multmodp(x2n_table[k & 31], p); - n >>= 1; - k++; - } - return p; -} - /* ========================================================================= * This function can be used by asm versions of crc32(), and to force the * generation of the CRC tables in a threaded application. */ -const z_crc_t FAR * ZEXPORT get_crc_table() -{ +const z_crc_t FAR * ZEXPORT get_crc_table(void) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ @@ -610,11 +572,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table() #define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */ #define Z_BATCH_MIN 800 /* fewest words in a final batch */ -unsigned long ZEXPORT crc32_z(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - z_size_t len; -{ +unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, + z_size_t len) { z_crc_t val; z_word_t crc1, crc2; const z_word_t *word; @@ -630,7 +589,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) #endif /* DYNAMIC_CRC_TABLE */ /* Pre-condition the CRC */ - crc ^= 0xffffffff; + crc = (~crc) & 0xffffffff; /* Compute the CRC up to a word boundary. */ while (len && ((z_size_t)buf & 7) != 0) { @@ -645,8 +604,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) len &= 7; /* Do three interleaved CRCs to realize the throughput of one crc32x - instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three - CRCs are combined into a single CRC after each set of batches. */ + instruction per cycle. Each CRC is calculated on Z_BATCH words. The + three CRCs are combined into a single CRC after each set of batches. */ while (num >= 3 * Z_BATCH) { crc1 = 0; crc2 = 0; @@ -714,18 +673,14 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) least-significant byte of the word as the first byte of data, without any pre or post conditioning. This is used to combine the CRCs of each braid. */ -local z_crc_t crc_word(data) - z_word_t data; -{ +local z_crc_t crc_word(z_word_t data) { int k; for (k = 0; k < W; k++) data = (data >> 8) ^ crc_table[data & 0xff]; return (z_crc_t)data; } -local z_word_t crc_word_big(data) - z_word_t data; -{ +local z_word_t crc_word_big(z_word_t data) { int k; for (k = 0; k < W; k++) data = (data << 8) ^ @@ -736,11 +691,8 @@ local z_word_t crc_word_big(data) #endif /* ========================================================================= */ -unsigned long ZEXPORT crc32_z(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - z_size_t len; -{ +unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, + z_size_t len) { /* Return initial CRC, if requested. */ if (buf == Z_NULL) return 0; @@ -749,7 +701,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) #endif /* DYNAMIC_CRC_TABLE */ /* Pre-condition the CRC */ - crc ^= 0xffffffff; + crc = (~crc) & 0xffffffff; #ifdef W @@ -772,8 +724,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) words = (z_word_t const *)buf; /* Do endian check at execution time instead of compile time, since ARM - processors can change the endianess at execution time. If the - compiler knows what the endianess will be, it can optimize out the + processors can change the endianness at execution time. If the + compiler knows what the endianness will be, it can optimize out the check and the unused branch. */ endian = 1; if (*(unsigned char *)&endian) { @@ -1060,39 +1012,26 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) #endif /* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - uInt len; -{ +unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, + uInt len) { return crc32_z(crc, buf, len); } /* ========================================================================= */ -uLong ZEXPORT crc32_combine64(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off64_t len2; -{ +uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ - return multmodp(x2nmodp(len2, 3), crc1) ^ crc2; + return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff); } /* ========================================================================= */ -uLong ZEXPORT crc32_combine(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off_t len2; -{ - return crc32_combine64(crc1, crc2, len2); +uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) { + return crc32_combine64(crc1, crc2, (z_off64_t)len2); } /* ========================================================================= */ -uLong ZEXPORT crc32_combine_gen64(len2) - z_off64_t len2; -{ +uLong ZEXPORT crc32_combine_gen64(z_off64_t len2) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ @@ -1100,17 +1039,11 @@ uLong ZEXPORT crc32_combine_gen64(len2) } /* ========================================================================= */ -uLong ZEXPORT crc32_combine_gen(len2) - z_off_t len2; -{ - return crc32_combine_gen64(len2); +uLong ZEXPORT crc32_combine_gen(z_off_t len2) { + return crc32_combine_gen64((z_off64_t)len2); } /* ========================================================================= */ -uLong crc32_combine_op(crc1, crc2, op) - uLong crc1; - uLong crc2; - uLong op; -{ - return multmodp(op, crc1) ^ crc2; +uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) { + return multmodp(op, crc1) ^ (crc2 & 0xffffffff); } diff --git a/deps/zlib/deflate.c b/deps/zlib/deflate.c index 799fb93cc..012ea8148 100644 --- a/deps/zlib/deflate.c +++ b/deps/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; + " deflate 1.3.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -60,9 +60,6 @@ const char deflate_copyright[] = copyright string in the executable of your product. */ -/* =========================================================================== - * Function prototypes. - */ typedef enum { need_more, /* block not completed, need more input or more output */ block_done, /* block flush performed */ @@ -70,35 +67,16 @@ typedef enum { finish_done /* finish done, accept no more input or output */ } block_state; -typedef block_state (*compress_func) OF((deflate_state *s, int flush)); +typedef block_state (*compress_func)(deflate_state *s, int flush); /* Compression function. Returns the block state after the call. */ -local int deflateStateCheck OF((z_streamp strm)); -local void slide_hash OF((deflate_state *s)); -local void fill_window OF((deflate_state *s)); -local block_state deflate_stored OF((deflate_state *s, int flush)); -local block_state deflate_fast OF((deflate_state *s, int flush)); +local block_state deflate_stored(deflate_state *s, int flush); +local block_state deflate_fast(deflate_state *s, int flush); #ifndef FASTEST -local block_state deflate_slow OF((deflate_state *s, int flush)); -#endif -local block_state deflate_rle OF((deflate_state *s, int flush)); -local block_state deflate_huff OF((deflate_state *s, int flush)); -local void lm_init OF((deflate_state *s)); -local void putShortMSB OF((deflate_state *s, uInt b)); -local void flush_pending OF((z_streamp strm)); -local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifdef ASMV -# pragma message("Assembler code may have bugs -- use at your own risk") - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else -local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif - -#ifdef ZLIB_DEBUG -local void check_match OF((deflate_state *s, IPos start, IPos match, - int length)); +local block_state deflate_slow(deflate_state *s, int flush); #endif +local block_state deflate_rle(deflate_state *s, int flush); +local block_state deflate_huff(deflate_state *s, int flush); /* =========================================================================== * Local data @@ -160,7 +138,7 @@ local const config configuration_table[10] = { * characters, so that a running hash key can be computed from the previous * key instead of complete recalculation each time. */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) +#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask) /* =========================================================================== @@ -191,9 +169,9 @@ local const config configuration_table[10] = { */ #define CLEAR_HASH(s) \ do { \ - s->head[s->hash_size-1] = NIL; \ + s->head[s->hash_size - 1] = NIL; \ zmemzero((Bytef *)s->head, \ - (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ + (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \ } while (0) /* =========================================================================== @@ -201,9 +179,12 @@ local const config configuration_table[10] = { * bit values at the expense of memory usage). We slide even when level == 0 to * keep the hash table consistent if we switch back to level > 0 later. */ -local void slide_hash(s) - deflate_state *s; -{ +#if defined(__has_feature) +# if __has_feature(memory_sanitizer) + __attribute__((no_sanitize("memory"))) +# endif +#endif +local void slide_hash(deflate_state *s) { unsigned n, m; Posf *p; uInt wsize = s->w_size; @@ -227,30 +208,177 @@ local void slide_hash(s) #endif } +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->next_in buffer and copying from it. + * (See also flush_pending()). + */ +local unsigned read_buf(z_streamp strm, Bytef *buf, unsigned size) { + unsigned len = strm->avail_in; + + if (len > size) len = size; + if (len == 0) return 0; + + strm->avail_in -= len; + + zmemcpy(buf, strm->next_in, len); + if (strm->state->wrap == 1) { + strm->adler = adler32(strm->adler, buf, len); + } +#ifdef GZIP + else if (strm->state->wrap == 2) { + strm->adler = crc32(strm->adler, buf, len); + } +#endif + strm->next_in += len; + strm->total_in += len; + + return len; +} + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +local void fill_window(deflate_state *s) { + unsigned n; + unsigned more; /* Amount of free space at the end of the window. */ + uInt wsize = s->w_size; + + Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); + + /* Deal with !@#$% 64K limit: */ + if (sizeof(int) <= 2) { + if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + more = wsize; + + } else if (more == (unsigned)(-1)) { + /* Very unlikely, but possible on 16 bit machine if + * strstart == 0 && lookahead == 1 (input done a byte at time) + */ + more--; + } + } + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s->strstart >= wsize + MAX_DIST(s)) { + + zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more); + s->match_start -= wsize; + s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ + s->block_start -= (long) wsize; + if (s->insert > s->strstart) + s->insert = s->strstart; + slide_hash(s); + more += wsize; + } + if (s->strm->avail_in == 0) break; + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + Assert(more >= 2, "more < 2"); + + n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); + s->lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s->lookahead + s->insert >= MIN_MATCH) { + uInt str = s->strstart - s->insert; + s->ins_h = s->window[str]; + UPDATE_HASH(s, s->ins_h, s->window[str + 1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + while (s->insert) { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + s->insert--; + if (s->lookahead + s->insert < MIN_MATCH) + break; + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ + if (s->high_water < s->window_size) { + ulg curr = s->strstart + (ulg)(s->lookahead); + ulg init; + + if (s->high_water < curr) { + /* Previous high water mark below current data -- zero WIN_INIT + * bytes or up to end of window, whichever is less. + */ + init = s->window_size - curr; + if (init > WIN_INIT) + init = WIN_INIT; + zmemzero(s->window + curr, (unsigned)init); + s->high_water = curr + init; + } + else if (s->high_water < (ulg)curr + WIN_INIT) { + /* High water mark at or above current data, but below current data + * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up + * to end of window, whichever is less. + */ + init = (ulg)curr + WIN_INIT - s->high_water; + if (init > s->window_size - s->high_water) + init = s->window_size - s->high_water; + zmemzero(s->window + s->high_water, (unsigned)init); + s->high_water += init; + } + } + + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "not enough room for search"); +} + /* ========================================================================= */ -int ZEXPORT deflateInit_(strm, level, version, stream_size) - z_streamp strm; - int level; - const char *version; - int stream_size; -{ +int ZEXPORT deflateInit_(z_streamp strm, int level, const char *version, + int stream_size) { return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, version, stream_size); /* To do: ignore strm->next_in if we use it as window */ } /* ========================================================================= */ -int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, - version, stream_size) - z_streamp strm; - int level; - int method; - int windowBits; - int memLevel; - int strategy; - const char *version; - int stream_size; -{ +int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, + int windowBits, int memLevel, int strategy, + const char *version, int stream_size) { deflate_state *s; int wrap = 1; static const char my_version[] = ZLIB_VERSION; @@ -285,6 +413,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, if (windowBits < 0) { /* suppress zlib wrapper */ wrap = 0; + if (windowBits < -15) + return Z_STREAM_ERROR; windowBits = -windowBits; } #ifdef GZIP @@ -314,7 +444,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, s->hash_bits = (uInt)memLevel + 7; s->hash_size = 1 << s->hash_bits; s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + s->hash_shift = ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH); s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); @@ -340,11 +470,11 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, * sym_buf value to read moves forward three bytes. From that symbol, up to * 31 bits are written to pending_buf. The closest the written pending_buf * bits gets to the next sym_buf symbol to read is just before the last - * code is written. At that time, 31*(n-2) bits have been written, just - * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at - * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1 + * code is written. At that time, 31*(n - 2) bits have been written, just + * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at + * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1 * symbols are written.) The closest the writing gets to what is unread is - * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and + * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and * can range from 128 to 32768. * * Therefore, at a minimum, there are 142 bits of space between what is @@ -363,7 +493,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, * symbols from which it is being constructed. */ - s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4); + s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS); s->pending_buf_size = (ulg)s->lit_bufsize * 4; if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || @@ -373,8 +503,14 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, deflateEnd (strm); return Z_MEM_ERROR; } +#ifdef LIT_MEM + s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1)); + s->l_buf = s->pending_buf + (s->lit_bufsize << 2); + s->sym_end = s->lit_bufsize - 1; +#else s->sym_buf = s->pending_buf + s->lit_bufsize; s->sym_end = (s->lit_bufsize - 1) * 3; +#endif /* We avoid equality with lit_bufsize*3 because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. @@ -390,9 +526,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, /* ========================================================================= * Check for a valid deflate stream state. Return 0 if ok, 1 if not. */ -local int deflateStateCheck (strm) - z_streamp strm; -{ +local int deflateStateCheck(z_streamp strm) { deflate_state *s; if (strm == Z_NULL || strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) @@ -413,11 +547,8 @@ local int deflateStateCheck (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) - z_streamp strm; - const Bytef *dictionary; - uInt dictLength; -{ +int ZEXPORT deflateSetDictionary(z_streamp strm, const Bytef *dictionary, + uInt dictLength) { deflate_state *s; uInt str, n; int wrap; @@ -482,11 +613,8 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) - z_streamp strm; - Bytef *dictionary; - uInt *dictLength; -{ +int ZEXPORT deflateGetDictionary(z_streamp strm, Bytef *dictionary, + uInt *dictLength) { deflate_state *s; uInt len; @@ -504,9 +632,7 @@ int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateResetKeep (strm) - z_streamp strm; -{ +int ZEXPORT deflateResetKeep(z_streamp strm) { deflate_state *s; if (deflateStateCheck(strm)) { @@ -541,10 +667,32 @@ int ZEXPORT deflateResetKeep (strm) return Z_OK; } +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +local void lm_init(deflate_state *s) { + s->window_size = (ulg)2L*s->w_size; + + CLEAR_HASH(s); + + /* Set the default configuration parameters: + */ + s->max_lazy_match = configuration_table[s->level].max_lazy; + s->good_match = configuration_table[s->level].good_length; + s->nice_match = configuration_table[s->level].nice_length; + s->max_chain_length = configuration_table[s->level].max_chain; + + s->strstart = 0; + s->block_start = 0L; + s->lookahead = 0; + s->insert = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + s->ins_h = 0; +} + /* ========================================================================= */ -int ZEXPORT deflateReset (strm) - z_streamp strm; -{ +int ZEXPORT deflateReset(z_streamp strm) { int ret; ret = deflateResetKeep(strm); @@ -554,10 +702,7 @@ int ZEXPORT deflateReset (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) - z_streamp strm; - gz_headerp head; -{ +int ZEXPORT deflateSetHeader(z_streamp strm, gz_headerp head) { if (deflateStateCheck(strm) || strm->state->wrap != 2) return Z_STREAM_ERROR; strm->state->gzhead = head; @@ -565,11 +710,7 @@ int ZEXPORT deflateSetHeader (strm, head) } /* ========================================================================= */ -int ZEXPORT deflatePending (strm, pending, bits) - unsigned *pending; - int *bits; - z_streamp strm; -{ +int ZEXPORT deflatePending(z_streamp strm, unsigned *pending, int *bits) { if (deflateStateCheck(strm)) return Z_STREAM_ERROR; if (pending != Z_NULL) *pending = strm->state->pending; @@ -579,19 +720,21 @@ int ZEXPORT deflatePending (strm, pending, bits) } /* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) - z_streamp strm; - int bits; - int value; -{ +int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) { deflate_state *s; int put; if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; +#ifdef LIT_MEM + if (bits < 0 || bits > 16 || + (uchf *)s->d_buf < s->pending_out + ((Buf_size + 7) >> 3)) + return Z_BUF_ERROR; +#else if (bits < 0 || bits > 16 || s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; +#endif do { put = Buf_size - s->bi_valid; if (put > bits) @@ -606,11 +749,7 @@ int ZEXPORT deflatePrime (strm, bits, value) } /* ========================================================================= */ -int ZEXPORT deflateParams(strm, level, strategy) - z_streamp strm; - int level; - int strategy; -{ +int ZEXPORT deflateParams(z_streamp strm, int level, int strategy) { deflate_state *s; compress_func func; @@ -655,13 +794,8 @@ int ZEXPORT deflateParams(strm, level, strategy) } /* ========================================================================= */ -int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) - z_streamp strm; - int good_length; - int max_lazy; - int nice_length; - int max_chain; -{ +int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy, + int nice_length, int max_chain) { deflate_state *s; if (deflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -674,36 +808,47 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) } /* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. + * For the default windowBits of 15 and memLevel of 8, this function returns a + * close to exact, as well as small, upper bound on the compressed size. This + * is an expansion of ~0.03%, plus a small constant. * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. + * For any setting other than those defaults for windowBits and memLevel, one + * of two worst case bounds is returned. This is at most an expansion of ~4% or + * ~13%, plus a small constant. * - * This function could be more sophisticated to provide closer upper bounds for - * every combination of windowBits and memLevel. But even the conservative - * upper bound of about 14% expansion does not seem onerous for output buffer - * allocation. + * Both the 0.03% and 4% derive from the overhead of stored blocks. The first + * one is for stored blocks of 16383 bytes (memLevel == 8), whereas the second + * is for stored blocks of 127 bytes (the worst case memLevel == 1). The + * expansion results from five bytes of header for each stored block. + * + * The larger expansion of 13% results from a window size less than or equal to + * the symbols buffer size (windowBits <= memLevel + 7). In that case some of + * the data being compressed may have slid out of the sliding window, impeding + * a stored block from being emitted. Then the only choice is a fixed or + * dynamic block, where a fixed block limits the maximum expansion to 9 bits + * per 8-bit byte, plus 10 bits for every block. The smallest block size for + * which this can occur is 255 (memLevel == 2). + * + * Shifts are used to approximate divisions, for speed. */ -uLong ZEXPORT deflateBound(strm, sourceLen) - z_streamp strm; - uLong sourceLen; -{ +uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) { deflate_state *s; - uLong complen, wraplen; + uLong fixedlen, storelen, wraplen; - /* conservative upper bound for compressed data */ - complen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; + /* upper bound for fixed blocks with 9-bit literals and length 255 + (memLevel == 2, which is the lowest that may not use stored blocks) -- + ~13% overhead plus a small constant */ + fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) + + (sourceLen >> 9) + 4; - /* if can't get parameters, return conservative bound plus zlib wrapper */ + /* upper bound for stored blocks with length 127 (memLevel == 1) -- + ~4% overhead plus a small constant */ + storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) + + (sourceLen >> 11) + 7; + + /* if can't get parameters, return larger bound plus a zlib wrapper */ if (deflateStateCheck(strm)) - return complen + 6; + return (fixedlen > storelen ? fixedlen : storelen) + 6; /* compute wrapper length */ s = strm->state; @@ -740,11 +885,13 @@ uLong ZEXPORT deflateBound(strm, sourceLen) wraplen = 6; } - /* if not default parameters, return conservative bound */ + /* if not default parameters, return one of the conservative bounds */ if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return complen + wraplen; + return (s->w_bits <= s->hash_bits && s->level ? fixedlen : storelen) + + wraplen; - /* default settings: return tight bound for that case */ + /* default settings: return tight bound for that case -- ~0.03% overhead + plus a small constant */ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13 - 6 + wraplen; } @@ -754,10 +901,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen) * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ -local void putShortMSB (s, b) - deflate_state *s; - uInt b; -{ +local void putShortMSB(deflate_state *s, uInt b) { put_byte(s, (Byte)(b >> 8)); put_byte(s, (Byte)(b & 0xff)); } @@ -768,9 +912,7 @@ local void putShortMSB (s, b) * applications may wish to modify it to avoid allocating a large * strm->next_out buffer and copying into it. (See also read_buf()). */ -local void flush_pending(strm) - z_streamp strm; -{ +local void flush_pending(z_streamp strm) { unsigned len; deflate_state *s = strm->state; @@ -801,10 +943,7 @@ local void flush_pending(strm) } while (0) /* ========================================================================= */ -int ZEXPORT deflate (strm, flush) - z_streamp strm; - int flush; -{ +int ZEXPORT deflate(z_streamp strm, int flush) { int old_flush; /* value of flush param for previous deflate call */ deflate_state *s; @@ -856,7 +995,7 @@ int ZEXPORT deflate (strm, flush) s->status = BUSY_STATE; if (s->status == INIT_STATE) { /* zlib header */ - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8; uInt level_flags; if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) @@ -1116,9 +1255,7 @@ int ZEXPORT deflate (strm, flush) } /* ========================================================================= */ -int ZEXPORT deflateEnd (strm) - z_streamp strm; -{ +int ZEXPORT deflateEnd(z_streamp strm) { int status; if (deflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1142,11 +1279,10 @@ int ZEXPORT deflateEnd (strm) * To simplify the source, this is not supported for 16-bit MSDOS (which * doesn't have enough memory anyway to duplicate compression states). */ -int ZEXPORT deflateCopy (dest, source) - z_streamp dest; - z_streamp source; -{ +int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { #ifdef MAXSEG_64K + (void)dest; + (void)source; return Z_STREAM_ERROR; #else deflate_state *ds; @@ -1170,7 +1306,7 @@ int ZEXPORT deflateCopy (dest, source) ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4); + ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, LIT_BUFS); if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || ds->pending_buf == Z_NULL) { @@ -1181,10 +1317,15 @@ int ZEXPORT deflateCopy (dest, source) zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + zmemcpy(ds->pending_buf, ss->pending_buf, ds->lit_bufsize * LIT_BUFS); ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); +#ifdef LIT_MEM + ds->d_buf = (ushf *)(ds->pending_buf + (ds->lit_bufsize << 1)); + ds->l_buf = ds->pending_buf + (ds->lit_bufsize << 2); +#else ds->sym_buf = ds->pending_buf + ds->lit_bufsize; +#endif ds->l_desc.dyn_tree = ds->dyn_ltree; ds->d_desc.dyn_tree = ds->dyn_dtree; @@ -1194,71 +1335,6 @@ int ZEXPORT deflateCopy (dest, source) #endif /* MAXSEG_64K */ } -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->next_in buffer and copying from it. - * (See also flush_pending()). - */ -local unsigned read_buf(strm, buf, size) - z_streamp strm; - Bytef *buf; - unsigned size; -{ - unsigned len = strm->avail_in; - - if (len > size) len = size; - if (len == 0) return 0; - - strm->avail_in -= len; - - zmemcpy(buf, strm->next_in, len); - if (strm->state->wrap == 1) { - strm->adler = adler32(strm->adler, buf, len); - } -#ifdef GZIP - else if (strm->state->wrap == 2) { - strm->adler = crc32(strm->adler, buf, len); - } -#endif - strm->next_in += len; - strm->total_in += len; - - return len; -} - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -local void lm_init (s) - deflate_state *s; -{ - s->window_size = (ulg)2L*s->w_size; - - CLEAR_HASH(s); - - /* Set the default configuration parameters: - */ - s->max_lazy_match = configuration_table[s->level].max_lazy; - s->good_match = configuration_table[s->level].good_length; - s->nice_match = configuration_table[s->level].nice_length; - s->max_chain_length = configuration_table[s->level].max_chain; - - s->strstart = 0; - s->block_start = 0L; - s->lookahead = 0; - s->insert = 0; - s->match_length = s->prev_length = MIN_MATCH-1; - s->match_available = 0; - s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif -} - #ifndef FASTEST /* =========================================================================== * Set match_start to the longest match starting at the given string and @@ -1269,14 +1345,7 @@ local void lm_init (s) * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 * OUT assertion: the match length is not greater than s->lookahead. */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ +local uInt longest_match(deflate_state *s, IPos cur_match) { unsigned chain_length = s->max_chain_length;/* max hash chain length */ register Bytef *scan = s->window + s->strstart; /* current string */ register Bytef *match; /* matched string */ @@ -1297,10 +1366,10 @@ local uInt longest_match(s, cur_match) */ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); + register ush scan_end = *(ushf*)(scan + best_len - 1); #else register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end1 = scan[best_len - 1]; register Byte scan_end = scan[best_len]; #endif @@ -1318,7 +1387,8 @@ local uInt longest_match(s, cur_match) */ if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); do { Assert(cur_match < s->strstart, "no future"); @@ -1336,43 +1406,44 @@ local uInt longest_match(s, cur_match) /* This code assumes sizeof(unsigned short) == 2. Do not use * UNALIGNED_OK if your compiler uses a different size. */ - if (*(ushf*)(match+best_len-1) != scan_end || + if (*(ushf*)(match + best_len - 1) != scan_end || *(ushf*)match != scan_start) continue; /* It is not necessary to compare scan[2] and match[2] since they are * always equal when the other bytes match, given that the hash keys * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient + * strstart + 3, + 5, up to strstart + 257. We check for insufficient * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is * necessary to put more guard bytes at the end of the window, or * to check more often for insufficient lookahead. */ Assert(scan[2] == match[2], "scan[2]?"); scan++, match++; do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && scan < strend); /* The funny "do {}" generates better code on most compilers */ - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + /* Here, scan <= window + strstart + 257 */ + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); if (*scan == *match) scan++; - len = (MAX_MATCH - 1) - (int)(strend-scan); + len = (MAX_MATCH - 1) - (int)(strend - scan); scan = strend - (MAX_MATCH-1); #else /* UNALIGNED_OK */ - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; + if (match[best_len] != scan_end || + match[best_len - 1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1382,7 +1453,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1391,7 +1462,8 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); len = MAX_MATCH - (int)(strend - scan); scan = strend - MAX_MATCH; @@ -1403,9 +1475,9 @@ local uInt longest_match(s, cur_match) best_len = len; if (len >= nice_match) break; #ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); + scan_end = *(ushf*)(scan + best_len - 1); #else - scan_end1 = scan[best_len-1]; + scan_end1 = scan[best_len - 1]; scan_end = scan[best_len]; #endif } @@ -1415,17 +1487,13 @@ local uInt longest_match(s, cur_match) if ((uInt)best_len <= s->lookahead) return (uInt)best_len; return s->lookahead; } -#endif /* ASMV */ #else /* FASTEST */ /* --------------------------------------------------------------------------- * Optimized version for FASTEST only */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ +local uInt longest_match(deflate_state *s, IPos cur_match) { register Bytef *scan = s->window + s->strstart; /* current string */ register Bytef *match; /* matched string */ register int len; /* length of current match */ @@ -1436,7 +1504,8 @@ local uInt longest_match(s, cur_match) */ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); Assert(cur_match < s->strstart, "no future"); @@ -1446,7 +1515,7 @@ local uInt longest_match(s, cur_match) */ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1456,7 +1525,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1465,7 +1534,7 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), "wild scan"); len = MAX_MATCH - (int)(strend - scan); @@ -1485,23 +1554,27 @@ local uInt longest_match(s, cur_match) /* =========================================================================== * Check that the match at match_start is indeed a match. */ -local void check_match(s, start, match, length) - deflate_state *s; - IPos start, match; - int length; -{ +local void check_match(deflate_state *s, IPos start, IPos match, int length) { /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); + Bytef *back = s->window + (int)match, *here = s->window + start; + IPos len = length; + if (match == (IPos)-1) { + /* match starts one byte before the current window -- just compare the + subsequent length-1 bytes */ + back++; + here++; + len--; + } + if (zmemcmp(back, here, len) != EQUAL) { + fprintf(stderr, " start %u, match %d, length %d\n", + start, (int)match, length); do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); + fprintf(stderr, "(%02x %02x)", *back++, *here++); + } while (--len != 0); z_error("invalid match"); } if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); + fprintf(stderr,"\\[%d,%d]", start - match, length); do { putc(s->window[start++], stderr); } while (--length != 0); } } @@ -1509,137 +1582,6 @@ local void check_match(s, start, match, length) # define check_match(s, start, match, length) #endif /* ZLIB_DEBUG */ -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -local void fill_window(s) - deflate_state *s; -{ - unsigned n; - unsigned more; /* Amount of free space at the end of the window. */ - uInt wsize = s->w_size; - - Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); - - do { - more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); - - /* Deal with !@#$% 64K limit: */ - if (sizeof(int) <= 2) { - if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - more = wsize; - - } else if (more == (unsigned)(-1)) { - /* Very unlikely, but possible on 16 bit machine if - * strstart == 0 && lookahead == 1 (input done a byte at time) - */ - more--; - } - } - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s->strstart >= wsize+MAX_DIST(s)) { - - zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); - s->match_start -= wsize; - s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ - s->block_start -= (long) wsize; - if (s->insert > s->strstart) - s->insert = s->strstart; - slide_hash(s); - more += wsize; - } - if (s->strm->avail_in == 0) break; - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - Assert(more >= 2, "more < 2"); - - n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); - s->lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s->lookahead + s->insert >= MIN_MATCH) { - uInt str = s->strstart - s->insert; - s->ins_h = s->window[str]; - UPDATE_HASH(s, s->ins_h, s->window[str + 1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - while (s->insert) { - UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); -#ifndef FASTEST - s->prev[str & s->w_mask] = s->head[s->ins_h]; -#endif - s->head[s->ins_h] = (Pos)str; - str++; - s->insert--; - if (s->lookahead + s->insert < MIN_MATCH) - break; - } - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); - - /* If the WIN_INIT bytes after the end of the current data have never been - * written, then zero those bytes in order to avoid memory check reports of - * the use of uninitialized (or uninitialised as Julian writes) bytes by - * the longest match routines. Update the high water mark for the next - * time through here. WIN_INIT is set to MAX_MATCH since the longest match - * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. - */ - if (s->high_water < s->window_size) { - ulg curr = s->strstart + (ulg)(s->lookahead); - ulg init; - - if (s->high_water < curr) { - /* Previous high water mark below current data -- zero WIN_INIT - * bytes or up to end of window, whichever is less. - */ - init = s->window_size - curr; - if (init > WIN_INIT) - init = WIN_INIT; - zmemzero(s->window + curr, (unsigned)init); - s->high_water = curr + init; - } - else if (s->high_water < (ulg)curr + WIN_INIT) { - /* High water mark at or above current data, but below current data - * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up - * to end of window, whichever is less. - */ - init = (ulg)curr + WIN_INIT - s->high_water; - if (init > s->window_size - s->high_water) - init = s->window_size - s->high_water; - zmemzero(s->window + s->high_water, (unsigned)init); - s->high_water += init; - } - } - - Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, - "not enough room for search"); -} - /* =========================================================================== * Flush the current block, with given end-of-file flag. * IN assertion: strstart is set to the end of the current match. @@ -1680,12 +1622,9 @@ local void fill_window(s) * * deflate_stored() is written to minimize the number of times an input byte is * copied. It is most efficient with large input and output buffers, which - * maximizes the opportunites to have a single copy from next_in to next_out. + * maximizes the opportunities to have a single copy from next_in to next_out. */ -local block_state deflate_stored(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_stored(deflate_state *s, int flush) { /* Smallest worthy block size when not flushing or finishing. By default * this is 32K. This can be as small as 507 bytes for memLevel == 1. For * large input and output buffers, the stored block size will be larger. @@ -1869,10 +1808,7 @@ local block_state deflate_stored(s, flush) * new strings in the dictionary only for unmatched strings or for short * matches. It is used only for the fast compression options. */ -local block_state deflate_fast(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_fast(deflate_state *s, int flush) { IPos hash_head; /* head of the hash chain */ int bflush; /* set if current block must be flushed */ @@ -1890,7 +1826,7 @@ local block_state deflate_fast(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -1938,7 +1874,7 @@ local block_state deflate_fast(s, flush) s->strstart += s->match_length; s->match_length = 0; s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); + UPDATE_HASH(s, s->ins_h, s->window[s->strstart + 1]); #if MIN_MATCH != 3 Call UPDATE_HASH() MIN_MATCH-3 more times #endif @@ -1949,7 +1885,7 @@ local block_state deflate_fast(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -1971,10 +1907,7 @@ local block_state deflate_fast(s, flush) * evaluation for matches: a match is finally adopted only if there is * no better match at the next window position. */ -local block_state deflate_slow(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_slow(deflate_state *s, int flush) { IPos hash_head; /* head of hash chain */ int bflush; /* set if current block must be flushed */ @@ -1993,7 +1926,7 @@ local block_state deflate_slow(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -2035,17 +1968,17 @@ local block_state deflate_slow(s, flush) uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ - check_match(s, s->strstart-1, s->prev_match, s->prev_length); + check_match(s, s->strstart - 1, s->prev_match, s->prev_length); - _tr_tally_dist(s, s->strstart -1 - s->prev_match, + _tr_tally_dist(s, s->strstart - 1 - s->prev_match, s->prev_length - MIN_MATCH, bflush); /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not + * strstart - 1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ - s->lookahead -= s->prev_length-1; + s->lookahead -= s->prev_length - 1; s->prev_length -= 2; do { if (++s->strstart <= max_insert) { @@ -2063,8 +1996,8 @@ local block_state deflate_slow(s, flush) * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); if (bflush) { FLUSH_BLOCK_ONLY(s, 0); } @@ -2082,8 +2015,8 @@ local block_state deflate_slow(s, flush) } Assert (flush != Z_NO_FLUSH, "no flush?"); if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); s->match_available = 0; } s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; @@ -2102,10 +2035,7 @@ local block_state deflate_slow(s, flush) * one. Do not maintain a hash table. (It will be regenerated if this run of * deflate switches away from Z_RLE.) */ -local block_state deflate_rle(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_rle(deflate_state *s, int flush) { int bflush; /* set if current block must be flushed */ uInt prev; /* byte at distance one to match */ Bytef *scan, *strend; /* scan goes up to strend for length of run */ @@ -2140,7 +2070,8 @@ local block_state deflate_rle(s, flush) if (s->match_length > s->lookahead) s->match_length = s->lookahead; } - Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (uInt)(s->window_size - 1), + "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ @@ -2155,7 +2086,7 @@ local block_state deflate_rle(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -2175,10 +2106,7 @@ local block_state deflate_rle(s, flush) * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. * (It will be regenerated if this run of deflate switches away from Huffman.) */ -local block_state deflate_huff(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_huff(deflate_state *s, int flush) { int bflush; /* set if current block must be flushed */ for (;;) { @@ -2195,7 +2123,7 @@ local block_state deflate_huff(s, flush) /* Output a literal byte */ s->match_length = 0; Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; if (bflush) FLUSH_BLOCK(s, 0); diff --git a/deps/zlib/deflate.h b/deps/zlib/deflate.h index 17c226113..300c6ada6 100644 --- a/deps/zlib/deflate.h +++ b/deps/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2018 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -23,6 +23,10 @@ # define GZIP #endif +/* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at + the cost of a larger memory footprint */ +/* #define LIT_MEM */ + /* =========================================================================== * Internal compression state. */ @@ -217,7 +221,14 @@ typedef struct internal_state { /* Depth of each subtree used as tie breaker for trees of equal frequency */ +#ifdef LIT_MEM +# define LIT_BUFS 5 + ushf *d_buf; /* buffer for distances */ + uchf *l_buf; /* buffer for literals/lengths */ +#else +# define LIT_BUFS 4 uchf *sym_buf; /* buffer for distances and literals/lengths */ +#endif uInt lit_bufsize; /* Size of match buffer for literals/lengths. There are 4 reasons for @@ -239,7 +250,7 @@ typedef struct internal_state { * - I can't count above 4 */ - uInt sym_next; /* running index in sym_buf */ + uInt sym_next; /* running index in symbol buffer */ uInt sym_end; /* symbol table full when sym_next reaches this */ ulg opt_len; /* bit length of current block with optimal trees */ @@ -291,14 +302,14 @@ typedef struct internal_state { memory checker errors from longest match routines */ /* in trees.c */ -void ZLIB_INTERNAL _tr_init OF((deflate_state *s)); -int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf, - ulg stored_len, int last)); -void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s)); -void ZLIB_INTERNAL _tr_align OF((deflate_state *s)); -void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, - ulg stored_len, int last)); +void ZLIB_INTERNAL _tr_init(deflate_state *s); +int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc); +void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, + ulg stored_len, int last); +void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s); +void ZLIB_INTERNAL _tr_align(deflate_state *s); +void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, + ulg stored_len, int last); #define d_code(dist) \ ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) @@ -318,6 +329,25 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, extern const uch ZLIB_INTERNAL _dist_code[]; #endif +#ifdef LIT_MEM +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->sym_next] = 0; \ + s->l_buf[s->sym_next++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ + s->d_buf[s->sym_next] = dist; \ + s->l_buf[s->sym_next++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +#else # define _tr_tally_lit(s, c, flush) \ { uch cc = (c); \ s->sym_buf[s->sym_next++] = 0; \ @@ -329,14 +359,15 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, # define _tr_tally_dist(s, distance, length, flush) \ { uch len = (uch)(length); \ ush dist = (ush)(distance); \ - s->sym_buf[s->sym_next++] = dist; \ - s->sym_buf[s->sym_next++] = dist >> 8; \ + s->sym_buf[s->sym_next++] = (uch)dist; \ + s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \ s->sym_buf[s->sym_next++] = len; \ dist--; \ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ s->dyn_dtree[d_code(dist)].Freq++; \ flush = (s->sym_next == s->sym_end); \ } +#endif #else # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) # define _tr_tally_dist(s, distance, length, flush) \ diff --git a/deps/zlib/gzclose.c b/deps/zlib/gzclose.c index caeb99a31..48d6a86f0 100644 --- a/deps/zlib/gzclose.c +++ b/deps/zlib/gzclose.c @@ -8,9 +8,7 @@ /* gzclose() is in a separate file so that it is linked in only if it is used. That way the other gzclose functions can be used instead to avoid linking in unneeded compression or decompression routines. */ -int ZEXPORT gzclose(file) - gzFile file; -{ +int ZEXPORT gzclose(gzFile file) { #ifndef NO_GZCOMPRESS gz_statep state; diff --git a/deps/zlib/gzguts.h b/deps/zlib/gzguts.h index 57faf3716..eba72085b 100644 --- a/deps/zlib/gzguts.h +++ b/deps/zlib/gzguts.h @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -7,9 +7,8 @@ # ifndef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # endif -# ifdef _FILE_OFFSET_BITS -# undef _FILE_OFFSET_BITS -# endif +# undef _FILE_OFFSET_BITS +# undef _TIME_BITS #endif #ifdef HAVE_HIDDEN @@ -119,8 +118,8 @@ /* gz* functions always use library allocation functions */ #ifndef STDC - extern voidp malloc OF((uInt size)); - extern void free OF((voidpf ptr)); + extern voidp malloc(uInt size); + extern void free(voidpf ptr); #endif /* get errno and strerror definition */ @@ -138,10 +137,10 @@ /* provide prototypes for these when building zlib without LFS */ #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); + ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); #endif /* default memLevel */ @@ -203,17 +202,13 @@ typedef struct { typedef gz_state FAR *gz_statep; /* shared functions */ -void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); +void ZLIB_INTERNAL gz_error(gz_statep, int, const char *); #if defined UNDER_CE -char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); +char ZLIB_INTERNAL *gz_strwinerror(DWORD error); #endif /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ -#ifdef INT_MAX -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) -#else -unsigned ZLIB_INTERNAL gz_intmax OF((void)); -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) -#endif +unsigned ZLIB_INTERNAL gz_intmax(void); +#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) diff --git a/deps/zlib/gzlib.c b/deps/zlib/gzlib.c index dddaf2687..983153cc8 100644 --- a/deps/zlib/gzlib.c +++ b/deps/zlib/gzlib.c @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -15,10 +15,6 @@ #endif #endif -/* Local functions */ -local void gz_reset OF((gz_statep)); -local gzFile gz_open OF((const void *, int, const char *)); - #if defined UNDER_CE /* Map the Windows error number in ERROR to a locale-dependent error message @@ -30,9 +26,7 @@ local gzFile gz_open OF((const void *, int, const char *)); The gz_strwinerror function does not change the current setting of GetLastError. */ -char ZLIB_INTERNAL *gz_strwinerror (error) - DWORD error; -{ +char ZLIB_INTERNAL *gz_strwinerror(DWORD error) { static char buf[1024]; wchar_t *msgbuf; @@ -72,9 +66,7 @@ char ZLIB_INTERNAL *gz_strwinerror (error) #endif /* UNDER_CE */ /* Reset gzip file state */ -local void gz_reset(state) - gz_statep state; -{ +local void gz_reset(gz_statep state) { state->x.have = 0; /* no output data available */ if (state->mode == GZ_READ) { /* for reading ... */ state->eof = 0; /* not at end of file */ @@ -90,11 +82,7 @@ local void gz_reset(state) } /* Open a gzip file either by name or file descriptor. */ -local gzFile gz_open(path, fd, mode) - const void *path; - int fd; - const char *mode; -{ +local gzFile gz_open(const void *path, int fd, const char *mode) { gz_statep state; z_size_t len; int oflag; @@ -269,26 +257,17 @@ local gzFile gz_open(path, fd, mode) } /* -- see zlib.h -- */ -gzFile ZEXPORT gzopen(path, mode) - const char *path; - const char *mode; -{ +gzFile ZEXPORT gzopen(const char *path, const char *mode) { return gz_open(path, -1, mode); } /* -- see zlib.h -- */ -gzFile ZEXPORT gzopen64(path, mode) - const char *path; - const char *mode; -{ +gzFile ZEXPORT gzopen64(const char *path, const char *mode) { return gz_open(path, -1, mode); } /* -- see zlib.h -- */ -gzFile ZEXPORT gzdopen(fd, mode) - int fd; - const char *mode; -{ +gzFile ZEXPORT gzdopen(int fd, const char *mode) { char *path; /* identifier for error messages */ gzFile gz; @@ -306,19 +285,13 @@ gzFile ZEXPORT gzdopen(fd, mode) /* -- see zlib.h -- */ #ifdef WIDECHAR -gzFile ZEXPORT gzopen_w(path, mode) - const wchar_t *path; - const char *mode; -{ +gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode) { return gz_open(path, -2, mode); } #endif /* -- see zlib.h -- */ -int ZEXPORT gzbuffer(file, size) - gzFile file; - unsigned size; -{ +int ZEXPORT gzbuffer(gzFile file, unsigned size) { gz_statep state; /* get internal structure and check integrity */ @@ -335,16 +308,14 @@ int ZEXPORT gzbuffer(file, size) /* check and set requested size */ if ((size << 1) < size) return -1; /* need to be able to double it */ - if (size < 2) - size = 2; /* need two bytes to check magic header */ + if (size < 8) + size = 8; /* needed to behave well with flushing */ state->want = size; return 0; } /* -- see zlib.h -- */ -int ZEXPORT gzrewind(file) - gzFile file; -{ +int ZEXPORT gzrewind(gzFile file) { gz_statep state; /* get internal structure */ @@ -365,11 +336,7 @@ int ZEXPORT gzrewind(file) } /* -- see zlib.h -- */ -z_off64_t ZEXPORT gzseek64(file, offset, whence) - gzFile file; - z_off64_t offset; - int whence; -{ +z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) { unsigned n; z_off64_t ret; gz_statep state; @@ -442,11 +409,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence) } /* -- see zlib.h -- */ -z_off_t ZEXPORT gzseek(file, offset, whence) - gzFile file; - z_off_t offset; - int whence; -{ +z_off_t ZEXPORT gzseek(gzFile file, z_off_t offset, int whence) { z_off64_t ret; ret = gzseek64(file, (z_off64_t)offset, whence); @@ -454,9 +417,7 @@ z_off_t ZEXPORT gzseek(file, offset, whence) } /* -- see zlib.h -- */ -z_off64_t ZEXPORT gztell64(file) - gzFile file; -{ +z_off64_t ZEXPORT gztell64(gzFile file) { gz_statep state; /* get internal structure and check integrity */ @@ -471,9 +432,7 @@ z_off64_t ZEXPORT gztell64(file) } /* -- see zlib.h -- */ -z_off_t ZEXPORT gztell(file) - gzFile file; -{ +z_off_t ZEXPORT gztell(gzFile file) { z_off64_t ret; ret = gztell64(file); @@ -481,9 +440,7 @@ z_off_t ZEXPORT gztell(file) } /* -- see zlib.h -- */ -z_off64_t ZEXPORT gzoffset64(file) - gzFile file; -{ +z_off64_t ZEXPORT gzoffset64(gzFile file) { z_off64_t offset; gz_statep state; @@ -504,9 +461,7 @@ z_off64_t ZEXPORT gzoffset64(file) } /* -- see zlib.h -- */ -z_off_t ZEXPORT gzoffset(file) - gzFile file; -{ +z_off_t ZEXPORT gzoffset(gzFile file) { z_off64_t ret; ret = gzoffset64(file); @@ -514,9 +469,7 @@ z_off_t ZEXPORT gzoffset(file) } /* -- see zlib.h -- */ -int ZEXPORT gzeof(file) - gzFile file; -{ +int ZEXPORT gzeof(gzFile file) { gz_statep state; /* get internal structure and check integrity */ @@ -531,10 +484,7 @@ int ZEXPORT gzeof(file) } /* -- see zlib.h -- */ -const char * ZEXPORT gzerror(file, errnum) - gzFile file; - int *errnum; -{ +const char * ZEXPORT gzerror(gzFile file, int *errnum) { gz_statep state; /* get internal structure and check integrity */ @@ -552,9 +502,7 @@ const char * ZEXPORT gzerror(file, errnum) } /* -- see zlib.h -- */ -void ZEXPORT gzclearerr(file) - gzFile file; -{ +void ZEXPORT gzclearerr(gzFile file) { gz_statep state; /* get internal structure and check integrity */ @@ -578,11 +526,7 @@ void ZEXPORT gzclearerr(file) memory). Simply save the error message as a static string. If there is an allocation failure constructing the error message, then convert the error to out of memory. */ -void ZLIB_INTERNAL gz_error(state, err, msg) - gz_statep state; - int err; - const char *msg; -{ +void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) { /* free previously allocated message and clear */ if (state->msg != NULL) { if (state->err != Z_MEM_ERROR) @@ -619,21 +563,20 @@ void ZLIB_INTERNAL gz_error(state, err, msg) #endif } -#ifndef INT_MAX /* portably return maximum value for an int (when limits.h presumed not available) -- we need to do this to cover cases where 2's complement not used, since C standard permits 1's complement and sign-bit representations, otherwise we could just use ((unsigned)-1) >> 1 */ -unsigned ZLIB_INTERNAL gz_intmax() -{ - unsigned p, q; - - p = 1; +unsigned ZLIB_INTERNAL gz_intmax(void) { +#ifdef INT_MAX + return INT_MAX; +#else + unsigned p = 1, q; do { q = p; p <<= 1; p++; } while (p > q); return q >> 1; -} #endif +} diff --git a/deps/zlib/gzread.c b/deps/zlib/gzread.c index 884c9bfe4..4168cbc88 100644 --- a/deps/zlib/gzread.c +++ b/deps/zlib/gzread.c @@ -5,25 +5,12 @@ #include "gzguts.h" -/* Local functions */ -local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *)); -local int gz_avail OF((gz_statep)); -local int gz_look OF((gz_statep)); -local int gz_decomp OF((gz_statep)); -local int gz_fetch OF((gz_statep)); -local int gz_skip OF((gz_statep, z_off64_t)); -local z_size_t gz_read OF((gz_statep, voidp, z_size_t)); - /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from state->fd, and update state->eof, state->err, and state->msg as appropriate. This function needs to loop on read(), since read() is not guaranteed to read the number of bytes requested, depending on the type of descriptor. */ -local int gz_load(state, buf, len, have) - gz_statep state; - unsigned char *buf; - unsigned len; - unsigned *have; -{ +local int gz_load(gz_statep state, unsigned char *buf, unsigned len, + unsigned *have) { int ret; unsigned get, max = ((unsigned)-1 >> 2) + 1; @@ -53,9 +40,7 @@ local int gz_load(state, buf, len, have) If strm->avail_in != 0, then the current data is moved to the beginning of the input buffer, and then the remainder of the buffer is loaded with the available data from the input file. */ -local int gz_avail(state) - gz_statep state; -{ +local int gz_avail(gz_statep state) { unsigned got; z_streamp strm = &(state->strm); @@ -88,9 +73,7 @@ local int gz_avail(state) case, all further file reads will be directly to either the output buffer or a user buffer. If decompressing, the inflate state will be initialized. gz_look() will return 0 on success or -1 on failure. */ -local int gz_look(state) - gz_statep state; -{ +local int gz_look(gz_statep state) { z_streamp strm = &(state->strm); /* allocate read buffers and inflate memory */ @@ -157,11 +140,9 @@ local int gz_look(state) the output buffer is larger than the input buffer, which also assures space for gzungetc() */ state->x.next = state->out; - if (strm->avail_in) { - memcpy(state->x.next, strm->next_in, strm->avail_in); - state->x.have = strm->avail_in; - strm->avail_in = 0; - } + memcpy(state->x.next, strm->next_in, strm->avail_in); + state->x.have = strm->avail_in; + strm->avail_in = 0; state->how = COPY; state->direct = 1; return 0; @@ -172,9 +153,7 @@ local int gz_look(state) data. If the gzip stream completes, state->how is reset to LOOK to look for the next gzip stream or raw data, once state->x.have is depleted. Returns 0 on success, -1 on failure. */ -local int gz_decomp(state) - gz_statep state; -{ +local int gz_decomp(gz_statep state) { int ret = Z_OK; unsigned had; z_streamp strm = &(state->strm); @@ -226,9 +205,7 @@ local int gz_decomp(state) looked for to determine whether to copy or decompress. Returns -1 on error, otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the end of the input file has been reached and all data has been processed. */ -local int gz_fetch(state) - gz_statep state; -{ +local int gz_fetch(gz_statep state) { z_streamp strm = &(state->strm); do { @@ -256,10 +233,7 @@ local int gz_fetch(state) } /* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ -local int gz_skip(state, len) - gz_statep state; - z_off64_t len; -{ +local int gz_skip(gz_statep state, z_off64_t len) { unsigned n; /* skip over len bytes or reach end-of-file, whichever comes first */ @@ -291,11 +265,7 @@ local int gz_skip(state, len) input. Return the number of bytes read. If zero is returned, either the end of file was reached, or there was an error. state->err must be consulted in that case to determine which. */ -local z_size_t gz_read(state, buf, len) - gz_statep state; - voidp buf; - z_size_t len; -{ +local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) { z_size_t got; unsigned n; @@ -372,11 +342,7 @@ local z_size_t gz_read(state, buf, len) } /* -- see zlib.h -- */ -int ZEXPORT gzread(file, buf, len) - gzFile file; - voidp buf; - unsigned len; -{ +int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) { gz_statep state; /* get internal structure */ @@ -408,12 +374,7 @@ int ZEXPORT gzread(file, buf, len) } /* -- see zlib.h -- */ -z_size_t ZEXPORT gzfread(buf, size, nitems, file) - voidp buf; - z_size_t size; - z_size_t nitems; - gzFile file; -{ +z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file) { z_size_t len; gz_statep state; @@ -444,9 +405,7 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file) #else # undef gzgetc #endif -int ZEXPORT gzgetc(file) - gzFile file; -{ +int ZEXPORT gzgetc(gzFile file) { unsigned char buf[1]; gz_statep state; @@ -471,17 +430,12 @@ int ZEXPORT gzgetc(file) return gz_read(state, buf, 1) < 1 ? -1 : buf[0]; } -int ZEXPORT gzgetc_(file) -gzFile file; -{ +int ZEXPORT gzgetc_(gzFile file) { return gzgetc(file); } /* -- see zlib.h -- */ -int ZEXPORT gzungetc(c, file) - int c; - gzFile file; -{ +int ZEXPORT gzungetc(int c, gzFile file) { gz_statep state; /* get internal structure */ @@ -489,6 +443,10 @@ int ZEXPORT gzungetc(c, file) return -1; state = (gz_statep)file; + /* in case this was just opened, set up the input buffer */ + if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0) + (void)gz_look(state); + /* check that we're reading and that there's no (serious) error */ if (state->mode != GZ_READ || (state->err != Z_OK && state->err != Z_BUF_ERROR)) @@ -538,11 +496,7 @@ int ZEXPORT gzungetc(c, file) } /* -- see zlib.h -- */ -char * ZEXPORT gzgets(file, buf, len) - gzFile file; - char *buf; - int len; -{ +char * ZEXPORT gzgets(gzFile file, char *buf, int len) { unsigned left, n; char *str; unsigned char *eol; @@ -602,9 +556,7 @@ char * ZEXPORT gzgets(file, buf, len) } /* -- see zlib.h -- */ -int ZEXPORT gzdirect(file) - gzFile file; -{ +int ZEXPORT gzdirect(gzFile file) { gz_statep state; /* get internal structure */ @@ -622,9 +574,7 @@ int ZEXPORT gzdirect(file) } /* -- see zlib.h -- */ -int ZEXPORT gzclose_r(file) - gzFile file; -{ +int ZEXPORT gzclose_r(gzFile file) { int ret, err; gz_statep state; diff --git a/deps/zlib/gzwrite.c b/deps/zlib/gzwrite.c index a8ffc8f53..435b4621b 100644 --- a/deps/zlib/gzwrite.c +++ b/deps/zlib/gzwrite.c @@ -5,18 +5,10 @@ #include "gzguts.h" -/* Local functions */ -local int gz_init OF((gz_statep)); -local int gz_comp OF((gz_statep, int)); -local int gz_zero OF((gz_statep, z_off64_t)); -local z_size_t gz_write OF((gz_statep, voidpc, z_size_t)); - /* Initialize state for writing a gzip file. Mark initialization by setting state->size to non-zero. Return -1 on a memory allocation failure, or 0 on success. */ -local int gz_init(state) - gz_statep state; -{ +local int gz_init(gz_statep state) { int ret; z_streamp strm = &(state->strm); @@ -70,10 +62,7 @@ local int gz_init(state) deflate() flush value. If flush is Z_FINISH, then the deflate() state is reset to start a new gzip stream. If gz->direct is true, then simply write to the output file without compressing, and ignore flush. */ -local int gz_comp(state, flush) - gz_statep state; - int flush; -{ +local int gz_comp(gz_statep state, int flush) { int ret, writ; unsigned have, put, max = ((unsigned)-1 >> 2) + 1; z_streamp strm = &(state->strm); @@ -151,10 +140,7 @@ local int gz_comp(state, flush) /* Compress len zeros to output. Return -1 on a write error or memory allocation failure by gz_comp(), or 0 on success. */ -local int gz_zero(state, len) - gz_statep state; - z_off64_t len; -{ +local int gz_zero(gz_statep state, z_off64_t len) { int first; unsigned n; z_streamp strm = &(state->strm); @@ -184,11 +170,7 @@ local int gz_zero(state, len) /* Write len bytes from buf to file. Return the number of bytes written. If the returned value is less than len, then there was an error. */ -local z_size_t gz_write(state, buf, len) - gz_statep state; - voidpc buf; - z_size_t len; -{ +local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) { z_size_t put = len; /* if len is zero, avoid unnecessary operations */ @@ -252,11 +234,7 @@ local z_size_t gz_write(state, buf, len) } /* -- see zlib.h -- */ -int ZEXPORT gzwrite(file, buf, len) - gzFile file; - voidpc buf; - unsigned len; -{ +int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) { gz_statep state; /* get internal structure */ @@ -280,12 +258,8 @@ int ZEXPORT gzwrite(file, buf, len) } /* -- see zlib.h -- */ -z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) - voidpc buf; - z_size_t size; - z_size_t nitems; - gzFile file; -{ +z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, z_size_t nitems, + gzFile file) { z_size_t len; gz_statep state; @@ -310,10 +284,7 @@ z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) } /* -- see zlib.h -- */ -int ZEXPORT gzputc(file, c) - gzFile file; - int c; -{ +int ZEXPORT gzputc(gzFile file, int c) { unsigned have; unsigned char buf[1]; gz_statep state; @@ -358,10 +329,7 @@ int ZEXPORT gzputc(file, c) } /* -- see zlib.h -- */ -int ZEXPORT gzputs(file, s) - gzFile file; - const char *s; -{ +int ZEXPORT gzputs(gzFile file, const char *s) { z_size_t len, put; gz_statep state; @@ -388,8 +356,7 @@ int ZEXPORT gzputs(file, s) #include /* -- see zlib.h -- */ -int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) -{ +int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) { int len; unsigned left; char *next; @@ -460,8 +427,7 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) return len; } -int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) -{ +int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) { va_list va; int ret; @@ -474,13 +440,10 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) #else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) - gzFile file; - const char *format; - int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; -{ +int ZEXPORTVA gzprintf(gzFile file, const char *format, int a1, int a2, int a3, + int a4, int a5, int a6, int a7, int a8, int a9, int a10, + int a11, int a12, int a13, int a14, int a15, int a16, + int a17, int a18, int a19, int a20) { unsigned len, left; char *next; gz_statep state; @@ -562,10 +525,7 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, #endif /* -- see zlib.h -- */ -int ZEXPORT gzflush(file, flush) - gzFile file; - int flush; -{ +int ZEXPORT gzflush(gzFile file, int flush) { gz_statep state; /* get internal structure */ @@ -594,11 +554,7 @@ int ZEXPORT gzflush(file, flush) } /* -- see zlib.h -- */ -int ZEXPORT gzsetparams(file, level, strategy) - gzFile file; - int level; - int strategy; -{ +int ZEXPORT gzsetparams(gzFile file, int level, int strategy) { gz_statep state; z_streamp strm; @@ -609,7 +565,7 @@ int ZEXPORT gzsetparams(file, level, strategy) strm = &(state->strm); /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) + if (state->mode != GZ_WRITE || state->err != Z_OK || state->direct) return Z_STREAM_ERROR; /* if no change is requested, then do nothing */ @@ -636,9 +592,7 @@ int ZEXPORT gzsetparams(file, level, strategy) } /* -- see zlib.h -- */ -int ZEXPORT gzclose_w(file) - gzFile file; -{ +int ZEXPORT gzclose_w(gzFile file) { int ret = Z_OK; gz_statep state; diff --git a/deps/zlib/infback.c b/deps/zlib/infback.c index a390c58e8..e7b25b307 100644 --- a/deps/zlib/infback.c +++ b/deps/zlib/infback.c @@ -15,9 +15,6 @@ #include "inflate.h" #include "inffast.h" -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); - /* strm provides memory allocation functions in zalloc and zfree, or Z_NULL to use the library memory allocation functions. @@ -25,13 +22,9 @@ local void fixedtables OF((struct inflate_state FAR *state)); windowBits is in the range 8..15, and window is a user-supplied window and output buffer that is 2**windowBits bytes. */ -int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) -z_streamp strm; -int windowBits; -unsigned char FAR *window; -const char *version; -int stream_size; -{ +int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, + unsigned char FAR *window, const char *version, + int stream_size) { struct inflate_state FAR *state; if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || @@ -66,6 +59,7 @@ int stream_size; state->window = window; state->wnext = 0; state->whave = 0; + state->sane = 1; return Z_OK; } @@ -79,9 +73,7 @@ int stream_size; used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ +local void fixedtables(struct inflate_state FAR *state) { #ifdef BUILDFIXED static int virgin = 1; static code *lenfix, *distfix; @@ -247,13 +239,8 @@ struct inflate_state FAR *state; inflateBack() can also return Z_STREAM_ERROR if the input parameters are not correct, i.e. strm is Z_NULL or the state was not initialized. */ -int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) -z_streamp strm; -in_func in; -void FAR *in_desc; -out_func out; -void FAR *out_desc; -{ +int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc) { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ @@ -605,33 +592,33 @@ void FAR *out_desc; break; case DONE: - /* inflate stream terminated properly -- write leftover output */ + /* inflate stream terminated properly */ ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } goto inf_leave; case BAD: ret = Z_DATA_ERROR; goto inf_leave; - default: /* can't happen, but makes compilers happy */ + default: + /* can't happen, but makes compilers happy */ ret = Z_STREAM_ERROR; goto inf_leave; } - /* Return unused input */ + /* Write leftover output and return unused input */ inf_leave: + if (left < state->wsize) { + if (out(out_desc, state->window, state->wsize - left) && + ret == Z_STREAM_END) + ret = Z_BUF_ERROR; + } strm->next_in = next; strm->avail_in = have; return ret; } -int ZEXPORT inflateBackEnd(strm) -z_streamp strm; -{ +int ZEXPORT inflateBackEnd(z_streamp strm) { if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) return Z_STREAM_ERROR; ZFREE(strm, strm->state); diff --git a/deps/zlib/inffast.c b/deps/zlib/inffast.c index 1fec7f363..9354676e7 100644 --- a/deps/zlib/inffast.c +++ b/deps/zlib/inffast.c @@ -47,10 +47,7 @@ requires strm->avail_out >= 258 for each loop to avoid checking for output space. */ -void ZLIB_INTERNAL inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ +void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) { struct inflate_state FAR *state; z_const unsigned char FAR *in; /* local strm->next_in */ z_const unsigned char FAR *last; /* have enough input while in < last */ diff --git a/deps/zlib/inffast.h b/deps/zlib/inffast.h index e5c1aa4ca..49c6d156c 100644 --- a/deps/zlib/inffast.h +++ b/deps/zlib/inffast.h @@ -8,4 +8,4 @@ subject to change. Applications should only use zlib.h. */ -void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); +void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); diff --git a/deps/zlib/inflate.c b/deps/zlib/inflate.c index 7a7289749..94ecff015 100644 --- a/deps/zlib/inflate.c +++ b/deps/zlib/inflate.c @@ -91,20 +91,7 @@ # endif #endif -/* function prototypes */ -local int inflateStateCheck OF((z_streamp strm)); -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, - unsigned copy)); -#ifdef BUILDFIXED - void makefixed OF((void)); -#endif -local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, - unsigned len)); - -local int inflateStateCheck(strm) -z_streamp strm; -{ +local int inflateStateCheck(z_streamp strm) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) @@ -116,9 +103,7 @@ z_streamp strm; return 0; } -int ZEXPORT inflateResetKeep(strm) -z_streamp strm; -{ +int ZEXPORT inflateResetKeep(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -142,9 +127,7 @@ z_streamp strm; return Z_OK; } -int ZEXPORT inflateReset(strm) -z_streamp strm; -{ +int ZEXPORT inflateReset(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -155,10 +138,7 @@ z_streamp strm; return inflateResetKeep(strm); } -int ZEXPORT inflateReset2(strm, windowBits) -z_streamp strm; -int windowBits; -{ +int ZEXPORT inflateReset2(z_streamp strm, int windowBits) { int wrap; struct inflate_state FAR *state; @@ -168,6 +148,8 @@ int windowBits; /* extract wrap request from windowBits parameter */ if (windowBits < 0) { + if (windowBits < -15) + return Z_STREAM_ERROR; wrap = 0; windowBits = -windowBits; } @@ -193,12 +175,8 @@ int windowBits; return inflateReset(strm); } -int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) -z_streamp strm; -int windowBits; -const char *version; -int stream_size; -{ +int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, + const char *version, int stream_size) { int ret; struct inflate_state FAR *state; @@ -237,22 +215,17 @@ int stream_size; return ret; } -int ZEXPORT inflateInit_(strm, version, stream_size) -z_streamp strm; -const char *version; -int stream_size; -{ +int ZEXPORT inflateInit_(z_streamp strm, const char *version, + int stream_size) { return inflateInit2_(strm, DEF_WBITS, version, stream_size); } -int ZEXPORT inflatePrime(strm, bits, value) -z_streamp strm; -int bits; -int value; -{ +int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; + if (bits == 0) + return Z_OK; state = (struct inflate_state FAR *)strm->state; if (bits < 0) { state->hold = 0; @@ -276,9 +249,7 @@ int value; used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ +local void fixedtables(struct inflate_state FAR *state) { #ifdef BUILDFIXED static int virgin = 1; static code *lenfix, *distfix; @@ -340,7 +311,7 @@ struct inflate_state FAR *state; a.out > inffixed.h */ -void makefixed() +void makefixed(void) { unsigned low, size; struct inflate_state state; @@ -394,11 +365,7 @@ void makefixed() output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ -local int updatewindow(strm, end, copy) -z_streamp strm; -const Bytef *end; -unsigned copy; -{ +local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) { struct inflate_state FAR *state; unsigned dist; @@ -620,10 +587,7 @@ unsigned copy; will return Z_BUF_ERROR if it has not reached the end of the stream. */ -int ZEXPORT inflate(strm, flush) -z_streamp strm; -int flush; -{ +int ZEXPORT inflate(z_streamp strm, int flush) { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ @@ -763,10 +727,10 @@ int flush; copy = state->length; if (copy > have) copy = have; if (copy) { - len = state->head->extra_len - state->length; if (state->head != Z_NULL && state->head->extra != Z_NULL && - len < state->head->extra_max) { + (len = state->head->extra_len - state->length) < + state->head->extra_max) { zmemcpy(state->head->extra + len, next, len + copy > state->head->extra_max ? state->head->extra_max - len : copy); @@ -1299,9 +1263,7 @@ int flush; return ret; } -int ZEXPORT inflateEnd(strm) -z_streamp strm; -{ +int ZEXPORT inflateEnd(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1313,11 +1275,8 @@ z_streamp strm; return Z_OK; } -int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) -z_streamp strm; -Bytef *dictionary; -uInt *dictLength; -{ +int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, + uInt *dictLength) { struct inflate_state FAR *state; /* check state */ @@ -1336,11 +1295,8 @@ uInt *dictLength; return Z_OK; } -int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) -z_streamp strm; -const Bytef *dictionary; -uInt dictLength; -{ +int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, + uInt dictLength) { struct inflate_state FAR *state; unsigned long dictid; int ret; @@ -1371,10 +1327,7 @@ uInt dictLength; return Z_OK; } -int ZEXPORT inflateGetHeader(strm, head) -z_streamp strm; -gz_headerp head; -{ +int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) { struct inflate_state FAR *state; /* check state */ @@ -1399,11 +1352,8 @@ gz_headerp head; called again with more data and the *have state. *have is initialized to zero for the first call. */ -local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -const unsigned char FAR *buf; -unsigned len; -{ +local unsigned syncsearch(unsigned FAR *have, const unsigned char FAR *buf, + unsigned len) { unsigned got; unsigned next; @@ -1422,9 +1372,7 @@ unsigned len; return next; } -int ZEXPORT inflateSync(strm) -z_streamp strm; -{ +int ZEXPORT inflateSync(z_streamp strm) { unsigned len; /* number of bytes to look at or looked at */ int flags; /* temporary to save header status */ unsigned long in, out; /* temporary to save total_in and total_out */ @@ -1439,7 +1387,7 @@ z_streamp strm; /* if first time, start search in bit buffer */ if (state->mode != SYNC) { state->mode = SYNC; - state->hold <<= state->bits & 7; + state->hold >>= state->bits & 7; state->bits -= state->bits & 7; len = 0; while (state->bits >= 8) { @@ -1480,9 +1428,7 @@ z_streamp strm; block. When decompressing, PPP checks that at the end of input packet, inflate is waiting for these length bytes. */ -int ZEXPORT inflateSyncPoint(strm) -z_streamp strm; -{ +int ZEXPORT inflateSyncPoint(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1490,10 +1436,7 @@ z_streamp strm; return state->mode == STORED && state->bits == 0; } -int ZEXPORT inflateCopy(dest, source) -z_streamp dest; -z_streamp source; -{ +int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) { struct inflate_state FAR *state; struct inflate_state FAR *copy; unsigned char FAR *window; @@ -1537,10 +1480,7 @@ z_streamp source; return Z_OK; } -int ZEXPORT inflateUndermine(strm, subvert) -z_streamp strm; -int subvert; -{ +int ZEXPORT inflateUndermine(z_streamp strm, int subvert) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1555,10 +1495,7 @@ int subvert; #endif } -int ZEXPORT inflateValidate(strm, check) -z_streamp strm; -int check; -{ +int ZEXPORT inflateValidate(z_streamp strm, int check) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1570,9 +1507,7 @@ int check; return Z_OK; } -long ZEXPORT inflateMark(strm) -z_streamp strm; -{ +long ZEXPORT inflateMark(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) @@ -1583,9 +1518,7 @@ z_streamp strm; (state->mode == MATCH ? state->was - state->length : 0)); } -unsigned long ZEXPORT inflateCodesUsed(strm) -z_streamp strm; -{ +unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return (unsigned long)-1; state = (struct inflate_state FAR *)strm->state; diff --git a/deps/zlib/inftrees.c b/deps/zlib/inftrees.c index 09462a740..98cfe1644 100644 --- a/deps/zlib/inftrees.c +++ b/deps/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2022 Mark Adler + * Copyright (C) 1995-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.12 Copyright 1995-2022 Mark Adler "; + " inflate 1.3.1 Copyright 1995-2024 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -29,14 +29,9 @@ const char inflate_copyright[] = table index bits. It will differ if the request is greater than the longest code or if it is less than the shortest code. */ -int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ +int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work) { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ unsigned min, max; /* minimum and maximum code lengths */ @@ -62,7 +57,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/deps/zlib/inftrees.h b/deps/zlib/inftrees.h index baa53a0b1..396f74b5d 100644 --- a/deps/zlib/inftrees.h +++ b/deps/zlib/inftrees.h @@ -38,11 +38,11 @@ typedef struct { /* Maximum size of the dynamic table. The maximum number of code structures is 1444, which is the sum of 852 for literal/length codes and 592 for distance codes. These values were found by exhaustive searches using the program - examples/enough.c found in the zlib distribtution. The arguments to that + examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes - returns returns 852, and "enough 30 6 15" for distance codes returns 592. - The initial root table size (9 or 6) is found in the fifth argument of the + returns 852, and "enough 30 6 15" for distance codes returns 592. The + initial root table size (9 or 6) is found in the fifth argument of the inflate_table() calls in inflate.c and infback.c. If the root table size is changed, then these maximum sizes would be need to be recalculated and updated. */ @@ -57,6 +57,6 @@ typedef enum { DISTS } codetype; -int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); +int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work); diff --git a/deps/zlib/trees.c b/deps/zlib/trees.c index f73fd99c3..6a523ef34 100644 --- a/deps/zlib/trees.c +++ b/deps/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2021 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -122,39 +122,116 @@ struct static_tree_desc_s { int max_length; /* max bit length for the codes */ }; -local const static_tree_desc static_l_desc = +#ifdef NO_INIT_GLOBAL_POINTERS +# define TCONST +#else +# define TCONST const +#endif + +local TCONST static_tree_desc static_l_desc = {static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; -local const static_tree_desc static_d_desc = +local TCONST static_tree_desc static_d_desc = {static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; -local const static_tree_desc static_bl_desc = +local TCONST static_tree_desc static_bl_desc = {(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; /* =========================================================================== - * Local (static) routines in this file. + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. */ +#define put_short(s, w) { \ + put_byte(s, (uch)((w) & 0xff)); \ + put_byte(s, (uch)((ush)(w) >> 8)); \ +} -local void tr_static_init OF((void)); -local void init_block OF((deflate_state *s)); -local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); -local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); -local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); -local void build_tree OF((deflate_state *s, tree_desc *desc)); -local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local int build_bl_tree OF((deflate_state *s)); -local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, - int blcodes)); -local void compress_block OF((deflate_state *s, const ct_data *ltree, - const ct_data *dtree)); -local int detect_data_type OF((deflate_state *s)); -local unsigned bi_reverse OF((unsigned code, int len)); -local void bi_windup OF((deflate_state *s)); -local void bi_flush OF((deflate_state *s)); +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +local unsigned bi_reverse(unsigned code, int len) { + register unsigned res = 0; + do { + res |= code & 1; + code >>= 1, res <<= 1; + } while (--len > 0); + return res >> 1; +} + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +local void bi_flush(deflate_state *s) { + if (s->bi_valid == 16) { + put_short(s, s->bi_buf); + s->bi_buf = 0; + s->bi_valid = 0; + } else if (s->bi_valid >= 8) { + put_byte(s, (Byte)s->bi_buf); + s->bi_buf >>= 8; + s->bi_valid -= 8; + } +} + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +local void bi_windup(deflate_state *s) { + if (s->bi_valid > 8) { + put_short(s, s->bi_buf); + } else if (s->bi_valid > 0) { + put_byte(s, (Byte)s->bi_buf); + } + s->bi_buf = 0; + s->bi_valid = 0; +#ifdef ZLIB_DEBUG + s->bits_sent = (s->bits_sent + 7) & ~7; +#endif +} + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) { + ush next_code[MAX_BITS+1]; /* next code value for each bit length */ + unsigned code = 0; /* running code value */ + int bits; /* bit index */ + int n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + code = (code + bl_count[bits - 1]) << 1; + next_code[bits] = (ush)code; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1, + "inconsistent bit counts"); + Tracev((stderr,"\ngen_codes: max_code %d ", max_code)); + + for (n = 0; n <= max_code; n++) { + int len = tree[n].Len; + if (len == 0) continue; + /* Now reverse the bits */ + tree[n].Code = (ush)bi_reverse(next_code[len]++, len); + + Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", + n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1)); + } +} #ifdef GEN_TREES_H -local void gen_trees_header OF((void)); +local void gen_trees_header(void); #endif #ifndef ZLIB_DEBUG @@ -167,33 +244,18 @@ local void gen_trees_header OF((void)); send_bits(s, tree[c].Code, tree[c].Len); } #endif -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -#define put_short(s, w) { \ - put_byte(s, (uch)((w) & 0xff)); \ - put_byte(s, (uch)((ush)(w) >> 8)); \ -} - /* =========================================================================== * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. */ #ifdef ZLIB_DEBUG -local void send_bits OF((deflate_state *s, int value, int length)); - -local void send_bits(s, value, length) - deflate_state *s; - int value; /* value to send */ - int length; /* number of bits */ -{ +local void send_bits(deflate_state *s, int value, int length) { Tracevv((stderr," l %2d v %4x ", length, value)); Assert(length > 0 && length <= 15, "invalid length"); s->bits_sent += (ulg)length; /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) + * (16 - bi_valid) bits from value, leaving (width - (16 - bi_valid)) * unused bits in value. */ if (s->bi_valid > (int)Buf_size - length) { @@ -229,8 +291,7 @@ local void send_bits(s, value, length) /* =========================================================================== * Initialize the various 'constant' tables. */ -local void tr_static_init() -{ +local void tr_static_init(void) { #if defined(GEN_TREES_H) || !defined(STDC) static int static_init_done = 0; int n; /* iterates over tree elements */ @@ -256,7 +317,7 @@ local void tr_static_init() length = 0; for (code = 0; code < LENGTH_CODES-1; code++) { base_length[code] = length; - for (n = 0; n < (1< dist code (0..29) */ dist = 0; for (code = 0 ; code < 16; code++) { base_dist[code] = dist; - for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ for ( ; code < D_CODES; code++) { base_dist[code] = dist << 7; - for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = (uch)code; } } - Assert (dist == 256, "tr_static_init: 256+dist != 512"); + Assert (dist == 256, "tr_static_init: 256 + dist != 512"); /* Construct the codes of the static literal tree */ for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; @@ -312,7 +373,7 @@ local void tr_static_init() } /* =========================================================================== - * Genererate the file trees.h describing the static trees. + * Generate the file trees.h describing the static trees. */ #ifdef GEN_TREES_H # ifndef ZLIB_DEBUG @@ -321,10 +382,9 @@ local void tr_static_init() # define SEPARATOR(i, last, width) \ ((i) == (last)? "\n};\n\n" : \ - ((i) % (width) == (width)-1 ? ",\n" : ", ")) + ((i) % (width) == (width) - 1 ? ",\n" : ", ")) -void gen_trees_header() -{ +void gen_trees_header(void) { FILE *header = fopen("trees.h", "w"); int i; @@ -373,12 +433,26 @@ void gen_trees_header() } #endif /* GEN_TREES_H */ +/* =========================================================================== + * Initialize a new block. + */ +local void init_block(deflate_state *s) { + int n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; + for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; + for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; + + s->dyn_ltree[END_BLOCK].Freq = 1; + s->opt_len = s->static_len = 0L; + s->sym_next = s->matches = 0; +} + /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ -void ZLIB_INTERNAL _tr_init(s) - deflate_state *s; -{ +void ZLIB_INTERNAL _tr_init(deflate_state *s) { tr_static_init(); s->l_desc.dyn_tree = s->dyn_ltree; @@ -401,24 +475,6 @@ void ZLIB_INTERNAL _tr_init(s) init_block(s); } -/* =========================================================================== - * Initialize a new block. - */ -local void init_block(s) - deflate_state *s; -{ - int n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; - for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; - for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; - - s->dyn_ltree[END_BLOCK].Freq = 1; - s->opt_len = s->static_len = 0L; - s->sym_next = s->matches = 0; -} - #define SMALLEST 1 /* Index within the heap array of least frequent node in the Huffman tree */ @@ -448,17 +504,13 @@ local void init_block(s) * when the heap property is re-established (each father smaller than its * two sons). */ -local void pqdownheap(s, tree, k) - deflate_state *s; - ct_data *tree; /* the tree to restore */ - int k; /* node to move down */ -{ +local void pqdownheap(deflate_state *s, ct_data *tree, int k) { int v = s->heap[k]; int j = k << 1; /* left son of k */ while (j <= s->heap_len) { /* Set j to the smallest of the two sons: */ if (j < s->heap_len && - smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { + smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) { j++; } /* Exit if v is smaller than both sons */ @@ -483,10 +535,7 @@ local void pqdownheap(s, tree, k) * The length opt_len is updated; static_len is also updated if stree is * not null. */ -local void gen_bitlen(s, desc) - deflate_state *s; - tree_desc *desc; /* the tree descriptor */ -{ +local void gen_bitlen(deflate_state *s, tree_desc *desc) { ct_data *tree = desc->dyn_tree; int max_code = desc->max_code; const ct_data *stree = desc->stat_desc->static_tree; @@ -507,7 +556,7 @@ local void gen_bitlen(s, desc) */ tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ - for (h = s->heap_max+1; h < HEAP_SIZE; h++) { + for (h = s->heap_max + 1; h < HEAP_SIZE; h++) { n = s->heap[h]; bits = tree[tree[n].Dad].Len + 1; if (bits > max_length) bits = max_length, overflow++; @@ -518,7 +567,7 @@ local void gen_bitlen(s, desc) s->bl_count[bits]++; xbits = 0; - if (n >= base) xbits = extra[n-base]; + if (n >= base) xbits = extra[n - base]; f = tree[n].Freq; s->opt_len += (ulg)f * (unsigned)(bits + xbits); if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits); @@ -530,10 +579,10 @@ local void gen_bitlen(s, desc) /* Find the first bit length which could increase: */ do { - bits = max_length-1; + bits = max_length - 1; while (s->bl_count[bits] == 0) bits--; - s->bl_count[bits]--; /* move one leaf down the tree */ - s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ + s->bl_count[bits]--; /* move one leaf down the tree */ + s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */ s->bl_count[max_length]--; /* The brother of the overflow item also moves one step up, * but this does not affect bl_count[max_length] @@ -561,48 +610,9 @@ local void gen_bitlen(s, desc) } } -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -local void gen_codes (tree, max_code, bl_count) - ct_data *tree; /* the tree to decorate */ - int max_code; /* largest code with non zero frequency */ - ushf *bl_count; /* number of codes at each bit length */ -{ - ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - unsigned code = 0; /* running code value */ - int bits; /* bit index */ - int n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - code = (code + bl_count[bits-1]) << 1; - next_code[bits] = (ush)code; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - Assert (code + bl_count[MAX_BITS]-1 == (1< +#endif /* =========================================================================== * Construct one Huffman tree and assigns the code bit strings and lengths. @@ -612,10 +622,7 @@ local void gen_codes (tree, max_code, bl_count) * and corresponding code. The length opt_len is updated; static_len is * also updated if stree is not null. The field max_code is set. */ -local void build_tree(s, desc) - deflate_state *s; - tree_desc *desc; /* the tree descriptor */ -{ +local void build_tree(deflate_state *s, tree_desc *desc) { ct_data *tree = desc->dyn_tree; const ct_data *stree = desc->stat_desc->static_tree; int elems = desc->stat_desc->elems; @@ -624,7 +631,7 @@ local void build_tree(s, desc) int node; /* new node being created */ /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n + 1]. * heap[0] is not used. */ s->heap_len = 0, s->heap_max = HEAP_SIZE; @@ -652,7 +659,7 @@ local void build_tree(s, desc) } desc->max_code = max_code; - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree, * establish sub-heaps of increasing lengths: */ for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); @@ -700,11 +707,7 @@ local void build_tree(s, desc) * Scan a literal or distance tree to determine the frequencies of the codes * in the bit length tree. */ -local void scan_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ +local void scan_tree(deflate_state *s, ct_data *tree, int max_code) { int n; /* iterates over all tree elements */ int prevlen = -1; /* last emitted length */ int curlen; /* length of current code */ @@ -714,10 +717,10 @@ local void scan_tree (s, tree, max_code) int min_count = 4; /* min repeat count */ if (nextlen == 0) max_count = 138, min_count = 3; - tree[max_code+1].Len = (ush)0xffff; /* guard */ + tree[max_code + 1].Len = (ush)0xffff; /* guard */ for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; + curlen = nextlen; nextlen = tree[n + 1].Len; if (++count < max_count && curlen == nextlen) { continue; } else if (count < min_count) { @@ -745,11 +748,7 @@ local void scan_tree (s, tree, max_code) * Send a literal or distance tree in compressed form, using the codes in * bl_tree. */ -local void send_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ +local void send_tree(deflate_state *s, ct_data *tree, int max_code) { int n; /* iterates over all tree elements */ int prevlen = -1; /* last emitted length */ int curlen; /* length of current code */ @@ -758,11 +757,11 @@ local void send_tree (s, tree, max_code) int max_count = 7; /* max repeat count */ int min_count = 4; /* min repeat count */ - /* tree[max_code+1].Len = -1; */ /* guard already set */ + /* tree[max_code + 1].Len = -1; */ /* guard already set */ if (nextlen == 0) max_count = 138, min_count = 3; for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; + curlen = nextlen; nextlen = tree[n + 1].Len; if (++count < max_count && curlen == nextlen) { continue; } else if (count < min_count) { @@ -773,13 +772,13 @@ local void send_tree (s, tree, max_code) send_code(s, curlen, s->bl_tree); count--; } Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); + send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2); } else if (count <= 10) { - send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); + send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3); } else { - send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); + send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7); } count = 0; prevlen = curlen; if (nextlen == 0) { @@ -796,9 +795,7 @@ local void send_tree (s, tree, max_code) * Construct the Huffman tree for the bit lengths and return the index in * bl_order of the last bit length code to send. */ -local int build_bl_tree(s) - deflate_state *s; -{ +local int build_bl_tree(deflate_state *s) { int max_blindex; /* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */ @@ -807,8 +804,8 @@ local int build_bl_tree(s) /* Build the bit length tree: */ build_tree(s, (tree_desc *)(&(s->bl_desc))); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + /* opt_len now includes the length of the tree representations, except the + * lengths of the bit lengths codes and the 5 + 5 + 4 bits for the counts. */ /* Determine the number of bit length codes to send. The pkzip format @@ -819,7 +816,7 @@ local int build_bl_tree(s) if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; } /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4; + s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4; Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", s->opt_len, s->static_len)); @@ -831,42 +828,36 @@ local int build_bl_tree(s) * lengths of the bit length codes, the literal tree and the distance tree. * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. */ -local void send_all_trees(s, lcodes, dcodes, blcodes) - deflate_state *s; - int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ +local void send_all_trees(deflate_state *s, int lcodes, int dcodes, + int blcodes) { int rank; /* index in bl_order */ Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, "too many codes"); Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes-1, 5); - send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ for (rank = 0; rank < blcodes; rank++) { Tracev((stderr, "\nbl code %2d ", bl_order[rank])); send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); } Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ + send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1); /* literal tree */ Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ + send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1); /* distance tree */ Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); } /* =========================================================================== * Send a stored block */ -void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) - deflate_state *s; - charf *buf; /* input block */ - ulg stored_len; /* length of input block */ - int last; /* one if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */ +void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, + ulg stored_len, int last) { + send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */ bi_windup(s); /* align on byte boundary */ put_short(s, (ush)stored_len); put_short(s, (ush)~stored_len); @@ -877,16 +868,14 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; s->compressed_len += (stored_len + 4) << 3; s->bits_sent += 2*16; - s->bits_sent += stored_len<<3; + s->bits_sent += stored_len << 3; #endif } /* =========================================================================== * Flush the bits in the bit buffer to pending output (leaves at most 7 bits) */ -void ZLIB_INTERNAL _tr_flush_bits(s) - deflate_state *s; -{ +void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) { bi_flush(s); } @@ -894,9 +883,7 @@ void ZLIB_INTERNAL _tr_flush_bits(s) * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ -void ZLIB_INTERNAL _tr_align(s) - deflate_state *s; -{ +void ZLIB_INTERNAL _tr_align(deflate_state *s) { send_bits(s, STATIC_TREES<<1, 3); send_code(s, END_BLOCK, static_ltree); #ifdef ZLIB_DEBUG @@ -905,16 +892,108 @@ void ZLIB_INTERNAL _tr_align(s) bi_flush(s); } +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +local void compress_block(deflate_state *s, const ct_data *ltree, + const ct_data *dtree) { + unsigned dist; /* distance of matched string */ + int lc; /* match length or unmatched char (if dist == 0) */ + unsigned sx = 0; /* running index in symbol buffers */ + unsigned code; /* the code to send */ + int extra; /* number of extra bits to send */ + + if (s->sym_next != 0) do { +#ifdef LIT_MEM + dist = s->d_buf[sx]; + lc = s->l_buf[sx++]; +#else + dist = s->sym_buf[sx++] & 0xff; + dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8; + lc = s->sym_buf[sx++]; +#endif + if (dist == 0) { + send_code(s, lc, ltree); /* send a literal byte */ + Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); /* send length code */ + extra = extra_lbits[code]; + if (extra != 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra != 0) { + dist -= (unsigned)base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check for no overlay of pending_buf on needed symbols */ +#ifdef LIT_MEM + Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow"); +#else + Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow"); +#endif + + } while (sx < s->sym_next); + + send_code(s, END_BLOCK, ltree); +} + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "block list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +local int detect_data_type(deflate_state *s) { + /* block_mask is the bit mask of block-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + unsigned long block_mask = 0xf3ffc07fUL; + int n; + + /* Check for non-textual ("block-listed") bytes. */ + for (n = 0; n <= 31; n++, block_mask >>= 1) + if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0)) + return Z_BINARY; + + /* Check for textual ("allow-listed") bytes. */ + if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 + || s->dyn_ltree[13].Freq != 0) + return Z_TEXT; + for (n = 32; n < LITERALS; n++) + if (s->dyn_ltree[n].Freq != 0) + return Z_TEXT; + + /* There are no "block-listed" or "allow-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + /* =========================================================================== * Determine the best encoding for the current block: dynamic trees, static * trees or store, and write out the encoded block. */ -void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) - deflate_state *s; - charf *buf; /* input block, or NULL if too old */ - ulg stored_len; /* length of input block */ - int last; /* one if this is the last block for a file */ -{ +void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, + ulg stored_len, int last) { ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ int max_blindex = 0; /* index of last bit length code of non zero freq */ @@ -943,14 +1022,17 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) max_blindex = build_bl_tree(s); /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s->opt_len+3+7)>>3; - static_lenb = (s->static_len+3+7)>>3; + opt_lenb = (s->opt_len + 3 + 7) >> 3; + static_lenb = (s->static_len + 3 + 7) >> 3; Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, s->sym_next / 3)); - if (static_lenb <= opt_lenb) opt_lenb = static_lenb; +#ifndef FORCE_STATIC + if (static_lenb <= opt_lenb || s->strategy == Z_FIXED) +#endif + opt_lenb = static_lenb; } else { Assert(buf != (char*)0, "lost buf"); @@ -960,7 +1042,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) #ifdef FORCE_STORED if (buf != (char*)0) { /* force stored block */ #else - if (stored_len+4 <= opt_lenb && buf != (char*)0) { + if (stored_len + 4 <= opt_lenb && buf != (char*)0) { /* 4: two words for the lengths */ #endif /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. @@ -971,21 +1053,17 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) */ _tr_stored_block(s, buf, stored_len, last); -#ifdef FORCE_STATIC - } else if (static_lenb >= 0) { /* force static trees */ -#else - } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { -#endif - send_bits(s, (STATIC_TREES<<1)+last, 3); + } else if (static_lenb == opt_lenb) { + send_bits(s, (STATIC_TREES<<1) + last, 3); compress_block(s, (const ct_data *)static_ltree, (const ct_data *)static_dtree); #ifdef ZLIB_DEBUG s->compressed_len += 3 + s->static_len; #endif } else { - send_bits(s, (DYN_TREES<<1)+last, 3); - send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, - max_blindex+1); + send_bits(s, (DYN_TREES<<1) + last, 3); + send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1, + max_blindex + 1); compress_block(s, (const ct_data *)s->dyn_ltree, (const ct_data *)s->dyn_dtree); #ifdef ZLIB_DEBUG @@ -1004,22 +1082,23 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) s->compressed_len += 7; /* align on byte boundary */ #endif } - Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - s->compressed_len-7*last)); + Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3, + s->compressed_len - 7*last)); } /* =========================================================================== * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ -int ZLIB_INTERNAL _tr_tally (s, dist, lc) - deflate_state *s; - unsigned dist; /* distance of matched string */ - unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - s->sym_buf[s->sym_next++] = dist; - s->sym_buf[s->sym_next++] = dist >> 8; - s->sym_buf[s->sym_next++] = lc; +int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) { +#ifdef LIT_MEM + s->d_buf[s->sym_next] = (ush)dist; + s->l_buf[s->sym_next++] = (uch)lc; +#else + s->sym_buf[s->sym_next++] = (uch)dist; + s->sym_buf[s->sym_next++] = (uch)(dist >> 8); + s->sym_buf[s->sym_next++] = (uch)lc; +#endif if (dist == 0) { /* lc is the unmatched char */ s->dyn_ltree[lc].Freq++; @@ -1031,152 +1110,8 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc) (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; + s->dyn_ltree[_length_code[lc] + LITERALS + 1].Freq++; s->dyn_dtree[d_code(dist)].Freq++; } return (s->sym_next == s->sym_end); } - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -local void compress_block(s, ltree, dtree) - deflate_state *s; - const ct_data *ltree; /* literal tree */ - const ct_data *dtree; /* distance tree */ -{ - unsigned dist; /* distance of matched string */ - int lc; /* match length or unmatched char (if dist == 0) */ - unsigned sx = 0; /* running index in sym_buf */ - unsigned code; /* the code to send */ - int extra; /* number of extra bits to send */ - - if (s->sym_next != 0) do { - dist = s->sym_buf[sx++] & 0xff; - dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8; - lc = s->sym_buf[sx++]; - if (dist == 0) { - send_code(s, lc, ltree); /* send a literal byte */ - Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code+LITERALS+1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra != 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra != 0) { - dist -= (unsigned)base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and sym_buf is ok: */ - Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow"); - - } while (sx < s->sym_next); - - send_code(s, END_BLOCK, ltree); -} - -/* =========================================================================== - * Check if the data type is TEXT or BINARY, using the following algorithm: - * - TEXT if the two conditions below are satisfied: - * a) There are no non-portable control characters belonging to the - * "block list" (0..6, 14..25, 28..31). - * b) There is at least one printable character belonging to the - * "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). - * - BINARY otherwise. - * - The following partially-portable control characters form a - * "gray list" that is ignored in this detection algorithm: - * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). - * IN assertion: the fields Freq of dyn_ltree are set. - */ -local int detect_data_type(s) - deflate_state *s; -{ - /* block_mask is the bit mask of block-listed bytes - * set bits 0..6, 14..25, and 28..31 - * 0xf3ffc07f = binary 11110011111111111100000001111111 - */ - unsigned long block_mask = 0xf3ffc07fUL; - int n; - - /* Check for non-textual ("block-listed") bytes. */ - for (n = 0; n <= 31; n++, block_mask >>= 1) - if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0)) - return Z_BINARY; - - /* Check for textual ("allow-listed") bytes. */ - if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 - || s->dyn_ltree[13].Freq != 0) - return Z_TEXT; - for (n = 32; n < LITERALS; n++) - if (s->dyn_ltree[n].Freq != 0) - return Z_TEXT; - - /* There are no "block-listed" or "allow-listed" bytes: - * this stream either is empty or has tolerated ("gray-listed") bytes only. - */ - return Z_BINARY; -} - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -local unsigned bi_reverse(code, len) - unsigned code; /* the value to invert */ - int len; /* its bit length */ -{ - register unsigned res = 0; - do { - res |= code & 1; - code >>= 1, res <<= 1; - } while (--len > 0); - return res >> 1; -} - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -local void bi_flush(s) - deflate_state *s; -{ - if (s->bi_valid == 16) { - put_short(s, s->bi_buf); - s->bi_buf = 0; - s->bi_valid = 0; - } else if (s->bi_valid >= 8) { - put_byte(s, (Byte)s->bi_buf); - s->bi_buf >>= 8; - s->bi_valid -= 8; - } -} - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -local void bi_windup(s) - deflate_state *s; -{ - if (s->bi_valid > 8) { - put_short(s, s->bi_buf); - } else if (s->bi_valid > 0) { - put_byte(s, (Byte)s->bi_buf); - } - s->bi_buf = 0; - s->bi_valid = 0; -#ifdef ZLIB_DEBUG - s->bits_sent = (s->bits_sent+7) & ~7; -#endif -} diff --git a/deps/zlib/uncompr.c b/deps/zlib/uncompr.c index f03a1a865..5e256663b 100644 --- a/deps/zlib/uncompr.c +++ b/deps/zlib/uncompr.c @@ -24,12 +24,8 @@ Z_DATA_ERROR if the input data was corrupted, including if the input data is an incomplete zlib stream. */ -int ZEXPORT uncompress2 (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong *sourceLen; -{ +int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong *sourceLen) { z_stream stream; int err; const uInt max = (uInt)-1; @@ -83,11 +79,7 @@ int ZEXPORT uncompress2 (dest, destLen, source, sourceLen) err; } -int ZEXPORT uncompress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ +int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen) { return uncompress2(dest, destLen, source, &sourceLen); } diff --git a/deps/zlib/zconf.h b/deps/zlib/zconf.h index 5e1d68a00..62adc8d84 100644 --- a/deps/zlib/zconf.h +++ b/deps/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -38,6 +38,9 @@ # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 +# define crc32_combine_gen z_crc32_combine_gen +# define crc32_combine_gen64 z_crc32_combine_gen64 +# define crc32_combine_op z_crc32_combine_op # define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound @@ -238,7 +241,11 @@ #endif #ifdef Z_SOLO - typedef unsigned long z_size_t; +# ifdef _WIN64 + typedef unsigned long long z_size_t; +# else + typedef unsigned long z_size_t; +# endif #else # define z_longlong long long # if defined(NO_SIZE_T) @@ -293,14 +300,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have @@ -349,6 +348,9 @@ # ifdef FAR # undef FAR # endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ @@ -467,11 +469,18 @@ typedef uLong FAR uLongf; # undef _LARGEFILE64_SOURCE #endif -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H +#ifndef Z_HAVE_UNISTD_H +# ifdef __WATCOMC__ +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_HAVE_UNISTD_H +# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32) +# define Z_HAVE_UNISTD_H +# endif #endif #ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) +# if defined(Z_HAVE_UNISTD_H) # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS # include /* for off_t */ @@ -507,7 +516,7 @@ typedef uLong FAR uLongf; #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# if defined(_WIN32) && !defined(__GNUC__) # define z_off64_t __int64 # else # define z_off64_t z_off_t diff --git a/deps/zlib/zlib.h b/deps/zlib/zlib.h index 4a98e38bf..8d4b932ea 100644 --- a/deps/zlib/zlib.h +++ b/deps/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.12, March 11th, 2022 + version 1.3.1, January 22nd, 2024 - Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.12" -#define ZLIB_VERNUM 0x12c0 +#define ZLIB_VERSION "1.3.1" +#define ZLIB_VERNUM 0x1310 #define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 12 +#define ZLIB_VER_MINOR 3 +#define ZLIB_VER_REVISION 1 #define ZLIB_VER_SUBREVISION 0 /* @@ -78,8 +78,8 @@ extern "C" { even in the case of corrupted input. */ -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); +typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size); +typedef void (*free_func)(voidpf opaque, voidpf address); struct internal_state; @@ -217,7 +217,7 @@ typedef gz_header FAR *gz_headerp; /* basic functions */ -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +ZEXTERN const char * ZEXPORT zlibVersion(void); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check @@ -225,12 +225,12 @@ ZEXTERN const char * ZEXPORT zlibVersion OF((void)); */ /* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); +ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. + allocation functions. total_in, total_out, adler, and msg are initialized. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all @@ -247,7 +247,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); */ -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce @@ -276,7 +276,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. See deflatePending(), - which can be used if desired to determine whether or not there is more ouput + which can be used if desired to determine whether or not there is more output in that case. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to @@ -320,8 +320,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. + avail_out is greater than six when the flush marker begins, in order to avoid + repeated flush markers upon calling deflate() again when avail_out == 0. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was @@ -360,7 +360,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); */ -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT deflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending @@ -375,7 +375,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateInit(z_streamp strm); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by @@ -383,7 +383,8 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the first call). If zalloc and zfree are set to Z_NULL, inflateInit updates - them to use default allocation functions. + them to use default allocation functions. total_in, total_out, adler, and + msg are initialized. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the @@ -397,7 +398,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); */ -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce @@ -517,7 +518,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); */ -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending @@ -535,12 +536,12 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); */ /* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); +ZEXTERN int ZEXPORT deflateInit2(z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy); This is another version of deflateInit with more compression options. The fields zalloc, zfree and opaque must be initialized before by the caller. @@ -607,9 +608,9 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); +ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm, + const Bytef *dictionary, + uInt dictLength); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this @@ -651,16 +652,16 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, not perform any compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); +ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm, + Bytef *dictionary, + uInt *dictLength); /* Returns the sliding dictionary being maintained by deflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If deflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. + Similarly, if dictLength is Z_NULL, then it is not set. deflateGetDictionary() may return a length less than the window size, even when more than the window size in input has been provided. It may return up @@ -673,8 +674,8 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, stream state is inconsistent. */ -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); +ZEXTERN int ZEXPORT deflateCopy(z_streamp dest, + z_streamp source); /* Sets the destination stream as a complete copy of the source stream. @@ -691,20 +692,20 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, destination. */ -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +ZEXTERN int ZEXPORT deflateReset(z_streamp strm); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been - set unchanged. + set unchanged. total_in, total_out, adler, and msg are initialized. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); +ZEXTERN int ZEXPORT deflateParams(z_streamp strm, + int level, + int strategy); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2(). This can be @@ -729,7 +730,7 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, Then no more input data should be provided before the deflateParams() call. If this is done, the old level and strategy will be applied to the data compressed before deflateParams(), and the new level and strategy will be - applied to the the data compressed after deflateParams(). + applied to the data compressed after deflateParams(). deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if @@ -740,11 +741,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, retried with more output space. */ -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); +ZEXTERN int ZEXPORT deflateTune(z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for @@ -757,8 +758,8 @@ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); +ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, + uLong sourceLen); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or @@ -772,9 +773,9 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, than Z_FINISH or Z_NO_FLUSH are used. */ -ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, - unsigned *pending, - int *bits)); +ZEXTERN int ZEXPORT deflatePending(z_streamp strm, + unsigned *pending, + int *bits); /* deflatePending() returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not @@ -787,9 +788,9 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, stream state was inconsistent. */ -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); +ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, + int bits, + int value); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits @@ -804,8 +805,8 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, source stream state was inconsistent. */ -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); +ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm, + gz_headerp head); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called @@ -821,16 +822,17 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). + the time set to zero, and os set to the current operating system, with no + extra, name, or comment fields. The gzip header is returned to the default + state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); +ZEXTERN int ZEXPORT inflateInit2(z_streamp strm, + int windowBits); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized @@ -883,9 +885,9 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, deferred until inflate() is called. */ -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); +ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm, + const Bytef *dictionary, + uInt dictLength); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, @@ -906,22 +908,22 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, inflate(). */ -ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); +ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm, + Bytef *dictionary, + uInt *dictLength); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If inflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. + Similarly, if dictLength is Z_NULL, then it is not set. inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateSync(z_streamp strm); /* Skips invalid compressed data until a possible full flush point (see above for the description of deflate with Z_FULL_FLUSH) can be found, or until all @@ -934,14 +936,14 @@ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. + In the success case, the application may save the current value of total_in + which indicates where valid compressed data was found. In the error case, + the application may repeatedly call inflateSync, providing more input each + time, until success or end of the input data. */ -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); +ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, + z_streamp source); /* Sets the destination stream as a complete copy of the source stream. @@ -956,18 +958,19 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, destination. */ -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateReset(z_streamp strm); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. + total_in, total_out, adler, and msg are initialized. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); +ZEXTERN int ZEXPORT inflateReset2(z_streamp strm, + int windowBits); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted @@ -980,9 +983,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, the windowBits parameter is invalid. */ -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); +ZEXTERN int ZEXPORT inflatePrime(z_streamp strm, + int bits, + int value); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the @@ -1001,7 +1004,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, stream state was inconsistent. */ -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +ZEXTERN long ZEXPORT inflateMark(z_streamp strm); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the @@ -1029,8 +1032,8 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); source stream state was inconsistent. */ -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); +ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm, + gz_headerp head); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after @@ -1070,8 +1073,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, */ /* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); +ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits, + unsigned char FAR *window); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized @@ -1091,13 +1094,13 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, the version of the header file. */ -typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); +typedef unsigned (*in_func)(void FAR *, + z_const unsigned char FAR * FAR *); +typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned); -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); +ZEXTERN int ZEXPORT inflateBack(z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than @@ -1165,7 +1168,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, cannot return Z_OK. */ -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateBackEnd(z_streamp strm); /* All memory allocated by inflateBackInit() is freed. @@ -1173,7 +1176,7 @@ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); state was inconsistent. */ -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +ZEXTERN uLong ZEXPORT zlibCompileFlags(void); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: @@ -1226,8 +1229,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); you need special options. */ -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); +ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size @@ -1241,9 +1244,9 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, buffer. */ -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); +ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte @@ -1257,15 +1260,15 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, Z_STREAM_ERROR if the level parameter is invalid. */ -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); +ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size @@ -1282,8 +1285,8 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, buffer with the uncompressed data up to that point. */ -ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong *sourceLen)); +ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); /* Same as uncompress, except that sourceLen is a pointer, where the length of the source is *sourceLen. On return, *sourceLen is the number of @@ -1302,7 +1305,7 @@ ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode); Open the gzip (.gz) file at path for reading and decompressing, or compressing and writing. The mode parameter is as in fopen ("rb" or "wb") @@ -1339,7 +1342,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); file could not be opened. */ -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode); /* Associate a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has @@ -1362,7 +1365,7 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); will not detect if fd is invalid (unless fd is -1). */ -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +ZEXTERN int ZEXPORT gzbuffer(gzFile file, unsigned size); /* Set the internal buffer size used by this library's functions for file to size. The default buffer size is 8192 bytes. This function must be called @@ -1378,7 +1381,7 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); too late. */ -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +ZEXTERN int ZEXPORT gzsetparams(gzFile file, int level, int strategy); /* Dynamically update the compression level and strategy for file. See the description of deflateInit2 for the meaning of these parameters. Previously @@ -1389,7 +1392,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); or Z_MEM_ERROR if there is a memory allocation error. */ -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +ZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len); /* Read and decompress up to len uncompressed bytes from file into buf. If the input file is not in gzip format, gzread copies the given number of @@ -1419,8 +1422,8 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); Z_STREAM_ERROR. */ -ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, - gzFile file)); +ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, + gzFile file); /* Read and decompress up to nitems items of size size from file into buf, otherwise operating as gzread() does. This duplicates the interface of @@ -1437,22 +1440,22 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, In the event that the end of file is reached and only a partial item is available at the end, i.e. the remaining uncompressed data length is not a - multiple of size, then the final partial item is nevetheless read into buf + multiple of size, then the final partial item is nevertheless read into buf and the end-of-file flag is set. The length of the partial item read is not provided, but could be inferred from the result of gztell(). This behavior is the same as the behavior of fread() implementations in common libraries, but it prevents the direct use of gzfread() to read a concurrently written - file, reseting and retrying on end-of-file, when size is not 1. + file, resetting and retrying on end-of-file, when size is not 1. */ -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); +ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len); /* Compress and write the len uncompressed bytes at buf to file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ -ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, - z_size_t nitems, gzFile file)); +ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, + z_size_t nitems, gzFile file); /* Compress and write nitems items of size size from buf to file, duplicating the interface of stdio's fwrite(), with size_t request and return types. If @@ -1465,7 +1468,7 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, is returned, and the error state is set to Z_STREAM_ERROR. */ -ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...); /* Convert, format, compress, and write the arguments (...) to file under control of the string format, as in fprintf. gzprintf returns the number of @@ -1480,7 +1483,7 @@ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); This can be determined using zlibCompileFlags(). */ -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s); /* Compress and write the given null-terminated string s to file, excluding the terminating null character. @@ -1488,7 +1491,7 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); gzputs returns the number of characters written, or -1 in case of error. */ -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len); /* Read and decompress bytes from file into buf, until len-1 characters are read, or until a newline character is read and transferred to buf, or an @@ -1502,13 +1505,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); buf are indeterminate. */ -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +ZEXTERN int ZEXPORT gzputc(gzFile file, int c); /* Compress and write c, converted to an unsigned char, into file. gzputc returns the value that was written, or -1 in case of error. */ -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +ZEXTERN int ZEXPORT gzgetc(gzFile file); /* Read and decompress one byte from file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. @@ -1517,7 +1520,7 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); points to has been clobbered or not. */ -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +ZEXTERN int ZEXPORT gzungetc(int c, gzFile file); /* Push c back onto the stream for file to be read as the first character on the next read. At least one character of push-back is always allowed. @@ -1529,7 +1532,7 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); gzseek() or gzrewind(). */ -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +ZEXTERN int ZEXPORT gzflush(gzFile file, int flush); /* Flush all pending output to file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function @@ -1545,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); */ /* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); +ZEXTERN z_off_t ZEXPORT gzseek(gzFile file, + z_off_t offset, int whence); Set the starting position to offset relative to whence for the next gzread or gzwrite on file. The offset represents a number of bytes in the @@ -1564,7 +1567,7 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, would be before the current position. */ -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +ZEXTERN int ZEXPORT gzrewind(gzFile file); /* Rewind file. This function is supported only for reading. @@ -1572,7 +1575,7 @@ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); */ /* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +ZEXTERN z_off_t ZEXPORT gztell(gzFile file); Return the starting position for the next gzread or gzwrite on file. This position represents a number of bytes in the uncompressed data stream, @@ -1583,7 +1586,7 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); */ /* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); +ZEXTERN z_off_t ZEXPORT gzoffset(gzFile file); Return the current compressed (actual) read or write offset of file. This offset includes the count of bytes that precede the gzip stream, for example @@ -1592,7 +1595,7 @@ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); be used for a progress indicator. On error, gzoffset() returns -1. */ -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +ZEXTERN int ZEXPORT gzeof(gzFile file); /* Return true (1) if the end-of-file indicator for file has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set @@ -1607,7 +1610,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); has grown since the previous end of file was detected. */ -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +ZEXTERN int ZEXPORT gzdirect(gzFile file); /* Return true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. @@ -1628,7 +1631,7 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); gzip file reading and decompression, which may not be desired.) */ -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose(gzFile file); /* Flush all pending output for file, if necessary, close file and deallocate the (de)compression state. Note that once file is closed, you @@ -1641,8 +1644,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); last read ended in the middle of a gzip stream, or Z_OK on success. */ -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_r(gzFile file); +ZEXTERN int ZEXPORT gzclose_w(gzFile file); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to @@ -1653,7 +1656,7 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); zlib library. */ -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum); /* Return the error message for the last error which occurred on file. errnum is set to zlib error number. If an error occurred in the file system @@ -1669,7 +1672,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); functions above that do not distinguish those cases in their return values. */ -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +ZEXTERN void ZEXPORT gzclearerr(gzFile file); /* Clear the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip @@ -1686,7 +1689,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); library. */ -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. An Adler-32 value is in the range of a 32-bit @@ -1706,15 +1709,15 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); if (adler != original_adler) error(); */ -ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, - z_size_t len)); +ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, + z_size_t len); /* Same as adler32(), but with a size_t length. */ /* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); +ZEXTERN uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, + z_off_t len2); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for @@ -1724,7 +1727,7 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, negative, the result has no meaning or utility. */ -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. @@ -1742,30 +1745,30 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); if (crc != original_crc) error(); */ -ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, - z_size_t len)); +ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf, + z_size_t len); /* Same as crc32(), but with a size_t length. */ /* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); +ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ /* -ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); +ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ -ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); +ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); /* Give the same result as crc32_combine(), using op in place of len2. op is is generated from len2 by crc32_combine_gen(). This will be faster than @@ -1778,20 +1781,20 @@ ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); +ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level, + const char *version, int stream_size); +ZEXTERN int ZEXPORT inflateInit_(z_streamp strm, + const char *version, int stream_size); +ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size); +ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, + const char *version, int stream_size); +ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size); #ifdef Z_PREFIX_SET # define z_deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) @@ -1836,7 +1839,7 @@ struct gzFile_s { unsigned char *next; z_off64_t pos; }; -ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ @@ -1853,13 +1856,13 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); + ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) @@ -1881,50 +1884,50 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ # define crc32_combine_gen crc32_combine_gen64 # endif # ifndef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int); + ZEXTERN z_off_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); # endif #else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *); + ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int); + ZEXTERN z_off_t ZEXPORT gztell(gzFile); + ZEXTERN z_off_t ZEXPORT gzoffset(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif #else /* Z_SOLO */ - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif /* !Z_SOLO */ /* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); -ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); -ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); -ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); -ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +ZEXTERN const char * ZEXPORT zError(int); +ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void); +ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int); +ZEXTERN int ZEXPORT inflateValidate(z_streamp, int); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp); +ZEXTERN int ZEXPORT inflateResetKeep(z_streamp); +ZEXTERN int ZEXPORT deflateResetKeep(z_streamp); #if defined(_WIN32) && !defined(Z_SOLO) -ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, - const char *mode)); +ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path, + const char *mode); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO -ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, - const char *format, - va_list va)); +ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, + const char *format, + va_list va); # endif #endif diff --git a/deps/zlib/zutil.c b/deps/zlib/zutil.c index dcab28a0d..b1c5d2d3c 100644 --- a/deps/zlib/zutil.c +++ b/deps/zlib/zutil.c @@ -24,13 +24,11 @@ z_const char * const z_errmsg[10] = { }; -const char * ZEXPORT zlibVersion() -{ +const char * ZEXPORT zlibVersion(void) { return ZLIB_VERSION; } -uLong ZEXPORT zlibCompileFlags() -{ +uLong ZEXPORT zlibCompileFlags(void) { uLong flags; flags = 0; @@ -61,9 +59,11 @@ uLong ZEXPORT zlibCompileFlags() #ifdef ZLIB_DEBUG flags += 1 << 8; #endif + /* #if defined(ASMV) || defined(ASMINF) flags += 1 << 9; #endif + */ #ifdef ZLIB_WINAPI flags += 1 << 10; #endif @@ -119,9 +119,7 @@ uLong ZEXPORT zlibCompileFlags() # endif int ZLIB_INTERNAL z_verbose = verbose; -void ZLIB_INTERNAL z_error (m) - char *m; -{ +void ZLIB_INTERNAL z_error(char *m) { fprintf(stderr, "%s\n", m); exit(1); } @@ -130,9 +128,7 @@ void ZLIB_INTERNAL z_error (m) /* exported to allow conversion of error code to string for compress() and * uncompress() */ -const char * ZEXPORT zError(err) - int err; -{ +const char * ZEXPORT zError(int err) { return ERR_MSG(err); } @@ -146,22 +142,14 @@ const char * ZEXPORT zError(err) #ifndef HAVE_MEMCPY -void ZLIB_INTERNAL zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ +void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) { if (len == 0) return; do { *dest++ = *source++; /* ??? to be unrolled */ } while (--len != 0); } -int ZLIB_INTERNAL zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ +int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) { uInt j; for (j = 0; j < len; j++) { @@ -170,10 +158,7 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len) return 0; } -void ZLIB_INTERNAL zmemzero(dest, len) - Bytef* dest; - uInt len; -{ +void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) { if (len == 0) return; do { *dest++ = 0; /* ??? to be unrolled */ @@ -214,8 +199,7 @@ local ptr_table table[MAX_PTR]; * a protected system like OS/2. Use Microsoft C instead. */ -voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) { voidpf buf; ulg bsize = (ulg)items*size; @@ -240,8 +224,7 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) return buf; } -void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { int n; (void)opaque; @@ -277,14 +260,12 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) # define _hfree hfree #endif -voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) { (void)opaque; return _halloc((long)items, size); } -void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { (void)opaque; _hfree(ptr); } @@ -297,25 +278,18 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) #ifndef MY_ZCALLOC /* Any system without a special alloc function */ #ifndef STDC -extern voidp malloc OF((uInt size)); -extern voidp calloc OF((uInt items, uInt size)); -extern void free OF((voidpf ptr)); +extern voidp malloc(uInt size); +extern voidp calloc(uInt items, uInt size); +extern void free(voidpf ptr); #endif -voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) { (void)opaque; return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); } -void ZLIB_INTERNAL zcfree (opaque, ptr) - voidpf opaque; - voidpf ptr; -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { (void)opaque; free(ptr); } diff --git a/deps/zlib/zutil.h b/deps/zlib/zutil.h index d9a20ae1b..48dd7feba 100644 --- a/deps/zlib/zutil.h +++ b/deps/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -56,7 +56,7 @@ typedef unsigned long ulg; extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] +#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err)) @@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#if defined(MACOS) || defined(TARGET_OS_MAC) +#if defined(MACOS) # define OS_CODE 7 -# ifndef Z_SOLO -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -# endif #endif #ifdef __acorn @@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define OS_CODE 19 #endif -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - #if defined(__BORLANDC__) && !defined(MSDOS) #pragma warn -8004 #pragma warn -8008 @@ -191,8 +170,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* provide prototypes for these when building zlib without LFS */ #if !defined(_WIN32) && \ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); #endif /* common defaults */ @@ -231,16 +211,16 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define zmemzero(dest, len) memset(dest, 0, len) # endif #else - void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); + void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len); + int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len); + void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len); #endif /* Diagnostic functions */ #ifdef ZLIB_DEBUG # include extern int ZLIB_INTERNAL z_verbose; - extern void ZLIB_INTERNAL z_error OF((char *m)); + extern void ZLIB_INTERNAL z_error(char *m); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} @@ -257,9 +237,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif #ifndef Z_SOLO - voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, - unsigned size)); - void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); + voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, + unsigned size); + void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr); #endif #define ZALLOC(strm, items, size) \ From 7cae4f5a16561034fce54aa275f45e49401ddf3e Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Wed, 23 Apr 2025 16:45:25 -0500 Subject: [PATCH 13/53] fix(Script/Sunwell): Use raycast to prevent Singularity throwing players through walls (#21928) --- .../SunwellPlateau/boss_muru.cpp | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index c1f8ff8bc..0f3751f31 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -23,6 +23,8 @@ #include "SpellScript.h" #include "SpellScriptLoader.h" #include "sunwell_plateau.h" +#include "VMapFactory.h" +#include "VMapMgr2.h" enum Spells { @@ -421,6 +423,28 @@ class spell_entropius_void_zone_visual_aura : public AuraScript class spell_entropius_black_hole_effect : public SpellScript { PrepareSpellScript(spell_entropius_black_hole_effect); + float RaycastToObstacle(Unit* unit, float angle, float z, float maxDist = 20.0f) + { + float baseX = unit->GetPositionX(); + float baseY = unit->GetPositionY(); + float targetX = baseX + maxDist * cos(angle); + float targetY = baseY + maxDist * sin(angle); + float hitX, hitY, hitZ; + if (VMAP::VMapFactory::createOrGetVMapMgr()->GetObjectHitPos( + unit->GetMapId(), + baseX, baseY, z, + targetX, targetY, z, + hitX, hitY, hitZ, + 0.0f)) + { + return std::sqrt( + std::pow(hitX - baseX, 2) + + std::pow(hitY - baseY, 2) + + std::pow(hitZ - z, 2) + ); + } + return maxDist; + } void HandlePull(SpellEffIndex effIndex) { @@ -428,21 +452,25 @@ class spell_entropius_black_hole_effect : public SpellScript Unit* target = GetHitUnit(); if (!target) return; - Position pos; if (target->GetDistance(GetCaster()) < 5.0f) { float o = frand(0, 2 * M_PI); - pos.Relocate(GetCaster()->GetPositionX() + 8.0f * cos(o), - GetCaster()->GetPositionY() + 8.0f * std::sin(o), - GetCaster()->GetPositionZ() + frand(2.0f, 5.0f)); + float z = GetCaster()->GetPositionZ() + frand(1.0f, 2.0f); + float safeDistance = RaycastToObstacle(GetCaster(), o, z, 10.0f); + float actualDistance = std::min(8.0f, safeDistance * 0.8f); + + pos.Relocate( + GetCaster()->GetPositionX() + actualDistance * cos(o), + GetCaster()->GetPositionY() + actualDistance * sin(o), + z + ); } else pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f); float speedXY = float(GetSpellInfo()->Effects[effIndex].MiscValue) * 0.1f; float speedZ = target->GetDistance(pos) / speedXY * 0.5f * Movement::gravity; - target->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ); } From 38ff8bae2803da83d0df7a1fadf7edf050ff9f6a Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Thu, 24 Apr 2025 00:59:32 +0200 Subject: [PATCH 14/53] fix(Core/Maps): Do not allow entering an instance if the player is (#21973) Co-authored-by: Gildor --- src/server/game/Maps/MapMgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Maps/MapMgr.cpp b/src/server/game/Maps/MapMgr.cpp index 34f371a67..f6e78a40a 100644 --- a/src/server/game/Maps/MapMgr.cpp +++ b/src/server/game/Maps/MapMgr.cpp @@ -214,6 +214,7 @@ Map::EnterState MapMgr::PlayerCannotEnter(uint32 mapid, Player* player, bool log else { LOG_DEBUG("maps", "Map::PlayerCannotEnter - player '{}' is dead but does not have a corpse!", player->GetName()); + return Map::CANNOT_ENTER_CORPSE_IN_DIFFERENT_INSTANCE; } } From dd43a0cfdf4e71850dc47cbce2348db1530a7895 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Thu, 24 Apr 2025 04:49:38 -0500 Subject: [PATCH 15/53] fix(Scripts/SunwellPlateau): Fix Entropius wrong spell ID and timers (#21970) --- .../EasternKingdoms/SunwellPlateau/boss_muru.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 0f3751f31..63f284452 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -45,7 +45,7 @@ enum Spells SPELL_ENTROPIUS_COSMETIC_SPAWN = 46223, SPELL_NEGATIVE_ENERGY_PERIODIC = 46284, SPELL_BLACK_HOLE = 46282, - SPELL_DARKNESS = 46268, + SPELL_DARKNESS = 46269, SPELL_SUMMON_DARK_FIEND_ENTROPIUS = 46263, //Black Hole Spells @@ -168,13 +168,13 @@ struct boss_entropius : public ScriptedAI void JustEngagedWith(Unit* /*who*/) override { - ScheduleTimedEvent(10s, [&] { + ScheduleTimedEvent(8s, 29s, [this]() { DoCastRandomTarget(SPELL_DARKNESS, 0, 50.0f, true, true); - }, 15s); + }, 8s, 29s); - ScheduleTimedEvent(15s, [&] { - DoCastRandomTarget(SPELL_BLACK_HOLE, 0, 50.0f, true, true); - }, 15s); + ScheduleTimedEvent(14s, 29s, [this]() { + DoCastRandomTarget(SPELL_BLACK_HOLE, 0, 50.0f, false, true); + }, 14s, 29s); } void JustDied(Unit* /*killer*/) override @@ -329,7 +329,7 @@ struct npc_singularity : public NullCreatureAI else { // No valid target found, check again soon - context.Repeat(1s); + context.Repeat(); } }); } From e6eb02a09e65ff78accdd19ad90641251dfaa14e Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Thu, 24 Apr 2025 19:05:06 +0000 Subject: [PATCH 16/53] fix (Script/SWP) use enrage function for brutallus enrage (#21987) --- .../EasternKingdoms/SunwellPlateau/boss_brutallus.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index f04d21333..e7937c622 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -85,6 +85,8 @@ struct boss_brutallus : public BossAI Talk(YELL_AGGRO); BossAI::JustEngagedWith(who); + ScheduleEnrageTimer(SPELL_BERSERK, 6min, YELL_BERSERK); + ScheduleTimedEvent(11s, [&] { DoCastVictim(SPELL_METEOR_SLASH); }, 12s); @@ -98,11 +100,6 @@ struct boss_brutallus : public BossAI if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, true, -SPELL_BURN_DAMAGE)) DoCast(target, SPELL_BURN); }, 20s); - - me->m_Events.AddEventAtOffset([&] { - DoCastSelf(SPELL_BERSERK, true); - Talk(YELL_BERSERK); - }, 6min); } void KilledUnit(Unit* victim) override From e84c837ae6c2983e6b98aac7a877b82856efe8c2 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Fri, 25 Apr 2025 03:44:20 -0300 Subject: [PATCH 17/53] fix(DB/SAI): Despawn Mu'ru Void Spawns on evade (#21989) --- data/sql/updates/pending_db_world/rev_1745536804631681300.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1745536804631681300.sql diff --git a/data/sql/updates/pending_db_world/rev_1745536804631681300.sql b/data/sql/updates/pending_db_world/rev_1745536804631681300.sql new file mode 100644 index 000000000..55cfefc83 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1745536804631681300.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 25824) 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 +(25824, 0, 2, 0, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Void Spawn - On Evade - Despawn Instant'); From d8d4999c3ec0289c9f340f3c86152f41902dbaa3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 25 Apr 2025 06:45:25 +0000 Subject: [PATCH 18/53] chore(DB): import pending files Referenced commit(s): e84c837ae6c2983e6b98aac7a877b82856efe8c2 --- .../rev_1745536804631681300.sql => db_world/2025_04_25_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1745536804631681300.sql => db_world/2025_04_25_00.sql} (94%) diff --git a/data/sql/updates/pending_db_world/rev_1745536804631681300.sql b/data/sql/updates/db_world/2025_04_25_00.sql similarity index 94% rename from data/sql/updates/pending_db_world/rev_1745536804631681300.sql rename to data/sql/updates/db_world/2025_04_25_00.sql index 55cfefc83..efe60b308 100644 --- a/data/sql/updates/pending_db_world/rev_1745536804631681300.sql +++ b/data/sql/updates/db_world/2025_04_25_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_20_01 -> 2025_04_25_00 -- DELETE FROM `smart_scripts` WHERE (`entryorguid` = 25824) 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 From e8453a19682a73ef81ebc2d23f917201e219c5f7 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Fri, 25 Apr 2025 10:12:07 -0500 Subject: [PATCH 19/53] fix(Scripts/SunwellPlateau): Make Kil'jaeden's Sinister Reflections clone the same player (#21949) --- .../SunwellPlateau/boss_kiljaeden.cpp | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index fc4abd434..69660f575 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -79,6 +79,10 @@ enum Spells SPELL_SINISTER_REFLECTION_SUMMON = 45891, SPELL_SINISTER_REFLECTION_CLASS = 45893, SPELL_SINISTER_REFLECTION_CLONE = 45785, + // TODO + // These should be applied to target of SPELL_SINISTER_REFLECTION but not implemented + //SPELL_SINISTER_COPY_WEAPON = 41054, + //SPELL_SINISTER_COPY_OFFHAND_WEAPON = 45205, // Misc SPELL_ANVEENA_ENERGY_DRAIN = 46410, @@ -270,9 +274,6 @@ struct boss_kiljaeden : public BossAI me->m_Events.AddEventAtOffset([&] { Talk(SAY_KJ_REFLECTION); me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); }, 1s); scheduler.Schedule(1s+200ms, [this](TaskContext) @@ -313,9 +314,6 @@ struct boss_kiljaeden : public BossAI me->m_Events.AddEventAtOffset([&] { Talk(SAY_KJ_REFLECTION); me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); }, 1s); scheduler.Schedule(1s + 200ms, [this](TaskContext) @@ -345,9 +343,6 @@ struct boss_kiljaeden : public BossAI me->m_Events.AddEventAtOffset([&] { Talk(SAY_KJ_REFLECTION); me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); - me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE); }, 1s); me->m_Events.AddEventAtOffset([&] { @@ -960,8 +955,14 @@ class spell_kiljaeden_sinister_reflection : public SpellScript PreventHitDefaultEffect(effIndex); if (Unit* target = GetHitUnit()) { - target->CastSpell(target, SPELL_SINISTER_REFLECTION_SUMMON, true); - //target->CastSpell(target, SPELL_SINISTER_REFLECTION_CLONE, true); + for (uint8 i = 0; i < 4; ++i) + { + target->CastSpell(target, SPELL_SINISTER_REFLECTION_SUMMON, true); + } + // TODO implement these auras + //target->AddAura(SPELL_SINISTER_COPY_WEAPON, target); + //target->AddAura(SPELL_SINISTER_COPY_OFFHAND_WEAPON, target); + target->CastSpell(target, SPELL_SINISTER_REFLECTION_CLONE, true); } } From 7a84999ef1deda5194e1e1654e4dfe02e07148ab Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Fri, 25 Apr 2025 16:16:48 -0500 Subject: [PATCH 20/53] fix(Scripts/SunwellPlateau): Make Blue Dragon Breath Haste apply 25% haste effect (#21984) Co-authored-by: Jelle Meeus --- .../sql/updates/pending_db_world/rev_1745497441690295560.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1745497441690295560.sql diff --git a/data/sql/updates/pending_db_world/rev_1745497441690295560.sql b/data/sql/updates/pending_db_world/rev_1745497441690295560.sql new file mode 100644 index 000000000..9af4508ad --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1745497441690295560.sql @@ -0,0 +1,5 @@ +-- blue dragon 25% haste aura +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 45856 AND `spell_effect` = 49725; +INSERT INTO `spell_linked_spell` +(`spell_trigger`, `spell_effect`, `type`, `comment`) +VALUES(45856, 49725, 1, 'Power of the Blue Flight - Breath: Haste'); From f35876968fcece87e903d6128bbe6b1e7aefa655 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 25 Apr 2025 21:17:54 +0000 Subject: [PATCH 21/53] chore(DB): import pending files Referenced commit(s): 7a84999ef1deda5194e1e1654e4dfe02e07148ab --- .../rev_1745497441690295560.sql => db_world/2025_04_25_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1745497441690295560.sql => db_world/2025_04_25_01.sql} (86%) diff --git a/data/sql/updates/pending_db_world/rev_1745497441690295560.sql b/data/sql/updates/db_world/2025_04_25_01.sql similarity index 86% rename from data/sql/updates/pending_db_world/rev_1745497441690295560.sql rename to data/sql/updates/db_world/2025_04_25_01.sql index 9af4508ad..e49b0fa7f 100644 --- a/data/sql/updates/pending_db_world/rev_1745497441690295560.sql +++ b/data/sql/updates/db_world/2025_04_25_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_25_00 -> 2025_04_25_01 -- blue dragon 25% haste aura DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 45856 AND `spell_effect` = 49725; INSERT INTO `spell_linked_spell` From b8b5a4ea1c969c1a5dd09c42900f0010a8553a53 Mon Sep 17 00:00:00 2001 From: Quentin Dawans Date: Sat, 26 Apr 2025 01:20:37 +0200 Subject: [PATCH 22/53] chore(Core/Auth): align mysql ping log level and name to worldserver (#21986) --- src/server/apps/authserver/Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/apps/authserver/Main.cpp b/src/server/apps/authserver/Main.cpp index 903a12134..e9ed0119f 100644 --- a/src/server/apps/authserver/Main.cpp +++ b/src/server/apps/authserver/Main.cpp @@ -246,7 +246,7 @@ void KeepDatabaseAliveHandler(std::weak_ptr dbPingTim { if (std::shared_ptr dbPingTimer = dbPingTimerRef.lock()) { - LOG_INFO("server.authserver", "Ping MySQL to keep connection alive"); + LOG_DEBUG("sql.driver", "Ping MySQL to keep connection alive"); LoginDatabase.KeepAlive(); dbPingTimer->expires_at(Acore::Asio::SteadyTimer::GetExpirationTime(dbPingInterval)); From d23e61b7219d7bae1aea36a63b860372c9f00173 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:24:35 -0500 Subject: [PATCH 23/53] fix(SmartAI): Ensure immediate combat engagement (#21854) NPCs will stop their current waypoint and start combat. --- src/server/game/AI/SmartScripts/SmartAI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 55ebd43d1..d48cf2681 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -848,6 +848,7 @@ void SmartAI::AttackStart(Unit* who) { me->GetMotionMaster()->MovementExpired(); me->StopMoving(); + me->GetMotionMaster()->Clear(false); } me->GetMotionMaster()->MoveChase(who); From da55f05cfc2db9bb49a37cd0b3697bbda565856a Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Sat, 26 Apr 2025 14:31:30 -0400 Subject: [PATCH 24/53] refactor(Core/WorldState): Initial addition of world state definition file. (#21875) Many world states had their enums from script's header and hardcoded values to their respective header file (WorldStateDefines.h) Co-authored-by: Jelle Meeus --- .../game/Battlefield/Zones/BattlefieldWG.cpp | 69 +- .../game/Battlefield/Zones/BattlefieldWG.h | 47 +- src/server/game/Battlegrounds/Arena.cpp | 9 +- src/server/game/Battlegrounds/Arena.h | 6 - .../game/Battlegrounds/BattlegroundMgr.cpp | 5 +- .../Battlegrounds/Zones/BattlegroundAB.cpp | 41 +- .../game/Battlegrounds/Zones/BattlegroundAB.h | 40 - .../Battlegrounds/Zones/BattlegroundAV.cpp | 18 +- .../game/Battlegrounds/Zones/BattlegroundAV.h | 148 +--- .../Battlegrounds/Zones/BattlegroundBE.cpp | 3 +- .../Battlegrounds/Zones/BattlegroundDS.cpp | 3 +- .../Battlegrounds/Zones/BattlegroundEY.cpp | 62 +- .../game/Battlegrounds/Zones/BattlegroundEY.h | 36 +- .../Battlegrounds/Zones/BattlegroundIC.cpp | 14 +- .../game/Battlegrounds/Zones/BattlegroundIC.h | 89 +- .../Battlegrounds/Zones/BattlegroundNA.cpp | 3 +- .../Battlegrounds/Zones/BattlegroundRL.cpp | 3 +- .../Battlegrounds/Zones/BattlegroundRV.cpp | 3 +- .../game/Battlegrounds/Zones/BattlegroundRV.h | 4 - .../Battlegrounds/Zones/BattlegroundSA.cpp | 126 +-- .../game/Battlegrounds/Zones/BattlegroundSA.h | 42 +- .../Battlegrounds/Zones/BattlegroundWS.cpp | 25 +- .../game/Battlegrounds/Zones/BattlegroundWS.h | 11 - src/server/game/Entities/Player/Player.cpp | 772 +++++++++--------- .../game/Tools/CharacterDatabaseCleaner.cpp | 5 +- src/server/game/World/World.cpp | 37 +- src/server/game/World/World.h | 12 - src/server/game/World/WorldState.cpp | 1 + src/server/game/World/WorldState.h | 18 - src/server/game/World/WorldStateDefines.h | 622 ++++++++++++++ .../ScarletEnclave/chapter5.cpp | 52 +- .../ZulAman/instance_zulaman.cpp | 21 +- .../EasternKingdoms/zone_undercity.cpp | 84 +- .../CavernsOfTime/BattleForMountHyjal/hyjal.h | 7 - .../BattleForMountHyjal/instance_hyjal.cpp | 17 +- .../culling_of_stratholme.cpp | 7 +- .../culling_of_stratholme.h | 9 - .../instance_culling_of_stratholme.cpp | 29 +- .../instance_old_hillsbrad.cpp | 7 +- .../EscapeFromDurnholdeKeep/old_hillsbrad.h | 1 - .../instance_the_black_morass.cpp | 23 +- .../TheBlackMorass/the_black_morass.h | 7 - .../RubySanctum/boss_halion.cpp | 11 +- .../RubySanctum/instance_ruby_sanctum.cpp | 13 +- .../RubySanctum/ruby_sanctum.h | 7 - .../instance_trial_of_the_crusader.cpp | 11 +- .../trial_of_the_crusader.h | 6 - .../HallsOfReflection/halls_of_reflection.h | 6 - .../instance_halls_of_reflection.cpp | 11 +- .../IcecrownCitadel/icecrown_citadel.h | 9 - .../instance_icecrown_citadel.cpp | 31 +- .../Nexus/Oculus/instance_oculus.cpp | 17 +- .../scripts/Northrend/Nexus/Oculus/oculus.h | 6 - .../Ulduar/Ulduar/instance_ulduar.cpp | 17 +- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 4 - .../VioletHold/instance_violet_hold.cpp | 23 +- .../Northrend/VioletHold/violet_hold.h | 7 - .../scripts/Northrend/zone_wintergrasp.cpp | 2 +- .../scripts/OutdoorPvP/OutdoorPvPEP.cpp | 201 ++--- src/server/scripts/OutdoorPvP/OutdoorPvPEP.h | 46 -- .../scripts/OutdoorPvP/OutdoorPvPGH.cpp | 27 +- src/server/scripts/OutdoorPvP/OutdoorPvPGH.h | 4 - .../scripts/OutdoorPvP/OutdoorPvPHP.cpp | 48 +- src/server/scripts/OutdoorPvP/OutdoorPvPHP.h | 20 +- .../scripts/OutdoorPvP/OutdoorPvPNA.cpp | 187 ++--- src/server/scripts/OutdoorPvP/OutdoorPvPNA.h | 38 - .../scripts/OutdoorPvP/OutdoorPvPSI.cpp | 19 +- src/server/scripts/OutdoorPvP/OutdoorPvPSI.h | 7 - .../scripts/OutdoorPvP/OutdoorPvPTF.cpp | 116 +-- src/server/scripts/OutdoorPvP/OutdoorPvPTF.h | 29 +- .../scripts/OutdoorPvP/OutdoorPvPZM.cpp | 83 +- src/server/scripts/OutdoorPvP/OutdoorPvPZM.h | 35 - src/server/scripts/World/npcs_special.cpp | 38 +- 73 files changed, 1828 insertions(+), 1789 deletions(-) create mode 100644 src/server/game/World/WorldStateDefines.h diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 0184386c8..3fe96fc42 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -30,6 +30,7 @@ #include "Vehicle.h" #include "WorldSession.h" #include "WorldSessionMgr.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" BattlefieldWG::~BattlefieldWG() @@ -80,17 +81,17 @@ bool BattlefieldWG::SetupBattlefield() SetGraveyardNumber(BATTLEFIELD_WG_GRAVEYARD_MAX); // Load from db - if (!sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) && - !sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) && + if (!sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_ACTIVE) && + !sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_DEFENDER) && !sWorld->getWorldState(ClockWorldState[0])) { - sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, uint64(false)); - sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, uint64(urand(0, 1))); + sWorld->setWorldState(WORLD_STATE_BATTLEFIELD_WG_ACTIVE, uint64(false)); + sWorld->setWorldState(WORLD_STATE_BATTLEFIELD_WG_DEFENDER, uint64(urand(0, 1))); sWorld->setWorldState(ClockWorldState[0], uint64(m_NoWarBattleTime)); } - m_isActive = bool(sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE)); - m_DefenderTeam = TeamId(sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER)); + m_isActive = bool(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_ACTIVE)); + m_DefenderTeam = TeamId(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_DEFENDER)); m_Timer = sWorld->getWorldState(ClockWorldState[0]); if (m_isActive) @@ -194,8 +195,8 @@ bool BattlefieldWG::Update(uint32 diff) bool m_return = Battlefield::Update(diff); if (m_saveTimer <= diff) { - sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, m_isActive); - sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, m_DefenderTeam); + sWorld->setWorldState(WORLD_STATE_BATTLEFIELD_WG_ACTIVE, m_isActive); + sWorld->setWorldState(WORLD_STATE_BATTLEFIELD_WG_DEFENDER, m_DefenderTeam); sWorld->setWorldState(ClockWorldState[0], m_Timer); m_saveTimer = 60 * IN_MILLISECONDS; } @@ -327,10 +328,10 @@ void BattlefieldWG::UpdateVehicleCountWG() for (GuidUnorderedSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(*itr)) { - player->SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H)); - player->SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H)); - player->SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A)); - player->SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A)); + player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H)); + player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H)); + player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A)); + player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A)); } } @@ -488,14 +489,14 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) if (!endByTimer) // win alli/horde { - uint32 const worldStateId = GetDefenderTeam() == TEAM_ALLIANCE ? WORLDSTATE_ALLIANCE_KEEP_CAPTURED : WORLDSTATE_HORDE_KEEP_CAPTURED; + uint32 const worldStateId = GetDefenderTeam() == TEAM_ALLIANCE ? WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_CAPTURED : WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_CAPTURED; sWorld->setWorldState(worldStateId, sWorld->getWorldState(worldStateId) + 1); SendWarning((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_WIN_KEEP : (BATTLEFIELD_WG_TEXT_WIN_KEEP + 2)); } else // defend alli/horde { - uint32 const worldStateId = GetDefenderTeam() == TEAM_ALLIANCE ? WORLDSTATE_ALLIANCE_KEEP_DEFENDED : WORLDSTATE_HORDE_KEEP_DEFENDED; + uint32 const worldStateId = GetDefenderTeam() == TEAM_ALLIANCE ? WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_DEFENDED : WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_DEFENDED; sWorld->setWorldState(worldStateId, sWorld->getWorldState(worldStateId) + 1); SendWarning((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_DEFEND_KEEP : (BATTLEFIELD_WG_TEXT_DEFEND_KEEP + 2)); @@ -941,27 +942,27 @@ void BattlefieldWG::FillInitialWorldStates(WorldPackets::WorldState::InitWorldSt bool iconActive = timer < 15 * MINUTE || IsWarTime(); packet.Worldstates.reserve(4+4+WG_MAX_OBJ+WG_MAX_WORKSHOP); - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ATTACKER, GetAttackerTeam()); - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, GetDefenderTeam()); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ATTACKER, GetAttackerTeam()); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_DEFENDER, GetDefenderTeam()); // Note: cleanup these two, their names look awkward - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, IsWarTime() ? 0 : 1); - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE, IsWarTime() ? 1 : 0); - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_CONTROL, m_DefenderTeam == TEAM_ALLIANCE ? 2 : 1); // Alliance 2, Hord 1 - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ICON_ACTIVE, iconActive ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ACTIVE, IsWarTime() ? 0 : 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_SHOW, IsWarTime() ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_CONTROL, m_DefenderTeam == TEAM_ALLIANCE ? 2 : 1); // Alliance 2, Hord 1 + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ICON_ACTIVE, iconActive ? 1 : 0); for (uint32 i = 0; i < 2; ++i) packet.Worldstates.emplace_back(ClockWorldState[i], GameTime::GetGameTime().count() + timer); - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H)); - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H)); - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A)); - packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A)); - packet.Worldstates.emplace_back(WORLDSTATE_ALLIANCE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_DEFENDED))); - packet.Worldstates.emplace_back(WORLDSTATE_HORDE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_CAPTURED))); - packet.Worldstates.emplace_back(WORLDSTATE_HORDE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_DEFENDED))); - packet.Worldstates.emplace_back(WORLDSTATE_ALLIANCE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_CAPTURED))); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_DEFENDED))); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_CAPTURED))); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_DEFENDED))); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_CAPTURED))); for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr) packet.Worldstates.emplace_back((*itr)->m_WorldState, (*itr)->m_State); @@ -995,12 +996,12 @@ void BattlefieldWG::SendUpdateWorldStates(Player* player) uint32 timer = GetTimer() / 1000; bool iconActive = timer < 15 * MINUTE || IsWarTime(); - SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_ATTACKER, GetAttackerTeam(), player); - SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, GetDefenderTeam(), player); - SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, IsWarTime() ? 0 : 1, player); - SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE, IsWarTime() ? 1 : 0, player); - SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_CONTROL, GetDefenderTeam() == TEAM_ALLIANCE ? 2 : 1, player); - SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_ICON_ACTIVE, iconActive ? 1 : 0, player); + SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_ATTACKER, GetAttackerTeam(), player); + SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_DEFENDER, GetDefenderTeam(), player); + SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_ACTIVE, IsWarTime() ? 0 : 1, player); + SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_SHOW, IsWarTime() ? 1 : 0, player); + SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_CONTROL, GetDefenderTeam() == TEAM_ALLIANCE ? 2 : 1, player); + SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_ICON_ACTIVE, iconActive ? 1 : 0, player); for (uint32 i = 0; i < 2; ++i) SendUpdateWorldStateMessage(ClockWorldState[i], uint32(GameTime::GetGameTime().count() + timer), player); diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 525fcd399..a3217a006 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -21,6 +21,7 @@ #include "Battlefield.h" #include "Log.h" #include "World.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" class Group; @@ -36,9 +37,9 @@ typedef std::set Workshop; typedef std::set GroupSet; //typedef std::set CapturePointSet; unused ? -uint32 const VehNumWorldState[2] = { 3680, 3490 }; -uint32 const MaxVehNumWorldState[2] = { 3681, 3491 }; -uint32 const ClockWorldState[2] = { 3781, 4354 }; +uint32 const VehNumWorldState[2] = { WORLD_STATE_BATTLEFIELD_WG_VEHICLE_A, WORLD_STATE_BATTLEFIELD_WG_VEHICLE_H }; +uint32 const MaxVehNumWorldState[2] = { WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_A, WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_H }; +uint32 const ClockWorldState[2] = { WORLD_STATE_BATTLEFIELD_WG_CLOCK, WORLD_STATE_BATTLEFIELD_WG_CLOCK_TEXTS }; uint32 const WintergraspFaction[3] = { 1, 2, 35 }; float const WintergraspStalkerPos[4] = { 4948.985f, 2937.789f, 550.5172f, 1.815142f }; @@ -99,20 +100,6 @@ enum WintergraspData BATTLEFIELD_WG_DATA_MAX, }; -enum WintergraspWorldStates -{ - BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H = 3490, - BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H = 3491, - BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A = 3680, - BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A = 3681, - BATTLEFIELD_WG_WORLD_STATE_ACTIVE = 3801, - BATTLEFIELD_WG_WORLD_STATE_DEFENDER = 3802, - BATTLEFIELD_WG_WORLD_STATE_ATTACKER = 3803, - BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE = 3710, - BATTLEFIELD_WG_WORLD_STATE_CONTROL = 3804, // Shows on the map who controls WG - BATTLEFIELD_WG_WORLD_STATE_ICON_ACTIVE = 4375, // Activates "ice" icon -}; - enum WintergraspAreaIds { BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp @@ -522,20 +509,6 @@ enum WintergraspWorkshopIds BATTLEFIELD_WG_WORKSHOP_KEEP_EAST, }; -enum WintergraspWorldstates -{ - WORLDSTATE_WORKSHOP_NE = 3701, - WORLDSTATE_WORKSHOP_NW = 3700, - WORLDSTATE_WORKSHOP_SE = 3703, - WORLDSTATE_WORKSHOP_SW = 3702, - WORLDSTATE_WORKSHOP_K_W = 3698, - WORLDSTATE_WORKSHOP_K_E = 3699, - WORLDSTATE_HORDE_KEEP_CAPTURED = 4022, - WORLDSTATE_HORDE_KEEP_DEFENDED = 4024, - WORLDSTATE_ALLIANCE_KEEP_CAPTURED = 4023, - WORLDSTATE_ALLIANCE_KEEP_DEFENDED = 4025, -}; - /// @todo: Handle this with creature_text ? enum eWGText { @@ -1079,17 +1052,17 @@ struct WGWorkshopData WGWorkshopData const WorkshopsData[WG_MAX_WORKSHOP] = { // NE - {BATTLEFIELD_WG_WORKSHOP_NE, WORLDSTATE_WORKSHOP_NE, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN}, + {BATTLEFIELD_WG_WORKSHOP_NE, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_NE, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN}, // NW - {BATTLEFIELD_WG_WORKSHOP_NW, WORLDSTATE_WORKSHOP_NW, BATTLEFIELD_WG_TEXT_WORKSHOP_NW_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_NW_TAKEN}, + {BATTLEFIELD_WG_WORKSHOP_NW, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_NW, BATTLEFIELD_WG_TEXT_WORKSHOP_NW_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_NW_TAKEN}, // SE - {BATTLEFIELD_WG_WORKSHOP_SE, WORLDSTATE_WORKSHOP_SE, BATTLEFIELD_WG_TEXT_WORKSHOP_SE_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_SE_TAKEN}, + {BATTLEFIELD_WG_WORKSHOP_SE, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_SE, BATTLEFIELD_WG_TEXT_WORKSHOP_SE_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_SE_TAKEN}, // SW - {BATTLEFIELD_WG_WORKSHOP_SW, WORLDSTATE_WORKSHOP_SW, BATTLEFIELD_WG_TEXT_WORKSHOP_SW_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_SW_TAKEN}, + {BATTLEFIELD_WG_WORKSHOP_SW, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_SW, BATTLEFIELD_WG_TEXT_WORKSHOP_SW_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_SW_TAKEN}, // KEEP WEST - It can't be taken - {BATTLEFIELD_WG_WORKSHOP_KEEP_WEST, WORLDSTATE_WORKSHOP_K_W, 0, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN}, + {BATTLEFIELD_WG_WORKSHOP_KEEP_WEST, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_K_W, 0, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN}, // KEEP EAST - It can't be taken - {BATTLEFIELD_WG_WORKSHOP_KEEP_EAST, WORLDSTATE_WORKSHOP_K_E, 0, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN} + {BATTLEFIELD_WG_WORKSHOP_KEEP_EAST, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_K_E, 0, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN} }; // ******************************************************************** diff --git a/src/server/game/Battlegrounds/Arena.cpp b/src/server/game/Battlegrounds/Arena.cpp index 2fd0f863d..d3e70fc31 100644 --- a/src/server/game/Battlegrounds/Arena.cpp +++ b/src/server/game/Battlegrounds/Arena.cpp @@ -26,6 +26,7 @@ #include "World.h" #include "WorldSession.h" #include "WorldSessionMgr.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" void ArenaScore::AppendToPacket(WorldPacket& data) @@ -150,14 +151,14 @@ void Arena::RemovePlayer(Player* /*player*/) void Arena::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(2); - packet.Worldstates.emplace_back(ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE)); - packet.Worldstates.emplace_back(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(WORLD_STATE_ARENA_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE)); + packet.Worldstates.emplace_back(WORLD_STATE_ARENA_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE)); } void Arena::UpdateArenaWorldState() { - UpdateWorldState(ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE)); - UpdateWorldState(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE)); + UpdateWorldState(WORLD_STATE_ARENA_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE)); + UpdateWorldState(WORLD_STATE_ARENA_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE)); } void Arena::HandleKillPlayer(Player* player, Player* killer) diff --git a/src/server/game/Battlegrounds/Arena.h b/src/server/game/Battlegrounds/Arena.h index 346d30e7a..165e2dc8e 100644 --- a/src/server/game/Battlegrounds/Arena.h +++ b/src/server/game/Battlegrounds/Arena.h @@ -38,12 +38,6 @@ enum ArenaSpellIds SPELL_LAST_MAN_STANDING = 26549 // Achievement Credit }; -enum ArenaWorldStates -{ - ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN = 3600, - ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD = 3601 -}; - class AC_GAME_API Arena : public Battleground { protected: diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 46bac265d..e8bc14d99 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -47,6 +47,7 @@ #include "SharedDefines.h" #include "World.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" #include bool BattlegroundTemplate::IsArena() const @@ -182,7 +183,7 @@ void BattlegroundMgr::Update(uint32 diff) { sArenaTeamMgr->DistributeArenaPoints(); m_NextAutoDistributionTime = GameTime::GetGameTime() + Seconds(DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS)); - sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, m_NextAutoDistributionTime.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_ARENA_DISTRIBUTION_TIME, m_NextAutoDistributionTime.count()); } m_AutoDistributionTimeChecker = 600000; // 10 minutes check } @@ -561,7 +562,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution() if (!sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) return; - Seconds wstime = Seconds(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME)); + Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_ARENA_DISTRIBUTION_TIME)); Seconds curtime = GameTime::GetGameTime(); LOG_INFO("server.loading", "Initializing Automatic Arena Point Distribution"); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index b105cb27e..6b1b58c81 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -24,6 +24,7 @@ #include "WorldPacket.h" #include "WorldSession.h" #include "WorldStatePackets.h" +#include "WorldStateDefines.h" void BattlegroundABScore::BuildObjectivesBlock(WorldPacket& data) { @@ -129,7 +130,7 @@ void BattlegroundAB::PostUpdateImpl(uint32 diff) } } - UpdateWorldState(teamId == TEAM_ALLIANCE ? BG_AB_OP_RESOURCES_ALLY : BG_AB_OP_RESOURCES_HORDE, m_TeamScores[teamId]); + UpdateWorldState(teamId == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_AB_RESOURCES_ALLIANCE : WORLD_STATE_BATTLEGROUND_AB_RESOURCES_HORDE, m_TeamScores[teamId]); if (m_TeamScores[teamId] > m_TeamScores[GetOtherTeamId(teamId)] + 500) _teamScores500Disadvantage[GetOtherTeamId(teamId)] = true; if (m_TeamScores[teamId] >= static_cast(_configurableMaxTeamScore)) @@ -247,13 +248,13 @@ void BattlegroundAB::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS packet.Worldstates.emplace_back(node._iconCapture + i - 1, node._state == i ? 1 : 0); } - packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_ALLY, _controlledPoints[TEAM_ALLIANCE]); - packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]); - packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_MAX, _configurableMaxTeamScore); - packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE); - packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[TEAM_ALLIANCE]); - packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_HORDE, m_TeamScores[TEAM_HORDE]); - packet.Worldstates.emplace_back(0x745, 2); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_ALLIANCE, _controlledPoints[TEAM_ALLIANCE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_MAX, _configurableMaxTeamScore); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_ALLIANCE, m_TeamScores[TEAM_ALLIANCE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_HORDE, m_TeamScores[TEAM_HORDE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_UNK, 2); } void BattlegroundAB::SendNodeUpdate(uint8 node) @@ -262,8 +263,8 @@ void BattlegroundAB::SendNodeUpdate(uint8 node) for (uint8 i = BG_AB_NODE_STATE_ALLY_OCCUPIED; i <= BG_AB_NODE_STATE_HORDE_CONTESTED; ++i) UpdateWorldState(_capturePointInfo[node]._iconCapture + i - 1, _capturePointInfo[node]._state == i); - UpdateWorldState(BG_AB_OP_OCCUPIED_BASES_ALLY, _controlledPoints[TEAM_ALLIANCE]); - UpdateWorldState(BG_AB_OP_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_ALLIANCE, _controlledPoints[TEAM_ALLIANCE]); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]); } void BattlegroundAB::NodeOccupied(uint8 node) @@ -470,16 +471,16 @@ void BattlegroundAB::Init() _honorTics = BattlegroundMgr::IsBGWeekend(GetBgTypeID(true)) ? BG_AB_HONOR_TICK_WEEKEND : BG_AB_HONOR_TICK_NORMAL; _reputationTics = BattlegroundMgr::IsBGWeekend(GetBgTypeID(true)) ? BG_AB_REP_TICK_WEEKEND : BG_AB_REP_TICK_NORMAL; - _capturePointInfo[BG_AB_NODE_STABLES]._iconNone = BG_AB_OP_STABLE_ICON; - _capturePointInfo[BG_AB_NODE_FARM]._iconNone = BG_AB_OP_FARM_ICON; - _capturePointInfo[BG_AB_NODE_BLACKSMITH]._iconNone = BG_AB_OP_BLACKSMITH_ICON; - _capturePointInfo[BG_AB_NODE_LUMBER_MILL]._iconNone = BG_AB_OP_LUMBERMILL_ICON; - _capturePointInfo[BG_AB_NODE_GOLD_MINE]._iconNone = BG_AB_OP_GOLDMINE_ICON; - _capturePointInfo[BG_AB_NODE_STABLES]._iconCapture = BG_AB_OP_STABLE_STATE_ALIENCE; - _capturePointInfo[BG_AB_NODE_FARM]._iconCapture = BG_AB_OP_FARM_STATE_ALIENCE; - _capturePointInfo[BG_AB_NODE_BLACKSMITH]._iconCapture = BG_AB_OP_BLACKSMITH_STATE_ALIENCE; - _capturePointInfo[BG_AB_NODE_LUMBER_MILL]._iconCapture = BG_AB_OP_LUMBERMILL_STATE_ALIENCE; - _capturePointInfo[BG_AB_NODE_GOLD_MINE]._iconCapture = BG_AB_OP_GOLDMINE_STATE_ALIENCE; + _capturePointInfo[BG_AB_NODE_STABLES]._iconNone = WORLD_STATE_BATTLEGROUND_AB_STABLE_ICON; + _capturePointInfo[BG_AB_NODE_FARM]._iconNone = WORLD_STATE_BATTLEGROUND_AB_FARM_ICON; + _capturePointInfo[BG_AB_NODE_BLACKSMITH]._iconNone = WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_ICON; + _capturePointInfo[BG_AB_NODE_LUMBER_MILL]._iconNone = WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_ICON; + _capturePointInfo[BG_AB_NODE_GOLD_MINE]._iconNone = WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_ICON; + _capturePointInfo[BG_AB_NODE_STABLES]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_ALLIANCE; + _capturePointInfo[BG_AB_NODE_FARM]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_ALLIANCE; + _capturePointInfo[BG_AB_NODE_BLACKSMITH]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_ALLIANCE; + _capturePointInfo[BG_AB_NODE_LUMBER_MILL]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_ALLIANCE; + _capturePointInfo[BG_AB_NODE_GOLD_MINE]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_ALLIANCE; uint32 bgArathiCapturePointsConfig = sWorld->getIntConfig(CONFIG_BATTLEGROUND_ARATHI_CAPTUREPOINTS); _configurableMaxTeamScore = bgArathiCapturePointsConfig > 0 diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 2dfbc0f49..3a100b0fb 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -40,46 +40,6 @@ enum BG_AB_Events BG_AB_EVENT_HORDE_TICK = 12 }; -enum BG_AB_WorldStates -{ - BG_AB_OP_OCCUPIED_BASES_HORDE = 1778, - BG_AB_OP_OCCUPIED_BASES_ALLY = 1779, - BG_AB_OP_RESOURCES_ALLY = 1776, - BG_AB_OP_RESOURCES_HORDE = 1777, - BG_AB_OP_RESOURCES_MAX = 1780, - BG_AB_OP_RESOURCES_WARNING = 1955, - - BG_AB_OP_STABLE_ICON = 1842, //Stable map icon (NONE) - BG_AB_OP_STABLE_STATE_ALIENCE = 1767, //Stable map state (ALIENCE) - BG_AB_OP_STABLE_STATE_HORDE = 1768, //Stable map state (HORDE) - BG_AB_OP_STABLE_STATE_CON_ALI = 1769, //Stable map state (CON ALIENCE) - BG_AB_OP_STABLE_STATE_CON_HOR = 1770, //Stable map state (CON HORDE) - - BG_AB_OP_FARM_ICON = 1845, //Farm map icon (NONE) - BG_AB_OP_FARM_STATE_ALIENCE = 1772, //Farm state (ALIENCE) - BG_AB_OP_FARM_STATE_HORDE = 1773, //Farm state (HORDE) - BG_AB_OP_FARM_STATE_CON_ALI = 1774, //Farm state (CON ALIENCE) - BG_AB_OP_FARM_STATE_CON_HOR = 1775, //Farm state (CON HORDE) - - BG_AB_OP_BLACKSMITH_ICON = 1846, //Blacksmith map icon (NONE) - BG_AB_OP_BLACKSMITH_STATE_ALIENCE = 1782, //Blacksmith map state (ALIENCE) - BG_AB_OP_BLACKSMITH_STATE_HORDE = 1783, //Blacksmith map state (HORDE) - BG_AB_OP_BLACKSMITH_STATE_CON_ALI = 1784, //Blacksmith map state (CON ALIENCE) - BG_AB_OP_BLACKSMITH_STATE_CON_HOR = 1785, //Blacksmith map state (CON HORDE) - - BG_AB_OP_LUMBERMILL_ICON = 1844, //Lumber Mill map icon (NONE) - BG_AB_OP_LUMBERMILL_STATE_ALIENCE = 1792, //Lumber Mill map state (ALIENCE) - BG_AB_OP_LUMBERMILL_STATE_HORDE = 1793, //Lumber Mill map state (HORDE) - BG_AB_OP_LUMBERMILL_STATE_CON_ALI = 1794, //Lumber Mill map state (CON ALIENCE) - BG_AB_OP_LUMBERMILL_STATE_CON_HOR = 1795, //Lumber Mill map state (CON HORDE) - - BG_AB_OP_GOLDMINE_ICON = 1843, //Gold Mine map icon (NONE) - BG_AB_OP_GOLDMINE_STATE_ALIENCE = 1787, //Gold Mine map state (ALIENCE) - BG_AB_OP_GOLDMINE_STATE_HORDE = 1788, //Gold Mine map state (HORDE) - BG_AB_OP_GOLDMINE_STATE_CON_ALI = 1789, //Gold Mine map state (CON ALIENCE - BG_AB_OP_GOLDMINE_STATE_CON_HOR = 1790, //Gold Mine map state (CON HORDE) -}; - enum BG_AB_ObjectIds { BG_AB_OBJECTID_NODE_BANNER_0 = 180087, // Stables banner diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 99dbfd11c..433601b42 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -272,7 +272,7 @@ void BattlegroundAV::UpdateScore(TeamId teamId, int16 points) //note: to remove reinforcementpoints points must be negative, for adding reinforcements points must be positive m_Team_Scores[teamId] += points; - UpdateWorldState(((teamId == TEAM_HORDE) ? AV_Horde_Score : AV_Alliance_Score), m_Team_Scores[teamId]); + UpdateWorldState(((teamId == TEAM_HORDE) ? WORLD_STATE_BATTLEGROUND_AV_HORDE_SCORE : WORLD_STATE_BATTLEGROUND_AV_ALLIANCE_SCORE), m_Team_Scores[teamId]); if (points < 0) { if (m_Team_Scores[teamId] < 1) @@ -480,8 +480,8 @@ void BattlegroundAV::StartingEventOpenDoors() if (BG_AV_SCORE_INITIAL_POINTS > 0) // display teamscores on top only if reinforcements are enabled { - UpdateWorldState(AV_SHOW_H_SCORE, 1); - UpdateWorldState(AV_SHOW_A_SCORE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_AV_SHOW_HORDE_SCORE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_AV_SHOW_ALLIANCE_SCORE, 1); } DoorOpen(BG_AV_OBJECT_DOOR_H); @@ -1118,14 +1118,14 @@ void BattlegroundAV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS } if (m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].OwnerId == TEAM_NEUTRAL) //cause neutral teams aren't handled generic { - packet.Worldstates.emplace_back(AV_SNOWFALL_N, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_N, 1); } - packet.Worldstates.emplace_back(AV_Alliance_Score, m_Team_Scores[0]); - packet.Worldstates.emplace_back(AV_Horde_Score, m_Team_Scores[1]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ALLIANCE_SCORE, m_Team_Scores[0]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_HORDE_SCORE, m_Team_Scores[1]); - packet.Worldstates.emplace_back(AV_SHOW_A_SCORE, GetStatus() == STATUS_IN_PROGRESS && BG_AV_SCORE_INITIAL_POINTS > 0 ? 1 : 0); - packet.Worldstates.emplace_back(AV_SHOW_H_SCORE, GetStatus() == STATUS_IN_PROGRESS && BG_AV_SCORE_INITIAL_POINTS > 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SHOW_ALLIANCE_SCORE, GetStatus() == STATUS_IN_PROGRESS && BG_AV_SCORE_INITIAL_POINTS > 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SHOW_HORDE_SCORE, GetStatus() == STATUS_IN_PROGRESS && BG_AV_SCORE_INITIAL_POINTS > 0 ? 1 : 0); SendMineWorldStates(AV_NORTH_MINE); SendMineWorldStates(AV_SOUTH_MINE); @@ -1158,7 +1158,7 @@ void BattlegroundAV::UpdateNodeWorldState(BG_AV_Nodes node) { UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].State, m_Nodes[node].OwnerId)], 1); if (m_Nodes[node].PrevOwnerId == TEAM_NEUTRAL) //currently only snowfall is supported as neutral node (i don't want to make an extra row (neutral states) in worldstatesarray just for one node - UpdateWorldState(AV_SNOWFALL_N, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_N, 0); else UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].PrevState, m_Nodes[node].PrevOwnerId)], 0); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index a9b9ada7e..d65fb8a86 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -20,6 +20,7 @@ #include "Battleground.h" #include "BattlegroundScore.h" +#include "WorldStateDefines.h" #define BG_AV_CAPTIME 240000 //4:00 #define BG_AV_SNOWFALL_FIRSTCAP 300000 //5:00 but i also have seen 4:05 @@ -1548,159 +1549,46 @@ enum BG_AV_States POINT_CONTROLED = 3 }; -enum BG_AV_WorldStates -{ - AV_Alliance_Score = 3127, - AV_Horde_Score = 3128, - AV_SHOW_H_SCORE = 3133, - AV_SHOW_A_SCORE = 3134, - - /* - //the comments behind the state shows which icon overlaps the other.. but is, until now, unused and maybe not a good solution (but give few performance (:) - - // Graves - - // Alliance - //Stormpike first aid station - AV_AID_A_C = 1325, - AV_AID_A_A = 1326, - AV_AID_H_C = 1327, - AV_AID_H_A = 1328, - //Stormpike Graveyard - AV_PIKEGRAVE_A_C = 1333, - AV_PIKEGRAVE_A_A = 1335, - AV_PIKEGRAVE_H_C = 1334, - AV_PIKEGRAVE_H_A = 1336, - //Stoneheart Grave - AV_STONEHEART_A_C = 1302, - AV_STONEHEART_A_A = 1304, //over hc - AV_STONEHEART_H_C = 1301, //over ac - AV_STONEHEART_H_A = 1303, //over aa - //Neutral - //Snowfall Grave - */ - AV_SNOWFALL_N = 1966, //over aa - /* - AV_SNOWFALL_A_C = 1341, //over hc - AV_SNOWFALL_A_A = 1343, //over ha - AV_SNOWFALL_H_C = 1342, - AV_SNOWFALL_H_A = 1344, //over ac - //Horde - //Iceblood grave - AV_ICEBLOOD_A_C = 1346, //over hc - AV_ICEBLOOD_A_A = 1348, //over ac - AV_ICEBLOOD_H_C = 1347, - AV_ICEBLOOD_H_A = 1349, //over aa - //Frostwolf Grave - AV_FROSTWOLF_A_C = 1337, //over hc - AV_FROSTWOLF_A_A = 1339, //over ac - AV_FROSTWOLF_H_C = 1338, - AV_FROSTWOLF_H_A = 1340, //over aa - //Frostwolf Hut - AV_FROSTWOLFHUT_A_C = 1329, //over hc - AV_FROSTWOLFHUT_A_A = 1331, //over ha - AV_FROSTWOLFHUT_H_C = 1330, - AV_FROSTWOLFHUT_H_A = 1332, //over ac - - //Towers - //Alliance - //Dunbaldar South Bunker - AV_DUNS_CONTROLLED = 1361, - AV_DUNS_DESTROYED = 1370, - AV_DUNS_ASSAULTED = 1378, - //Dunbaldar North Bunker - AV_DUNN_CONTROLLED = 1362, - AV_DUNN_DESTROYED = 1371, - AV_DUNN_ASSAULTED = 1379, - //Icewing Bunker - AV_ICEWING_CONTROLLED = 1363, - AV_ICEWING_DESTROYED = 1372, - AV_ICEWING_ASSAULTED = 1380, - //Stoneheart Bunker - AV_STONEH_CONTROLLED = 1364, - AV_STONEH_DESTROYED = 1373, - AV_STONEH_ASSAULTED = 1381, - //Horde - //Iceblood Tower - AV_ICEBLOOD_CONTROLLED = 1385, - AV_ICEBLOOD_DESTROYED = 1368, - AV_ICEBLOOD_ASSAULTED = 1390, - //Tower Point - AV_TOWERPOINT_CONTROLLED = 1384, - AV_TOWERPOINT_DESTROYED = 1367, //goes over controlled - AV_TOWERPOINT_ASSAULTED = 1389, //goes over destroyed - //Frostwolf West - AV_FROSTWOLFW_CONTROLLED = 1382, - AV_FROSTWOLFW_DESTROYED = 1365, //over controlled - AV_FROSTWOLFW_ASSAULTED = 1387, //over destroyed - //Frostwolf East - AV_FROSTWOLFE_CONTROLLED = 1383, - AV_FROSTWOLFE_DESTROYED = 1366, - AV_FROSTWOLFE_ASSAULTED = 1388, - - //mines - - AV_N_MINE_N = 1360, - AV_N_MINE_A = 1358, - AV_N_MINE_H = 1359, - - AV_S_MINE_N = 1357, - AV_S_MINE_A = 1355, - AV_S_MINE_H = 1356, - - //towers assaulted by own team (unused) - AV_STONEH_UNUSED = 1377, - AV_ICEWING_UNUSED = 1376, - AV_DUNS_UNUSED = 1375, - AV_DUNN_UNUSED = 1374, - - AV_ICEBLOOD_UNUSED = 1395, - AV_TOWERPOINT_UNUSED = 1394, - AV_FROSTWOLFE_UNUSED = 1393, - AV_FROSTWOLFW_UNUSED = 1392 - */ -}; - //alliance_control neutral_control horde_control const uint32 BG_AV_MineWorldStates[2][3] = { - {1358, 1360, 1359}, - {1355, 1357, 1356} + {WORLD_STATE_BATTLEGROUND_AV_N_MINE_A, WORLD_STATE_BATTLEGROUND_AV_N_MINE_N, WORLD_STATE_BATTLEGROUND_AV_N_MINE_H}, + {WORLD_STATE_BATTLEGROUND_AV_S_MINE_A, WORLD_STATE_BATTLEGROUND_AV_S_MINE_N, WORLD_STATE_BATTLEGROUND_AV_S_MINE_H} }; //alliance_control alliance_assault h_control h_assault const uint32 BG_AV_NodeWorldStates[16][4] = { //Stormpike first aid station - {1325, 1326, 1327, 1328}, + {WORLD_STATE_BATTLEGROUND_AV_AID_A_C, WORLD_STATE_BATTLEGROUND_AV_AID_A_A, WORLD_STATE_BATTLEGROUND_AV_AID_H_C, WORLD_STATE_BATTLEGROUND_AV_AID_H_A}, //Stormpike Graveyard - {1333, 1335, 1334, 1336}, + {WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_C, WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_A, WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_C, WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_A}, //Stoneheart Grave - {1302, 1304, 1301, 1303}, + {WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_C, WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_A, WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_C, WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_A}, //Snowfall Grave - {1341, 1343, 1342, 1344}, + {WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_C, WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_A, WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_C, WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_A}, //Iceblood grave - {1346, 1348, 1347, 1349}, + {WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_C, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_A, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_C, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_A}, //Frostwolf Grave - {1337, 1339, 1338, 1340}, + {WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_C, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_A, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_C, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_A}, //Frostwolf Hut - {1329, 1331, 1330, 1332}, + {WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_C, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_A, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_C, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_A}, //Dunbaldar South Bunker - {1361, 1375, 1370, 1378}, + {WORLD_STATE_BATTLEGROUND_AV_DUNS_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_DUNS_UNUSED, WORLD_STATE_BATTLEGROUND_AV_DUNS_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_DUNS_ASSAULTED}, //Dunbaldar North Bunker - {1362, 1374, 1371, 1379}, + {WORLD_STATE_BATTLEGROUND_AV_DUNN_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_DUNN_UNUSED, WORLD_STATE_BATTLEGROUND_AV_DUNN_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_DUNN_ASSAULTED}, //Icewing Bunker - {1363, 1376, 1372, 1380}, + {WORLD_STATE_BATTLEGROUND_AV_ICEWING_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_ICEWING_UNUSED, WORLD_STATE_BATTLEGROUND_AV_ICEWING_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_ICEWING_ASSAULTED}, //Stoneheart Bunker - {1364, 1377, 1373, 1381}, + {WORLD_STATE_BATTLEGROUND_AV_STONEH_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_STONEH_UNUSED, WORLD_STATE_BATTLEGROUND_AV_STONEH_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_STONEH_ASSAULTED}, //Iceblood Tower - {1368, 1390, 1385, 1395}, + {WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_ASSAULTED, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_UNUSED}, //Tower Point - {1367, 1389, 1384, 1394}, + {WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_ASSAULTED, WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_UNUSED}, //Frostwolf East - {1366, 1388, 1383, 1393}, + {WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_ASSAULTED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_UNUSED}, //Frostwolf West - {1365, 1387, 1382, 1392}, + {WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_ASSAULTED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_UNUSED}, }; enum BG_AV_QuestIds diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp index ce210aa60..ae3778561 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp @@ -20,6 +20,7 @@ #include "Player.h" #include "WorldPacket.h" #include "WorldStatePackets.h" +#include "WorldStateDefines.h" BattlegroundBE::BattlegroundBE() { @@ -90,7 +91,7 @@ void BattlegroundBE::HandleAreaTrigger(Player* player, uint32 trigger) void BattlegroundBE::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(0x9f3, 1); // BATTLEGROUND_BLADES_EDGE_ARENA_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_BE_ARENA_SHOW, 1); Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index 5a91f57ac..833145151 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -22,6 +22,7 @@ #include "ObjectAccessor.h" #include "Player.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" BattlegroundDS::BattlegroundDS() @@ -176,7 +177,7 @@ bool BattlegroundDS::HandlePlayerUnderMap(Player* player) void BattlegroundDS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(0xe1a, 1); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW, 1); // Wrong worldstate used Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 4f9f608c6..0b5e665c8 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -120,7 +120,7 @@ void BattlegroundEY::AddPoints(TeamId teamId, uint32 points) for (; honorRewards < uint8(m_TeamScores[teamId] / _honorTics); ++honorRewards) RewardHonorToTeam(GetBonusHonorFromKill(1), teamId); - UpdateWorldState(teamId == TEAM_ALLIANCE ? EY_ALLIANCE_RESOURCES : EY_HORDE_RESOURCES, std::min(m_TeamScores[teamId], _configurableMaxTeamScore)); + UpdateWorldState(teamId == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_RESOURCES : WORLD_STATE_BATTLEGROUND_EY_HORDE_RESOURCES, std::min(m_TeamScores[teamId], _configurableMaxTeamScore)); if (m_TeamScores[teamId] >= static_cast(_configurableMaxTeamScore)) EndBattleground(teamId); } @@ -138,14 +138,14 @@ void BattlegroundEY::UpdatePointsState() const BattlegroundPlayerMap& bgPlayerMap = GetPlayers(); for (BattlegroundPlayerMap::const_iterator itr = bgPlayerMap.begin(); itr != bgPlayerMap.end(); ++itr) { - itr->second->SendUpdateWorldState(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW); + itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW); for (uint8 point = 0; point < EY_POINTS_MAX; ++point) if (GameObject* pointObject = pointsVec[point]) if (itr->second->CanCaptureTowerPoint() && itr->second->IsWithinDistInMap(pointObject, BG_EY_POINT_RADIUS)) { - itr->second->SendUpdateWorldState(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW); - itr->second->SendUpdateWorldState(PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_PERCENT_GREY); - itr->second->SendUpdateWorldState(PROGRESS_BAR_STATUS, _capturePointInfo[point]._barStatus); + itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW); + itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_PERCENT_GREY); + itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_STATUS, _capturePointInfo[point]._barStatus); ++_capturePointInfo[point]._playersCount[itr->second->GetTeamId()]; _capturePointInfo[point].player = itr->second; @@ -187,8 +187,8 @@ void BattlegroundEY::EndBattleground(TeamId winnerTeamId) void BattlegroundEY::UpdatePointsCount() { - UpdateWorldState(EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]); - UpdateWorldState(EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]); } void BattlegroundEY::UpdatePointsIcons(uint32 point) @@ -382,7 +382,7 @@ void BattlegroundEY::RespawnFlag() SendBroadcastText(BG_EY_TEXT_FLAG_RESET, CHAT_MSG_BG_SYSTEM_NEUTRAL); PlaySoundToAll(BG_EY_SOUND_FLAG_RESET); - UpdateWorldState(NETHERSTORM_FLAG, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_FLAG, 1); } void BattlegroundEY::RespawnFlagAfterDrop() @@ -442,7 +442,7 @@ void BattlegroundEY::EventPlayerClickedOnFlag(Player* player, GameObject* gameOb player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); PlaySoundToAll(player->GetTeamId() == TEAM_ALLIANCE ? BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE : BG_EY_SOUND_FLAG_PICKED_UP_HORDE); - UpdateWorldState(NETHERSTORM_FLAG, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_FLAG, 0); if (player->GetTeamId() == TEAM_ALLIANCE) SendBroadcastText(BG_EY_TEXT_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, player); @@ -577,28 +577,28 @@ bool BattlegroundEY::UpdatePlayerScore(Player* player, uint32 type, uint32 value void BattlegroundEY::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(22); - packet.Worldstates.emplace_back(EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]); - packet.Worldstates.emplace_back(EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]); - packet.Worldstates.emplace_back(DRAENEI_RUINS_HORDE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_HORDE)); - packet.Worldstates.emplace_back(DRAENEI_RUINS_ALLIANCE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_ALLIANCE)); - packet.Worldstates.emplace_back(DRAENEI_RUINS_UNCONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUncontrolled()); - packet.Worldstates.emplace_back(MAGE_TOWER_ALLIANCE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_HORDE)); - packet.Worldstates.emplace_back(MAGE_TOWER_HORDE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_ALLIANCE)); - packet.Worldstates.emplace_back(MAGE_TOWER_UNCONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUncontrolled()); - packet.Worldstates.emplace_back(FEL_REAVER_HORDE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_HORDE)); - packet.Worldstates.emplace_back(FEL_REAVER_ALLIANCE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_ALLIANCE)); - packet.Worldstates.emplace_back(FEL_REAVER_UNCONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUncontrolled()); - packet.Worldstates.emplace_back(BLOOD_ELF_HORDE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_HORDE)); - packet.Worldstates.emplace_back(BLOOD_ELF_ALLIANCE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_ALLIANCE)); - packet.Worldstates.emplace_back(BLOOD_ELF_UNCONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUncontrolled()); - packet.Worldstates.emplace_back(NETHERSTORM_FLAG, _flagState == BG_EY_FLAG_STATE_ON_BASE); - packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_HORDE, 1); - packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_ALLIANCE, 1); - packet.Worldstates.emplace_back(EY_HORDE_RESOURCES, GetTeamScore(TEAM_HORDE)); - packet.Worldstates.emplace_back(EY_ALLIANCE_RESOURCES, GetTeamScore(TEAM_ALLIANCE)); - packet.Worldstates.emplace_back(PROGRESS_BAR_SHOW, 0); - packet.Worldstates.emplace_back(PROGRESS_BAR_PERCENT_GREY, 0); - packet.Worldstates.emplace_back(PROGRESS_BAR_STATUS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_HORDE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_UNCONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUncontrolled()); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_HORDE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_UNCONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUncontrolled()); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_HORDE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_UNCONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUncontrolled()); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_HORDE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_HORDE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_ALLIANCE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_UNCONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUncontrolled()); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG, _flagState == BG_EY_FLAG_STATE_ON_BASE); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_HORDE, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_ALLIANCE, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_HORDE_RESOURCES, GetTeamScore(TEAM_HORDE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_RESOURCES, GetTeamScore(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_PERCENT_GREY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_STATUS, 0); } GraveyardStruct const* BattlegroundEY::GetClosestGraveyard(Player* player) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index f80416c1a..1cdf29992 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -21,6 +21,7 @@ #include "Battleground.h" #include "BattlegroundScore.h" #include "EventMap.h" +#include "WorldStateDefines.h" enum BG_EY_Events { @@ -38,33 +39,6 @@ enum BG_EY_Timers BG_EY_FPOINTS_TICK_TIME = 2 * IN_MILLISECONDS }; -enum BG_EY_WorldStates -{ - EY_ALLIANCE_RESOURCES = 2749, - EY_HORDE_RESOURCES = 2750, - EY_ALLIANCE_BASE = 2752, - EY_HORDE_BASE = 2753, - DRAENEI_RUINS_HORDE_CONTROL = 2733, - DRAENEI_RUINS_ALLIANCE_CONTROL = 2732, - DRAENEI_RUINS_UNCONTROL = 2731, - MAGE_TOWER_ALLIANCE_CONTROL = 2730, - MAGE_TOWER_HORDE_CONTROL = 2729, - MAGE_TOWER_UNCONTROL = 2728, - FEL_REAVER_HORDE_CONTROL = 2727, - FEL_REAVER_ALLIANCE_CONTROL = 2726, - FEL_REAVER_UNCONTROL = 2725, - BLOOD_ELF_HORDE_CONTROL = 2724, - BLOOD_ELF_ALLIANCE_CONTROL = 2723, - BLOOD_ELF_UNCONTROL = 2722, - PROGRESS_BAR_PERCENT_GREY = 2720, //100 = empty (only grey), 0 = blue|red (no grey) - PROGRESS_BAR_STATUS = 2719, //50 init!, 48 ... hordak bere .. 33 .. 0 = full 100% hordacky, 100 = full alliance - PROGRESS_BAR_SHOW = 2718, //1 init, 0 druhy send - bez messagu, 1 = controlled aliance - NETHERSTORM_FLAG = 2757, - //set to 2 when flag is picked up, and to 1 if it is dropped - NETHERSTORM_FLAG_STATE_ALLIANCE = 2769, - NETHERSTORM_FLAG_STATE_HORDE = 2770 -}; - enum BG_EY_ProgressBarConsts { BG_EY_POINT_MAX_CAPTURERS_COUNT = 5, @@ -326,10 +300,10 @@ const uint32 BG_EY_FlagPoints[EY_POINTS_MAX] = {75, 85, 100, 500}; //constant arrays: const BattlegroundEYPointIconsStruct m_PointsIconStruct[EY_POINTS_MAX] = { - BattlegroundEYPointIconsStruct(FEL_REAVER_UNCONTROL, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL), - BattlegroundEYPointIconsStruct(BLOOD_ELF_UNCONTROL, BLOOD_ELF_ALLIANCE_CONTROL, BLOOD_ELF_HORDE_CONTROL), - BattlegroundEYPointIconsStruct(DRAENEI_RUINS_UNCONTROL, DRAENEI_RUINS_ALLIANCE_CONTROL, DRAENEI_RUINS_HORDE_CONTROL), - BattlegroundEYPointIconsStruct(MAGE_TOWER_UNCONTROL, MAGE_TOWER_ALLIANCE_CONTROL, MAGE_TOWER_HORDE_CONTROL) + BattlegroundEYPointIconsStruct(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_UNCONTROL, WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONTROL, WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONTROL), + BattlegroundEYPointIconsStruct(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_UNCONTROL, WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_ALLIANCE_CONTROL, WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_HORDE_CONTROL), + BattlegroundEYPointIconsStruct(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_UNCONTROL, WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONTROL, WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONTROL), + BattlegroundEYPointIconsStruct(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_UNCONTROL, WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONTROL, WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONTROL) }; const BattlegroundEYLosingPointStruct m_LosingPointTypes[EY_POINTS_MAX] = diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index e9957a17f..e1eb6b812 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -268,7 +268,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff) { factionReinforcements[nodePoint[i].faction] += 1; RewardHonorToTeam(RESOURCE_HONOR_AMOUNT, nodePoint[i].faction); - UpdateWorldState((nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_ALLIANCE_RENFORT : BG_IC_HORDE_RENFORT), factionReinforcements[nodePoint[i].faction]); + UpdateWorldState((nodePoint[i].faction == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT : WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT), factionReinforcements[nodePoint[i].faction]); } } resourceTimer = IC_RESOURCE_TIME; @@ -385,10 +385,10 @@ bool BattlegroundIC::UpdatePlayerScore(Player* player, uint32 type, uint32 value void BattlegroundIC::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(4+MAX_FORTRESS_GATES_SPAWNS+MAX_NODE_TYPES+1); - packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT_SET, 1); - packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT_SET, 1); - packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT, factionReinforcements[TEAM_ALLIANCE]); - packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT, factionReinforcements[TEAM_HORDE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT_SET, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT_SET, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT, factionReinforcements[TEAM_ALLIANCE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT, factionReinforcements[TEAM_HORDE]); for (uint8 i = 0; i < MAX_FORTRESS_GATES_SPAWNS; ++i) { @@ -399,7 +399,7 @@ void BattlegroundIC::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS for (uint8 i = 0; i < MAX_NODE_TYPES; ++i) packet.Worldstates.emplace_back(nodePoint[i].worldStates[nodePoint[i].nodeState], 1); - packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT_SET, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT_SET, 1); } bool BattlegroundIC::SetupBattleground() @@ -545,7 +545,7 @@ void BattlegroundIC::HandleKillPlayer(Player* player, Player* killer) factionReinforcements[player->GetTeamId()] -= 1; - UpdateWorldState((player->GetTeamId() == TEAM_ALLIANCE ? BG_IC_ALLIANCE_RENFORT : BG_IC_HORDE_RENFORT), factionReinforcements[player->GetTeamId()]); + UpdateWorldState((player->GetTeamId() == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT : WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT), factionReinforcements[player->GetTeamId()]); // we must end the battleground if (factionReinforcements[player->GetTeamId()] < 1) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index a067b794a..33bb9a776 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -21,6 +21,7 @@ #include "Battleground.h" #include "BattlegroundScore.h" #include "Object.h" +#include "WorldStateDefines.h" const uint32 BG_IC_Factions[PVP_TEAMS_COUNT] = { @@ -735,68 +736,6 @@ enum BG_IC_Objectives IC_OBJECTIVE_DEFEND_BASE = 246 }; -enum ICWorldStates -{ - BG_IC_ALLIANCE_RENFORT_SET = 4221, - BG_IC_HORDE_RENFORT_SET = 4222, - BG_IC_ALLIANCE_RENFORT = 4226, - BG_IC_HORDE_RENFORT = 4227, - BG_IC_GATE_FRONT_H_WS_CLOSED = 4317, - BG_IC_GATE_WEST_H_WS_CLOSED = 4318, - BG_IC_GATE_EAST_H_WS_CLOSED = 4319, - BG_IC_GATE_FRONT_A_WS_CLOSED = 4328, - BG_IC_GATE_WEST_A_WS_CLOSED = 4327, - BG_IC_GATE_EAST_A_WS_CLOSED = 4326, - BG_IC_GATE_FRONT_H_WS_OPEN = 4322, - BG_IC_GATE_WEST_H_WS_OPEN = 4321, - BG_IC_GATE_EAST_H_WS_OPEN = 4320, - BG_IC_GATE_FRONT_A_WS_OPEN = 4323, - BG_IC_GATE_WEST_A_WS_OPEN = 4324, - BG_IC_GATE_EAST_A_WS_OPEN = 4325, - - BG_IC_DOCKS_UNCONTROLLED = 4301, - BG_IC_DOCKS_CONFLICT_A = 4305, - BG_IC_DOCKS_CONFLICT_H = 4302, - BG_IC_DOCKS_CONTROLLED_A = 4304, - BG_IC_DOCKS_CONTROLLED_H = 4303, - - BG_IC_HANGAR_UNCONTROLLED = 4296, - BG_IC_HANGAR_CONFLICT_A = 4300, - BG_IC_HANGAR_CONFLICT_H = 4297, - BG_IC_HANGAR_CONTROLLED_A = 4299, - BG_IC_HANGAR_CONTROLLED_H = 4298, - - BG_IC_QUARRY_UNCONTROLLED = 4306, - BG_IC_QUARRY_CONFLICT_A = 4310, - BG_IC_QUARRY_CONFLICT_H = 4307, - BG_IC_QUARRY_CONTROLLED_A = 4309, - BG_IC_QUARRY_CONTROLLED_H = 4308, - - BG_IC_REFINERY_UNCONTROLLED = 4311, - BG_IC_REFINERY_CONFLICT_A = 4315, - BG_IC_REFINERY_CONFLICT_H = 4312, - BG_IC_REFINERY_CONTROLLED_A = 4314, - BG_IC_REFINERY_CONTROLLED_H = 4313, - - BG_IC_WORKSHOP_UNCONTROLLED = 4294, - BG_IC_WORKSHOP_CONFLICT_A = 4228, - BG_IC_WORKSHOP_CONFLICT_H = 4293, - BG_IC_WORKSHOP_CONTROLLED_A = 4229, - BG_IC_WORKSHOP_CONTROLLED_H = 4230, - - BG_IC_ALLIANCE_KEEP_UNCONTROLLED = 4341, - BG_IC_ALLIANCE_KEEP_CONFLICT_A = 4342, - BG_IC_ALLIANCE_KEEP_CONFLICT_H = 4343, - BG_IC_ALLIANCE_KEEP_CONTROLLED_A = 4339, - BG_IC_ALLIANCE_KEEP_CONTROLLED_H = 4340, - - BG_IC_HORDE_KEEP_UNCONTROLLED = 4346, - BG_IC_HORDE_KEEP_CONFLICT_A = 4347, - BG_IC_HORDE_KEEP_CONFLICT_H = 4348, - BG_IC_HORDE_KEEP_CONTROLLED_A = 4344, - BG_IC_HORDE_KEEP_CONTROLLED_H = 4345 -}; - enum BG_IC_GateState { BG_IC_GATE_OK = 1, @@ -901,13 +840,13 @@ struct ICNodePoint const ICNodePoint nodePointInitial[MAX_NODE_TYPES] = { - {BG_IC_GO_REFINERY_BANNER, GO_REFINERY_BANNER, TEAM_NEUTRAL, NODE_TYPE_REFINERY, {GO_ALLIANCE_BANNER_REFINERY, GO_ALLIANCE_BANNER_REFINERY_CONT, GO_HORDE_BANNER_REFINERY, GO_HORDE_BANNER_REFINERY_CONT}, false, 0, 0, {BG_IC_REFINERY_UNCONTROLLED, BG_IC_REFINERY_CONFLICT_A, BG_IC_REFINERY_CONFLICT_H, BG_IC_REFINERY_CONTROLLED_A, BG_IC_REFINERY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, - {BG_IC_GO_QUARRY_BANNER, GO_QUARRY_BANNER, TEAM_NEUTRAL, NODE_TYPE_QUARRY, {GO_ALLIANCE_BANNER_QUARRY, GO_ALLIANCE_BANNER_QUARRY_CONT, GO_HORDE_BANNER_QUARRY, GO_HORDE_BANNER_QUARRY_CONT}, false, 0, 0, {BG_IC_QUARRY_UNCONTROLLED, BG_IC_QUARRY_CONFLICT_A, BG_IC_QUARRY_CONFLICT_H, BG_IC_QUARRY_CONTROLLED_A, BG_IC_QUARRY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, - {BG_IC_GO_DOCKS_BANNER, GO_DOCKS_BANNER, TEAM_NEUTRAL, NODE_TYPE_DOCKS, {GO_ALLIANCE_BANNER_DOCK, GO_ALLIANCE_BANNER_DOCK_CONT, GO_HORDE_BANNER_DOCK, GO_HORDE_BANNER_DOCK_CONT}, false, 0, 0, {BG_IC_DOCKS_UNCONTROLLED, BG_IC_DOCKS_CONFLICT_A, BG_IC_DOCKS_CONFLICT_H, BG_IC_DOCKS_CONTROLLED_A, BG_IC_DOCKS_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, - {BG_IC_GO_HANGAR_BANNER, GO_HANGAR_BANNER, TEAM_NEUTRAL, NODE_TYPE_HANGAR, {GO_ALLIANCE_BANNER_HANGAR, GO_ALLIANCE_BANNER_HANGAR_CONT, GO_HORDE_BANNER_HANGAR, GO_HORDE_BANNER_HANGAR_CONT}, false, 0, 0, {BG_IC_HANGAR_UNCONTROLLED, BG_IC_HANGAR_CONFLICT_A, BG_IC_HANGAR_CONFLICT_H, BG_IC_HANGAR_CONTROLLED_A, BG_IC_HANGAR_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, - {BG_IC_GO_WORKSHOP_BANNER, GO_WORKSHOP_BANNER, TEAM_NEUTRAL, NODE_TYPE_WORKSHOP, {GO_ALLIANCE_BANNER_WORKSHOP, GO_ALLIANCE_BANNER_WORKSHOP_CONT, GO_HORDE_BANNER_WORKSHOP, GO_HORDE_BANNER_WORKSHOP_CONT}, false, 0, 0, {BG_IC_WORKSHOP_UNCONTROLLED, BG_IC_WORKSHOP_CONFLICT_A, BG_IC_WORKSHOP_CONFLICT_H, BG_IC_WORKSHOP_CONTROLLED_A, BG_IC_WORKSHOP_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, - {BG_IC_GO_ALLIANCE_BANNER, GO_ALLIANCE_BANNER, TEAM_ALLIANCE, NODE_TYPE_GRAVEYARD_A, {GO_ALLIANCE_BANNER_GRAVEYARD_A, GO_ALLIANCE_BANNER_GRAVEYARD_A_CONT, GO_HORDE_BANNER_GRAVEYARD_A, GO_HORDE_BANNER_GRAVEYARD_A_CONT}, false, 0, 0, {BG_IC_ALLIANCE_KEEP_UNCONTROLLED, BG_IC_ALLIANCE_KEEP_CONFLICT_A, BG_IC_ALLIANCE_KEEP_CONFLICT_H, BG_IC_ALLIANCE_KEEP_CONTROLLED_A, BG_IC_ALLIANCE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_A}, - {BG_IC_GO_HORDE_BANNER, GO_HORDE_BANNER, TEAM_HORDE, NODE_TYPE_GRAVEYARD_H, {GO_ALLIANCE_BANNER_GRAVEYARD_H, GO_ALLIANCE_BANNER_GRAVEYARD_H_CONT, GO_HORDE_BANNER_GRAVEYARD_H, GO_HORDE_BANNER_GRAVEYARD_H_CONT}, false, 0, 0, {BG_IC_HORDE_KEEP_UNCONTROLLED, BG_IC_HORDE_KEEP_CONFLICT_A, BG_IC_HORDE_KEEP_CONFLICT_H, BG_IC_HORDE_KEEP_CONTROLLED_A, BG_IC_HORDE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_H} + {BG_IC_GO_REFINERY_BANNER, GO_REFINERY_BANNER, TEAM_NEUTRAL, NODE_TYPE_REFINERY, {GO_ALLIANCE_BANNER_REFINERY, GO_ALLIANCE_BANNER_REFINERY_CONT, GO_HORDE_BANNER_REFINERY, GO_HORDE_BANNER_REFINERY_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_REFINERY_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, + {BG_IC_GO_QUARRY_BANNER, GO_QUARRY_BANNER, TEAM_NEUTRAL, NODE_TYPE_QUARRY, {GO_ALLIANCE_BANNER_QUARRY, GO_ALLIANCE_BANNER_QUARRY_CONT, GO_HORDE_BANNER_QUARRY, GO_HORDE_BANNER_QUARRY_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_QUARRY_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, + {BG_IC_GO_DOCKS_BANNER, GO_DOCKS_BANNER, TEAM_NEUTRAL, NODE_TYPE_DOCKS, {GO_ALLIANCE_BANNER_DOCK, GO_ALLIANCE_BANNER_DOCK_CONT, GO_HORDE_BANNER_DOCK, GO_HORDE_BANNER_DOCK_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_DOCKS_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, + {BG_IC_GO_HANGAR_BANNER, GO_HANGAR_BANNER, TEAM_NEUTRAL, NODE_TYPE_HANGAR, {GO_ALLIANCE_BANNER_HANGAR, GO_ALLIANCE_BANNER_HANGAR_CONT, GO_HORDE_BANNER_HANGAR, GO_HORDE_BANNER_HANGAR_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_HANGAR_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, + {BG_IC_GO_WORKSHOP_BANNER, GO_WORKSHOP_BANNER, TEAM_NEUTRAL, NODE_TYPE_WORKSHOP, {GO_ALLIANCE_BANNER_WORKSHOP, GO_ALLIANCE_BANNER_WORKSHOP_CONT, GO_HORDE_BANNER_WORKSHOP, GO_HORDE_BANNER_WORKSHOP_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONTROLLED_H}, NODE_STATE_UNCONTROLLED}, + {BG_IC_GO_ALLIANCE_BANNER, GO_ALLIANCE_BANNER, TEAM_ALLIANCE, NODE_TYPE_GRAVEYARD_A, {GO_ALLIANCE_BANNER_GRAVEYARD_A, GO_ALLIANCE_BANNER_GRAVEYARD_A_CONT, GO_HORDE_BANNER_GRAVEYARD_A, GO_HORDE_BANNER_GRAVEYARD_A_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_A}, + {BG_IC_GO_HORDE_BANNER, GO_HORDE_BANNER, TEAM_HORDE, NODE_TYPE_GRAVEYARD_H, {GO_ALLIANCE_BANNER_GRAVEYARD_H, GO_ALLIANCE_BANNER_GRAVEYARD_H_CONT, GO_HORDE_BANNER_GRAVEYARD_H, GO_HORDE_BANNER_GRAVEYARD_H_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_H} }; enum HonorRewards @@ -1035,22 +974,22 @@ private: switch (id) { case GO_HORDE_GATE_1: - uws = (open ? BG_IC_GATE_FRONT_H_WS_OPEN : BG_IC_GATE_FRONT_H_WS_CLOSED); + uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_CLOSED); break; case GO_HORDE_GATE_2: - uws = (open ? BG_IC_GATE_EAST_H_WS_OPEN : BG_IC_GATE_EAST_H_WS_CLOSED); + uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_CLOSED); break; case GO_HORDE_GATE_3: - uws = (open ? BG_IC_GATE_WEST_H_WS_OPEN : BG_IC_GATE_WEST_H_WS_CLOSED); + uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_CLOSED); break; case GO_ALLIANCE_GATE_3: - uws = (open ? BG_IC_GATE_FRONT_A_WS_OPEN : BG_IC_GATE_FRONT_A_WS_CLOSED); + uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_CLOSED); break; case GO_ALLIANCE_GATE_1: - uws = (open ? BG_IC_GATE_WEST_A_WS_OPEN : BG_IC_GATE_WEST_A_WS_CLOSED); + uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_CLOSED); break; case GO_ALLIANCE_GATE_2: - uws = (open ? BG_IC_GATE_EAST_A_WS_OPEN : BG_IC_GATE_EAST_A_WS_CLOSED); + uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_CLOSED); break; } return uws; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp index f2585d387..fbc0eca1b 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp @@ -18,6 +18,7 @@ #include "BattlegroundNA.h" #include "Player.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" BattlegroundNA::BattlegroundNA() { @@ -66,7 +67,7 @@ void BattlegroundNA::HandleAreaTrigger(Player* player, uint32 trigger) void BattlegroundNA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(0xa11, 1); // BATTLEGROUND_NAGRAND_ARENA_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_NA_ARENA_SHOW, 1); Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp index a8447a953..8f209d4d0 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp @@ -19,6 +19,7 @@ #include "Log.h" #include "Player.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" BattlegroundRL::BattlegroundRL() { @@ -93,7 +94,7 @@ void BattlegroundRL::HandleAreaTrigger(Player* player, uint32 trigger) void BattlegroundRL::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(0xbba, 1); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RL_ARENA_SHOW, 1); Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index faae3a2ed..22a5595d3 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -22,6 +22,7 @@ #include "ObjectAccessor.h" #include "Player.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" static constexpr Milliseconds BG_RV_PILLAR_SWITCH_TIMER = 25s; static constexpr Milliseconds BG_RV_FIRE_TO_PILLAR_TIMER = 20s; @@ -206,7 +207,7 @@ void BattlegroundRV::HandleAreaTrigger(Player* player, uint32 trigger) void BattlegroundRV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(BG_RV_WORLD_STATE, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW, 1); Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h index 5596723ff..722de1c79 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h @@ -76,10 +76,6 @@ enum BattlegroundRVData BG_RV_STATE_OPEN_FENCES, BG_RV_STATE_SWITCH_PILLARS, BG_RV_STATE_CLOSE_FIRE, - - BG_RV_WORLD_STATE_A = 0xe11, - BG_RV_WORLD_STATE_H = 0xe10, - BG_RV_WORLD_STATE = 0xe1a, }; class AC_GAME_API BattlegroundRV : public Arena diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 0d6e80804..c5f1c3c34 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -238,47 +238,47 @@ bool BattlegroundSA::ResetObjs() } //Player may enter BEFORE we set up bG - lets update his worldstates anyway... - UpdateWorldState(BG_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - UpdateWorldState(BG_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - UpdateWorldState(BG_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); - UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); - UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); if (Attackers == TEAM_ALLIANCE) { - UpdateWorldState(BG_SA_ALLY_ATTACKS, 1); - UpdateWorldState(BG_SA_HORDE_ATTACKS, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_ATTACKS, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKS, 0); - UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_ALL, 1); - UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_ALL, 1); - UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 0); - UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE, 0); - UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN, 1); - UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN, 0); } else { - UpdateWorldState(BG_SA_HORDE_ATTACKS, 1); - UpdateWorldState(BG_SA_ALLY_ATTACKS, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKS, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_ATTACKS, 0); - UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_ALL, 0); - UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_ALL, 0); - UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 1); - UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE, 1); - UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN, 0); - UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN, 1); } - UpdateWorldState(BG_SA_PURPLE_GATEWS, 1); - UpdateWorldState(BG_SA_RED_GATEWS, 1); - UpdateWorldState(BG_SA_BLUE_GATEWS, 1); - UpdateWorldState(BG_SA_GREEN_GATEWS, 1); - UpdateWorldState(BG_SA_YELLOW_GATEWS, 1); - UpdateWorldState(BG_SA_ANCIENT_GATEWS, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RED_GATE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE, 1); for (int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++) for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) @@ -473,40 +473,40 @@ void BattlegroundSA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS bool const horde_attacks = Attackers == TEAM_HORDE; packet.Worldstates.reserve(25); - packet.Worldstates.emplace_back(BG_SA_ANCIENT_GATEWS, GateStatus[BG_SA_ANCIENT_GATE]); - packet.Worldstates.emplace_back(BG_SA_YELLOW_GATEWS, GateStatus[BG_SA_YELLOW_GATE]); - packet.Worldstates.emplace_back(BG_SA_GREEN_GATEWS, GateStatus[BG_SA_GREEN_GATE]); - packet.Worldstates.emplace_back(BG_SA_BLUE_GATEWS, GateStatus[BG_SA_BLUE_GATE]); - packet.Worldstates.emplace_back(BG_SA_RED_GATEWS, GateStatus[BG_SA_RED_GATE]); - packet.Worldstates.emplace_back(BG_SA_PURPLE_GATEWS, GateStatus[BG_SA_PURPLE_GATE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE, GateStatus[BG_SA_ANCIENT_GATE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE, GateStatus[BG_SA_YELLOW_GATE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE, GateStatus[BG_SA_GREEN_GATE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE, GateStatus[BG_SA_BLUE_GATE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RED_GATE, GateStatus[BG_SA_RED_GATE]); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE, GateStatus[BG_SA_PURPLE_GATE]); - packet.Worldstates.emplace_back(BG_SA_BONUS_TIMER, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_BONUS_TIMER, 0); - packet.Worldstates.emplace_back(BG_SA_HORDE_ATTACKS, horde_attacks); - packet.Worldstates.emplace_back(BG_SA_ALLY_ATTACKS, ally_attacks); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKS, horde_attacks); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_ATTACKS, ally_attacks); //Time will be sent on first update... - packet.Worldstates.emplace_back(BG_SA_ENABLE_TIMER, TimerEnabled ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ENABLE_TIMER, TimerEnabled ? 1 : 0); - packet.Worldstates.emplace_back(BG_SA_TIMER_MINS, 0); - packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_TENS, 0); - packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_DECS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_MINUTES, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_FIRST_DIGIT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_SECOND_DIGIT, 0); - packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - packet.Worldstates.emplace_back(BG_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - packet.Worldstates.emplace_back(BG_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0); - packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); - packet.Worldstates.emplace_back(BG_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); - packet.Worldstates.emplace_back(BG_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0); - packet.Worldstates.emplace_back(BG_SA_HORDE_DEFENCE_TOKEN, ally_attacks); - packet.Worldstates.emplace_back(BG_SA_ALLIANCE_DEFENCE_TOKEN, horde_attacks); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN, ally_attacks); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN, horde_attacks); - packet.Worldstates.emplace_back(BG_SA_LEFT_ATT_TOKEN_HRD, horde_attacks); - packet.Worldstates.emplace_back(BG_SA_RIGHT_ATT_TOKEN_HRD, horde_attacks); - packet.Worldstates.emplace_back(BG_SA_RIGHT_ATT_TOKEN_ALL, ally_attacks); - packet.Worldstates.emplace_back(BG_SA_LEFT_ATT_TOKEN_ALL, ally_attacks); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE, horde_attacks); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE, horde_attacks); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE, ally_attacks); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE, ally_attacks); } void BattlegroundSA::AddPlayer(Player* player) @@ -830,9 +830,9 @@ GraveyardStruct const* BattlegroundSA::GetClosestGraveyard(Player* player) void BattlegroundSA::SendTime() { Milliseconds end_of_round = (EndRoundTimer - TotalTime); - UpdateWorldState(BG_SA_TIMER_MINS, end_of_round / 1min); - UpdateWorldState(BG_SA_TIMER_SEC_TENS, (end_of_round % 1min) / 10s); - UpdateWorldState(BG_SA_TIMER_SEC_DECS, ((end_of_round % 1min) % 10s) / 1s); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_TIMER_MINUTES, end_of_round / 1min); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_FIRST_DIGIT, (end_of_round % 1min) / 10s); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_SECOND_DIGIT, ((end_of_round % 1min) % 10s) / 1s); } bool BattlegroundSA::CanInteractWithObject(uint32 objectId) @@ -973,8 +973,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) dem->SetFaction(BG_SA_Factions[Attackers]); } - UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); - UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); GetBgMap()->DoForAllPlayers([&](Player* player) { if (player->GetTeamId() == TEAM_ALLIANCE) @@ -1004,8 +1004,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) dem->SetFaction(BG_SA_Factions[Attackers]); } - UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); - UpdateWorldState(BG_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); GetBgMap()->DoForAllPlayers([&](Player* player) { if (player->GetTeamId() == TEAM_ALLIANCE) @@ -1021,8 +1021,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1], BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY); - UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); - UpdateWorldState(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0)); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1)); GetBgMap()->DoForAllPlayers([&](Player* player) { if (player->GetTeamId() == TEAM_ALLIANCE) @@ -1082,7 +1082,7 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object) void BattlegroundSA::ToggleTimer() { TimerEnabled = !TimerEnabled; - UpdateWorldState(BG_SA_ENABLE_TIMER, (TimerEnabled) ? 1 : 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ENABLE_TIMER, (TimerEnabled) ? 1 : 0); } void BattlegroundSA::EndBattleground(TeamId winnerTeamId) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index e816ad1cb..7b3197567 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -20,6 +20,7 @@ #include "Battleground.h" #include "BattlegroundScore.h" +#include "WorldStateDefines.h" #define BG_SA_FLAG_AMOUNT 3 #define BG_SA_DEMOLISHER_AMOUNT 4 @@ -42,35 +43,6 @@ enum BG_SA_GateState BG_SA_GATE_DESTROYED = 3 }; -enum BG_SA_WorldStates -{ - BG_SA_TIMER_MINS = 3559, - BG_SA_TIMER_SEC_TENS = 3560, - BG_SA_TIMER_SEC_DECS = 3561, - BG_SA_ALLY_ATTACKS = 4352, - BG_SA_HORDE_ATTACKS = 4353, - BG_SA_PURPLE_GATEWS = 3614, - BG_SA_RED_GATEWS = 3617, - BG_SA_BLUE_GATEWS = 3620, - BG_SA_GREEN_GATEWS = 3623, - BG_SA_YELLOW_GATEWS = 3638, - BG_SA_ANCIENT_GATEWS = 3849, - BG_SA_LEFT_GY_ALLIANCE = 3635, - BG_SA_RIGHT_GY_ALLIANCE = 3636, - BG_SA_CENTER_GY_ALLIANCE = 3637, - BG_SA_RIGHT_ATT_TOKEN_ALL = 3627, - BG_SA_LEFT_ATT_TOKEN_ALL = 3626, - BG_SA_LEFT_ATT_TOKEN_HRD = 3629, - BG_SA_RIGHT_ATT_TOKEN_HRD = 3628, - BG_SA_HORDE_DEFENCE_TOKEN = 3631, - BG_SA_ALLIANCE_DEFENCE_TOKEN = 3630, - BG_SA_RIGHT_GY_HORDE = 3632, - BG_SA_LEFT_GY_HORDE = 3633, - BG_SA_CENTER_GY_HORDE = 3634, - BG_SA_BONUS_TIMER = 0xdf3, - BG_SA_ENABLE_TIMER = 3564, -}; - enum npc { NPC_ANTI_PERSONNAL_CANNON = 27894, @@ -494,22 +466,22 @@ public: switch (id) { case BG_SA_GREEN_GATE: - uws = BG_SA_GREEN_GATEWS; + uws = WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE; break; case BG_SA_YELLOW_GATE: - uws = BG_SA_YELLOW_GATEWS; + uws = WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE; break; case BG_SA_BLUE_GATE: - uws = BG_SA_BLUE_GATEWS; + uws = WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE; break; case BG_SA_RED_GATE: - uws = BG_SA_RED_GATEWS; + uws = WORLD_STATE_BATTLEGROUND_SA_RED_GATE; break; case BG_SA_PURPLE_GATE: - uws = BG_SA_PURPLE_GATEWS; + uws = WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE; break; case BG_SA_ANCIENT_GATE: - uws = BG_SA_ANCIENT_GATEWS; + uws = WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE; break; } return uws; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index da875ad3e..e4e154f6e 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -24,6 +24,7 @@ #include "Player.h" #include "World.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" void BattlegroundWGScore::BuildObjectivesBlock(WorldPacket& data) { @@ -61,7 +62,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff) switch (_bgEvents.ExecuteEvent()) { case BG_WS_EVENT_UPDATE_GAME_TIME: - UpdateWorldState(BG_WS_STATE_TIMER, GetMatchTime()); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER, GetMatchTime()); _bgEvents.ScheduleEvent(BG_WS_EVENT_UPDATE_GAME_TIME, ((BG_WS_TOTAL_GAME_TIME - GetStartTime()) % (MINUTE * IN_MILLISECONDS)) + 1); break; case BG_WS_EVENT_NO_TIME_LEFT: @@ -135,7 +136,7 @@ void BattlegroundWS::StartingEventOpenDoors() SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY); StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, WS_EVENT_START_BATTLE); - UpdateWorldState(BG_WS_STATE_TIMER_ACTIVE, 1); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE, 1); _bgEvents.ScheduleEvent(BG_WS_EVENT_UPDATE_GAME_TIME, 0); _bgEvents.ScheduleEvent(BG_WS_EVENT_NO_TIME_LEFT, BG_WS_TOTAL_GAME_TIME - 2 * MINUTE * IN_MILLISECONDS); // 27 - 2 = 25 minutes _bgEvents.ScheduleEvent(BG_WS_EVENT_DESPAWN_DOORS, BG_WS_DOOR_DESPAWN_TIME); @@ -216,7 +217,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* player) SpawnBGObject(BG_WS_OBJECT_H_FLAG, BG_WS_FLAG_RESPAWN_TIME); SpawnBGObject(BG_WS_OBJECT_A_FLAG, BG_WS_FLAG_RESPAWN_TIME); - UpdateWorldState(player->GetTeamId() == TEAM_ALLIANCE ? BG_WS_FLAG_CAPTURES_ALLIANCE : BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(player->GetTeamId())); + UpdateWorldState(player->GetTeamId() == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_ALLIANCE : WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_HORDE, GetTeamScore(player->GetTeamId())); UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1); // +1 flag captures _lastFlagCaptureTeam = player->GetTeamId(); @@ -224,7 +225,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* player) if (GetTeamScore(TEAM_ALLIANCE) == _configurableMaxTeamScore || GetTeamScore(TEAM_HORDE) == _configurableMaxTeamScore) { - UpdateWorldState(BG_WS_STATE_TIMER_ACTIVE, 0); + UpdateWorldState(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE, 0); EndBattleground(GetTeamScore(TEAM_HORDE) == _configurableMaxTeamScore ? TEAM_HORDE : TEAM_ALLIANCE); } else @@ -391,7 +392,7 @@ void BattlegroundWS::RemovePlayer(Player* player) void BattlegroundWS::UpdateFlagState(TeamId teamId, uint32 value) { _flagState[teamId] = value; - UpdateWorldState(teamId == TEAM_ALLIANCE ? BG_WS_FLAG_STATE_HORDE : BG_WS_FLAG_STATE_ALLIANCE, value); + UpdateWorldState(teamId == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_HORDE : WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_ALLIANCE, value); } void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger) @@ -554,15 +555,15 @@ GraveyardStruct const* BattlegroundWS::GetClosestGraveyard(Player* player) void BattlegroundWS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(7); - packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(TEAM_ALLIANCE)); - packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(TEAM_HORDE)); - packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_MAX, _configurableMaxTeamScore); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_HORDE, GetTeamScore(TEAM_HORDE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_MAX, _configurableMaxTeamScore); - packet.Worldstates.emplace_back(BG_WS_STATE_TIMER_ACTIVE, GetStatus() == STATUS_IN_PROGRESS ? 1 : 0); - packet.Worldstates.emplace_back(BG_WS_STATE_TIMER, GetMatchTime()); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE, GetStatus() == STATUS_IN_PROGRESS ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER, GetMatchTime()); - packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_HORDE, GetFlagState(TEAM_HORDE)); - packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_ALLIANCE, GetFlagState(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_HORDE, GetFlagState(TEAM_HORDE)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_ALLIANCE, GetFlagState(TEAM_ALLIANCE)); } TeamId BattlegroundWS::GetPrematureWinner() diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h index e5c1560bd..61fa2516e 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h @@ -86,17 +86,6 @@ enum BG_WS_SpellId BG_WS_SPELL_BRUTAL_ASSAULT = 46393 }; -enum BG_WS_WorldStates -{ - BG_WS_FLAG_CAPTURES_ALLIANCE = 1581, - BG_WS_FLAG_CAPTURES_HORDE = 1582, - BG_WS_FLAG_CAPTURES_MAX = 1601, - BG_WS_FLAG_STATE_HORDE = 2338, - BG_WS_FLAG_STATE_ALLIANCE = 2339, - BG_WS_STATE_TIMER = 4248, - BG_WS_STATE_TIMER_ACTIVE = 4247 -}; - enum BG_WS_ObjectTypes { BG_WS_OBJECT_DOOR_A_1 = 0, diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 701715ad3..c79fd6f1f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -86,6 +86,7 @@ #include "WorldSession.h" #include "WorldSessionMgr.h" #include "WorldState.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" #include @@ -8244,24 +8245,24 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) packet.AreaID = areaId; packet.Worldstates.reserve(8); - packet.Worldstates.emplace_back(0x8d8, 0); // SCOURGE_EVENT_WORLDSTATE_EASTERN_PLAGUELANDS - packet.Worldstates.emplace_back(0x8d7, 0); // SCOURGE_EVENT_WORLDSTATE_TANARIS - packet.Worldstates.emplace_back(0x8d6, 0); // SCOURGE_EVENT_WORLDSTATE_BURNING_STEPPES - packet.Worldstates.emplace_back(0x8d5, 0); // SCOURGE_EVENT_WORLDSTATE_BLASTED_LANDS - packet.Worldstates.emplace_back(0x8d4, 0); // SCOURGE_EVENT_WORLDSTATE_AZSHARA - packet.Worldstates.emplace_back(0x8d3, 0); // SCOURGE_EVENT_WORLDSTATE_WINTERSPRING + packet.Worldstates.emplace_back(WORLD_STATE_SCOURGE_INVASION_WINTERSPRING, 0); + packet.Worldstates.emplace_back(WORLD_STATE_SCOURGE_INVASION_AZSHARA, 0); + packet.Worldstates.emplace_back(WORLD_STATE_SCOURGE_INVASION_BLASTED_LANDS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_SCOURGE_INVASION_BURNING_STEPPES, 0); + packet.Worldstates.emplace_back(WORLD_STATE_SCOURGE_INVASION_TANARIS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_SCOURGE_INVASION_EASTERN_PLAGUELANDS, 0); // 7 1 - Arena season in progress, 0 - end of season - packet.Worldstates.emplace_back(0xc77, sArenaSeasonMgr->GetSeasonState() == ARENA_SEASON_STATE_IN_PROGRESS); + packet.Worldstates.emplace_back(WORLD_STATE_ARENA_SEASON_PROGRESS, sArenaSeasonMgr->GetSeasonState() == ARENA_SEASON_STATE_IN_PROGRESS); // 8 Arena season id - packet.Worldstates.emplace_back(0xf3d, sArenaSeasonMgr->GetCurrentSeason()); + packet.Worldstates.emplace_back(WORLD_STATE_ARENA_SEASON_ID, sArenaSeasonMgr->GetCurrentSeason()); if (mapId == 530) // Outland { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0x9bf, 0); // NA_UI_OUTLAND_01 "Progress: %2494w" - packet.Worldstates.emplace_back(0x9bd, 15); // NA_UI_GUARDS_MAX - packet.Worldstates.emplace_back(0x9bb, 15); // NA_UI_GUARDS_LEFT + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_GUARDS_MAX, 15); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT, 15); } if (Player::bgZoneIdToFillWorldStates.find(zoneId) != Player::bgZoneIdToFillWorldStates.end()) @@ -8290,39 +8291,39 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(32); - packet.Worldstates.emplace_back(0x97a, 0); // GENERAL_WORLDSTATES_01 "Progress: %2427w" - packet.Worldstates.emplace_back(0x917, 0); // EP_UI_TOWER_COUNT_A - packet.Worldstates.emplace_back(0x918, 0); // EP_UI_TOWER_COUNT_H - packet.Worldstates.emplace_back(0x97b, 50); // GENERAL_WORLDSTATES_02 - packet.Worldstates.emplace_back(0x97c, 50); // GENERAL_WORLDSTATES_03 - packet.Worldstates.emplace_back(0x933, 1); // EP_CGT_N - packet.Worldstates.emplace_back(0x946, 0); // EP_CGT_N_A - packet.Worldstates.emplace_back(0x947, 0); // EP_CGT_N_H - packet.Worldstates.emplace_back(0x948, 0); // GENERAL_WORLDSTATES_04 - packet.Worldstates.emplace_back(0x949, 0); // GENERAL_WORLDSTATES_05 - packet.Worldstates.emplace_back(0x94a, 0); // EP_CGT_A - packet.Worldstates.emplace_back(0x94b, 0); // EP_CGT_H - packet.Worldstates.emplace_back(0x932, 0); // EP_EWT_A - packet.Worldstates.emplace_back(0x934, 0); // EP_EWT_H - packet.Worldstates.emplace_back(0x935, 0); // GENERAL_WORLDSTATES_06 - packet.Worldstates.emplace_back(0x936, 0); // GENERAL_WORLDSTATES_07 - packet.Worldstates.emplace_back(0x937, 0); // EP_EWT_N_A - packet.Worldstates.emplace_back(0x938, 0); // EP_EWT_N_H - packet.Worldstates.emplace_back(0x939, 1); // EP_EWT_N - packet.Worldstates.emplace_back(0x930, 1); // EP_NPT_N - packet.Worldstates.emplace_back(0x93a, 0); // EP_NPT_N_A - packet.Worldstates.emplace_back(0x93b, 0); // GENERAL_WORLDSTATES_08 - packet.Worldstates.emplace_back(0x93c, 0); // GENERAL_WORLDSTATES_09 - packet.Worldstates.emplace_back(0x93d, 0); // GENERAL_WORLDSTATES_10 - packet.Worldstates.emplace_back(0x944, 0); // EP_NPT_A - packet.Worldstates.emplace_back(0x945, 0); // EP_NPT_H - packet.Worldstates.emplace_back(0x931, 1); // EP_PWT_N - packet.Worldstates.emplace_back(0x93e, 0); // EP_PWT_N_A - //packet.Worldstates.emplace_back(0x93f, 1); // GENERAL_WORLDSTATES_13 grey horde not in dbc! - packet.Worldstates.emplace_back(0x940, 0); // GENERAL_WORLDSTATES_11 - packet.Worldstates.emplace_back(0x941, 0); // GENERAL_WORLDSTATES_12 - packet.Worldstates.emplace_back(0x942, 0); // EP_PWT_A - packet.Worldstates.emplace_back(0x943, 0); // EP_PWT_H + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, 50); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, 50); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_7, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_8, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_0, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_1, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_2, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_3, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_A, 0); + //packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_4, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_5, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UNK_6, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_H, 0); break; case 1377: // Silithus @@ -8331,16 +8332,16 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0x909, 0); // SI_GATHERED_A - packet.Worldstates.emplace_back(0x90a, 0); // SI_GATHERED_H - packet.Worldstates.emplace_back(0x90d, 0); // SI_SILITHYST_MAX + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_SI_GATHERED_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_SI_GATHERED_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_SI_SILITHYST_MAX, 0); } // unknown, aq opening? packet.Worldstates.reserve(4); - packet.Worldstates.emplace_back(0x912, 0); // AQ_SANDWORM_N - packet.Worldstates.emplace_back(0x913, 0); // AQ_SANDWORM_S - packet.Worldstates.emplace_back(0x914, 0); // AQ_SANDWORM_SW - packet.Worldstates.emplace_back(0x915, 0); // AQ_SANDWORM_E + packet.Worldstates.emplace_back(WORLD_STATE_AHNQIRAJ_SANDWORM_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_AHNQIRAJ_SANDWORM_S, 0); + packet.Worldstates.emplace_back(WORLD_STATE_AHNQIRAJ_SANDWORM_SW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_AHNQIRAJ_SANDWORM_E, 0); break; case 2597: // Alterac Valley if (battleground && battleground->GetBgTypeID(true) == BATTLEGROUND_AV) @@ -8348,81 +8349,81 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(75); - packet.Worldstates.emplace_back(0x7ae, 1); // AV_SNOWFALL_N - packet.Worldstates.emplace_back(0x532, 1); // AV_FROSTWOLFHUT_H_C - packet.Worldstates.emplace_back(0x531, 0); // AV_FROSTWOLFHUT_A_C - packet.Worldstates.emplace_back(0x52e, 0); // AV_AID_A_A - packet.Worldstates.emplace_back(0x571, 0); // East Frostwolf Tower Horde Assaulted - UNUSED - packet.Worldstates.emplace_back(0x570, 0); // West Frostwolf Tower Horde Assaulted - UNUSED - packet.Worldstates.emplace_back(0x567, 1); // AV_FROSTWOLFE_CONTROLLED - packet.Worldstates.emplace_back(0x566, 1); // AV_FROSTWOLFW_CONTROLLED - packet.Worldstates.emplace_back(0x550, 1); // AV_N_MINE_N - packet.Worldstates.emplace_back(0x544, 0); // AV_ICEBLOOD_A_A - packet.Worldstates.emplace_back(0x536, 0); // AV_PIKEGRAVE_H_C - packet.Worldstates.emplace_back(0x535, 1); // AV_PIKEGRAVE_A_C - packet.Worldstates.emplace_back(0x518, 0); // AV_STONEHEART_A_A - packet.Worldstates.emplace_back(0x517, 0); // AV_STONEHEART_H_A - packet.Worldstates.emplace_back(0x574, 0); // unk - packet.Worldstates.emplace_back(0x573, 0); // Iceblood Tower Horde Assaulted - UNUSED - packet.Worldstates.emplace_back(0x572, 0); // Towerpoint Horde Assaulted - UNUSED - packet.Worldstates.emplace_back(0x56f, 0); // unk - packet.Worldstates.emplace_back(0x56e, 0); // AV_ICEBLOOD_ASSAULTED - packet.Worldstates.emplace_back(0x56d, 0); // AV_TOWERPOINT_ASSAULTED - packet.Worldstates.emplace_back(0x56c, 0); // AV_FROSTWOLFE_ASSAULTED - packet.Worldstates.emplace_back(0x56b, 0); // AV_FROSTWOLFW_ASSAULTED - packet.Worldstates.emplace_back(0x56a, 1); // unk - packet.Worldstates.emplace_back(0x569, 1); // AV_ICEBLOOD_CONTROLLED - packet.Worldstates.emplace_back(0x568, 1); // AV_TOWERPOINT_CONTROLLED - packet.Worldstates.emplace_back(0x565, 0); // AV_STONEH_ASSAULTED - packet.Worldstates.emplace_back(0x564, 0); // AV_ICEWING_ASSAULTED - packet.Worldstates.emplace_back(0x563, 0); // AV_DUNN_ASSAULTED - packet.Worldstates.emplace_back(0x562, 0); // AV_DUNS_ASSAULTED - packet.Worldstates.emplace_back(0x561, 0); // Stoneheart Bunker Alliance Assaulted - UNUSED - packet.Worldstates.emplace_back(0x560, 0); // Icewing Bunker Alliance Assaulted - UNUSED - packet.Worldstates.emplace_back(0x55f, 0); // Dunbaldar South Alliance Assaulted - UNUSED - packet.Worldstates.emplace_back(0x55e, 0); // Dunbaldar North Alliance Assaulted - UNUSED - packet.Worldstates.emplace_back(0x55d, 0); // AV_STONEH_DESTROYED - packet.Worldstates.emplace_back(0x3c6, 0); // AV_UNK_02 - packet.Worldstates.emplace_back(0x3c4, 0); // AV_UNK_01 - packet.Worldstates.emplace_back(0x3c2, 0); // AV_STORMPIKE_COMMANDERS - packet.Worldstates.emplace_back(0x516, 1); // AV_STONEHEART_A_C - packet.Worldstates.emplace_back(0x515, 0); // AV_STONEHEART_H_C - packet.Worldstates.emplace_back(0x3b6, 0); // AV_STORMPIKE_LIEUTENANTS - packet.Worldstates.emplace_back(0x55c, 0); // AV_ICEWING_DESTROYED - packet.Worldstates.emplace_back(0x55b, 0); // AV_DUNN_DESTROYED - packet.Worldstates.emplace_back(0x55a, 0); // AV_DUNS_DESTROYED - packet.Worldstates.emplace_back(0x559, 0); // unk - packet.Worldstates.emplace_back(0x558, 0); // AV_ICEBLOOD_DESTROYED - packet.Worldstates.emplace_back(0x557, 0); // AV_TOWERPOINT_DESTROYED - packet.Worldstates.emplace_back(0x556, 0); // AV_FROSTWOLFE_DESTROYED - packet.Worldstates.emplace_back(0x555, 0); // AV_FROSTWOLFW_DESTROYED - packet.Worldstates.emplace_back(0x554, 1); // AV_STONEH_CONTROLLED - packet.Worldstates.emplace_back(0x553, 1); // AV_ICEWING_CONTROLLED - packet.Worldstates.emplace_back(0x552, 1); // AV_DUNN_CONTROLLED - packet.Worldstates.emplace_back(0x551, 1); // AV_DUNS_CONTROLLED - packet.Worldstates.emplace_back(0x54f, 0); // AV_N_MINE_H - packet.Worldstates.emplace_back(0x54e, 0); // AV_N_MINE_A - packet.Worldstates.emplace_back(0x54d, 1); // AV_S_MINE_N - packet.Worldstates.emplace_back(0x54c, 0); // AV_S_MINE_H - packet.Worldstates.emplace_back(0x54b, 0); // AV_S_MINE_A - packet.Worldstates.emplace_back(0x545, 0); // AV_ICEBLOOD_H_A - packet.Worldstates.emplace_back(0x543, 1); // AV_ICEBLOOD_H_C - packet.Worldstates.emplace_back(0x542, 0); // AV_ICEBLOOD_A_C - packet.Worldstates.emplace_back(0x540, 0); // AV_SNOWFALL_H_A - packet.Worldstates.emplace_back(0x53f, 0); // AV_SNOWFALL_A_A - packet.Worldstates.emplace_back(0x53e, 0); // AV_SNOWFALL_H_C - packet.Worldstates.emplace_back(0x53d, 0); // AV_SNOWFALL_A_C - packet.Worldstates.emplace_back(0x53c, 0); // AV_FROSTWOLF_H_A - packet.Worldstates.emplace_back(0x53b, 0); // AV_FROSTWOLF_A_A - packet.Worldstates.emplace_back(0x53a, 1); // AV_FROSTWOLF_H_C - packet.Worldstates.emplace_back(0x539, 0); // AV_FROSTWOLF_A_C - packet.Worldstates.emplace_back(0x538, 0); // AV_PIKEGRAVE_H_A - packet.Worldstates.emplace_back(0x537, 0); // AV_PIKEGRAVE_A_A - packet.Worldstates.emplace_back(0x534, 0); // AV_FROSTWOLFHUT_H_A - packet.Worldstates.emplace_back(0x533, 0); // AV_FROSTWOLFHUT_A_A - packet.Worldstates.emplace_back(0x530, 0); // AV_AID_H_A - packet.Worldstates.emplace_back(0x52f, 0); // AV_AID_H_C - packet.Worldstates.emplace_back(0x52d, 1); // AV_AID_A_C + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_N, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_C, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_C, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_AID_A_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_UNUSED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_UNUSED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_CONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_CONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_N_MINE_N, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_C, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_C, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_UNK_5, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_UNUSED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_UNUSED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_UNK_4, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_ASSAULTED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_ASSAULTED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_ASSAULTED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_ASSAULTED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_UNK_3, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_CONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_CONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STONEH_ASSAULTED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEWING_ASSAULTED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_DUNN_ASSAULTED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_DUNS_ASSAULTED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STONEH_UNUSED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEWING_UNUSED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_DUNS_UNUSED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_DUNN_UNUSED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STONEH_DESTROYED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_UNK_1, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_UNK_0, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STORMPIKE_COMMANDERS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_C, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_C, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STORMPIKE_LIEUTENANTS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEWING_DESTROYED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_DUNN_DESTROYED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_DUNS_DESTROYED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_UNK_2, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_DESTROYED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_DESTROYED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_DESTROYED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_DESTROYED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_STONEH_CONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEWING_CONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_DUNN_CONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_DUNS_CONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_N_MINE_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_N_MINE_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_S_MINE_N, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_S_MINE_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_S_MINE_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_C, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_C, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_C, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_C, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_C, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_C, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_AID_H_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_AID_H_C, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_AID_A_C, 1); } break; case 3277: // Warsong Gulch @@ -8431,14 +8432,14 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(8); - packet.Worldstates.emplace_back(0x62d, 0); // alliance flag captures - packet.Worldstates.emplace_back(0x62e, 0); // horde flag captures - packet.Worldstates.emplace_back(0x609, 0); // unk, set to 1 on alliance flag pickup... - packet.Worldstates.emplace_back(0x60a, 0); // unk, set to 1 on horde flag pickup, after drop it's -1 - packet.Worldstates.emplace_back(0x60b, 2); // unk - packet.Worldstates.emplace_back(0x641, 3); // unk (max flag captures?) - packet.Worldstates.emplace_back(0x922, 1); // horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) - packet.Worldstates.emplace_back(0x923, 1); // alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_UNK_0, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_UNK_1, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_UNK_2, 2); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_MAX, 3); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_HORDE, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_ALLIANCE, 1); } break; case 3358: // Arathi Basin @@ -8447,38 +8448,38 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(32); - packet.Worldstates.emplace_back(0x6e7, 0); // stables alliance - packet.Worldstates.emplace_back(0x6e8, 0); // stables horde - packet.Worldstates.emplace_back(0x6e9, 0); // stables alliance controlled - packet.Worldstates.emplace_back(0x6ea, 0); // stables horde controlled - packet.Worldstates.emplace_back(0x6ec, 0); // farm alliance - packet.Worldstates.emplace_back(0x6ed, 0); // farm horde - packet.Worldstates.emplace_back(0x6ee, 0); // farm alliance controlled - packet.Worldstates.emplace_back(0x6ef, 0); // farm horde controlled - packet.Worldstates.emplace_back(0x6f0, 0); // alliance resources - packet.Worldstates.emplace_back(0x6f1, 0); // horde resources - packet.Worldstates.emplace_back(0x6f2, 0); // horde bases - packet.Worldstates.emplace_back(0x6f3, 0); // alliance bases - packet.Worldstates.emplace_back(0x6f4, 1600); // max resources (1600) - packet.Worldstates.emplace_back(0x6f6, 0); // blacksmith alliance - packet.Worldstates.emplace_back(0x6f7, 0); // blacksmith horde - packet.Worldstates.emplace_back(0x6f8, 0); // blacksmith alliance controlled - packet.Worldstates.emplace_back(0x6f9, 0); // blacksmith horde controlled - packet.Worldstates.emplace_back(0x6fb, 0); // gold mine alliance - packet.Worldstates.emplace_back(0x6fc, 0); // gold mine horde - packet.Worldstates.emplace_back(0x6fd, 0); // gold mine alliance controlled - packet.Worldstates.emplace_back(0x6fe, 0); // gold mine horde controlled - packet.Worldstates.emplace_back(0x700, 0); // lumber mill alliance - packet.Worldstates.emplace_back(0x701, 0); // lumber mill horde - packet.Worldstates.emplace_back(0x702, 0); // lumber mill alliance controlled - packet.Worldstates.emplace_back(0x703, 0); // lumber mill horde controlled - packet.Worldstates.emplace_back(0x732, 1); // stables (1 - uncontrolled) - packet.Worldstates.emplace_back(0x733, 1); // gold mine (1 - uncontrolled) - packet.Worldstates.emplace_back(0x734, 1); // lumber mill (1 - uncontrolled) - packet.Worldstates.emplace_back(0x735, 1); // farm (1 - uncontrolled) - packet.Worldstates.emplace_back(0x736, 1); // blacksmith (1 - uncontrolled) - packet.Worldstates.emplace_back(0x745, 2); // unk - packet.Worldstates.emplace_back(0x7a3, 1400); // warning limit (1400) + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_CONTROLLED_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_CONTROLLED_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_CONTROLLED_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_CONTROLLED_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_MAX, 1600); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_CONTROLLED_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_CONTROLLED_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_CONTROLLED_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_CONTROLLED_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_CONTROLLED_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_CONTROLLED_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_STABLE_ICON, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_ICON, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_ICON, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_FARM_ICON, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_ICON, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_UNK, 2); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_WARNING, 1400); // warning limit (1400) } break; case 3820: // Eye of the Storm @@ -8487,38 +8488,38 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(32); - packet.Worldstates.emplace_back(0xac1, 0); // Horde Bases - packet.Worldstates.emplace_back(0xac0, 0); // Alliance Bases - packet.Worldstates.emplace_back(0xab6, 0); // Mage Tower - Horde conflict - packet.Worldstates.emplace_back(0xab5, 0); // Mage Tower - Alliance conflict - packet.Worldstates.emplace_back(0xab4, 0); // Fel Reaver - Horde conflict - packet.Worldstates.emplace_back(0xab3, 0); // Fel Reaver - Alliance conflict - packet.Worldstates.emplace_back(0xab2, 0); // Draenei - Alliance conflict - packet.Worldstates.emplace_back(0xab1, 0); // Draenei - Horde conflict - packet.Worldstates.emplace_back(0xab0, 0); // unk (0 at start) - packet.Worldstates.emplace_back(0xaaf, 0); // unk (0 at start) - packet.Worldstates.emplace_back(0xaad, 0); // Draenei - Horde control - packet.Worldstates.emplace_back(0xaac, 0); // Draenei - Alliance control - packet.Worldstates.emplace_back(0xaab, 1); // Draenei uncontrolled (1 - yes, 0 - no) - packet.Worldstates.emplace_back(0xaaa, 0); // Mage Tower - Alliance control - packet.Worldstates.emplace_back(0xaa9, 0); // Mage Tower - Horde control - packet.Worldstates.emplace_back(0xaa8, 1); // Mage Tower uncontrolled (1 - yes, 0 - no) - packet.Worldstates.emplace_back(0xaa7, 0); // Fel Reaver - Horde control - packet.Worldstates.emplace_back(0xaa6, 0); // Fel Reaver - Alliance control - packet.Worldstates.emplace_back(0xaa5, 1); // Fel Reaver uncontrolled (1 - yes, 0 - no) - packet.Worldstates.emplace_back(0xaa4, 0); // Boold Elf - Horde control - packet.Worldstates.emplace_back(0xaa3, 0); // Boold Elf - Alliance control - packet.Worldstates.emplace_back(0xaa2, 1); // Boold Elf uncontrolled (1 - yes, 0 - no) - packet.Worldstates.emplace_back(0xac5, 1); // Flag (1 - show, 0 - hide) - doesn't work exactly this way! - packet.Worldstates.emplace_back(0xad2, 1); // Horde top-stats (1 - show, 0 - hide) // 02 -> horde picked up the flag - packet.Worldstates.emplace_back(0xad1, 1); // Alliance top-stats (1 - show, 0 - hide) // 02 -> alliance picked up the flag - packet.Worldstates.emplace_back(0xabe, 0); // Horde resources - packet.Worldstates.emplace_back(0xabd, 0); // Alliance resources - packet.Worldstates.emplace_back(0xa05, 142); // unk, constant? - packet.Worldstates.emplace_back(0xaa0, 0); // Capturing progress-bar (100 -> empty (only grey), 0 -> blue|red (no grey), default 0) - packet.Worldstates.emplace_back(0xa9f, 0); // Capturing progress-bar (0 - left, 100 - right) - packet.Worldstates.emplace_back(0xa9e, 0); // Capturing progress-bar (1 - show, 0 - hide) - packet.Worldstates.emplace_back(0xc0d, 379); // unk, constant? + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_HORDE_BASE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_BASE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONFLICT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONFLICT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONFLICT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONFLICT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONFLICT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONFLICT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_UNK_2, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_UNK_1, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONTROL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONTROL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_UNCONTROL, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONTROL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONTROL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_UNCONTROL, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONTROL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONTROL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_UNCONTROL, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_HORDE_CONTROL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_ALLIANCE_CONTROL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_UNCONTROL, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_HORDE, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_ALLIANCE, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_HORDE_RESOURCES, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_RESOURCES, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_UNK_0, 142); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_PERCENT_GREY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_STATUS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_UNK_3, 379); // missing unknowns } break; @@ -8530,22 +8531,22 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(16); - packet.Worldstates.emplace_back(0x9ba, 1); // add ally tower main gui icon // maybe should be sent only on login? - packet.Worldstates.emplace_back(0x9b9, 1); // add horde tower main gui icon // maybe should be sent only on login? - packet.Worldstates.emplace_back(0x9b5, 0); // show neutral broken hill icon - packet.Worldstates.emplace_back(0x9b4, 1); // show icon above broken hill - packet.Worldstates.emplace_back(0x9b3, 0); // show ally broken hill icon - packet.Worldstates.emplace_back(0x9b2, 0); // show neutral overlook icon - packet.Worldstates.emplace_back(0x9b1, 1); // show the overlook arrow - packet.Worldstates.emplace_back(0x9b0, 0); // show ally overlook icon - packet.Worldstates.emplace_back(0x9ae, 0); // horde pvp objectives captured - packet.Worldstates.emplace_back(0x9ac, 0); // ally pvp objectives captured - packet.Worldstates.emplace_back(0x9ab, 100); //: ally / horde slider grey area // show only in direct vicinity! - packet.Worldstates.emplace_back(0x9aa, 50); //: ally / horde slider percentage, 100 for ally, 0 for horde // show only in direct vicinity! - packet.Worldstates.emplace_back(0x9a9, 0); //: ally / horde slider display // show only in direct vicinity! - packet.Worldstates.emplace_back(0x9a8, 0); // show the neutral stadium icon - packet.Worldstates.emplace_back(0x9a7, 0); // show the ally stadium icon - packet.Worldstates.emplace_back(0x9a6, 1); // show the horde stadium icon + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_A, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_BROKENHILL_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_BROKENHILL_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_BROKENHILL_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_OVERLOOK_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_OVERLOOK_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_OVERLOOK_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_N, 100); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_POS, 50); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_STADIUM_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_STADIUM_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_STADIUM_H, 1); } break; case 3518: // Nagrand @@ -8554,34 +8555,34 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(28); - packet.Worldstates.emplace_back(0x9c7, 0); // NA_UI_HORDE_GUARDS_SHOW - packet.Worldstates.emplace_back(0x9c6, 0); // NA_UI_ALLIANCE_GUARDS_SHOW - packet.Worldstates.emplace_back(0x9bd, 0); // NA_UI_GUARDS_MAX - packet.Worldstates.emplace_back(0x9bb, 0); // NA_UI_GUARDS_LEFT - packet.Worldstates.emplace_back(0x9bf, 0); // NA_UI_OUTLAND_01 - packet.Worldstates.emplace_back(0x9be, 0); // NA_UI_UNK_1 - packet.Worldstates.emplace_back(0x9c1, 0); // NA_UI_UNK_2 - packet.Worldstates.emplace_back(0xaca, 0); // NA_MAP_WYVERN_NORTH_NEU_H - packet.Worldstates.emplace_back(0xa66, 0); // NA_MAP_WYVERN_NORTH_NEU_A - packet.Worldstates.emplace_back(0xa67, 0); // NA_MAP_WYVERN_NORTH_H - packet.Worldstates.emplace_back(0xa68, 0); // NA_MAP_WYVERN_NORTH_A - packet.Worldstates.emplace_back(0xac8, 0); // NA_MAP_WYVERN_SOUTH_NEU_H - packet.Worldstates.emplace_back(0xa6e, 0); // NA_MAP_WYVERN_SOUTH_NEU_A - packet.Worldstates.emplace_back(0xa6c, 0); // NA_MAP_WYVERN_SOUTH_H - packet.Worldstates.emplace_back(0xa6d, 0); // NA_MAP_WYVERN_SOUTH_A - packet.Worldstates.emplace_back(0xac9, 0); // NA_MAP_WYVERN_WEST_NEU_H - packet.Worldstates.emplace_back(0xa6b, 0); // NA_MAP_WYVERN_WEST_NEU_A - packet.Worldstates.emplace_back(0xa69, 0); // NA_MAP_WYVERN_WEST_H - packet.Worldstates.emplace_back(0xa6a, 0); // NA_MAP_WYVERN_WEST_A - packet.Worldstates.emplace_back(0xacb, 0); // NA_MAP_WYVERN_EAST_NEU_H - packet.Worldstates.emplace_back(0xa63, 0); // NA_MAP_WYVERN_EAST_NEU_A - packet.Worldstates.emplace_back(0xa64, 0); // NA_MAP_WYVERN_EAST_H - packet.Worldstates.emplace_back(0xa65, 0); // NA_MAP_WYVERN_EAST_A - packet.Worldstates.emplace_back(0xa6f, 0); // NA_MAP_HALAA_NEUTRAL - packet.Worldstates.emplace_back(0xa74, 0); // NA_MAP_HALAA_NEU_A - packet.Worldstates.emplace_back(0xa75, 0); // NA_MAP_HALAA_NEU_H - packet.Worldstates.emplace_back(0xa70, 0); // NA_MAP_HALAA_HORDE - packet.Worldstates.emplace_back(0xa71, 0); // NA_MAP_HALAA_ALLIANCE + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_GUARDS_MAX, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_POS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_SLIDER_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_NEUTRAL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_ALLIANCE, 0); } break; case 3519: // Terokkar Forest @@ -8590,34 +8591,34 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(28); - packet.Worldstates.emplace_back(0xa41, 0); // TF_UI_CAPTURE_BAR_POS - packet.Worldstates.emplace_back(0xa40, 20); // TF_UI_CAPTURE_BAR_NEUTRAL - packet.Worldstates.emplace_back(0xa3f, 0); // TF_UI_SHOW CAPTURE BAR - packet.Worldstates.emplace_back(0xa3e, 0); // TF_UI_TOWER_COUNT_H - packet.Worldstates.emplace_back(0xa3d, 5); // TF_UI_TOWER_COUNT_A - packet.Worldstates.emplace_back(0xa3c, 0); // TF_UI_TOWERS_CONTROLLED_DISPLAY - packet.Worldstates.emplace_back(0xa88, 0); // TF_TOWER_NUM_15 - SE Neutral - packet.Worldstates.emplace_back(0xa87, 0); // TF_TOWER_NUM_14 - SE Horde - packet.Worldstates.emplace_back(0xa86, 0); // TF_TOWER_NUM_13 - SE Alliance - packet.Worldstates.emplace_back(0xa85, 0); // TF_TOWER_NUM_12 - S Neutral - packet.Worldstates.emplace_back(0xa84, 0); // TF_TOWER_NUM_11 - S Horde - packet.Worldstates.emplace_back(0xa83, 0); // TF_TOWER_NUM_10 - S Alliance - packet.Worldstates.emplace_back(0xa82, 0); // TF_TOWER_NUM_09 - NE Neutral - packet.Worldstates.emplace_back(0xa81, 0); // TF_TOWER_NUM_08 - NE Horde - packet.Worldstates.emplace_back(0xa80, 0); // TF_TOWER_NUM_07 - NE Alliance - packet.Worldstates.emplace_back(0xa7f, 0); // TF_TOWER_NUM_16 - unk - packet.Worldstates.emplace_back(0xa7e, 0); // TF_TOWER_NUM_06 - N Neutral - packet.Worldstates.emplace_back(0xa7d, 0); // TF_TOWER_NUM_05 - N Horde - packet.Worldstates.emplace_back(0xa7c, 0); // TF_TOWER_NUM_04 - N Alliance - packet.Worldstates.emplace_back(0xa7b, 0); // TF_TOWER_NUM_03 - NW Alliance - packet.Worldstates.emplace_back(0xa7a, 0); // TF_TOWER_NUM_02 - NW Horde - packet.Worldstates.emplace_back(0xa79, 0); // TF_TOWER_NUM_01 - NW Neutral - packet.Worldstates.emplace_back(0x9d0, 5); // TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT - packet.Worldstates.emplace_back(0x9ce, 0); // TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT - packet.Worldstates.emplace_back(0x9cd, 0); // TF_UI_LOCKED_TIME_HOURS - packet.Worldstates.emplace_back(0x9cc, 0); // TF_UI_LOCKED_DISPLAY_NEUTRAL - packet.Worldstates.emplace_back(0xad0, 0); // TF_UI_LOCKED_DISPLAY_HORDE - packet.Worldstates.emplace_back(0xacf, 1); // TF_UI_LOCKED_DISPLAY_ALLIANCE + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_POS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_N, 20); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A, 5); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_14, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_13, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_12, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_11, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_10, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_09, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_08, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_07, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_06, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_15, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_05, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_04, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_03, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_02, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_01, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_TOWER_NUM_00, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, 5); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_HOURS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_NEUTRAL, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_ALLIANCE, 1); } break; case 3521: // Zangarmarsh @@ -8626,32 +8627,32 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(26); - packet.Worldstates.emplace_back(0x9e1, 0); // ZM_UNK_1 - packet.Worldstates.emplace_back(0x9e0, 0); // ZM_UNK_2 - packet.Worldstates.emplace_back(0x9df, 0); // ZM_UNK_3 - packet.Worldstates.emplace_back(0xa5d, 1); // ZM_WORLDSTATE_UNK_1 - packet.Worldstates.emplace_back(0xa5c, 0); // ZM_MAP_TOWER_EAST_N - packet.Worldstates.emplace_back(0xa5b, 1); // ZM_MAP_TOWER_EAST_H - packet.Worldstates.emplace_back(0xa5a, 0); // ZM_MAP_TOWER_EAST_A - packet.Worldstates.emplace_back(0xa59, 1); // ZM_MAP_GRAVEYARD_H - Twin spire graveyard horde - packet.Worldstates.emplace_back(0xa58, 0); // ZM_MAP_GRAVEYARD_A - packet.Worldstates.emplace_back(0xa57, 0); // ZM_MAP_GRAVEYARD_N - packet.Worldstates.emplace_back(0xa56, 0); // ZM_MAP_TOWER_WEST_N - packet.Worldstates.emplace_back(0xa55, 1); // ZM_MAP_TOWER_WEST_H - packet.Worldstates.emplace_back(0xa54, 0); // ZM_MAP_TOWER_WEST_A - packet.Worldstates.emplace_back(0x9e7, 0); // ZM_UNK_4 - packet.Worldstates.emplace_back(0x9e6, 0); // ZM_UNK_5 - packet.Worldstates.emplace_back(0x9e5, 0); // ZM_UNK_6 - packet.Worldstates.emplace_back(0xa00, 0); // ZM_UI_TOWER_EAST_N - packet.Worldstates.emplace_back(0x9ff, 1); // ZM_UI_TOWER_EAST_H - packet.Worldstates.emplace_back(0x9fe, 0); // ZM_UI_TOWER_EAST_A - packet.Worldstates.emplace_back(0x9fd, 0); // ZM_UI_TOWER_WEST_N - packet.Worldstates.emplace_back(0x9fc, 1); // ZM_UI_TOWER_WEST_H - packet.Worldstates.emplace_back(0x9fb, 0); // ZM_UI_TOWER_WEST_A - packet.Worldstates.emplace_back(0xa62, 0); // ZM_MAP_HORDE_FLAG_READY - packet.Worldstates.emplace_back(0xa61, 1); // ZM_MAP_HORDE_FLAG_NOT_READY - packet.Worldstates.emplace_back(0xa60, 1); // ZM_MAP_ALLIANCE_FLAG_NOT_READY - packet.Worldstates.emplace_back(0xa5f, 0); // ZM_MAP_ALLIANCE_FLAG_READY + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_N_W, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_POS_W, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_DISPLAY_W, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UNK, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_N_E, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_POS_E, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_DISPLAY_E, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_N, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_A, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_READY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_NOT_READY, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_NOT_READY, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_READY, 0); } break; case 3698: // Nagrand Arena @@ -8660,9 +8661,9 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0xa0f, 0); // BATTLEGROUND_NAGRAND_ARENA_GOLD - packet.Worldstates.emplace_back(0xa10, 0); // BATTLEGROUND_NAGRAND_ARENA_GREEN - packet.Worldstates.emplace_back(0xa11, 0); // BATTLEGROUND_NAGRAND_ARENA_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_NA_ARENA_GOLD, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_NA_ARENA_GREEN, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_NA_ARENA_SHOW, 0); } break; case 3702: // Blade's Edge Arena @@ -8671,9 +8672,9 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0x9f0, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_GOLD - packet.Worldstates.emplace_back(0x9f1, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_GREEN - packet.Worldstates.emplace_back(0x9f3, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_BE_ARENA_GOLD, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_BE_ARENA_GREEN, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_BE_ARENA_SHOW, 0); } break; case 3968: // Ruins of Lordaeron @@ -8682,9 +8683,9 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0xbb8, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_GOLD - packet.Worldstates.emplace_back(0xbb9, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_GREEN - packet.Worldstates.emplace_back(0xbba, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RL_ARENA_GOLD, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RL_ARENA_GREEN, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RL_ARENA_SHOW, 0); } break; case 4378: // Dalaran Sewers @@ -8693,9 +8694,9 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0xe11, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD - packet.Worldstates.emplace_back(0xe10, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN - packet.Worldstates.emplace_back(0xe1a, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_DS_ARENA_GOLD, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_DS_ARENA_GREEN, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_DS_ARENA_SHOW, 0); } break; case 4384: // Strand of the Ancients @@ -8704,34 +8705,33 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(24); - // 1-3 A defend, 4-6 H defend, 7-9 unk defend, 1 - ok, 2 - half destroyed, 3 - destroyed - packet.Worldstates.emplace_back(0xf09, 0); // Gate of Temple - packet.Worldstates.emplace_back(0xe36, 0); // Gate of Yellow Moon - packet.Worldstates.emplace_back(0xe27, 0); // Gate of Green Emerald - packet.Worldstates.emplace_back(0xe24, 0); // Gate of Blue Sapphire - packet.Worldstates.emplace_back(0xe21, 0); // Gate of Red Sun - packet.Worldstates.emplace_back(0xe1e, 0); // Gate of Purple Ametyst - packet.Worldstates.emplace_back(0xdf3, 0); // bonus timer (1 - on, 0 - off) - packet.Worldstates.emplace_back(0xded, 0); // Horde Attacker - packet.Worldstates.emplace_back(0xdec, 0); // Alliance Attacker + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RED_GATE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_BONUS_TIMER, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKER, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ENABLE_TIMER, 0); // End Round timer, example: 19:59 -> A:BC - packet.Worldstates.emplace_back(0xde9, 0); // C - packet.Worldstates.emplace_back(0xde8, 0); // B - packet.Worldstates.emplace_back(0xde7, 0); // A + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_SECOND_DIGIT, 0); // C + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_FIRST_DIGIT, 0); // B + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_MINUTES, 0); // A - packet.Worldstates.emplace_back(0xe35, 0); // BG_SA_CENTER_GY_ALLIANCE - packet.Worldstates.emplace_back(0xe34, 0); // BG_SA_RIGHT_GY_ALLIANCE - packet.Worldstates.emplace_back(0xe33, 0); // BG_SA_LEFT_GY_ALLIANCE - packet.Worldstates.emplace_back(0xe32, 0); // BG_SA_CENTER_GY_HORDE - packet.Worldstates.emplace_back(0xe31, 0); // BG_SA_LEFT_GY_HORDE - packet.Worldstates.emplace_back(0xe30, 0); // BG_SA_RIGHT_GY_HORDE - packet.Worldstates.emplace_back(0xe2f, 0); // BG_SA_HORDE_DEFENCE_TOKEN - packet.Worldstates.emplace_back(0xe2e, 0); // BG_SA_ALLIANCE_DEFENCE_TOKEN - packet.Worldstates.emplace_back(0xe2d, 0); // BG_SA_LEFT_ATT_TOKEN_HRD - packet.Worldstates.emplace_back(0xe2c, 0); // BG_SA_RIGHT_ATT_TOKEN_HRD - packet.Worldstates.emplace_back(0xe2b, 0); // BG_SA_RIGHT_ATT_TOKEN_ALL - packet.Worldstates.emplace_back(0xe2a, 0); // BG_SA_LEFT_ATT_TOKEN_ALL + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE, 0); // missing unknowns } break; @@ -8741,9 +8741,9 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0xe10, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN - packet.Worldstates.emplace_back(0xe11, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD - packet.Worldstates.emplace_back(0xe1a, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RV_ARENA_GREEN, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RV_ARENA_GOLD, 0); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW, 0); } break; case 4710: // Isle of Conquest @@ -8752,24 +8752,24 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(18); - packet.Worldstates.emplace_back(0x107d, 1); // BG_IC_ALLIANCE_RENFORT_SET - packet.Worldstates.emplace_back(0x107e, 1); // BG_IC_HORDE_RENFORT_SET - packet.Worldstates.emplace_back(0x1082, 300); // BG_IC_ALLIANCE_RENFORT - packet.Worldstates.emplace_back(0x1083, 300); // BG_IC_HORDE_RENFORT - packet.Worldstates.emplace_back(0x10e2, 1); // BG_IC_GATE_FRONT_H_WS_OPEN - packet.Worldstates.emplace_back(0x10e1, 1); // BG_IC_GATE_WEST_H_WS_OPEN - packet.Worldstates.emplace_back(0x10e0, 1); // BG_IC_GATE_EAST_H_WS_OPEN - packet.Worldstates.emplace_back(0x10e3, 1); // BG_IC_GATE_FRONT_A_WS_OPEN - packet.Worldstates.emplace_back(0x10e4, 1); // BG_IC_GATE_WEST_A_WS_OPEN - packet.Worldstates.emplace_back(0x10e5, 1); // BG_IC_GATE_EAST_A_WS_OPEN - packet.Worldstates.emplace_back(0x10dd, 1); // unk - packet.Worldstates.emplace_back(0x10cd, 1); // BG_IC_DOCKS_UNCONTROLLED - packet.Worldstates.emplace_back(0x10c8, 1); // BG_IC_HANGAR_UNCONTROLLED - packet.Worldstates.emplace_back(0x10d2, 1); // BG_IC_QUARRY_UNCONTROLLED - packet.Worldstates.emplace_back(0x10d7, 1); // BG_IC_REFINERY_UNCONTROLLED - packet.Worldstates.emplace_back(0x10c6, 1); // BG_IC_WORKSHOP_UNCONTROLLED - packet.Worldstates.emplace_back(0x1093, 1); // unk - packet.Worldstates.emplace_back(0x10f9, 1); // unk + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT_SET, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT_SET, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT, 300); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT, 300); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_OPEN, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_OPEN, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_OPEN, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_OPEN, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_OPEN, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_OPEN, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_CLOSED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_DOCKS_UNCONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HANGAR_UNCONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_QUARRY_UNCONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_REFINERY_UNCONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_UNCONTROLLED, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_UNK, 1); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_H, 1); } break; case 4987: // The Ruby Sanctum @@ -8778,9 +8778,9 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0x13b9, 50); // WORLDSTATE_CORPOREALITY_MATERIAL - packet.Worldstates.emplace_back(0x13ba, 50); // WORLDSTATE_CORPOREALITY_TWILIGHT - packet.Worldstates.emplace_back(0x13bb, 0); // WORLDSTATE_CORPOREALITY_TOGGLE + packet.Worldstates.emplace_back(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_MATERIAL, 50); + packet.Worldstates.emplace_back(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TWILIGHT, 50); + packet.Worldstates.emplace_back(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TOGGLE, 0); } break; case 4812: // Icecrown Citadel @@ -8789,11 +8789,11 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(0x1327, 0); // WORLDSTATE_SHOW_TIMER (Blood Quickening weekly) - packet.Worldstates.emplace_back(0x1328, 30); // WORLDSTATE_EXECUTION_TIME - packet.Worldstates.emplace_back(0x134c, 0); // WORLDSTATE_SHOW_ATTEMPTS - packet.Worldstates.emplace_back(0x134d, 50); // WORLDSTATE_ATTEMPTS_REMAINING - packet.Worldstates.emplace_back(0x134e, 50); // WORLDSTATE_ATTEMPTS_MAX + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER, 0); + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_EXECUTION_TIME, 30); + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_SHOW_ATTEMPTS, 0); + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_REMAINING, 50); + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_MAX, 50); } break; case 4100: // The Culling of Stratholme @@ -8802,11 +8802,11 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(0xd97, 0); // WORLDSTATE_SHOW_CRATES - packet.Worldstates.emplace_back(0xd98, 0); // WORLDSTATE_CRATES_REVEALED - packet.Worldstates.emplace_back(0xdb0, 0); // WORLDSTATE_WAVE_COUNT - packet.Worldstates.emplace_back(0xf5b, 25); // WORLDSTATE_TIME_GUARDIAN - packet.Worldstates.emplace_back(0xf5c, 0); // WORLDSTATE_TIME_GUARDIAN_SHOW + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES, 0); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_CRATES_REVEALED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN, 25); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, 0); } break; case 4228: // The Oculus @@ -8815,8 +8815,8 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(2); - packet.Worldstates.emplace_back(0xdc4, 0); // WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW - packet.Worldstates.emplace_back(0xd9e, 0); // WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT + packet.Worldstates.emplace_back(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_AMOUNT, 0); } break; case 4273: // Ulduar @@ -8825,8 +8825,8 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(2); - packet.Worldstates.emplace_back(0x1024, 0); // WORLDSTATE_ALGALON_TIMER_ENABLED - packet.Worldstates.emplace_back(0x1023, 0); // WORLDSTATE_ALGALON_DESPAWN_TIMER + packet.Worldstates.emplace_back(WORLD_STATE_ULDUAR_ALGALON_TIMER_ENABLED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_ULDUAR_ALGALON_DESPAWN_TIMER, 0); } break; case 4415: // Violet Hold @@ -8835,9 +8835,9 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(0xee8, 0); // WORLD_STATE_VH_SHOW - packet.Worldstates.emplace_back(0xee7, 100); // WORLD_STATE_VH_PRISON_STATE - packet.Worldstates.emplace_back(0xee2, 0); // WORLD_STATE_VH_WAVE_COUNT + packet.Worldstates.emplace_back(WORLD_STATE_VIOLET_HOLD_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_VIOLET_HOLD_PRISON_STATE, 100); + packet.Worldstates.emplace_back(WORLD_STATE_VIOLET_HOLD_WAVE_COUNT, 0); } break; case 4820: // Halls of Refection @@ -8846,8 +8846,8 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) else { packet.Worldstates.reserve(2); - packet.Worldstates.emplace_back(0x1314, 0); // WORLD_STATE_HOR_WAVES_ENABLED - packet.Worldstates.emplace_back(0x1312, 0); // WORLD_STATE_HOR_WAVE_COUNT + packet.Worldstates.emplace_back(WORLD_STATE_HALLS_OF_REFLECTION_WAVES_ENABLED, 0); + packet.Worldstates.emplace_back(WORLD_STATE_HALLS_OF_REFLECTION_WAVE_COUNT, 0); } break; case 4298: // Scarlet Enclave (DK starting zone) @@ -8857,12 +8857,12 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) if (CreatureAI* mograineAI = mograine->AI()) { packet.Worldstates.reserve(6); - packet.Worldstates.emplace_back(0xe06, mograineAI->GetData(3590)); - packet.Worldstates.emplace_back(0xe07, mograineAI->GetData(3591)); - packet.Worldstates.emplace_back(0xe08, mograineAI->GetData(3592)); - packet.Worldstates.emplace_back(0xe13, mograineAI->GetData(3603)); - packet.Worldstates.emplace_back(0xe14, mograineAI->GetData(3604)); - packet.Worldstates.emplace_back(0xe15, mograineAI->GetData(3605)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT, mograineAI->GetData(3590)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT, mograineAI->GetData(3591)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE, mograineAI->GetData(3592)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE, mograineAI->GetData(3603)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, mograineAI->GetData(3604)); + packet.Worldstates.emplace_back(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE, mograineAI->GetData(3605)); } } break; @@ -8875,10 +8875,10 @@ void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) [[fallthrough]]; default: packet.Worldstates.reserve(4); - packet.Worldstates.emplace_back(0x914, 0); - packet.Worldstates.emplace_back(0x913, 0); - packet.Worldstates.emplace_back(0x912, 0); - packet.Worldstates.emplace_back(0x915, 0); + packet.Worldstates.emplace_back(WORLD_STATE_GENERIC_UNK_2, 0); + packet.Worldstates.emplace_back(WORLD_STATE_GENERIC_UNK_1, 0); + packet.Worldstates.emplace_back(WORLD_STATE_GENERIC_UNK_0, 0); + packet.Worldstates.emplace_back(WORLD_STATE_GENERIC_UNK_3, 0); break; } } diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index ca133a3d9..4c4d69f53 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -22,6 +22,7 @@ #include "QueryResult.h" #include "SpellMgr.h" #include "World.h" +#include "WorldStateDefines.h" void CharacterDatabaseCleaner::CleanDatabase() { @@ -34,7 +35,7 @@ void CharacterDatabaseCleaner::CleanDatabase() uint32 oldMSTime = getMSTime(); // check flags which clean ups are necessary - QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry = {}", WS_CLEANING_FLAGS); + QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry = {}", WORLD_STATE_CUSTOM_CLEANING_FLAGS); if (!result) return; @@ -59,7 +60,7 @@ void CharacterDatabaseCleaner::CleanDatabase() // NOTE: In order to have persistentFlags be set in worldstates for the next cleanup, // you need to define them at least once in worldstates. flags &= sWorld->getIntConfig(CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS); - CharacterDatabase.DirectExecute("UPDATE worldstates SET value = {} WHERE entry = {}", flags, WS_CLEANING_FLAGS); + CharacterDatabase.DirectExecute("UPDATE worldstates SET value = {} WHERE entry = {}", flags, WORLD_STATE_CUSTOM_CLEANING_FLAGS); sWorld->SetCleaningFlags(flags); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index b9d740d15..fff052a60 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -96,6 +96,7 @@ #include "WorldSession.h" #include "WorldSessionMgr.h" #include "WorldState.h" +#include "WorldStateDefines.h" #include #include @@ -2516,67 +2517,67 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount,uint32 acc void World::InitWeeklyQuestResetTime() { - Seconds wstime = Seconds(sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME)); + Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME)); _nextWeeklyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(4, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count()); } } void World::InitDailyQuestResetTime() { - Seconds wstime = Seconds(sWorld->getWorldState(WS_DAILY_QUEST_RESET_TIME)); + Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME)); _nextDailyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count()); } } void World::InitMonthlyQuestResetTime() { - Seconds wstime = Seconds(sWorld->getWorldState(WS_MONTHLY_QUEST_RESET_TIME)); + Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME)); _nextMonthlyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count()); } } void World::InitRandomBGResetTime() { - Seconds wstime = Seconds(sWorld->getWorldState(WS_BG_DAILY_RESET_TIME)); + Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME)); _nextRandomBGReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, _nextRandomBGReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME, _nextRandomBGReset.count()); } } void World::InitCalendarOldEventsDeletionTime() { - Seconds currentDeletionTime = Seconds(getWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME)); + Seconds currentDeletionTime = Seconds(getWorldState(WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME)); Seconds nextDeletionTime = currentDeletionTime > 0s ? currentDeletionTime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, getIntConfig(CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR))); if (currentDeletionTime == 0s) { - sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, nextDeletionTime.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, nextDeletionTime.count()); } } void World::InitGuildResetTime() { - Seconds wstime = Seconds(getWorldState(WS_GUILD_DAILY_RESET_TIME)); + Seconds wstime = Seconds(getWorldState(WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME)); _nextGuildReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, _nextGuildReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME, _nextGuildReset.count()); } } @@ -2591,7 +2592,7 @@ void World::ResetDailyQuests() itr->second->GetPlayer()->ResetDailyQuestStatus(); _nextDailyQuestReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); - sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count()); // change available dailies sPoolMgr->ChangeDailyQuests(); @@ -2627,7 +2628,7 @@ void World::ResetWeeklyQuests() itr->second->GetPlayer()->ResetWeeklyQuestStatus(); _nextWeeklyQuestReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(4, 6)); - sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count()); // change available weeklies sPoolMgr->ChangeWeeklyQuests(); @@ -2646,7 +2647,7 @@ void World::ResetMonthlyQuests() itr->second->GetPlayer()->ResetMonthlyQuestStatus(); _nextMonthlyQuestReset = Seconds(Acore::Time::GetNextTimeWithMonthAndHour(-1, 6)); - sWorld->setWorldState(WS_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count()); } void World::ResetEventSeasonalQuests(uint16 event_id) @@ -2674,7 +2675,7 @@ void World::ResetRandomBG() itr->second->GetPlayer()->SetRandomWinner(false); _nextRandomBGReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); - sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, _nextRandomBGReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME, _nextRandomBGReset.count()); } void World::CalendarDeleteOldEvents() @@ -2682,7 +2683,7 @@ void World::CalendarDeleteOldEvents() LOG_INFO("server.worldserver", "Calendar deletion of old events."); _nextCalendarOldEventsDeletionTime = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, getIntConfig(CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR))); - sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, _nextCalendarOldEventsDeletionTime.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, _nextCalendarOldEventsDeletionTime.count()); sCalendarMgr->DeleteOldEvents(); } @@ -2691,7 +2692,7 @@ void World::ResetGuildCap() LOG_INFO("server.worldserver", "Guild Daily Cap reset."); _nextGuildReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); - sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, _nextGuildReset.count()); + sWorld->setWorldState(WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME, _nextGuildReset.count()); sGuildMgr->ResetTimes(); } diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 73ee81c4d..864202c1e 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -127,18 +127,6 @@ enum RealmZone REALM_ZONE_CN5_8 = 37 // basic-Latin at create, any at login }; -enum WorldStates -{ - WS_ARENA_DISTRIBUTION_TIME = 20001, // Next arena distribution time - WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time - WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time - WS_CLEANING_FLAGS = 20004, // Cleaning Flags - WS_DAILY_QUEST_RESET_TIME = 20005, // Next daily reset time - WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time - WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time - WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME = 20008 // Next daily calendar deletions of old events time -}; - // xinef: petitions storage struct PetitionData { diff --git a/src/server/game/World/WorldState.cpp b/src/server/game/World/WorldState.cpp index dcec3b958..e5defc1fc 100644 --- a/src/server/game/World/WorldState.cpp +++ b/src/server/game/World/WorldState.cpp @@ -21,6 +21,7 @@ #include "SharedDefines.h" #include "Weather.h" #include "WorldState.h" +#include "WorldStateDefines.h" WorldState* WorldState::instance() { diff --git a/src/server/game/World/WorldState.h b/src/server/game/World/WorldState.h index b6198a7b9..4ba883b6b 100644 --- a/src/server/game/World/WorldState.h +++ b/src/server/game/World/WorldState.h @@ -21,24 +21,6 @@ #include "Player.h" #include -// TODO: Move these to WorldStateDefines.h -enum WorldStateWorldStates -{ - // Sun's Reach Reclamation - WORLD_STATE_QUEL_DANAS_MUSIC = 3426, - WORLD_STATE_QUEL_DANAS_HARBOR = 3238, - WORLD_STATE_QUEL_DANAS_ALCHEMY_LAB = 3223, - WORLD_STATE_QUEL_DANAS_ARMORY = 3233, - WORLD_STATE_QUEL_DANAS_SANCTUM = 3244, - WORLD_STATE_QUEL_DANAS_PORTAL = 3269, - WORLD_STATE_QUEL_DANAS_ANVIL = 3228, - WORLD_STATE_QUEL_DANAS_MONUMENT = 3275, - // Sunwell Gate - WORLD_STATE_AGAMATH_THE_FIRST_GATE_HEALTH = 3253, // guessed, potentially wrong - WORLD_STATE_ROHENDOR_THE_SECOND_GATE_HEALTH = 3255, - WORLD_STATE_ARCHONISUS_THE_FINAL_GATE_HEALTH = 3257, -}; - enum WorldStateCondition { WORLD_STATE_CONDITION_TROLLBANES_COMMAND = 39911, diff --git a/src/server/game/World/WorldStateDefines.h b/src/server/game/World/WorldStateDefines.h new file mode 100644 index 000000000..5a7a869f5 --- /dev/null +++ b/src/server/game/World/WorldStateDefines.h @@ -0,0 +1,622 @@ +/* + * 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 . + */ + +#ifndef WORLD_STATE_DEFINES_H +#define WORLD_STATE_DEFINES_H + +enum WorldStateIDs +{ + // Scourge Invasion + WORLD_STATE_SCOURGE_INVASION_VICTORIES = 2219, + + // Active Invasion Indicators + WORLD_STATE_SCOURGE_INVASION_WINTERSPRING = 2259, + WORLD_STATE_SCOURGE_INVASION_AZSHARA = 2260, + WORLD_STATE_SCOURGE_INVASION_BLASTED_LANDS = 2261, + WORLD_STATE_SCOURGE_INVASION_BURNING_STEPPES = 2262, + WORLD_STATE_SCOURGE_INVASION_TANARIS = 2263, + WORLD_STATE_SCOURGE_INVASION_EASTERN_PLAGUELANDS = 2264, + + // Active Necropoli + WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_AZSHARA = 2279, + WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_BLASTED_LANDS = 2280, + WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_BURNING_STEPPES = 2281, + WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_EASTERN_PLAGUELANDS = 2282, + WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_TANARIS = 2283, + WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_WINTERSPRING = 2284, + + // Arena + WORLD_STATE_ARENA_SEASON_PROGRESS = 3191, + WORLD_STATE_ARENA_ALIVE_PLAYERS_GREEN = 3600, + WORLD_STATE_ARENA_ALIVE_PLAYERS_GOLD = 3601, + WORLD_STATE_ARENA_SEASON_ID = 3901, + + // Sun's Reach Reclamation + WORLD_STATE_QUEL_DANAS_MUSIC = 3426, + WORLD_STATE_QUEL_DANAS_HARBOR = 3238, + WORLD_STATE_QUEL_DANAS_ALCHEMY_LAB = 3223, + WORLD_STATE_QUEL_DANAS_ARMORY = 3233, + WORLD_STATE_QUEL_DANAS_SANCTUM = 3244, + WORLD_STATE_QUEL_DANAS_PORTAL = 3269, + WORLD_STATE_QUEL_DANAS_ANVIL = 3228, + WORLD_STATE_QUEL_DANAS_MONUMENT = 3275, + + // Sunwell Gate + WORLD_STATE_AGAMATH_THE_FIRST_GATE_HEALTH = 3253, // guessed, potentially wrong + WORLD_STATE_ROHENDOR_THE_SECOND_GATE_HEALTH = 3255, + WORLD_STATE_ARCHONISUS_THE_FINAL_GATE_HEALTH = 3257, + + // Wintergrasp + WORLD_STATE_BATTLEFIELD_WG_VEHICLE_H = 3490, + WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_H = 3491, + WORLD_STATE_BATTLEFIELD_WG_VEHICLE_A = 3680, + WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_A = 3681, + WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_K_W = 3698, + WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_K_E = 3699, + WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_NW = 3700, + WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_NE = 3701, + WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_SW = 3702, + WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_SE = 3703, + WORLD_STATE_BATTLEFIELD_WG_SHOW = 3710, + WORLD_STATE_BATTLEFIELD_WG_CLOCK = 3781, + WORLD_STATE_BATTLEFIELD_WG_ACTIVE = 3801, + WORLD_STATE_BATTLEFIELD_WG_DEFENDER = 3802, + WORLD_STATE_BATTLEFIELD_WG_ATTACKER = 3803, + WORLD_STATE_BATTLEFIELD_WG_CONTROL = 3804, // Shows on the map who controls WG + WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_CAPTURED = 4022, + WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_CAPTURED = 4023, + WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_DEFENDED = 4024, + WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_DEFENDED = 4025, + WORLD_STATE_BATTLEFIELD_WG_CLOCK_TEXTS = 4354, + WORLD_STATE_BATTLEFIELD_WG_ICON_ACTIVE = 4375, // Activates "ice" icon + + // Alterac Valley + WORLD_STATE_BATTLEGROUND_AV_STORMPIKE_LIEUTENANTS = 950, + WORLD_STATE_BATTLEGROUND_AV_STORMPIKE_COMMANDERS = 962, + WORLD_STATE_BATTLEGROUND_AV_UNK_0 = 964, + WORLD_STATE_BATTLEGROUND_AV_UNK_1 = 966, + WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_C = 1301, + WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_C = 1302, + WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_A = 1303, + WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_A = 1304, + WORLD_STATE_BATTLEGROUND_AV_AID_A_C = 1325, + WORLD_STATE_BATTLEGROUND_AV_AID_A_A = 1326, + WORLD_STATE_BATTLEGROUND_AV_AID_H_C = 1327, + WORLD_STATE_BATTLEGROUND_AV_AID_H_A = 1328, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_C = 1329, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_C = 1330, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_A = 1331, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_A = 1332, + WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_C = 1333, + WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_C = 1334, + WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_A = 1335, + WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_A = 1336, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_C = 1337, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_C = 1338, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_A = 1339, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_A = 1340, + WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_C = 1341, + WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_C = 1342, + WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_A = 1343, + WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_A = 1344, + WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_C = 1346, + WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_C = 1347, + WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_A = 1348, + WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_A = 1349, + WORLD_STATE_BATTLEGROUND_AV_S_MINE_A = 1355, + WORLD_STATE_BATTLEGROUND_AV_S_MINE_H = 1356, + WORLD_STATE_BATTLEGROUND_AV_S_MINE_N = 1357, + WORLD_STATE_BATTLEGROUND_AV_N_MINE_A = 1358, + WORLD_STATE_BATTLEGROUND_AV_N_MINE_H = 1359, + WORLD_STATE_BATTLEGROUND_AV_N_MINE_N = 1360, + WORLD_STATE_BATTLEGROUND_AV_DUNS_CONTROLLED = 1361, + WORLD_STATE_BATTLEGROUND_AV_DUNN_CONTROLLED = 1362, + WORLD_STATE_BATTLEGROUND_AV_ICEWING_CONTROLLED = 1363, + WORLD_STATE_BATTLEGROUND_AV_STONEH_CONTROLLED = 1364, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_DESTROYED = 1365, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_DESTROYED = 1366, + WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_DESTROYED = 1367, + WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_DESTROYED = 1368, + WORLD_STATE_BATTLEGROUND_AV_UNK_2 = 1369, + WORLD_STATE_BATTLEGROUND_AV_DUNS_DESTROYED = 1370, + WORLD_STATE_BATTLEGROUND_AV_DUNN_DESTROYED = 1371, + WORLD_STATE_BATTLEGROUND_AV_ICEWING_DESTROYED = 1372, + WORLD_STATE_BATTLEGROUND_AV_STONEH_DESTROYED = 1373, + WORLD_STATE_BATTLEGROUND_AV_DUNN_UNUSED = 1374, // Unused + WORLD_STATE_BATTLEGROUND_AV_DUNS_UNUSED = 1375, // Unused + WORLD_STATE_BATTLEGROUND_AV_ICEWING_UNUSED = 1376, // Unused + WORLD_STATE_BATTLEGROUND_AV_STONEH_UNUSED = 1377, // Unused + WORLD_STATE_BATTLEGROUND_AV_DUNS_ASSAULTED = 1378, + WORLD_STATE_BATTLEGROUND_AV_DUNN_ASSAULTED = 1379, + WORLD_STATE_BATTLEGROUND_AV_ICEWING_ASSAULTED = 1380, + WORLD_STATE_BATTLEGROUND_AV_STONEH_ASSAULTED = 1381, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_CONTROLLED = 1382, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_CONTROLLED = 1383, + WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_CONTROLLED = 1384, + WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_CONTROLLED = 1385, + WORLD_STATE_BATTLEGROUND_AV_UNK_3 = 1386, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_ASSAULTED = 1387, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_ASSAULTED = 1388, + WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_ASSAULTED = 1389, + WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_ASSAULTED = 1390, + WORLD_STATE_BATTLEGROUND_AV_UNK_4 = 1391, + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_UNUSED = 1392, // Unused + WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_UNUSED = 1393, // Unused + WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_UNUSED = 1394, // Unused + WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_UNUSED = 1395, // Unused + WORLD_STATE_BATTLEGROUND_AV_UNK_5 = 1396, + WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_N = 1966, + WORLD_STATE_BATTLEGROUND_AV_ALLIANCE_SCORE = 3127, + WORLD_STATE_BATTLEGROUND_AV_HORDE_SCORE = 3128, + WORLD_STATE_BATTLEGROUND_AV_SHOW_HORDE_SCORE = 3133, + WORLD_STATE_BATTLEGROUND_AV_SHOW_ALLIANCE_SCORE = 3134, + + // Warsong Gulch + WORLD_STATE_BATTLEGROUND_WS_UNK_0 = 1545, // set to 1 on alliance flag pickup... + WORLD_STATE_BATTLEGROUND_WS_UNK_1 = 1546, // set to 1 on horde flag pickup, after drop it's -1 + WORLD_STATE_BATTLEGROUND_WS_UNK_2 = 1547, + WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_ALLIANCE = 1581, + WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_HORDE = 1582, + WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_MAX = 1601, // unk + WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_HORDE = 2338, // (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_ALLIANCE = 2339, // (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE = 4247, + WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER = 4248, + + // Arathi Basin + WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_ALLIANCE = 1767, + WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_HORDE = 1768, + WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_CONTROLLED_ALLIANCE = 1769, + WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_CONTROLLED_HORDE = 1770, + WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_ALLIANCE = 1772, + WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_HORDE = 1773, + WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_CONTROLLED_ALLIANCE = 1774, + WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_CONTROLLED_HORDE = 1775, + WORLD_STATE_BATTLEGROUND_AB_RESOURCES_ALLIANCE = 1776, + WORLD_STATE_BATTLEGROUND_AB_RESOURCES_HORDE = 1777, + WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_HORDE = 1778, + WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_ALLIANCE = 1779, + WORLD_STATE_BATTLEGROUND_AB_RESOURCES_MAX = 1780, + WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_ALLIANCE = 1782, + WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_HORDE = 1783, + WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_CONTROLLED_ALLIANCE = 1784, + WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_CONTROLLED_HORDE = 1785, + WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_ALLIANCE = 1787, + WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_HORDE = 1788, + WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_CONTROLLED_ALLIANCE = 1789, + WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_CONTROLLED_HORDE = 1790, + WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_ALLIANCE = 1792, + WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_HORDE = 1793, + WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_CONTROLLED_ALLIANCE = 1794, + WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_CONTROLLED_HORDE = 1795, + WORLD_STATE_BATTLEGROUND_AB_STABLE_ICON = 1842, // 1 - uncontrolled + WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_ICON = 1843, // 1 - uncontrolled + WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_ICON = 1844, // 1 - uncontrolled + WORLD_STATE_BATTLEGROUND_AB_FARM_ICON = 1845, // 1 - uncontrolled + WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_ICON = 1846, // 1 - uncontrolled + WORLD_STATE_BATTLEGROUND_AB_UNK = 1861, + WORLD_STATE_BATTLEGROUND_AB_RESOURCES_WARNING = 1955, + + // Eye of the Storm + WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW = 2718, //1 init, 0 druhy send - bez messagu, 1 = controlled aliance // Capturing progress-bar (1 - show, 0 - hide) + WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_STATUS = 2719, //50 init!, 48 ... hordak bere .. 33 .. 0 = full 100% hordacky, 100 = full alliance // Capturing progress-bar (0 - left, 100 - right) + WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_PERCENT_GREY = 2720, //100 = empty (only grey), 0 = blue|red (no grey) + WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_UNCONTROL = 2722, // 1 - yes, 0 - no + WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_ALLIANCE_CONTROL = 2723, + WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_HORDE_CONTROL = 2724, + WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_UNCONTROL = 2725, // 1 - yes, 0 - no + WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONTROL = 2726, + WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONTROL = 2727, + WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_UNCONTROL = 2728, // 1 - yes, 0 - no + WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONTROL = 2729, + WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONTROL = 2730, + WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_UNCONTROL = 2731, // 1 - yes, 0 - no + WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONTROL = 2732, + WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONTROL = 2733, + WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONFLICT = 2737, + WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONFLICT = 2738, + WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONFLICT = 2739, + WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONFLICT = 2740, + WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONFLICT = 2741, + WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONFLICT = 2742, + WORLD_STATE_BATTLEGROUND_EY_UNK_0 = 2565, // 142, constant? + WORLD_STATE_BATTLEGROUND_EY_UNK_1 = 2735, // 0 at start + WORLD_STATE_BATTLEGROUND_EY_UNK_2 = 2736, // 0 at start + WORLD_STATE_BATTLEGROUND_EY_UNK_3 = 3085, // 379, constant? + WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_RESOURCES = 2749, + WORLD_STATE_BATTLEGROUND_EY_HORDE_RESOURCES = 2750, + WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_BASE = 2752, + WORLD_STATE_BATTLEGROUND_EY_HORDE_BASE = 2753, + WORLD_STATE_BATTLEGROUND_EY_FLAG = 2757, // 1 - show, 0 - hide (doesn't work exactly this way!) + WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_ALLIANCE = 2769, // 0 - hide, 1 - show stats, 2 - Alliance picked up the flag + WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_HORDE = 2770, // 0 - hide, 1 - show stats, 2 - Horde picked up the flag + + // Isle of Conquest + WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT_SET = 4221, + WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT_SET = 4222, + WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT = 4226, + WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT = 4227, + WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONFLICT_A = 4228, + WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONTROLLED_A = 4229, + WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONTROLLED_H = 4230, + WORLD_STATE_BATTLEGROUND_IC_UNK = 4243, + WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONFLICT_H = 4293, + WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_UNCONTROLLED = 4294, + WORLD_STATE_BATTLEGROUND_IC_HANGAR_UNCONTROLLED = 4296, + WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONFLICT_H = 4297, + WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONTROLLED_H = 4298, + WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONTROLLED_A = 4299, + WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONFLICT_A = 4300, + WORLD_STATE_BATTLEGROUND_IC_DOCKS_UNCONTROLLED = 4301, + WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONFLICT_H = 4302, + WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONTROLLED_H = 4303, + WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONTROLLED_A = 4304, + WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONFLICT_A = 4305, + WORLD_STATE_BATTLEGROUND_IC_QUARRY_UNCONTROLLED = 4306, + WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONFLICT_H = 4307, + WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONTROLLED_H = 4308, + WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONTROLLED_A = 4309, + WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONFLICT_A = 4310, + WORLD_STATE_BATTLEGROUND_IC_REFINERY_UNCONTROLLED = 4311, + WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONFLICT_H = 4312, + WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONTROLLED_H = 4313, + WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONTROLLED_A = 4314, + WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONFLICT_A = 4315, + WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_CLOSED = 4317, + WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_CLOSED = 4318, + WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_CLOSED = 4319, + WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_OPEN = 4320, + WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_OPEN = 4321, + WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_OPEN = 4322, + WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_OPEN = 4323, + WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_OPEN = 4324, + WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_OPEN = 4325, + WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_CLOSED = 4326, + WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_CLOSED = 4327, + WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_CLOSED = 4328, + WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONTROLLED_A = 4339, + WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONTROLLED_H = 4340, + WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_UNCONTROLLED = 4341, + WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONFLICT_A = 4342, + WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONFLICT_H = 4343, + WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_A = 4344, + WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_H = 4345, + WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_UNCONTROLLED = 4346, + WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONFLICT_A = 4347, + WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONFLICT_H = 4348, + + // Strand of the Ancients + // Gates: 1-3 A defend, 4-6 H defend, 7-9 unk defend, 1 - ok, 2 - half destroyed, 3 - destroyed + WORLD_STATE_BATTLEGROUND_SA_TIMER_MINUTES = 3559, + WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_FIRST_DIGIT = 3560, + WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_SECOND_DIGIT = 3561, + WORLD_STATE_BATTLEGROUND_SA_ENABLE_TIMER = 3564, // previously mislabelled? (Alliance Attacker) + WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKER = 3565, // mislabelled? + WORLD_STATE_BATTLEGROUND_SA_BONUS_TIMER = 3571, // bonus timer (1 - on, 0 - off) + WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE = 3614, // Gate of Purple Amethyst + WORLD_STATE_BATTLEGROUND_SA_RED_GATE = 3617, // Gate of Red Sun + WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE = 3620, // Gate of Blue Sapphire + WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE = 3623, // Gate of Green Emerald + WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE = 3626, + WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE = 3627, + WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE = 3628, + WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE = 3629, + WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN = 3630, + WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN = 3631, + WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE = 3632, + WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE = 3633, + WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE = 3634, + WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE = 3635, + WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE = 3636, + WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE = 3637, + WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE = 3638, // Gate of Yellow Moon + WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE = 3849, // Gate of Temple + WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_ATTACKS = 4352, + WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKS = 4353, + + // Blade's Edge Arena + WORLD_STATE_BATTLEGROUND_BE_ARENA_GOLD = 2544, + WORLD_STATE_BATTLEGROUND_BE_ARENA_GREEN = 2545, + WORLD_STATE_BATTLEGROUND_BE_ARENA_SHOW = 2547, + + // Nagrand Arena + WORLD_STATE_BATTLEGROUND_NA_ARENA_GOLD = 2575, + WORLD_STATE_BATTLEGROUND_NA_ARENA_GREEN = 2576, + WORLD_STATE_BATTLEGROUND_NA_ARENA_SHOW = 2577, + + // Ruins of Lordaeron + WORLD_STATE_BATTLEGROUND_RL_ARENA_GOLD = 3000, + WORLD_STATE_BATTLEGROUND_RL_ARENA_GREEN = 3001, + WORLD_STATE_BATTLEGROUND_RL_ARENA_SHOW = 3002, + + // Dalaran Sewers + WORLD_STATE_BATTLEGROUND_DS_ARENA_GREEN = 3600, + WORLD_STATE_BATTLEGROUND_DS_ARENA_GOLD = 3601, + WORLD_STATE_BATTLEGROUND_DS_ARENA_SHOW = 3610, + + // The Ring of Valor + WORLD_STATE_BATTLEGROUND_RV_ARENA_GREEN = 3600, // Used generically for all arenas + WORLD_STATE_BATTLEGROUND_RV_ARENA_GOLD = 3601, // Used generically for all arenas + WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW = 3610, + + // The Silithyst Must Flow - Silithus Outdoor PvP + WORLD_STATE_OPVP_SI_GATHERED_A = 2313, + WORLD_STATE_OPVP_SI_GATHERED_H = 2314, + WORLD_STATE_OPVP_SI_SILITHYST_MAX = 2317, + + // A Game of Towers - Eastern Plaguelands Outdoor PvP + WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_A = 2327, + WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_H = 2328, + WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N = 2352, + WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N = 2353, + WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_H = 2353, // 2367 not present! use neutral! + WORLD_STATE_OPVP_EP_EASTWALLTOWER_A = 2354, + WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N = 2355, + WORLD_STATE_OPVP_EP_EASTWALLTOWER_H = 2356, + WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_A = 2359, // ally conquested + WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_H = 2360, + WORLD_STATE_OPVP_EP_EASTWALLTOWER_N = 2361, + WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_A = 2362, + WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_H = 2363, // GENERAL_WORLDSTATES_08 + WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_A = 2366, + WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_A = 2370, + WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_H = 2371, + WORLD_STATE_OPVP_EP_NORTHPASSTOWER_A = 2372, + WORLD_STATE_OPVP_EP_NORTHPASSTOWER_H = 2373, + WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A = 2374, + WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H = 2375, + WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A = 2378, + WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H = 2379, + WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY = 2426, // GENERAL_WORLDSTATES_01 "Progress: %2427w" + WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS = 2427, // GENERAL_WORLDSTATES_02 + WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N = 2428, // GENERAL_WORLDSTATES_03 + WORLD_STATE_OPVP_EP_UNK_0 = 2357, // GENERAL_WORLDSTATES_06 + WORLD_STATE_OPVP_EP_UNK_1 = 2358, // GENERAL_WORLDSTATES_07 + WORLD_STATE_OPVP_EP_UNK_2 = 2364, // GENERAL_WORLDSTATES_09 + WORLD_STATE_OPVP_EP_UNK_3 = 2365, // GENERAL_WORLDSTATES_10 + // WORLD_STATE_OPVP_EP_UNK_4 = 2367, // GENERAL_WORLDSTATES_13 grey horde not in dbc! See: PlaguewoodTowerNH + WORLD_STATE_OPVP_EP_UNK_5 = 2368, // GENERAL_WORLDSTATES_11 + WORLD_STATE_OPVP_EP_UNK_6 = 2369, // GENERAL_WORLDSTATES_12 + WORLD_STATE_OPVP_EP_UNK_7 = 2376, // GENERAL_WORLDSTATES_04 + WORLD_STATE_OPVP_EP_UNK_8 = 2377, // GENERAL_WORLDSTATES_05 + + // Hellfire Peninsula Outdoor PvP + WORLD_STATE_OPVP_HP_STADIUM_H = 2470, // show the horde stadium icon + WORLD_STATE_OPVP_HP_STADIUM_A = 2471, // show the ally stadium icon + WORLD_STATE_OPVP_HP_STADIUM_N = 2472, // show the neutral stadium icon + WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_DISPLAY = 2473, //: ally / horde slider display // show only in direct vicinity! + WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_POS = 2474, //: ally / horde slider percentage, 100 for ally, 0 for horde // show only in direct vicinity! + WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_N = 2475, //: ally / horde slider grey area // show only in direct vicinity! + WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_A = 2476, // ally pvp objectives captured + WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_H = 2478, // horde pvp objectives captured + WORLD_STATE_OPVP_HP_OVERLOOK_A = 2480, // show ally overlook icon + WORLD_STATE_OPVP_HP_OVERLOOK_H = 2481, // show the overlook arrow + WORLD_STATE_OPVP_HP_OVERLOOK_N = 2482, // show neutral overlook icon + WORLD_STATE_OPVP_HP_BROKENHILL_A = 2483, // show ally broken hill icon + WORLD_STATE_OPVP_HP_BROKENHILL_H = 2484, // show icon above broken hill + WORLD_STATE_OPVP_HP_BROKENHILL_N = 2485, // show neutral broken hill icon + WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_H = 2489, // add horde tower main gui icon // maybe should be sent only on login? + WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_A = 2490, // add ally tower main gui icon // maybe should be sent only on login? + + // Zangarmarsh Outdoor PvP + WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_DISPLAY_W = 2527, + WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_POS_W = 2528, + WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_N_W = 2529, + WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_DISPLAY_E = 2533, + WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_POS_E = 2534, + WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_N_E = 2535, + WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_A = 2555, + WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_H = 2556, + WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_N = 2557, + WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_A = 2558, + WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_H = 2559, + WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_N = 2560, + WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_A = 2644, + WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_H = 2645, + WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_N = 2646, + WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_N = 2647, + WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_A = 2648, + WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_H = 2649, // Twin spire graveyard horde + WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_A = 2650, + WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_H = 2651, + WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_N = 2652, + WORLD_STATE_OPVP_ZM_UNK = 2653, + WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_READY = 2655, + WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_NOT_READY = 2656, + WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_NOT_READY = 2657, + WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_READY = 2658, + + // Terokkar Forest Outdoor PvP + WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_NEUTRAL = 2508, + WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_HOURS = 2509, + WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT = 2510, + WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT = 2512, + WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY = 2620, + WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A = 2621, + WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H = 2622, + WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_DISPLAY = 2623, + WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_N = 2624, + WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_POS = 2625, + WORLD_STATE_OPVP_TF_TOWER_NUM_00 = 2681, // NW Neutral + WORLD_STATE_OPVP_TF_TOWER_NUM_01 = 2682, // NW Horde + WORLD_STATE_OPVP_TF_TOWER_NUM_02 = 2683, // NW Alliance + WORLD_STATE_OPVP_TF_TOWER_NUM_03 = 2684, // N Alliance + WORLD_STATE_OPVP_TF_TOWER_NUM_04 = 2685, // N Horde + WORLD_STATE_OPVP_TF_TOWER_NUM_05 = 2686, // N Neutral + WORLD_STATE_OPVP_TF_TOWER_NUM_15 = 2687, // unk + WORLD_STATE_OPVP_TF_TOWER_NUM_06 = 2688, // NE Alliance + WORLD_STATE_OPVP_TF_TOWER_NUM_07 = 2689, // NE Horde + WORLD_STATE_OPVP_TF_TOWER_NUM_08 = 2690, // NE Neutral + WORLD_STATE_OPVP_TF_TOWER_NUM_09 = 2691, // S Alliance + WORLD_STATE_OPVP_TF_TOWER_NUM_10 = 2692, // S Horde + WORLD_STATE_OPVP_TF_TOWER_NUM_11 = 2693, // S Neutral + WORLD_STATE_OPVP_TF_TOWER_NUM_12 = 2694, // SE Alliance + WORLD_STATE_OPVP_TF_TOWER_NUM_13 = 2695, // SE Horde + WORLD_STATE_OPVP_TF_TOWER_NUM_14 = 2696, // SE Neutral + WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_ALLIANCE = 2767, + WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_HORDE = 2768, + + // Halaa, Nagrand Outdoor PvP + WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT = 2491, + WORLD_STATE_OPVP_NA_UI_GUARDS_MAX = 2493, + WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_POS = 2494, + WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY = 2495, // OUTLAND_01 "Progress: %2494w" + WORLD_STATE_OPVP_NA_UI_SLIDER_N = 2497, + WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW = 2502, + WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW = 2503, + WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_A = 2659, + WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_H = 2660, + WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_A = 2661, + WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_A = 2662, + WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_H = 2663, + WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_A = 2664, + WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_H = 2665, + WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_A = 2666, + WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_A = 2667, + WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_H = 2668, + WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_A = 2669, + WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_A = 2670, + WORLD_STATE_OPVP_NA_MAP_HALAA_NEUTRAL = 2671, + WORLD_STATE_OPVP_NA_MAP_HALAA_HORDE = 2672, + WORLD_STATE_OPVP_NA_MAP_HALAA_ALLIANCE = 2673, + WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_A = 2676, + WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_H = 2677, + WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_H = 2760, + WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_H = 2761, + WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_H = 2762, + WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_H = 2763, + + // Grizzly Hills Outdoor PvP + WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY = 3466, + WORLD_STATE_OPVP_GH_UI_SLIDER_POS = 3467, + WORLD_STATE_OPVP_GH_UI_SLIDER_N = 3468, + + // Ahn'Qiraj + WORLD_STATE_AHNQIRAJ_SANDWORM_N = 2322, + WORLD_STATE_AHNQIRAJ_SANDWORM_S = 2323, + WORLD_STATE_AHNQIRAJ_SANDWORM_SW = 2324, + WORLD_STATE_AHNQIRAJ_SANDWORM_E = 2325, + + // The Battle for Light's Hope Chapel - Scarlet Enclave + WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT = 3590, + WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT = 3591, + WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE = 3592, + WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE = 3603, + WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME = 3604, + WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE = 3605, + + // The Battle for the Undercity + WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_COUNTDOWN_A = 3958, + WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_FIGHT_A = 3962, + WORLD_STATE_BATTLE_FOR_UNDERCITY_FAIL_A = 3963, + WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_DONE_A = 3964, + WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_STARTS_A = 3966, + WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_DONE_A = 3971, + WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_FIGHT_A = 3972, + WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H = 3875, + WORLD_STATE_BATTLE_FOR_UNDERCITY_COUNTDOWN_H = 3876, + WORLD_STATE_BATTLE_FOR_UNDERCITY_FAIL_H = 3878, + WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H = 3885, + WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_DONE_H = 3886, + WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_FIGHT_H = 3887, + WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_DONE_H = 3888, + WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H = 3889, + WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_DONE_H = 3890, + WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_FIGHT_H = 3891, // unused + WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_DONE_H = 3892, // unused + + // The Ruby Sanctum + WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_MATERIAL = 5049, + WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TWILIGHT = 5050, + WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TOGGLE = 5051, + + // Icecrown Citadel + WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER = 4903, // Blood Quickening weekly + WORLD_STATE_ICECROWN_CITADEL_EXECUTION_TIME = 4904, + WORLD_STATE_ICECROWN_CITADEL_SHOW_ATTEMPTS = 4940, + WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_REMAINING = 4941, + WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_MAX = 4942, + + // The Culling of Stratholme + WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES = 3479, + WORLD_STATE_CULLING_OF_STRATHOLME_CRATES_REVEALED = 3480, + WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT = 3504, + WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN = 3931, + WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW = 3932, + + // The Oculus + WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_AMOUNT = 3486, + WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_SHOW = 3524, + + // Ulduar + WORLD_STATE_ULDUAR_ALGALON_DESPAWN_TIMER = 4131, + WORLD_STATE_ULDUAR_ALGALON_TIMER_ENABLED = 4132, + + // The Violet Hold + WORLD_STATE_VIOLET_HOLD_WAVE_COUNT = 3810, + WORLD_STATE_VIOLET_HOLD_PRISON_STATE = 3815, + WORLD_STATE_VIOLET_HOLD_SHOW = 3816, + + // Halls of Reflection + WORLD_STATE_HALLS_OF_REFLECTION_WAVE_COUNT = 4882, + WORLD_STATE_HALLS_OF_REFLECTION_WAVES_ENABLED = 4884, + + // Zul'Aman + WORLD_STATE_ZUL_AMAN_SHOW_TIMER = 3104, + WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE = 3106, + + // The Black Morass + WORLD_STATE_BLACK_MORASS_SHIELD = 2540, + WORLD_STATE_BLACK_MORASS = 2541, + WORLD_STATE_BLACK_MORASS_RIFT = 2784, + + // Battle for Mount Hyjal + WORLD_STATE_HYJAL_ENEMY = 2453, + WORLD_STATE_HYJAL_ENEMY_COUNT = 2454, + WORLD_STATE_HYJAL_WAVES = 2842, + + // Escape From Durnholde Keep + WORLD_STATE_OLD_HILLSBRAD_BARRELS_PLANTED = 2436, + + // Trial of the Crusader + WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_COUNT = 4389, + WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_SHOW = 4390, + + // Unknown + WORLD_STATE_GENERIC_UNK_0 = 2322, + WORLD_STATE_GENERIC_UNK_1 = 2323, + WORLD_STATE_GENERIC_UNK_2 = 2324, + WORLD_STATE_GENERIC_UNK_3 = 2325, + + // Stranglethorn Fishing Extravaganza (Are these custom IDs?) + WORLD_STATE_STRANGLETHORN_VALE_FISHING_PREV_WIN_TIME = 197, + WORLD_STATE_STRANGLETHORN_VALE_FISHING_HAS_WINNER = 198, + WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_EVENT_BEGIN = 199, + WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_POOLS_DESPAWN = 200, + + // Custom + WORLD_STATE_CUSTOM_ARENA_DISTRIBUTION_TIME = 20001, // Next arena distribution time + WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time + WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time + WORLD_STATE_CUSTOM_CLEANING_FLAGS = 20004, // Cleaning Flags + WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME = 20005, // Next daily reset time + WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time + WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time + WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME = 20008, // Next daily calendar deletions of old events time +}; + +#endif diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 177481c8b..1edb08561 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -21,6 +21,7 @@ #include "ScriptedGossip.h" #include "SpellScript.h" #include "SpellScriptLoader.h" +#include "WorldStateDefines.h" enum LightOfDawnSays { @@ -198,13 +199,6 @@ enum LightOfDawnEncounter ENCOUNTER_TOTAL_DEFENDERS = 300, ENCOUNTER_TOTAL_SCOURGE = 10000, - WORLD_STATE_DEFENDERS_COUNT = 3590, - WORLD_STATE_SCOURGE_COUNT = 3591, - WORLD_STATE_SOLDIERS_ENABLE = 3592, - WORLD_STATE_COUNTDOWN_ENABLE = 3603, - WORLD_STATE_COUNTDOWN_TIME = 3604, - WORLD_STATE_EVENT_BEGIN_ENABLE = 3605, - ENCOUNTER_STATE_NONE = 0, ENCOUNTER_STATE_FIGHT = 1, ENCOUNTER_STATE_OUTRO = 2, @@ -343,7 +337,7 @@ public: if (creature->IsQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); - if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE && !creature->AI()->GetData(WORLD_STATE_SOLDIERS_ENABLE)) + if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE && !creature->AI()->GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE)) AddGossipItemFor(player, 9795, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID()); @@ -414,17 +408,17 @@ public: { switch (type) { - case WORLD_STATE_DEFENDERS_COUNT: + case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT: return defendersRemaining; - case WORLD_STATE_SCOURGE_COUNT: + case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT: return scourgeRemaining; - case WORLD_STATE_SOLDIERS_ENABLE: + case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE: return me->IsAlive() && (startTimeRemaining || battleStarted); - case WORLD_STATE_COUNTDOWN_ENABLE: + case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE: return me->IsAlive() && startTimeRemaining; - case WORLD_STATE_COUNTDOWN_TIME: + case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME: return startTimeRemaining; - case WORLD_STATE_EVENT_BEGIN_ENABLE: + case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE: return me->IsAlive() && !startTimeRemaining && battleStarted; } return 0; @@ -442,12 +436,12 @@ public: void SendInitialWorldStates() { - SendUpdateWorldState(WORLD_STATE_DEFENDERS_COUNT, GetData(WORLD_STATE_DEFENDERS_COUNT)); - SendUpdateWorldState(WORLD_STATE_SCOURGE_COUNT, GetData(WORLD_STATE_SCOURGE_COUNT)); - SendUpdateWorldState(WORLD_STATE_SOLDIERS_ENABLE, GetData(WORLD_STATE_SOLDIERS_ENABLE)); - SendUpdateWorldState(WORLD_STATE_COUNTDOWN_ENABLE, GetData(WORLD_STATE_COUNTDOWN_ENABLE)); - SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, GetData(WORLD_STATE_COUNTDOWN_TIME)); - SendUpdateWorldState(WORLD_STATE_EVENT_BEGIN_ENABLE, GetData(WORLD_STATE_EVENT_BEGIN_ENABLE)); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT)); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT)); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE)); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE)); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME)); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE)); } void JustSummoned(Creature* cr) override @@ -482,12 +476,12 @@ public: if (creature->GetEntry() >= NPC_RAMPAGING_ABOMINATION) { --scourgeRemaining; - SendUpdateWorldState(WORLD_STATE_SCOURGE_COUNT, GetData(WORLD_STATE_SCOURGE_COUNT)); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT)); } else { --defendersRemaining; - SendUpdateWorldState(WORLD_STATE_DEFENDERS_COUNT, GetData(WORLD_STATE_DEFENDERS_COUNT)); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT)); if (defendersRemaining == 200) FinishFight(); @@ -610,25 +604,25 @@ public: switch (eventId) { case EVENT_START_COUNTDOWN_1: - SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 4); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 4); break; case EVENT_START_COUNTDOWN_2: - SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 3); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 3); break; case EVENT_START_COUNTDOWN_3: - SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 2); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 2); break; case EVENT_START_COUNTDOWN_4: Talk(SAY_LIGHT_OF_DAWN02); - SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 1); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 1); break; case EVENT_START_COUNTDOWN_5: battleStarted = ENCOUNTER_STATE_FIGHT; me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); Talk(SAY_LIGHT_OF_DAWN04); // Wrong order in DB! - SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 0); - SendUpdateWorldState(WORLD_STATE_COUNTDOWN_ENABLE, 0); - SendUpdateWorldState(WORLD_STATE_EVENT_BEGIN_ENABLE, 1); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 0); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE, 0); + SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE, 1); break; case EVENT_START_COUNTDOWN_6: case EVENT_START_COUNTDOWN_7: diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 20843574e..87c101b8f 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -19,13 +19,12 @@ #include "InstanceScript.h" #include "Player.h" #include "TemporarySummon.h" +#include "WorldStateDefines.h" #include "zulaman.h" enum Misc { - RAND_VENDOR = 2, - WORLDSTATE_SHOW_TIMER = 3104, - WORLDSTATE_TIME_TO_SACRIFICE = 3106 + RAND_VENDOR = 2, }; // Chests spawn at bear/eagle/dragonhawk/lynx bosses @@ -175,8 +174,8 @@ public: { if (uint32 timer = GetPersistentData(DATA_TIMED_RUN)) { - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); - DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer); + DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_SHOW_TIMER, 1); + DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE, timer); } scheduler.Schedule(1min, GROUP_TIMED_RUN, [this](TaskContext context) @@ -184,13 +183,13 @@ public: if (uint32 timer = GetPersistentData(DATA_TIMED_RUN)) { --timer; - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); - DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer); + DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_SHOW_TIMER, 1); + DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE, timer); StorePersistentData(DATA_TIMED_RUN, timer); context.Repeat(); } else - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); + DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_SHOW_TIMER, 0); }); } } @@ -303,7 +302,7 @@ public: if (uint32 timer = GetPersistentData(DATA_TIMED_RUN)) { StorePersistentData(DATA_TIMED_RUN, timer += 15); - DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer); + DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE, timer); } SummonHostage(type); break; @@ -311,7 +310,7 @@ public: if (uint32 timer = GetPersistentData(DATA_TIMED_RUN)) { StorePersistentData(DATA_TIMED_RUN, timer += 10); - DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer); + DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE, timer); } SummonHostage(type); break; @@ -328,7 +327,7 @@ public: if (GetPersistentData(DATA_TIMED_RUN) && AllBossesDone({ DATA_NALORAKK, DATA_AKILZON, DATA_JANALAI, DATA_HALAZZI })) { StorePersistentData(DATA_TIMED_RUN, 0); - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); + DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_SHOW_TIMER, 0); } CheckInstanceStatus(); diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index d9495faf4..0ea8f3e84 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -37,6 +37,7 @@ EndContentData */ #include "SpellAuraEffects.h" #include "SpellScript.h" #include "SpellScriptLoader.h" +#include "WorldStateDefines.h" /*###### ## npc_lady_sylvanas_windrunner @@ -723,31 +724,6 @@ enum QuestMisc ZONE_UNDERCITY = 1497 }; -enum Worldstates -{ - // Alliance - WORLD_STATE_MANHUNT_COUNTDOWN_A = 3958, - WORLD_STATE_MANHUNT_STARTS_A = 3966, - WORLD_STATE_SEWERS_FIGHT_A = 3962, - WORLD_STATE_SEWERS_DONE_A = 3964, - WORLD_STATE_APOTHECARIUM_FIGHT_A = 3972, - WORLD_STATE_APOTHECARIUM_DONE_A = 3971, - WORLD_STATE_FAIL_A = 3963, - - // Horde - WORLD_STATE_BATTLE_COUNTDOWN_H = 3876, - WORLD_STATE_BATTLE_START_H = 3875, - WORLD_STATE_COURTYARD_FIGHT_H = 3885, - WORLD_STATE_COURTYARD_DONE_H = 3886, - WORLD_STATE_INNER_SANKTUM_FIGHT_H = 3887, - WORLD_STATE_INNER_SANKTUM_DONE_H = 3888, - WORLD_STATE_APOTHECARIUM_FIGHT_H = 3891, // unused - WORLD_STATE_APOTHECARIUM_DONE_H = 3892, // unused - WORLD_STATE_ROYAL_QUARTER_FIGHT_H = 3889, - WORLD_STATE_ROYAL_QUARTER_DONE_H = 3890, - WORLD_STATE_FAIL_H = 3878 -}; - struct LocationXYZO { float x, y, z, o; }; @@ -1131,13 +1107,13 @@ public: switch (summon->GetEntry()) { case NPC_BLIGHTWORM: - UpdateWorldState(me->GetMap(), WORLD_STATE_SEWERS_FIGHT_A, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_SEWERS_DONE_A, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_FIGHT_A, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_DONE_A, 1); bStepping = true; break; case NPC_PUTRESS: - UpdateWorldState(me->GetMap(), WORLD_STATE_APOTHECARIUM_FIGHT_A, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_APOTHECARIUM_DONE_A, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_FIGHT_A, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_DONE_A, 1); bStepping = true; break; default: @@ -1536,7 +1512,7 @@ public: //Preparation case 0: me->setActive(true); - UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_COUNTDOWN_A, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_COUNTDOWN_A, 1); Talk(WRYNN_SAY_PREP_1); JumpToNextStep(10 * IN_MILLISECONDS); break; @@ -1553,8 +1529,8 @@ public: JumpToNextStep(20 * IN_MILLISECONDS); break; case 4: - UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_COUNTDOWN_A, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_STARTS_A, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_COUNTDOWN_A, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_STARTS_A, 1); Talk(WRYNN_SAY_PREP_5); JumpToNextStep(10 * IN_MILLISECONDS); break; @@ -1600,8 +1576,8 @@ public: break; case 12: SetEscortPaused(false); - UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_STARTS_A, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_SEWERS_FIGHT_A, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_STARTS_A, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_FIGHT_A, 1); JumpToNextStep(1 * IN_MILLISECONDS); break; case 13: @@ -1692,7 +1668,7 @@ public: JumpToNextStep(1.5 * IN_MILLISECONDS); break; case 30: - UpdateWorldState(me->GetMap(), WORLD_STATE_APOTHECARIUM_FIGHT_A, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_FIGHT_A, 1); if (Creature* putress = ObjectAccessor::GetCreature(*me, putressGUID)) putress->AI()->Talk(PUTRESS_SAY_1); if (Player* player = GetPlayerForEscort()) @@ -2018,9 +1994,9 @@ public: } } } - UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_STARTS_A, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_SEWERS_DONE_A, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_APOTHECARIUM_DONE_A, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_STARTS_A, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_DONE_A, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_DONE_A, 0); me->DespawnOrUnsummon(); break; } @@ -2471,14 +2447,14 @@ public: switch (summon->GetEntry()) { case NPC_BLIGHT_ABBERATION: - UpdateWorldState(me->GetMap(), WORLD_STATE_COURTYARD_FIGHT_H, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_COURTYARD_DONE_H, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_DONE_H, 1); bStepping = true; break; case NPC_KHANOK: { - UpdateWorldState(me->GetMap(), WORLD_STATE_INNER_SANKTUM_FIGHT_H, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_INNER_SANKTUM_DONE_H, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_FIGHT_H, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_DONE_H, 1); FollowThrall(); SetEscortPaused(false); std::list SanktumList; @@ -2497,8 +2473,8 @@ public: } case NPC_VARIMATHRAS: { - UpdateWorldState(me->GetMap(), WORLD_STATE_ROYAL_QUARTER_FIGHT_H, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_ROYAL_QUARTER_DONE_H, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_DONE_H, 1); std::list ThroneList; me->GetCreatureListWithEntryInGrid(ThroneList, NPC_LEGION_OVERLORD, 1000.0f); me->GetCreatureListWithEntryInGrid(ThroneList, NPC_LEGION_INVADER, 1000.0f); @@ -2874,7 +2850,7 @@ public: break; case 36: Talk(THRALL_SAY_SANCTUM_1); - UpdateWorldState(me->GetMap(), WORLD_STATE_INNER_SANKTUM_FIGHT_H, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H, 1); break; case 46: SetHoldState(true); @@ -2951,7 +2927,7 @@ public: JumpToNextStep(3 * IN_MILLISECONDS); break; case 1: - UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_COUNTDOWN_H, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COUNTDOWN_H, 1); Talk(THRALL_SAY_PREP_1); JumpToNextStep(6 * IN_MILLISECONDS); break; @@ -2995,8 +2971,8 @@ public: break; // Start Event case 11: - UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_COUNTDOWN_H, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_START_H, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COUNTDOWN_H, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H, 1); Talk(THRALL_SAY_PREP_8); SetEscortPaused(false); bStepping = false; @@ -3108,8 +3084,8 @@ public: bStepping = false; SetRun(true); Talk(THRALL_SAY_COURTYARD_4); - UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_START_H, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_COURTYARD_FIGHT_H, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 1); JumpToNextStep(0); break; case 28: @@ -3548,7 +3524,7 @@ public: } case 116: Talk(THRALL_SAY_SANCTUM_7); - UpdateWorldState(me->GetMap(), WORLD_STATE_ROYAL_QUARTER_FIGHT_H, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H, 1); FollowThrall(); SetEscortPaused(false); bStepping = false; @@ -3885,9 +3861,9 @@ public: me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); Talk(THRALL_SAY_THRONE_11); - UpdateWorldState(me->GetMap(), WORLD_STATE_ROYAL_QUARTER_FIGHT_H, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_INNER_SANKTUM_FIGHT_H, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_COURTYARD_FIGHT_H, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_FIGHT_H, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 0); std::list HelperList; me->GetCreatureListWithEntryInGrid(HelperList, NPC_SYLVANAS, 100.0f); me->GetCreatureListWithEntryInGrid(HelperList, NPC_OVERLORD_SAURFANG, 100.0f); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h index 54ba1eab3..f18773262 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h @@ -51,13 +51,6 @@ enum DataTypes DATA_BOSS_WAVE = 27 }; -enum HyjalWorldStateIds -{ - WORLD_STATE_WAVES = 2842, - WORLD_STATE_ENEMY = 2453, - WORLD_STATE_ENEMYCOUNT = 2454 -}; - enum HyjalCreaturesIds { // Trash Mobs summoned in waves diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index 51b66ae14..e28cb85d1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -19,6 +19,7 @@ #include "InstanceMapScript.h" #include "InstanceScript.h" #include "Player.h" +#include "WorldStateDefines.h" #include "hyjal.h" /* Battle of Mount Hyjal encounters: @@ -193,7 +194,7 @@ public: { if (_currentWave == 0 && _initialWaves) creature->SetReputationRewardDisabled(true); - DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, ++_trash); // Update the instance wave count on new trash spawn + DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY_COUNT, ++_trash); // Update the instance wave count on new trash spawn _encounterNPCs.insert(creature->GetGUID()); // Used for despawning on wipe } break; @@ -231,7 +232,7 @@ public: { if (_bossWave != TO_BE_DECIDED) { - DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, --_trash); // Update the instance wave count on new trash death + DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY_COUNT, --_trash); // Update the instance wave count on new trash death _encounterNPCs.erase(creature->GetGUID()); // Used for despawning on wipe if (_trash == 0) // It can reach negatives if trash spawned after a retreat are killed, it shouldn't affect anything. Also happens on retail @@ -406,7 +407,7 @@ public: if (_bossWave != TO_BE_DECIDED) { - DoUpdateWorldState(WORLD_STATE_WAVES, 0); + DoUpdateWorldState(WORLD_STATE_HYJAL_WAVES, 0); scheduler.Schedule(30s, [this](TaskContext context) { if (IsEncounterInProgress()) @@ -491,9 +492,9 @@ public: _trash = 0; _bossWave = TO_BE_DECIDED; _retreat = 0; - DoUpdateWorldState(WORLD_STATE_WAVES, _currentWave); - DoUpdateWorldState(WORLD_STATE_ENEMY, _trash); - DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, _trash); + DoUpdateWorldState(WORLD_STATE_HYJAL_WAVES, _currentWave); + DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY, _trash); + DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY_COUNT, _trash); break; } @@ -548,8 +549,8 @@ public: context.Repeat(timerptr[_currentWave]); if (++_currentWave < maxWaves && _bossWave != TO_BE_DECIDED) { - DoUpdateWorldState(WORLD_STATE_WAVES, _currentWave); - DoUpdateWorldState(WORLD_STATE_ENEMY, 1); + DoUpdateWorldState(WORLD_STATE_HYJAL_WAVES, _currentWave); + DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY, 1); } context.SetGroup(CONTEXT_GROUP_WAVES); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 98b8839ed..511a6c020 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -23,6 +23,7 @@ #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" #include "SpellInfo.h" +#include "WorldStateDefines.h" enum Says { @@ -924,7 +925,7 @@ public: break; case EVENT_ACTION_PHASE2+9: if (pInstance) - pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 0); Talk(SAY_PHASE210); eventInRun = false; @@ -1274,7 +1275,7 @@ void npc_arthas::npc_arthasAI::ReorderInstance(uint32 data) else // if (data == COS_PROGRESS_KILLED_SALRAMM) { if (pInstance) - pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, 10); + pInstance->DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 10); DoAction(ACTION_KILLED_SALRAMM); } break; @@ -1331,7 +1332,7 @@ void npc_arthas::npc_arthasAI::SendNextWave(uint32 entry) else SummonNextWave(); - pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, waveGroupId + 1); + pInstance->DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, waveGroupId + 1); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h index 28d7a36dd..cbf8b8b13 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h @@ -73,15 +73,6 @@ enum GameObjects GO_PLAGUED_CRATE = 190095, }; -enum WorldStatesCoT -{ - WORLDSTATE_SHOW_CRATES = 3479, - WORLDSTATE_CRATES_REVEALED = 3480, - WORLDSTATE_WAVE_COUNT = 3504, - WORLDSTATE_TIME_GUARDIAN = 3931, - WORLDSTATE_TIME_GUARDIAN_SHOW = 3932, -}; - enum CrateSpells { SPELL_CRATES_CREDIT = 58109, diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index 8d8d7eb23..700b69eaf 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -22,6 +22,7 @@ #include "ScriptedCreature.h" #include "SpellInfo.h" #include "TemporarySummon.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" #include "culling_of_stratholme.h" @@ -57,11 +58,11 @@ public: void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(WORLDSTATE_SHOW_CRATES, 0); - packet.Worldstates.emplace_back(WORLDSTATE_CRATES_REVEALED, _crateCount); - packet.Worldstates.emplace_back(WORLDSTATE_WAVE_COUNT, 0); - packet.Worldstates.emplace_back(WORLDSTATE_TIME_GUARDIAN, 25); - packet.Worldstates.emplace_back(WORLDSTATE_TIME_GUARDIAN_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES, 0); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_CRATES_REVEALED, _crateCount); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 0); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN, 25); + packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, 0); } void OnPlayerEnter(Player* plr) override @@ -112,13 +113,13 @@ public: switch (type) { case DATA_SHOW_CRATES: - DoUpdateWorldState(WORLDSTATE_SHOW_CRATES, data); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES, data); return; case DATA_SHOW_INFINITE_TIMER: if (!instance->IsHeroic() || !_guardianTimer) return; - DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, data); - DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN, uint32(_guardianTimer / (MINUTE * IN_MILLISECONDS))); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, data); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN, uint32(_guardianTimer / (MINUTE * IN_MILLISECONDS))); if (data == 0) { _guardianTimer = 0; @@ -128,10 +129,10 @@ public: instance->SummonCreature(NPC_INFINITE, EventPos[EVENT_SRC_CORRUPTOR]); return; case DATA_START_WAVES: - DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, 1); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 1); if (instance->IsHeroic()) { - DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, true); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, true); _guardianTimer = 26 * MINUTE * IN_MILLISECONDS; if (!_infiniteGUID) instance->SummonCreature(NPC_INFINITE, EventPos[EVENT_SRC_CORRUPTOR]); @@ -151,7 +152,7 @@ public: SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_CRATES_FOUND); } - DoUpdateWorldState(WORLDSTATE_CRATES_REVEALED, _crateCount); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_CRATES_REVEALED, _crateCount); return; case DATA_ARTHAS_EVENT: // Start Event @@ -256,7 +257,7 @@ public: if (divAfter == 0) { _guardianTimer = 0; - DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, 0); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, 0); // Inform infinite we run out of time if (instance->IsHeroic() && _infiniteGUID) @@ -270,7 +271,7 @@ public: else if (divAfter == 1) ChromieWhisper(2); - DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN, divAfter); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN, divAfter); SaveToDB(); } } @@ -290,7 +291,7 @@ public: ChromieWhisper(0); // hide crates count - DoUpdateWorldState(WORLDSTATE_SHOW_CRATES, 0); + DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES, 0); _showCrateTimer = 0; _encounterState = COS_PROGRESS_CRATES_FOUND; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp index fdbd0b4f7..95df71987 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp @@ -19,6 +19,7 @@ #include "InstanceMapScript.h" #include "InstanceScript.h" #include "Player.h" +#include "WorldStateDefines.h" #include "old_hillsbrad.h" static Position const instancePositions[INSTANCE_POSITIONS_COUNT] = @@ -70,7 +71,7 @@ public: CleanupInstance(); if (_encounterProgress < ENCOUNTER_PROGRESS_BARRELS) - player->SendUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, _barrelCount); + player->SendUpdateWorldState(WORLD_STATE_OLD_HILLSBRAD_BARRELS_PLANTED, _barrelCount); } void CleanupInstance() @@ -153,7 +154,7 @@ public: if (_barrelCount >= 5 || _encounterProgress > ENCOUNTER_PROGRESS_NONE) return; - DoUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, ++_barrelCount); + DoUpdateWorldState(WORLD_STATE_OLD_HILLSBRAD_BARRELS_PLANTED, ++_barrelCount); if (_barrelCount == 5) { _events.ScheduleEvent(EVENT_INITIAL_BARRELS_FLAME, 4000); @@ -237,7 +238,7 @@ public: orc->HandleEmoteCommand(EMOTE_ONESHOT_CHEER); SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_BARRELS); - DoUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, 0); + DoUpdateWorldState(WORLD_STATE_OLD_HILLSBRAD_BARRELS_PLANTED, 0); break; } case EVENT_SUMMON_LIEUTENANT: diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h index 57a692b1a..ce3de8590 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h @@ -69,7 +69,6 @@ enum GobjectIds enum MiscIds { - WORLD_STATE_BARRELS_PLANTED = 2436, SKARLOC_MOUNT_MODEL = 18223, ENCOUNTER_PROGRESS_NONE = 0, diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp index 1551eefbd..78a0dbbdc 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp @@ -18,6 +18,7 @@ #include "InstanceMapScript.h" #include "InstanceScript.h" #include "Player.h" +#include "WorldStateDefines.h" #include "the_black_morass.h" const Position PortalLocation[4] = @@ -180,9 +181,9 @@ public: CleanupInstance(); } - player->SendUpdateWorldState(WORLD_STATE_BM, _eventStatus); - player->SendUpdateWorldState(WORLD_STATE_BM_SHIELD, _shieldPercent); - player->SendUpdateWorldState(WORLD_STATE_BM_RIFT, _currentRift); + player->SendUpdateWorldState(WORLD_STATE_BLACK_MORASS, _eventStatus); + player->SendUpdateWorldState(WORLD_STATE_BLACK_MORASS_SHIELD, _shieldPercent); + player->SendUpdateWorldState(WORLD_STATE_BLACK_MORASS_RIFT, _currentRift); } void ScheduleNextPortal(Milliseconds time, Position lastPosition) @@ -219,7 +220,7 @@ public: _availableRiftPositions.remove(spawnPos); - DoUpdateWorldState(WORLD_STATE_BM_RIFT, ++_currentRift); + DoUpdateWorldState(WORLD_STATE_BLACK_MORASS_RIFT, ++_currentRift); instance->SummonCreature(NPC_TIME_RIFT, spawnPos); @@ -318,9 +319,9 @@ public: { _eventStatus = EVENT_IN_PROGRESS; - DoUpdateWorldState(WORLD_STATE_BM, _eventStatus); - DoUpdateWorldState(WORLD_STATE_BM_SHIELD, _shieldPercent); - DoUpdateWorldState(WORLD_STATE_BM_RIFT, _currentRift); + DoUpdateWorldState(WORLD_STATE_BLACK_MORASS, _eventStatus); + DoUpdateWorldState(WORLD_STATE_BLACK_MORASS_SHIELD, _shieldPercent); + DoUpdateWorldState(WORLD_STATE_BLACK_MORASS_RIFT, _currentRift); ScheduleNextPortal(3s, Position(0.0f, 0.0f, 0.0f, 0.0f)); @@ -339,7 +340,7 @@ public: _shieldPercent = 0; } - DoUpdateWorldState(WORLD_STATE_BM_SHIELD, _shieldPercent); + DoUpdateWorldState(WORLD_STATE_BLACK_MORASS_SHIELD, _shieldPercent); if (!_shieldPercent) { @@ -421,9 +422,9 @@ public: { CleanupInstance(); - DoUpdateWorldState(WORLD_STATE_BM, _eventStatus); - DoUpdateWorldState(WORLD_STATE_BM_SHIELD, _shieldPercent); - DoUpdateWorldState(WORLD_STATE_BM_RIFT, _currentRift); + DoUpdateWorldState(WORLD_STATE_BLACK_MORASS, _eventStatus); + DoUpdateWorldState(WORLD_STATE_BLACK_MORASS_SHIELD, _shieldPercent); + DoUpdateWorldState(WORLD_STATE_BLACK_MORASS_RIFT, _currentRift); }); }); }); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h index 0eac0cb3f..e162b7f77 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h @@ -40,13 +40,6 @@ enum DataTypes DATA_RIFT_NUMBER = 14 }; -enum WorldStateIds -{ - WORLD_STATE_BM = 2541, - WORLD_STATE_BM_SHIELD = 2540, - WORLD_STATE_BM_RIFT = 2784 -}; - enum EventStatus { EVENT_PREPARE = 0, diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 08a178be0..a991d0d91 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -26,6 +26,7 @@ #include "SpellScript.h" #include "SpellScriptLoader.h" #include "Vehicle.h" +#include "WorldStateDefines.h" #include "ruby_sanctum.h" enum Texts @@ -715,8 +716,8 @@ public: break; } - _instance->DoUpdateWorldState(WORLDSTATE_CORPOREALITY_MATERIAL, _corporeality * 10); - _instance->DoUpdateWorldState(WORLDSTATE_CORPOREALITY_TWILIGHT, 100 - _corporeality * 10); + _instance->DoUpdateWorldState(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_MATERIAL, _corporeality * 10); + _instance->DoUpdateWorldState(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TWILIGHT, 100 - _corporeality * 10); if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_TWILIGHT_HALION))) { @@ -1272,9 +1273,9 @@ class spell_halion_twilight_division : public SpellScript if (GameObject* gobject = halion->FindNearestGameObject(GO_HALION_PORTAL_1, 100.0f)) gobject->Delete(); - instance->DoUpdateWorldState(WORLDSTATE_CORPOREALITY_TOGGLE, 1); - instance->DoUpdateWorldState(WORLDSTATE_CORPOREALITY_MATERIAL, 50); - instance->DoUpdateWorldState(WORLDSTATE_CORPOREALITY_TWILIGHT, 50); + instance->DoUpdateWorldState(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TOGGLE, 1); + instance->DoUpdateWorldState(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_MATERIAL, 50); + instance->DoUpdateWorldState(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TWILIGHT, 50); } void Register() override diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp index b1ed2bf5d..54e34f5e4 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp @@ -22,6 +22,7 @@ #include "SpellScript.h" #include "SpellScriptLoader.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" #include "ruby_sanctum.h" @@ -208,9 +209,9 @@ public: halionController->AI()->DoAction(ACTION_INTRO_HALION); break; case DATA_HALION: - DoUpdateWorldState(WORLDSTATE_CORPOREALITY_TOGGLE, 0); - DoUpdateWorldState(WORLDSTATE_CORPOREALITY_TWILIGHT, 0); - DoUpdateWorldState(WORLDSTATE_CORPOREALITY_MATERIAL, 0); + DoUpdateWorldState(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TOGGLE, 0); + DoUpdateWorldState(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TWILIGHT, 0); + DoUpdateWorldState(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_MATERIAL, 0); HandleGameObject(FlameRingGUID, true); break; } @@ -221,9 +222,9 @@ public: void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(WORLDSTATE_CORPOREALITY_MATERIAL, 50); - packet.Worldstates.emplace_back(WORLDSTATE_CORPOREALITY_TWILIGHT, 50); - packet.Worldstates.emplace_back(WORLDSTATE_CORPOREALITY_TOGGLE, 0); + packet.Worldstates.emplace_back(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_MATERIAL, 50); + packet.Worldstates.emplace_back(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TWILIGHT, 50); + packet.Worldstates.emplace_back(WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TOGGLE, 0); } protected: diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h index a75092ae8..07e94cbb5 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h @@ -95,13 +95,6 @@ enum GameObjectsIds GO_BURNING_TREE_4 = 203037 }; -enum WorldStatesRS -{ - WORLDSTATE_CORPOREALITY_MATERIAL = 5049, - WORLDSTATE_CORPOREALITY_TWILIGHT = 5050, - WORLDSTATE_CORPOREALITY_TOGGLE = 5051 -}; - enum InstanceSpell { SPELL_BERSERK = 26662, diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 5d2da7425..26704ed92 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -20,6 +20,7 @@ #include "InstanceMapScript.h" #include "Player.h" #include "ScriptedCreature.h" +#include "WorldStateDefines.h" #include "trial_of_the_crusader.h" std::map validDedicatedInsanityItems; @@ -283,7 +284,7 @@ public: Map::PlayerList const& pl = instance->GetPlayers(); for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr ) if (Player* plr = itr->GetSource()) - plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft); + plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_COUNT, AttemptsLeft); } InstanceCleanup(true); SaveToDB(); @@ -1379,11 +1380,11 @@ public: if (instance->IsHeroic()) { - plr->SendUpdateWorldState(UPDATE_STATE_UI_SHOW, 1); - plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft); + plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_SHOW, 1); + plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_COUNT, AttemptsLeft); } else - plr->SendUpdateWorldState(UPDATE_STATE_UI_SHOW, 0); + plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_SHOW, 0); if (DoNeedCleanup(plr)) { @@ -1555,7 +1556,7 @@ public: Map::PlayerList const& pl = instance->GetPlayers(); for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr ) if (Player* plr = itr->GetSource()) - plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft); + plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_COUNT, AttemptsLeft); } if (instance->IsHeroic() && AttemptsLeft == 0 ) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h index 6b87cb236..edc742da4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h @@ -379,12 +379,6 @@ enum eAchievementCriteria ACHIEV_CRITERIA_REALM_FIRST_GRAND_CRUSADER = 12350, }; -enum euiWorldStates -{ - UPDATE_STATE_UI_SHOW = 4390, - UPDATE_STATE_UI_COUNT = 4389, -}; - const uint32 dIIc = 405; const uint32 dedicatedInsanityItems[405] = { diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h index 204ce5ad3..60894b5a9 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h @@ -100,12 +100,6 @@ enum GameObjects GO_PORTAL_TO_DALARAN = 195682, }; -enum HorWorldStates -{ - WORLD_STATE_HOR_COUNTER = 4884, - WORLD_STATE_HOR_WAVE_COUNT = 4882, -}; - enum BatteredHiltStatusFlags { BHSF_NONE = 0, diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index 34c096d0f..349b17b9f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -20,6 +20,7 @@ #include "InstanceScript.h" #include "MapMgr.h" #include "Transport.h" +#include "WorldStateDefines.h" #include "halls_of_reflection.h" class UtherBatteredHiltEvent : public BasicEvent @@ -435,7 +436,7 @@ public: c->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); } WaveNumber = 0; - DoUpdateWorldState(WORLD_STATE_HOR_COUNTER, 0); + DoUpdateWorldState(WORLD_STATE_HALLS_OF_REFLECTION_WAVES_ENABLED, 0); // give quest Map::PlayerList const& pl = instance->GetPlayers(); @@ -803,8 +804,8 @@ public: if (WaveNumber >= 6) bFinished5Waves = true; - DoUpdateWorldState(WORLD_STATE_HOR_COUNTER, 1); - DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, WaveNumber); + DoUpdateWorldState(WORLD_STATE_HALLS_OF_REFLECTION_WAVES_ENABLED, 1); + DoUpdateWorldState(WORLD_STATE_HALLS_OF_REFLECTION_WAVE_COUNT, WaveNumber); HandleGameObject(GO_FrontDoorGUID, false); // some of them could go back to spawn due to vanish, etc. @@ -869,8 +870,8 @@ public: if (!WaveNumber) return; - DoUpdateWorldState(WORLD_STATE_HOR_COUNTER, 0); - DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, 0); + DoUpdateWorldState(WORLD_STATE_HALLS_OF_REFLECTION_WAVES_ENABLED, 0); + DoUpdateWorldState(WORLD_STATE_HALLS_OF_REFLECTION_WAVE_COUNT, 0); HandleGameObject(GO_FrontDoorGUID, true); TrashCounter = NUM_OF_TRASH; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h index a2720c0d1..e77542678 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h @@ -557,15 +557,6 @@ enum QuestsICC QUEST_A_FEAST_OF_SOULS = 24547 }; -enum WorldStatesICC -{ - WORLDSTATE_SHOW_TIMER = 4903, - WORLDSTATE_EXECUTION_TIME = 4904, - WORLDSTATE_SHOW_ATTEMPTS = 4940, - WORLDSTATE_ATTEMPTS_REMAINING = 4941, - WORLDSTATE_ATTEMPTS_MAX = 4942, -}; - enum PutricideEventFlags { PUTRICIDE_EVENT_FLAG_FESTERGUT_VALVE = 1, diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index fa49b8e2a..2e34baf88 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -27,6 +27,7 @@ #include "Transport.h" #include "WorldPacket.h" #include "WorldSession.h" +#include "WorldStateDefines.h" #include "icecrown_citadel.h" enum EventIds @@ -233,11 +234,11 @@ public: void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(WORLDSTATE_SHOW_TIMER, BloodQuickeningState == IN_PROGRESS ? 1 : 0); - packet.Worldstates.emplace_back(WORLDSTATE_EXECUTION_TIME, BloodQuickeningMinutes); - packet.Worldstates.emplace_back(WORLDSTATE_SHOW_ATTEMPTS, 1); // instance->IsHeroic() ? 1 : 0 - packet.Worldstates.emplace_back(WORLDSTATE_ATTEMPTS_REMAINING, HeroicAttempts); - packet.Worldstates.emplace_back(WORLDSTATE_ATTEMPTS_MAX, MaxHeroicAttempts); + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER, BloodQuickeningState == IN_PROGRESS ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_EXECUTION_TIME, BloodQuickeningMinutes); + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_SHOW_ATTEMPTS, 1); // instance->IsHeroic() ? 1 : 0 + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_REMAINING, HeroicAttempts); + packet.Worldstates.emplace_back(WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_MAX, MaxHeroicAttempts); } void OnPlayerAreaUpdate(Player* player, uint32 /*oldArea*/, uint32 newArea) override @@ -252,7 +253,7 @@ public: } else { - player->SendUpdateWorldState(WORLDSTATE_SHOW_ATTEMPTS, 0); + player->SendUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_SHOW_ATTEMPTS, 0); } } @@ -1021,7 +1022,7 @@ public: if (drop && HeroicAttempts) { --HeroicAttempts; - DoUpdateWorldState(WORLDSTATE_ATTEMPTS_REMAINING, HeroicAttempts); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_REMAINING, HeroicAttempts); SaveToDB(); } if (HeroicAttempts) @@ -1350,13 +1351,13 @@ public: case IN_PROGRESS: Events.ScheduleEvent(EVENT_UPDATE_EXECUTION_TIME, 1min); BloodQuickeningMinutes = 30; - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); - DoUpdateWorldState(WORLDSTATE_EXECUTION_TIME, BloodQuickeningMinutes); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER, 1); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_EXECUTION_TIME, BloodQuickeningMinutes); break; case DONE: Events.CancelEvent(EVENT_UPDATE_EXECUTION_TIME); BloodQuickeningMinutes = 0; - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER, 0); break; default: break; @@ -1616,8 +1617,8 @@ public: if (BloodQuickeningState == IN_PROGRESS) { Events.ScheduleEvent(EVENT_UPDATE_EXECUTION_TIME, 1min); - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); - DoUpdateWorldState(WORLDSTATE_EXECUTION_TIME, BloodQuickeningMinutes); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER, 1); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_EXECUTION_TIME, BloodQuickeningMinutes); } data >> WeeklyQuestId10; @@ -1695,13 +1696,13 @@ public: if (BloodQuickeningMinutes) { Events.ScheduleEvent(EVENT_UPDATE_EXECUTION_TIME, 1min); - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); - DoUpdateWorldState(WORLDSTATE_EXECUTION_TIME, BloodQuickeningMinutes); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER, 1); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_EXECUTION_TIME, BloodQuickeningMinutes); } else { BloodQuickeningState = DONE; - DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); + DoUpdateWorldState(WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER, 0); if (Creature* bq = instance->GetCreature(BloodQueenLanaThelGUID)) bq->AI()->DoAction(ACTION_KILL_MINCHAR); } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp index a9be11304..55fc7e318 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp @@ -20,6 +20,7 @@ #include "LFGMgr.h" #include "Player.h" #include "ScriptedCreature.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" #include "oculus.h" @@ -112,13 +113,13 @@ public: { if (m_auiEncounter[DATA_DRAKOS] == DONE && m_auiEncounter[DATA_VAROS] != DONE) { - player->SendUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 1); - player->SendUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount); + player->SendUpdateWorldState(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_SHOW, 1); + player->SendUpdateWorldState(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount); } else { - player->SendUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0); - player->SendUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 0); + player->SendUpdateWorldState(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_SHOW, 0); + player->SendUpdateWorldState(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_AMOUNT, 0); } } @@ -136,8 +137,8 @@ public: m_auiEncounter[DATA_DRAKOS] = data; if (data == DONE) { - DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 1); - DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount); + DoUpdateWorldState(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_SHOW, 1); + DoUpdateWorldState(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount); if (instance->IsHeroic()) DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MAKE_IT_COUNT_TIMED_EVENT); @@ -147,7 +148,7 @@ public: m_auiEncounter[DATA_VAROS] = data; if (data == DONE) { - DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0); + DoUpdateWorldState(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_SHOW, 0); if (Creature* urom = instance->GetCreature(uiUromGUID)) urom->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); @@ -178,7 +179,7 @@ public: if (CentrifugeCount < 10) { ++CentrifugeCount; - DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount); + DoUpdateWorldState(WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_AMOUNT, 10 - CentrifugeCount); } if (CentrifugeCount >= 10) if (Creature* varos = instance->GetCreature(uiVarosGUID)) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h index 9140cd7be..e08d0541c 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h @@ -97,12 +97,6 @@ enum AchievData CRITERIA_RUBY_VOID = 7323, }; -enum OculusWorldStates -{ - WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW = 3524, - WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT = 3486 -}; - enum MISC { POINT_MOVE_DRAKES diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index a9de02208..30b7f4fd6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -22,6 +22,7 @@ #include "ScriptedCreature.h" #include "Transport.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" #include "ulduar.h" @@ -173,8 +174,8 @@ public: void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { packet.Worldstates.reserve(2); - packet.Worldstates.emplace_back(WORLD_STATE_ALGALON_TIMER_ENABLED, (m_algalonTimer && m_algalonTimer <= 60) ? 1 : 0); - packet.Worldstates.emplace_back(WORLD_STATE_ALGALON_DESPAWN_TIMER, std::min(m_algalonTimer, 60)); + packet.Worldstates.emplace_back(WORLD_STATE_ULDUAR_ALGALON_TIMER_ENABLED, (m_algalonTimer && m_algalonTimer <= 60) ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_ULDUAR_ALGALON_DESPAWN_TIMER, std::min(m_algalonTimer, 60)); } void OnPlayerEnter(Player* player) override @@ -769,15 +770,15 @@ public: SaveToDB(); return; case DATA_DESPAWN_ALGALON: - DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1); - DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, 60); + DoUpdateWorldState(WORLD_STATE_ULDUAR_ALGALON_TIMER_ENABLED, 1); + DoUpdateWorldState(WORLD_STATE_ULDUAR_ALGALON_DESPAWN_TIMER, 60); m_algalonTimer = 60; _events.RescheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 1min); SaveToDB(); return; case DATA_ALGALON_SUMMON_STATE: case DATA_ALGALON_DEFEATED: - DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 0); + DoUpdateWorldState(WORLD_STATE_ULDUAR_ALGALON_TIMER_ENABLED, 0); m_algalonTimer = (type == DATA_ALGALON_DEFEATED ? TIMER_ALGALON_DEFEATED : TIMER_ALGALON_SUMMONED); _events.CancelEvent(EVENT_UPDATE_ALGALON_TIMER); SaveToDB(); @@ -1148,8 +1149,8 @@ public: if (m_algalonTimer && m_algalonTimer <= 60 && GetData(TYPE_ALGALON) != DONE) { - DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1); - DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, m_algalonTimer); + DoUpdateWorldState(WORLD_STATE_ULDUAR_ALGALON_TIMER_ENABLED, 1); + DoUpdateWorldState(WORLD_STATE_ULDUAR_ALGALON_DESPAWN_TIMER, m_algalonTimer); } data >> C_of_Ulduar_MASK; @@ -1190,7 +1191,7 @@ public: } SaveToDB(); - DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, --m_algalonTimer); + DoUpdateWorldState(WORLD_STATE_ULDUAR_ALGALON_DESPAWN_TIMER, --m_algalonTimer); if (m_algalonTimer) { _events.Repeat(1min); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index 4093dd891..ce4a8c6ac 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -276,10 +276,6 @@ enum UlduarMisc ACTION_TOWER_OF_FLAMES_DESTROYED = 3, ACTION_TOWER_OF_LIFE_DESTROYED = 4, - // Algalon the Observer - WORLD_STATE_ALGALON_DESPAWN_TIMER = 4131, - WORLD_STATE_ALGALON_TIMER_ENABLED = 4132, - EVENT_UPDATE_ALGALON_TIMER = 1, ACTION_FEEDS_ON_TEARS_FAILED = 0, ACTION_INIT_ALGALON = 1, diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index ba1f65e5e..1b0ee5f98 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -19,6 +19,7 @@ #include "InstanceMapScript.h" #include "Player.h" #include "ScriptedCreature.h" +#include "WorldStateDefines.h" #include "violet_hold.h" enum vYells @@ -235,7 +236,7 @@ public: CLEANED = false; InstanceCleanup(); } - DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, (uint32)GateHealth); + DoUpdateWorldState(WORLD_STATE_VIOLET_HOLD_PRISON_STATE, (uint32)GateHealth); break; case DATA_RELEASE_BOSS: if (WaveCount == 6) @@ -253,7 +254,7 @@ public: m_auiEncounter[2] = DONE; EncounterStatus = DONE; HandleGameObject(GO_MainGateGUID, true); - DoUpdateWorldState(WORLD_STATE_VH_SHOW, 0); + DoUpdateWorldState(WORLD_STATE_VIOLET_HOLD_SHOW, 0); if (Creature* c = instance->GetCreature(NPC_SinclariGUID)) { c->AI()->Talk(SAY_SINCLARI_COMPLETE); @@ -458,9 +459,9 @@ public: } GateHealth = 100; HandleGameObject(GO_MainGateGUID, false); - DoUpdateWorldState(WORLD_STATE_VH_SHOW, 1); - DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, (uint32)GateHealth); - DoUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, (uint32)WaveCount); + DoUpdateWorldState(WORLD_STATE_VIOLET_HOLD_SHOW, 1); + DoUpdateWorldState(WORLD_STATE_VIOLET_HOLD_PRISON_STATE, (uint32)GateHealth); + DoUpdateWorldState(WORLD_STATE_VIOLET_HOLD_WAVE_COUNT, (uint32)WaveCount); for (ObjectGuid const& guid : GO_ActivationCrystalGUID) if (GameObject* go = instance->GetGameObject(guid)) @@ -473,7 +474,7 @@ public: break; case EVENT_SUMMON_PORTAL: ++WaveCount; - DoUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, (uint32)WaveCount); + DoUpdateWorldState(WORLD_STATE_VIOLET_HOLD_WAVE_COUNT, (uint32)WaveCount); SetData(DATA_PORTAL_LOCATION, (GetData(DATA_PORTAL_LOCATION) + urand(1, 5)) % 6); if (Creature* c = instance->GetCreature(NPC_SinclariGUID)) { @@ -527,12 +528,12 @@ public: if (EncounterStatus == IN_PROGRESS) { - plr->SendUpdateWorldState(WORLD_STATE_VH_SHOW, 1); - plr->SendUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, (uint32)GateHealth); - plr->SendUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, (uint32)WaveCount); + plr->SendUpdateWorldState(WORLD_STATE_VIOLET_HOLD_SHOW, 1); + plr->SendUpdateWorldState(WORLD_STATE_VIOLET_HOLD_PRISON_STATE, (uint32)GateHealth); + plr->SendUpdateWorldState(WORLD_STATE_VIOLET_HOLD_WAVE_COUNT, (uint32)WaveCount); } else - plr->SendUpdateWorldState(WORLD_STATE_VH_SHOW, 0); + plr->SendUpdateWorldState(WORLD_STATE_VIOLET_HOLD_SHOW, 0); events.RescheduleEvent(EVENT_CHECK_PLAYERS, 5s); } @@ -625,7 +626,7 @@ public: } // reinitialize variables and events - DoUpdateWorldState(WORLD_STATE_VH_SHOW, 0); + DoUpdateWorldState(WORLD_STATE_VIOLET_HOLD_SHOW, 0); EncounterStatus = NOT_STARTED; GateHealth = 100; WaveCount = 0; diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.h b/src/server/scripts/Northrend/VioletHold/violet_hold.h index 65d0723d4..4a3614089 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.h +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.h @@ -89,13 +89,6 @@ enum Bosses BOSS_CYANIGOSA }; -enum VHWorldStates -{ - WORLD_STATE_VH_SHOW = 3816, - WORLD_STATE_VH_PRISON_STATE = 3815, - WORLD_STATE_VH_WAVE_COUNT = 3810, -}; - enum Spells { SPELL_CONTROL_CRYSTAL_ACTIVATION = 57804, diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 9dbbd68f4..cc4286910 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -307,7 +307,7 @@ public: else { uint32 timer = wintergrasp->GetTimer() / 1000; - player->SendUpdateWorldState(4354, GameTime::GetGameTime().count() + timer); + player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_CLOCK_TEXTS, GameTime::GetGameTime().count() + timer); if (timer < 15 * MINUTE) { AddGossipItemFor(player, WG_GOSSIP_MENU_QUEUE, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp index e2c7d86e5..57feefa55 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp @@ -28,6 +28,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSessionMgr.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp) @@ -101,41 +102,41 @@ void OPvPCapturePointEP_EWT::ChangeState() void OPvPCapturePointEP_EWT::SendChangePhase() { // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 1); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, phase); // send this too, sometimes it resets :S - SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, _neutralValuePct); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, _neutralValuePct); } void OPvPCapturePointEP_EWT::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(EP_EWT_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_EWT_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_EWT_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_EWT_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_EWT_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0); } void OPvPCapturePointEP_EWT::UpdateTowerState() { - _pvp->SendUpdateWorldState(EP_EWT_A, bool(m_TowerState & EP_TS_A)); - _pvp->SendUpdateWorldState(EP_EWT_H, bool(m_TowerState & EP_TS_H)); - _pvp->SendUpdateWorldState(EP_EWT_N_A, bool(m_TowerState & EP_TS_N_A)); - _pvp->SendUpdateWorldState(EP_EWT_N_H, bool(m_TowerState & EP_TS_N_H)); - _pvp->SendUpdateWorldState(EP_EWT_N, bool(m_TowerState & EP_TS_N)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_A, bool(m_TowerState & EP_TS_A)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_H, bool(m_TowerState & EP_TS_H)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_A, bool(m_TowerState & EP_TS_N_A)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_H, bool(m_TowerState & EP_TS_N_H)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N, bool(m_TowerState & EP_TS_N)); } bool OPvPCapturePointEP_EWT::HandlePlayerEnter(Player* player) { if (OPvPCapturePoint::HandlePlayerEnter(player)) { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 1); uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, _neutralValuePct); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, phase); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, _neutralValuePct); return true; } return false; @@ -143,7 +144,7 @@ bool OPvPCapturePointEP_EWT::HandlePlayerEnter(Player* player) void OPvPCapturePointEP_EWT::HandlePlayerLeave(Player* player) { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 0); OPvPCapturePoint::HandlePlayerLeave(player); } @@ -244,41 +245,41 @@ void OPvPCapturePointEP_NPT::ChangeState() void OPvPCapturePointEP_NPT::SendChangePhase() { // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 1); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, phase); // send this too, sometimes it resets :S - SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, _neutralValuePct); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, _neutralValuePct); } void OPvPCapturePointEP_NPT::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(EP_NPT_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_NPT_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_NPT_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_NPT_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_NPT_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0); } void OPvPCapturePointEP_NPT::UpdateTowerState() { - _pvp->SendUpdateWorldState(EP_NPT_A, bool(m_TowerState & EP_TS_A)); - _pvp->SendUpdateWorldState(EP_NPT_H, bool(m_TowerState & EP_TS_H)); - _pvp->SendUpdateWorldState(EP_NPT_N_A, bool(m_TowerState & EP_TS_N_A)); - _pvp->SendUpdateWorldState(EP_NPT_N_H, bool(m_TowerState & EP_TS_N_H)); - _pvp->SendUpdateWorldState(EP_NPT_N, bool(m_TowerState & EP_TS_N)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_A, bool(m_TowerState & EP_TS_A)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_H, bool(m_TowerState & EP_TS_H)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_A, bool(m_TowerState & EP_TS_N_A)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_H, bool(m_TowerState & EP_TS_N_H)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N, bool(m_TowerState & EP_TS_N)); } bool OPvPCapturePointEP_NPT::HandlePlayerEnter(Player* player) { if (OPvPCapturePoint::HandlePlayerEnter(player)) { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 1); uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, _neutralValuePct); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, phase); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, _neutralValuePct); return true; } return false; @@ -286,7 +287,7 @@ bool OPvPCapturePointEP_NPT::HandlePlayerEnter(Player* player) void OPvPCapturePointEP_NPT::HandlePlayerLeave(Player* player) { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 0); OPvPCapturePoint::HandlePlayerLeave(player); } @@ -377,41 +378,41 @@ void OPvPCapturePointEP_CGT::ChangeState() void OPvPCapturePointEP_CGT::SendChangePhase() { // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 1); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, phase); // send this too, sometimes it resets :S - SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, _neutralValuePct); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, _neutralValuePct); } void OPvPCapturePointEP_CGT::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(EP_CGT_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_CGT_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_CGT_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_CGT_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_CGT_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0); } void OPvPCapturePointEP_CGT::UpdateTowerState() { - _pvp->SendUpdateWorldState(EP_CGT_A, bool(m_TowerState & EP_TS_A)); - _pvp->SendUpdateWorldState(EP_CGT_H, bool(m_TowerState & EP_TS_H)); - _pvp->SendUpdateWorldState(EP_CGT_N_A, bool(m_TowerState & EP_TS_N_A)); - _pvp->SendUpdateWorldState(EP_CGT_N_H, bool(m_TowerState & EP_TS_N_H)); - _pvp->SendUpdateWorldState(EP_CGT_N, bool(m_TowerState & EP_TS_N)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A, bool(m_TowerState & EP_TS_A)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H, bool(m_TowerState & EP_TS_H)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A, bool(m_TowerState & EP_TS_N_A)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H, bool(m_TowerState & EP_TS_N_H)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N, bool(m_TowerState & EP_TS_N)); } bool OPvPCapturePointEP_CGT::HandlePlayerEnter(Player* player) { if (OPvPCapturePoint::HandlePlayerEnter(player)) { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 1); uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, _neutralValuePct); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, phase); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, _neutralValuePct); return true; } return false; @@ -419,7 +420,7 @@ bool OPvPCapturePointEP_CGT::HandlePlayerEnter(Player* player) void OPvPCapturePointEP_CGT::HandlePlayerLeave(Player* player) { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 0); OPvPCapturePoint::HandlePlayerLeave(player); } @@ -515,41 +516,41 @@ void OPvPCapturePointEP_PWT::ChangeState() void OPvPCapturePointEP_PWT::SendChangePhase() { // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 1); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, phase); // send this too, sometimes it resets :S - SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, _neutralValuePct); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, _neutralValuePct); } void OPvPCapturePointEP_PWT::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(EP_PWT_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_PWT_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_PWT_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_PWT_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(EP_PWT_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0); } void OPvPCapturePointEP_PWT::UpdateTowerState() { - _pvp->SendUpdateWorldState(EP_PWT_A, bool(m_TowerState & EP_TS_A)); - _pvp->SendUpdateWorldState(EP_PWT_H, bool(m_TowerState & EP_TS_H)); - _pvp->SendUpdateWorldState(EP_PWT_N_A, bool(m_TowerState & EP_TS_N_A)); - _pvp->SendUpdateWorldState(EP_PWT_N_H, bool(m_TowerState & EP_TS_N_H)); - _pvp->SendUpdateWorldState(EP_PWT_N, bool(m_TowerState & EP_TS_N)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_A, bool(m_TowerState & EP_TS_A)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_H, bool(m_TowerState & EP_TS_H)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_A, bool(m_TowerState & EP_TS_N_A)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_H, bool(m_TowerState & EP_TS_N_H)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N, bool(m_TowerState & EP_TS_N)); } bool OPvPCapturePointEP_PWT::HandlePlayerEnter(Player* player) { if (OPvPCapturePoint::HandlePlayerEnter(player)) { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 1); uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, _neutralValuePct); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, phase); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, _neutralValuePct); return true; } return false; @@ -557,7 +558,7 @@ bool OPvPCapturePointEP_PWT::HandlePlayerEnter(Player* player) void OPvPCapturePointEP_PWT::HandlePlayerLeave(Player* player) { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 0); OPvPCapturePoint::HandlePlayerLeave(player); } @@ -647,8 +648,8 @@ bool OutdoorPvPEP::Update(uint32 diff) ++m_AllianceTowersControlled; else if (EP_ControlsId[i] == TEAM_HORDE) ++m_HordeTowersControlled; - SendUpdateWorldState(EP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); - SendUpdateWorldState(EP_UI_TOWER_COUNT_H, m_HordeTowersControlled); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_H, m_HordeTowersControlled); BuffTeams(); } return true; @@ -720,11 +721,11 @@ void OutdoorPvPEP::SetControlledState(uint32 index, TeamId teamId) void OutdoorPvPEP::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(5); - packet.Worldstates.emplace_back(EP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); - packet.Worldstates.emplace_back(EP_UI_TOWER_COUNT_H, m_HordeTowersControlled); - packet.Worldstates.emplace_back(EP_UI_TOWER_SLIDER_DISPLAY, 0); - packet.Worldstates.emplace_back(EP_UI_TOWER_SLIDER_POS, 50); - packet.Worldstates.emplace_back(EP_UI_TOWER_SLIDER_N, 100); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_H, m_HordeTowersControlled); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, 50); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, 100); for (OPvPCapturePointMap::iterator itr = _capturePoints.begin(); itr != _capturePoints.end(); ++itr) { @@ -734,35 +735,35 @@ void OutdoorPvPEP::FillInitialWorldStates(WorldPackets::WorldState::InitWorldSta void OutdoorPvPEP::SendRemoveWorldStates(Player* player) { - player->SendUpdateWorldState(EP_UI_TOWER_COUNT_A, 0); - player->SendUpdateWorldState(EP_UI_TOWER_COUNT_H, 0); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, 0); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, 0); - player->SendUpdateWorldState(EP_EWT_A, 0); - player->SendUpdateWorldState(EP_EWT_H, 0); - player->SendUpdateWorldState(EP_EWT_N, 0); - player->SendUpdateWorldState(EP_EWT_N_A, 0); - player->SendUpdateWorldState(EP_EWT_N_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_H, 0); - player->SendUpdateWorldState(EP_PWT_A, 0); - player->SendUpdateWorldState(EP_PWT_H, 0); - player->SendUpdateWorldState(EP_PWT_N, 0); - player->SendUpdateWorldState(EP_PWT_N_A, 0); - player->SendUpdateWorldState(EP_PWT_N_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_H, 0); - player->SendUpdateWorldState(EP_NPT_A, 0); - player->SendUpdateWorldState(EP_NPT_H, 0); - player->SendUpdateWorldState(EP_NPT_N, 0); - player->SendUpdateWorldState(EP_NPT_N_A, 0); - player->SendUpdateWorldState(EP_NPT_N_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_H, 0); - player->SendUpdateWorldState(EP_CGT_A, 0); - player->SendUpdateWorldState(EP_CGT_H, 0); - player->SendUpdateWorldState(EP_CGT_N, 0); - player->SendUpdateWorldState(EP_CGT_N_A, 0); - player->SendUpdateWorldState(EP_CGT_N_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H, 0); } class OutdoorPvP_eastern_plaguelands : public OutdoorPvPScript diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h index b6e5fab91..bcbe6ff25 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h @@ -46,52 +46,6 @@ const uint32 EPBuffZones[EPBuffZonesNum] = {139, 2017, 2057}; // EP_PWT_Taxi = 84 //}; -enum EP_EastwallTowerWorldStates -{ - EP_EWT_A = 2354, - EP_EWT_H = 2356, - EP_EWT_N_A = 2359, // ally conquested - EP_EWT_N_H = 2360, - EP_EWT_N = 2361 -}; - -enum EP_NorthpassTowerWorldStates -{ - EP_NPT_N = 2352, - EP_NPT_N_A = 2362, - EP_NPT_N_H = 2363, - EP_NPT_A = 2372, - EP_NPT_H = 2373 -}; - -enum EP_PlagewoodTowerWorldStates -{ - EP_PWT_N_A = 2366, - EP_PWT_N_H = 2353, //2367 not present! use neutral! - EP_PWT_A = 2370, - EP_PWT_H = 2371, - EP_PWT_N = 2353 -}; - -enum EP_CrownGuardTowerWorldStates -{ - EP_CGT_N_A = 2374, - EP_CGT_N_H = 2375, - EP_CGT_A = 2378, - EP_CGT_H = 2379, - EP_CGT_N = 2355 -}; - -enum EP_WorldStates -{ - EP_UI_TOWER_SLIDER_DISPLAY = 2426, - EP_UI_TOWER_SLIDER_POS = 2427, - EP_UI_TOWER_SLIDER_N = 2428, - - EP_UI_TOWER_COUNT_A = 2327, - EP_UI_TOWER_COUNT_H = 2328 -}; - enum EP_Summons { EP_EWT_COMMANDER = 0, diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPGH.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPGH.cpp index 5037503a9..81091447d 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPGH.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPGH.cpp @@ -22,6 +22,7 @@ #include "OutdoorPvPScript.h" #include "Player.h" #include "WorldPacket.h" +#include "WorldStateDefines.h" OutdoorPvPGH::OutdoorPvPGH() { @@ -39,9 +40,9 @@ bool OutdoorPvPGH::SetupOutdoorPvP() void OutdoorPvPGH::SendRemoveWorldStates(Player* player) { - player->SendUpdateWorldState(GH_UI_SLIDER_DISPLAY, 0); - player->SendUpdateWorldState(GH_UI_SLIDER_POS, 0); - player->SendUpdateWorldState(GH_UI_SLIDER_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_POS, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_N, 0); } OPvPCapturePointGH::OPvPCapturePointGH(OutdoorPvP* pvp) : OPvPCapturePoint(pvp) @@ -52,29 +53,29 @@ OPvPCapturePointGH::OPvPCapturePointGH(OutdoorPvP* pvp) : OPvPCapturePoint(pvp) void OPvPCapturePointGH::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(GH_UI_SLIDER_DISPLAY, 0); - packet.Worldstates.emplace_back(GH_UI_SLIDER_POS, 50); - packet.Worldstates.emplace_back(GH_UI_SLIDER_N, 20); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_GH_UI_SLIDER_POS, 50); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_GH_UI_SLIDER_N, 20); } void OPvPCapturePointGH::SendChangePhase() { // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(GH_UI_SLIDER_DISPLAY, 1); + SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY, 1); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - SendUpdateWorldState(GH_UI_SLIDER_POS, phase); - SendUpdateWorldState(GH_UI_SLIDER_N, _neutralValuePct); + SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_POS, phase); + SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_N, _neutralValuePct); } bool OPvPCapturePointGH::HandlePlayerEnter(Player* player) { if (OPvPCapturePoint::HandlePlayerEnter(player)) { - player->SendUpdateWorldState(GH_UI_SLIDER_DISPLAY, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY, 1); uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - player->SendUpdateWorldState(GH_UI_SLIDER_POS, phase); - player->SendUpdateWorldState(GH_UI_SLIDER_N, _neutralValuePct); + player->SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_POS, phase); + player->SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_N, _neutralValuePct); return true; } return false; @@ -82,7 +83,7 @@ bool OPvPCapturePointGH::HandlePlayerEnter(Player* player) void OPvPCapturePointGH::HandlePlayerLeave(Player* player) { - player->SendUpdateWorldState(GH_UI_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY, 0); OPvPCapturePoint::HandlePlayerLeave(player); } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPGH.h b/src/server/scripts/OutdoorPvP/OutdoorPvPGH.h index 4ec3f2784..66ce2481d 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPGH.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPGH.h @@ -26,10 +26,6 @@ enum OutdoorPvPGHenum GH_HORDE_DEFENSE_EVENT = 66, GH_ZONE = 394, - - GH_UI_SLIDER_DISPLAY = 3466, - GH_UI_SLIDER_POS = 3467, - GH_UI_SLIDER_N = 3468, }; class Unit; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index 9e32988d3..5f2bef7ee 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -131,21 +131,21 @@ bool OutdoorPvPHP::Update(uint32 diff) TeamCastSpell(TEAM_ALLIANCE, -AllianceBuff); TeamCastSpell(TEAM_HORDE, -HordeBuff); } - SendUpdateWorldState(HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); - SendUpdateWorldState(HP_UI_TOWER_COUNT_H, m_HordeTowersControlled); + SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_H, m_HordeTowersControlled); } return changed; } void OutdoorPvPHP::SendRemoveWorldStates(Player* player) { - player->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_A, 0); - player->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_H, 0); - player->SendUpdateWorldState(HP_UI_TOWER_COUNT_H, 0); - player->SendUpdateWorldState(HP_UI_TOWER_COUNT_A, 0); - player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, 0); - player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, 0); - player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_POS, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_DISPLAY, 0); for (int i = 0; i < HP_TOWER_NUM; ++i) { player->SendUpdateWorldState(HP_MAP_N[i], 0); @@ -157,15 +157,15 @@ void OutdoorPvPHP::SendRemoveWorldStates(Player* player) void OutdoorPvPHP::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(8); - packet.Worldstates.emplace_back(HP_UI_TOWER_DISPLAY_A, 1); - packet.Worldstates.emplace_back(HP_UI_TOWER_DISPLAY_H, 1); - packet.Worldstates.emplace_back(HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); - packet.Worldstates.emplace_back(HP_UI_TOWER_COUNT_H, m_HordeTowersControlled); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_A, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_H, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_H, m_HordeTowersControlled); - packet.Worldstates.emplace_back(HP_UI_TOWER_COUNT_H, m_HordeTowersControlled); - packet.Worldstates.emplace_back(HP_UI_TOWER_SLIDER_DISPLAY, 0); - packet.Worldstates.emplace_back(HP_UI_TOWER_SLIDER_POS, 50); - packet.Worldstates.emplace_back(HP_UI_TOWER_SLIDER_N, 100); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_H, m_HordeTowersControlled); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_POS, 50); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_N, 100); for (OPvPCapturePointMap::iterator itr = _capturePoints.begin(); itr != _capturePoints.end(); ++itr) { itr->second->FillInitialWorldStates(packet); @@ -269,12 +269,12 @@ void OPvPCapturePointHP::ChangeState() void OPvPCapturePointHP::SendChangePhase() { - SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, _neutralValuePct); + SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_N, _neutralValuePct); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, phase); + SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_POS, phase); // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 1); + SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_DISPLAY, 1); } void OPvPCapturePointHP::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) @@ -311,10 +311,10 @@ bool OPvPCapturePointHP::HandlePlayerEnter(Player* player) { if (OPvPCapturePoint::HandlePlayerEnter(player)) { - player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_DISPLAY, 1); uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, _neutralValuePct); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_POS, phase); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_N, _neutralValuePct); return true; } return false; @@ -322,7 +322,7 @@ bool OPvPCapturePointHP::HandlePlayerEnter(Player* player) void OPvPCapturePointHP::HandlePlayerLeave(Player* player) { - player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_DISPLAY, 0); OPvPCapturePoint::HandlePlayerLeave(player); } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h index 95646e5cc..810da0376 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h @@ -19,6 +19,7 @@ #define OUTDOOR_PVP_HP_ #include "OutdoorPvP.h" +#include "WorldStateDefines.h" #define OutdoorPvPHPBuffZonesNum 6 // HP, citadel, ramparts, blood furnace, shattered halls, mag's lair @@ -46,24 +47,11 @@ const uint32 HP_CREDITMARKER[HP_TOWER_NUM] = {19032, 19028, 19029}; //const uint32 HP_CapturePointEvent_Leave[HP_TOWER_NUM] = {11403, 11395, 11387}; -enum OutdoorPvPHPWorldStates -{ - HP_UI_TOWER_DISPLAY_A = 0x9ba, - HP_UI_TOWER_DISPLAY_H = 0x9b9, +const uint32 HP_MAP_N[HP_TOWER_NUM] = {WORLD_STATE_OPVP_HP_BROKENHILL_N, WORLD_STATE_OPVP_HP_OVERLOOK_N, WORLD_STATE_OPVP_HP_STADIUM_N }; - HP_UI_TOWER_COUNT_H = 0x9ae, - HP_UI_TOWER_COUNT_A = 0x9ac, +const uint32 HP_MAP_A[HP_TOWER_NUM] = {WORLD_STATE_OPVP_HP_BROKENHILL_A, WORLD_STATE_OPVP_HP_OVERLOOK_A, WORLD_STATE_OPVP_HP_STADIUM_A }; - HP_UI_TOWER_SLIDER_N = 2475, - HP_UI_TOWER_SLIDER_POS = 2474, - HP_UI_TOWER_SLIDER_DISPLAY = 2473 -}; - -const uint32 HP_MAP_N[HP_TOWER_NUM] = {0x9b5, 0x9b2, 0x9a8}; - -const uint32 HP_MAP_A[HP_TOWER_NUM] = {0x9b3, 0x9b0, 0x9a7}; - -const uint32 HP_MAP_H[HP_TOWER_NUM] = {0x9b4, 0x9b1, 0x9a6}; +const uint32 HP_MAP_H[HP_TOWER_NUM] = {WORLD_STATE_OPVP_HP_BROKENHILL_H, WORLD_STATE_OPVP_HP_OVERLOOK_H, WORLD_STATE_OPVP_HP_STADIUM_H }; const uint32 HP_TowerArtKit_A[HP_TOWER_NUM] = {65, 62, 67}; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index 3af31cc6b..aab8ddb7a 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -29,6 +29,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSessionMgr.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" OutdoorPvPNA::OutdoorPvPNA() @@ -216,9 +217,9 @@ void OPvPCapturePointNA::FactionTakeOver(TeamId teamId) m_WyvernStateEast = WYVERN_NEU_HORDE; m_WyvernStateWest = WYVERN_NEU_HORDE; _pvp->TeamApplyBuff(TEAM_ALLIANCE, NA_CAPTURE_BUFF); - _pvp->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0); - _pvp->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 1); - _pvp->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW, 0); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW, 1); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT, m_GuardsAlive); sWorldSessionMgr->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_NA_CAPTURE_A)); } else @@ -228,9 +229,9 @@ void OPvPCapturePointNA::FactionTakeOver(TeamId teamId) m_WyvernStateEast = WYVERN_NEU_ALLIANCE; m_WyvernStateWest = WYVERN_NEU_ALLIANCE; _pvp->TeamApplyBuff(TEAM_HORDE, NA_CAPTURE_BUFF); - _pvp->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 1); - _pvp->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0); - _pvp->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW, 1); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW, 0); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT, m_GuardsAlive); sWorldSessionMgr->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_NA_CAPTURE_H)); } UpdateWyvernRoostWorldState(NA_ROOST_S); @@ -243,10 +244,10 @@ bool OPvPCapturePointNA::HandlePlayerEnter(Player* player) { if (OPvPCapturePoint::HandlePlayerEnter(player)) { - player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY, 1); uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, _neutralValuePct); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_POS, phase); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_SLIDER_N, _neutralValuePct); return true; } return false; @@ -254,7 +255,7 @@ bool OPvPCapturePointNA::HandlePlayerEnter(Player* player) void OPvPCapturePointNA::HandlePlayerLeave(Player* player) { - player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY, 0); OPvPCapturePoint::HandlePlayerLeave(player); } @@ -311,75 +312,75 @@ void OPvPCapturePointNA::FillInitialWorldStates(WorldPackets::WorldState::InitWo packet.Worldstates.reserve(25); if (m_ControllingFaction == TEAM_ALLIANCE) { - packet.Worldstates.emplace_back(NA_UI_HORDE_GUARDS_SHOW, 0); - packet.Worldstates.emplace_back(NA_UI_ALLIANCE_GUARDS_SHOW, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW, 1); } else if (m_ControllingFaction == TEAM_HORDE) { - packet.Worldstates.emplace_back(NA_UI_HORDE_GUARDS_SHOW, 1); - packet.Worldstates.emplace_back(NA_UI_ALLIANCE_GUARDS_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW, 0); } else { - packet.Worldstates.emplace_back(NA_UI_HORDE_GUARDS_SHOW, 0); - packet.Worldstates.emplace_back(NA_UI_ALLIANCE_GUARDS_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW, 0); } - packet.Worldstates.emplace_back(NA_UI_GUARDS_MAX, NA_GUARDS_MAX); - packet.Worldstates.emplace_back(NA_UI_GUARDS_LEFT, m_GuardsAlive); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_NORTH_NEU_H, (m_WyvernStateNorth & WYVERN_NEU_HORDE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_NORTH_NEU_A, (m_WyvernStateNorth & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_NORTH_H, (m_WyvernStateNorth & WYVERN_HORDE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_NORTH_A, (m_WyvernStateNorth & WYVERN_ALLIANCE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_SOUTH_NEU_H, (m_WyvernStateSouth & WYVERN_NEU_HORDE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_SOUTH_NEU_A, (m_WyvernStateSouth & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_SOUTH_H, (m_WyvernStateSouth & WYVERN_HORDE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_SOUTH_A, (m_WyvernStateSouth & WYVERN_ALLIANCE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_WEST_NEU_H, (m_WyvernStateWest & WYVERN_NEU_HORDE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_WEST_NEU_A, (m_WyvernStateWest & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_WEST_H, (m_WyvernStateWest & WYVERN_HORDE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_WEST_A, (m_WyvernStateWest & WYVERN_ALLIANCE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_EAST_NEU_H, (m_WyvernStateEast & WYVERN_NEU_HORDE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_EAST_NEU_A, (m_WyvernStateEast & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_EAST_H, (m_WyvernStateEast & WYVERN_HORDE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_WYVERN_EAST_A, (m_WyvernStateEast & WYVERN_ALLIANCE) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_HALAA_NEUTRAL, (m_HalaaState & HALAA_N) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_HALAA_NEU_A, (m_HalaaState & HALAA_N_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_HALAA_NEU_H, (m_HalaaState & HALAA_N_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_HALAA_HORDE, (m_HalaaState & HALAA_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(NA_MAP_HALAA_ALLIANCE, (m_HalaaState & HALAA_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_GUARDS_MAX, NA_GUARDS_MAX); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT, m_GuardsAlive); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_H, (m_WyvernStateNorth & WYVERN_NEU_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_A, (m_WyvernStateNorth & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_H, (m_WyvernStateNorth & WYVERN_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_A, (m_WyvernStateNorth & WYVERN_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_H, (m_WyvernStateSouth & WYVERN_NEU_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_A, (m_WyvernStateSouth & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_H, (m_WyvernStateSouth & WYVERN_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_A, (m_WyvernStateSouth & WYVERN_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_H, (m_WyvernStateWest & WYVERN_NEU_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_A, (m_WyvernStateWest & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_H, (m_WyvernStateWest & WYVERN_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_A, (m_WyvernStateWest & WYVERN_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_H, (m_WyvernStateEast & WYVERN_NEU_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_A, (m_WyvernStateEast & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_H, (m_WyvernStateEast & WYVERN_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_A, (m_WyvernStateEast & WYVERN_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_NEUTRAL, (m_HalaaState & HALAA_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_A, (m_HalaaState & HALAA_N_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_H, (m_HalaaState & HALAA_N_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_HORDE, (m_HalaaState & HALAA_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_NA_MAP_HALAA_ALLIANCE, (m_HalaaState & HALAA_A) != 0 ? 1 : 0); } void OutdoorPvPNA::SendRemoveWorldStates(Player* player) { - player->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0); - player->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0); - player->SendUpdateWorldState(NA_UI_GUARDS_MAX, 0); - player->SendUpdateWorldState(NA_UI_GUARDS_LEFT, 0); - player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0); - player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, 0); - player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_H, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_A, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_H, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_A, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_H, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_A, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_H, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_A, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_H, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_A, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_H, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_A, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_H, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_A, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_H, 0); - player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_A, 0); - player->SendUpdateWorldState(NA_MAP_HALAA_NEUTRAL, 0); - player->SendUpdateWorldState(NA_MAP_HALAA_NEU_A, 0); - player->SendUpdateWorldState(NA_MAP_HALAA_NEU_H, 0); - player->SendUpdateWorldState(NA_MAP_HALAA_HORDE, 0); - player->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_GUARDS_MAX, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_POS, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_SLIDER_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_NEUTRAL, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_HORDE, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_ALLIANCE, 0); } bool OutdoorPvPNA::Update(uint32 diff) @@ -640,7 +641,7 @@ bool OPvPCapturePointNA::Update(uint32 diff) else m_capturable = false; // update the guard count for the players in zone - _pvp->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT, m_GuardsAlive); } } else m_GuardCheckTimer -= diff; @@ -774,7 +775,7 @@ bool OPvPCapturePointNA::Update(uint32 diff) } } else - SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0); //Point is not capturable so we hide the slider + SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY, 0); //Point is not capturable so we hide the slider return false; } @@ -824,20 +825,20 @@ void OPvPCapturePointNA::ChangeState() void OPvPCapturePointNA::SendChangePhase() { // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1); + SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY, 1); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase); - SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, _neutralValuePct); + SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_POS, phase); + SendUpdateWorldState(WORLD_STATE_OPVP_NA_UI_SLIDER_N, _neutralValuePct); } void OPvPCapturePointNA::UpdateHalaaWorldState() { - _pvp->SendUpdateWorldState(NA_MAP_HALAA_NEUTRAL, uint32(bool(m_HalaaState & HALAA_N))); - _pvp->SendUpdateWorldState(NA_MAP_HALAA_NEU_A, uint32(bool(m_HalaaState & HALAA_N_A))); - _pvp->SendUpdateWorldState(NA_MAP_HALAA_NEU_H, uint32(bool(m_HalaaState & HALAA_N_H))); - _pvp->SendUpdateWorldState(NA_MAP_HALAA_HORDE, uint32(bool(m_HalaaState & HALAA_H))); - _pvp->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE, uint32(bool(m_HalaaState & HALAA_A))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_NEUTRAL, uint32(bool(m_HalaaState & HALAA_N))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_A, uint32(bool(m_HalaaState & HALAA_N_A))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_H, uint32(bool(m_HalaaState & HALAA_N_H))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_HORDE, uint32(bool(m_HalaaState & HALAA_H))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_HALAA_ALLIANCE, uint32(bool(m_HalaaState & HALAA_A))); } void OPvPCapturePointNA::UpdateWyvernRoostWorldState(uint32 roost) @@ -845,28 +846,28 @@ void OPvPCapturePointNA::UpdateWyvernRoostWorldState(uint32 roost) switch (roost) { case NA_ROOST_S: - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_H, uint32(bool(m_WyvernStateSouth & WYVERN_NEU_HORDE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_A, uint32(bool(m_WyvernStateSouth & WYVERN_NEU_ALLIANCE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_H, uint32(bool(m_WyvernStateSouth & WYVERN_HORDE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_A, uint32(bool(m_WyvernStateSouth & WYVERN_ALLIANCE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_H, uint32(bool(m_WyvernStateSouth & WYVERN_NEU_HORDE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_A, uint32(bool(m_WyvernStateSouth & WYVERN_NEU_ALLIANCE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_H, uint32(bool(m_WyvernStateSouth & WYVERN_HORDE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_A, uint32(bool(m_WyvernStateSouth & WYVERN_ALLIANCE))); break; case NA_ROOST_N: - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_H, uint32(bool(m_WyvernStateNorth & WYVERN_NEU_HORDE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_A, uint32(bool(m_WyvernStateNorth & WYVERN_NEU_ALLIANCE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_H, uint32(bool(m_WyvernStateNorth & WYVERN_HORDE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_A, uint32(bool(m_WyvernStateNorth & WYVERN_ALLIANCE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_H, uint32(bool(m_WyvernStateNorth & WYVERN_NEU_HORDE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_A, uint32(bool(m_WyvernStateNorth & WYVERN_NEU_ALLIANCE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_H, uint32(bool(m_WyvernStateNorth & WYVERN_HORDE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_A, uint32(bool(m_WyvernStateNorth & WYVERN_ALLIANCE))); break; case NA_ROOST_W: - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_H, uint32(bool(m_WyvernStateWest & WYVERN_NEU_HORDE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_A, uint32(bool(m_WyvernStateWest & WYVERN_NEU_ALLIANCE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_WEST_H, uint32(bool(m_WyvernStateWest & WYVERN_HORDE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_WEST_A, uint32(bool(m_WyvernStateWest & WYVERN_ALLIANCE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_H, uint32(bool(m_WyvernStateWest & WYVERN_NEU_HORDE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_A, uint32(bool(m_WyvernStateWest & WYVERN_NEU_ALLIANCE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_H, uint32(bool(m_WyvernStateWest & WYVERN_HORDE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_A, uint32(bool(m_WyvernStateWest & WYVERN_ALLIANCE))); break; case NA_ROOST_E: - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_H, uint32(bool(m_WyvernStateEast & WYVERN_NEU_HORDE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_A, uint32(bool(m_WyvernStateEast & WYVERN_NEU_ALLIANCE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_EAST_H, uint32(bool(m_WyvernStateEast & WYVERN_HORDE))); - _pvp->SendUpdateWorldState(NA_MAP_WYVERN_EAST_A, uint32(bool(m_WyvernStateEast & WYVERN_ALLIANCE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_H, uint32(bool(m_WyvernStateEast & WYVERN_NEU_HORDE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_A, uint32(bool(m_WyvernStateEast & WYVERN_NEU_ALLIANCE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_H, uint32(bool(m_WyvernStateEast & WYVERN_HORDE))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_A, uint32(bool(m_WyvernStateEast & WYVERN_ALLIANCE))); break; } } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h index 0f8f6ab13..51701ecd7 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h @@ -48,44 +48,6 @@ const uint32 NA_GUARD_CHECK_TIME = 500; // every half second const uint32 NA_HALAA_BOMB = 24538; // Item id Bomb throwed in Halaa -enum OutdoorPvPNAWorldStates -{ - NA_UI_HORDE_GUARDS_SHOW = 2503, - NA_UI_ALLIANCE_GUARDS_SHOW = 2502, - NA_UI_GUARDS_MAX = 2493, - NA_UI_GUARDS_LEFT = 2491, - - NA_UI_TOWER_SLIDER_DISPLAY = 2495, - NA_UI_TOWER_SLIDER_POS = 2494, - NA_UI_TOWER_SLIDER_N = 2497, - - NA_MAP_WYVERN_NORTH_NEU_H = 2762, - NA_MAP_WYVERN_NORTH_NEU_A = 2662, - NA_MAP_WYVERN_NORTH_H = 2663, - NA_MAP_WYVERN_NORTH_A = 2664, - - NA_MAP_WYVERN_SOUTH_NEU_H = 2760, - NA_MAP_WYVERN_SOUTH_NEU_A = 2670, - NA_MAP_WYVERN_SOUTH_H = 2668, - NA_MAP_WYVERN_SOUTH_A = 2669, - - NA_MAP_WYVERN_WEST_NEU_H = 2761, - NA_MAP_WYVERN_WEST_NEU_A = 2667, - NA_MAP_WYVERN_WEST_H = 2665, - NA_MAP_WYVERN_WEST_A = 2666, - - NA_MAP_WYVERN_EAST_NEU_H = 2763, - NA_MAP_WYVERN_EAST_NEU_A = 2659, - NA_MAP_WYVERN_EAST_H = 2660, - NA_MAP_WYVERN_EAST_A = 2661, - - NA_MAP_HALAA_NEUTRAL = 2671, - NA_MAP_HALAA_NEU_A = 2676, - NA_MAP_HALAA_NEU_H = 2677, - NA_MAP_HALAA_HORDE = 2672, - NA_MAP_HALAA_ALLIANCE = 2673 -}; - const uint32 FLIGHT_NODES_NUM = 4; // used to access the elements of Horde/AllyControlGOs diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 2e01c38e8..56449ef3e 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -29,6 +29,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSessionMgr.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" OutdoorPvPSI::OutdoorPvPSI() @@ -42,23 +43,23 @@ OutdoorPvPSI::OutdoorPvPSI() void OutdoorPvPSI::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(3); - packet.Worldstates.emplace_back(SI_GATHERED_A, m_Gathered_A); - packet.Worldstates.emplace_back(SI_GATHERED_H, m_Gathered_H); - packet.Worldstates.emplace_back(SI_SILITHYST_MAX, SI_MAX_RESOURCES); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_SI_GATHERED_A, m_Gathered_A); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_SI_GATHERED_H, m_Gathered_H); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_SI_SILITHYST_MAX, SI_MAX_RESOURCES); } void OutdoorPvPSI::SendRemoveWorldStates(Player* player) { - player->SendUpdateWorldState(SI_GATHERED_A, 0); - player->SendUpdateWorldState(SI_GATHERED_H, 0); - player->SendUpdateWorldState(SI_SILITHYST_MAX, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_SI_GATHERED_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_SI_GATHERED_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_SI_SILITHYST_MAX, 0); } void OutdoorPvPSI::UpdateWorldState() { - SendUpdateWorldState(SI_GATHERED_A, m_Gathered_A); - SendUpdateWorldState(SI_GATHERED_H, m_Gathered_H); - SendUpdateWorldState(SI_SILITHYST_MAX, SI_MAX_RESOURCES); + SendUpdateWorldState(WORLD_STATE_OPVP_SI_GATHERED_A, m_Gathered_A); + SendUpdateWorldState(WORLD_STATE_OPVP_SI_GATHERED_H, m_Gathered_H); + SendUpdateWorldState(WORLD_STATE_OPVP_SI_SILITHYST_MAX, SI_MAX_RESOURCES); } bool OutdoorPvPSI::SetupOutdoorPvP() diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h index 1ae673954..c4d724463 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h @@ -44,13 +44,6 @@ const uint32 SI_TURNIN_QUEST_CM_H = 18199; const uint32 SI_SILITHYST_MOUND = 181597; -enum SI_WorldStates -{ - SI_GATHERED_A = 2313, - SI_GATHERED_H = 2314, - SI_SILITHYST_MAX = 2317 -}; - class OutdoorPvPSI : public OutdoorPvP { public: diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index cf0e239a8..3e7272743 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -63,19 +63,19 @@ void OPvPCapturePointTF::FillInitialWorldStates(WorldPackets::WorldState::InitWo void OutdoorPvPTF::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(12); - packet.Worldstates.emplace_back(TF_UI_TOWER_SLIDER_POS, 50); - packet.Worldstates.emplace_back(TF_UI_TOWER_SLIDER_N, 100); - packet.Worldstates.emplace_back(TF_UI_TOWER_SLIDER_DISPLAY, 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_POS, 50); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_N, 100); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_DISPLAY, 0); - packet.Worldstates.emplace_back(TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); - packet.Worldstates.emplace_back(TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); - packet.Worldstates.emplace_back(TF_UI_TOWERS_CONTROLLED_DISPLAY, !m_IsLocked); - packet.Worldstates.emplace_back(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, first_digit); - packet.Worldstates.emplace_back(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, second_digit); - packet.Worldstates.emplace_back(TF_UI_LOCKED_TIME_HOURS, hours_left); - packet.Worldstates.emplace_back(TF_UI_LOCKED_DISPLAY_NEUTRAL, (m_IsLocked && !m_HordeTowersControlled && !m_AllianceTowersControlled) ? 1 : 0); - packet.Worldstates.emplace_back(TF_UI_LOCKED_DISPLAY_HORDE, (m_IsLocked && (m_HordeTowersControlled > m_AllianceTowersControlled)) ? 1 : 0); - packet.Worldstates.emplace_back(TF_UI_LOCKED_DISPLAY_ALLIANCE, (m_IsLocked && (m_HordeTowersControlled < m_AllianceTowersControlled)) ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY, !m_IsLocked); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, first_digit); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, second_digit); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_HOURS, hours_left); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_NEUTRAL, (m_IsLocked && !m_HordeTowersControlled && !m_AllianceTowersControlled) ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_HORDE, (m_IsLocked && (m_HordeTowersControlled > m_AllianceTowersControlled)) ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_ALLIANCE, (m_IsLocked && (m_HordeTowersControlled < m_AllianceTowersControlled)) ? 1 : 0); for (OPvPCapturePointMap::iterator itr = _capturePoints.begin(); itr != _capturePoints.end(); ++itr) { @@ -85,21 +85,21 @@ void OutdoorPvPTF::FillInitialWorldStates(WorldPackets::WorldState::InitWorldSta void OutdoorPvPTF::SendRemoveWorldStates(Player* player) { - player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, uint32(0)); - player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, uint32(0)); - player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_POS, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_N, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_DISPLAY, uint32(0)); - player->SendUpdateWorldState(TF_UI_TOWER_COUNT_H, uint32(0)); - player->SendUpdateWorldState(TF_UI_TOWER_COUNT_A, uint32(0)); - player->SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0)); - player->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, uint32(0)); - player->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, uint32(0)); - player->SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_HOURS, uint32(0)); - player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0)); - player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0)); - player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_HORDE, uint32(0)); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0)); for (int i = 0; i < TF_TOWER_NUM; ++i) { @@ -111,14 +111,14 @@ void OutdoorPvPTF::SendRemoveWorldStates(Player* player) void OutdoorPvPTF::SaveRequiredWorldStates() const { - sWorld->setWorldState(TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); - sWorld->setWorldState(TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + sWorld->setWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); + sWorld->setWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); - sWorld->setWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, m_IsLocked); + sWorld->setWorldState(WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY, m_IsLocked); // Save expiry as unix uint32 const lockExpireTime = GameTime::GetGameTime().count() + (m_LockTimer / IN_MILLISECONDS); - sWorld->setWorldState(TF_UI_LOCKED_TIME_HOURS, lockExpireTime); + sWorld->setWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_HOURS, lockExpireTime); } void OutdoorPvPTF::ResetZoneToTeamControlled(TeamId team) @@ -144,8 +144,8 @@ void OutdoorPvPTF::ResetZoneToTeamControlled(TeamId team) dynamic_cast(tower)->ResetToTeamControlled(team); } - SendUpdateWorldState(TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); - SendUpdateWorldState(TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); } void OPvPCapturePointTF::ResetToTeamControlled(TeamId team) @@ -185,10 +185,10 @@ bool OPvPCapturePointTF::HandlePlayerEnter(Player* player) { if (OPvPCapturePoint::HandlePlayerEnter(player)) { - player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_DISPLAY, 1); uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, _neutralValuePct); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_POS, phase); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_N, _neutralValuePct); return true; } return false; @@ -196,7 +196,7 @@ bool OPvPCapturePointTF::HandlePlayerEnter(Player* player) void OPvPCapturePointTF::HandlePlayerLeave(Player* player) { - player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_DISPLAY, 0); OPvPCapturePoint::HandlePlayerLeave(player); } @@ -211,20 +211,20 @@ bool OutdoorPvPTF::Update(uint32 diff) TeamApplyBuff(TEAM_ALLIANCE, TF_CAPTURE_BUFF); m_IsLocked = true; m_JustLocked = true; - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0)); - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0)); - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(1)); - SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_HORDE, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(1)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0)); } else if (m_HordeTowersControlled == TF_TOWER_NUM) { TeamApplyBuff(TEAM_HORDE, TF_CAPTURE_BUFF); m_IsLocked = true; m_JustLocked = true; - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0)); - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(1)); - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0)); - SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_HORDE, uint32(1)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0)); } else { @@ -232,8 +232,8 @@ bool OutdoorPvPTF::Update(uint32 diff) TeamCastSpell(TEAM_HORDE, -TF_CAPTURE_BUFF); } - SendUpdateWorldState(TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); - SendUpdateWorldState(TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); } if (m_IsLocked) @@ -254,10 +254,10 @@ bool OutdoorPvPTF::Update(uint32 diff) ResetZoneToTeamControlled(TEAM_NEUTRAL); SaveRequiredWorldStates(); - SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(1)); - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0)); - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0)); - SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(1)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_HORDE, uint32(0)); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0)); } else { @@ -267,9 +267,9 @@ bool OutdoorPvPTF::Update(uint32 diff) m_LockTimerUpdate = TF_LOCK_TIME_UPDATE; RecalculateClientUILockTime(); - SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, first_digit); - SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, second_digit); - SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS, hours_left); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, first_digit); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, second_digit); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_HOURS, hours_left); } else { @@ -335,7 +335,7 @@ bool OutdoorPvPTF::SetupOutdoorPvP() m_AllianceTowersControlled = 0; m_HordeTowersControlled = 0; - m_IsLocked = bool(sWorld->getWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY)); + m_IsLocked = bool(sWorld->getWorldState(WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY)); m_JustLocked = false; m_LockTimer = TF_LOCK_TIME; m_LockTimerUpdate = 0; @@ -359,14 +359,14 @@ bool OutdoorPvPTF::SetupOutdoorPvP() { // Core shutdown while locked -- init from latest known data in WorldState // Convert from unix - int32 const lockRemainingTime = int32((sWorld->getWorldState(TF_UI_LOCKED_TIME_HOURS) - GameTime::GetGameTime().count()) * IN_MILLISECONDS); + int32 const lockRemainingTime = int32((sWorld->getWorldState(WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_HOURS) - GameTime::GetGameTime().count()) * IN_MILLISECONDS); if (lockRemainingTime > 0) { m_LockTimer = lockRemainingTime; RecalculateClientUILockTime(); - uint32 const hordeTowers = uint32(sWorld->getWorldState(TF_UI_TOWER_COUNT_H)); - uint32 const allianceTowers = uint32(sWorld->getWorldState(TF_UI_TOWER_COUNT_A)); + uint32 const hordeTowers = uint32(sWorld->getWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H)); + uint32 const allianceTowers = uint32(sWorld->getWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A)); TeamId const controllingTeam = hordeTowers > allianceTowers ? TEAM_HORDE : TEAM_ALLIANCE; ResetZoneToTeamControlled(controllingTeam); @@ -462,12 +462,12 @@ void OPvPCapturePointTF::ChangeState() void OPvPCapturePointTF::SendChangePhase() { // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 1); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_DISPLAY, 1); // send these updates to only the ones in this objective uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f); - SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, phase); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_POS, phase); // send this too, sometimes it resets :S - SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, _neutralValuePct); + SendUpdateWorldState(WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_N, _neutralValuePct); } class OutdoorPvP_terokkar_forest : public OutdoorPvPScript diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h index aa9dfef43..68abdc37b 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h @@ -19,6 +19,7 @@ #define OUTDOOR_PVP_TF_ #include "OutdoorPvP.h" +#include "WorldStateDefines.h" const uint8 OutdoorPvPTFBuffZonesNum = 5; @@ -71,11 +72,11 @@ struct tf_tower_world_state const tf_tower_world_state TFTowerWorldStates[TF_TOWER_NUM] = { - {0xa79, 0xa7a, 0xa7b}, - {0xa7e, 0xa7d, 0xa7c}, - {0xa82, 0xa81, 0xa80}, - {0xa88, 0xa87, 0xa86}, - {0xa85, 0xa84, 0xa83} + {WORLD_STATE_OPVP_TF_TOWER_NUM_00, WORLD_STATE_OPVP_TF_TOWER_NUM_01, WORLD_STATE_OPVP_TF_TOWER_NUM_02}, + {WORLD_STATE_OPVP_TF_TOWER_NUM_05, WORLD_STATE_OPVP_TF_TOWER_NUM_04, WORLD_STATE_OPVP_TF_TOWER_NUM_03}, + {WORLD_STATE_OPVP_TF_TOWER_NUM_08, WORLD_STATE_OPVP_TF_TOWER_NUM_07, WORLD_STATE_OPVP_TF_TOWER_NUM_06}, + {WORLD_STATE_OPVP_TF_TOWER_NUM_14, WORLD_STATE_OPVP_TF_TOWER_NUM_13, WORLD_STATE_OPVP_TF_TOWER_NUM_12}, + {WORLD_STATE_OPVP_TF_TOWER_NUM_11, WORLD_STATE_OPVP_TF_TOWER_NUM_10, WORLD_STATE_OPVP_TF_TOWER_NUM_09} }; //const uint32 TFTowerPlayerEnterEvents[TF_TOWER_NUM] = @@ -96,24 +97,6 @@ const tf_tower_world_state TFTowerWorldStates[TF_TOWER_NUM] = // 12500 //}; -enum TFWorldStates -{ - TF_UI_TOWER_SLIDER_POS = 0xa41, - TF_UI_TOWER_SLIDER_N = 0xa40, - TF_UI_TOWER_SLIDER_DISPLAY = 0xa3f, - - TF_UI_TOWER_COUNT_H = 0xa3e, - TF_UI_TOWER_COUNT_A = 0xa3d, - TF_UI_TOWERS_CONTROLLED_DISPLAY = 0xa3c, - - TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT = 0x9d0, - TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT = 0x9ce, - TF_UI_LOCKED_TIME_HOURS = 0x9cd, - TF_UI_LOCKED_DISPLAY_NEUTRAL = 0x9cc, - TF_UI_LOCKED_DISPLAY_HORDE = 0xad0, - TF_UI_LOCKED_DISPLAY_ALLIANCE = 0xacf -}; - enum TFTowerStates { TF_TOWERSTATE_N = 1, diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index 48a370737..9dfd2876f 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -26,6 +26,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSessionMgr.h" +#include "WorldStateDefines.h" #include "WorldStatePackets.h" OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type) @@ -269,26 +270,26 @@ OPvPCapturePointZM_Graveyard::OPvPCapturePointZM_Graveyard(OutdoorPvP* pvp) void OPvPCapturePointZM_Graveyard::UpdateTowerState() { - _pvp->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, uint32(bool(m_GraveyardState & ZM_GRAVEYARD_N))); - _pvp->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, uint32(bool(m_GraveyardState & ZM_GRAVEYARD_H))); - _pvp->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, uint32(bool(m_GraveyardState & ZM_GRAVEYARD_A))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_N, uint32(bool(m_GraveyardState & ZM_GRAVEYARD_N))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_H, uint32(bool(m_GraveyardState & ZM_GRAVEYARD_H))); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_A, uint32(bool(m_GraveyardState & ZM_GRAVEYARD_A))); - _pvp->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY, uint32(m_BothControllingFactionId == TEAM_ALLIANCE)); - _pvp->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY, uint32(m_BothControllingFactionId != TEAM_ALLIANCE)); - _pvp->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY, uint32(m_BothControllingFactionId == TEAM_HORDE)); - _pvp->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY, uint32(m_BothControllingFactionId != TEAM_HORDE)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_READY, uint32(m_BothControllingFactionId == TEAM_ALLIANCE)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_NOT_READY, uint32(m_BothControllingFactionId != TEAM_ALLIANCE)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_READY, uint32(m_BothControllingFactionId == TEAM_HORDE)); + _pvp->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_NOT_READY, uint32(m_BothControllingFactionId != TEAM_HORDE)); } void OPvPCapturePointZM_Graveyard::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.reserve(7); - packet.Worldstates.emplace_back(ZM_MAP_GRAVEYARD_N, (m_GraveyardState & ZM_GRAVEYARD_N) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(ZM_MAP_GRAVEYARD_H, (m_GraveyardState & ZM_GRAVEYARD_H) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(ZM_MAP_GRAVEYARD_A, (m_GraveyardState & ZM_GRAVEYARD_A) != 0 ? 1 : 0); - packet.Worldstates.emplace_back(ZM_MAP_ALLIANCE_FLAG_READY, m_BothControllingFactionId == TEAM_ALLIANCE ? 1 : 0); - packet.Worldstates.emplace_back(ZM_MAP_ALLIANCE_FLAG_NOT_READY, m_BothControllingFactionId != TEAM_ALLIANCE ? 1 : 0); - packet.Worldstates.emplace_back(ZM_MAP_HORDE_FLAG_READY, m_BothControllingFactionId == TEAM_HORDE ? 1 : 0); - packet.Worldstates.emplace_back(ZM_MAP_HORDE_FLAG_NOT_READY, m_BothControllingFactionId != TEAM_HORDE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_N, (m_GraveyardState & ZM_GRAVEYARD_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_H, (m_GraveyardState & ZM_GRAVEYARD_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_A, (m_GraveyardState & ZM_GRAVEYARD_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_READY, m_BothControllingFactionId == TEAM_ALLIANCE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_NOT_READY, m_BothControllingFactionId != TEAM_ALLIANCE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_READY, m_BothControllingFactionId == TEAM_HORDE ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_NOT_READY, m_BothControllingFactionId != TEAM_HORDE ? 1 : 0); } void OPvPCapturePointZM_Graveyard::SetBeaconState(TeamId controlling_factionId) @@ -417,7 +418,7 @@ void OutdoorPvPZM::SetHordeTowersControlled(uint32 count) void OutdoorPvPZM::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(ZM_WORLDSTATE_UNK_1, 1); + packet.Worldstates.emplace_back(WORLD_STATE_OPVP_ZM_UNK, 1); for (OPvPCapturePointMap::iterator itr = _capturePoints.begin(); itr != _capturePoints.end(); ++itr) { itr->second->FillInitialWorldStates(packet); @@ -426,32 +427,32 @@ void OutdoorPvPZM::FillInitialWorldStates(WorldPackets::WorldState::InitWorldSta void OutdoorPvPZM::SendRemoveWorldStates(Player* player) { - player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_W, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_W, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_W, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_E, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_E, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_E, 0); - player->SendUpdateWorldState(ZM_WORLDSTATE_UNK_1, 1); - player->SendUpdateWorldState(ZM_UI_TOWER_EAST_N, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_EAST_H, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_EAST_A, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_WEST_N, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_WEST_H, 0); - player->SendUpdateWorldState(ZM_UI_TOWER_WEST_A, 0); - player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_N, 0); - player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_H, 0); - player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_A, 0); - player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, 0); - player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, 0); - player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, 0); - player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_N, 0); - player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_H, 0); - player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_A, 0); - player->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY, 0); - player->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY, 0); - player->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY, 0); - player->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_N_W, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_POS_W, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_DISPLAY_W, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_N_E, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_POS_E, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_DISPLAY_E, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UNK, 1); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_N, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_H, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_A, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_READY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_NOT_READY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_NOT_READY, 0); + player->SendUpdateWorldState(WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_READY, 0); } class OutdoorPvP_zangarmarsh : public OutdoorPvPScript diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h index ef31a4ea2..58517d84b 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h @@ -122,41 +122,6 @@ const go_type ZMCapturePoints[ZM_NUM_BEACONS] = {182522, 530, 336.466f, 7340.26f, 41.4984f, -1.58825f, 0.0f, 0.0f, 0.71325f, -0.700909f} }; -enum OutdoorPvPZMWorldStates -{ - ZM_UI_TOWER_SLIDER_N_W = 2529, - ZM_UI_TOWER_SLIDER_POS_W = 2528, - ZM_UI_TOWER_SLIDER_DISPLAY_W = 2527, - - ZM_UI_TOWER_SLIDER_N_E = 2535, - ZM_UI_TOWER_SLIDER_POS_E = 2534, - ZM_UI_TOWER_SLIDER_DISPLAY_E = 2533, - - ZM_WORLDSTATE_UNK_1 = 2653, - - ZM_UI_TOWER_EAST_N = 2560, - ZM_UI_TOWER_EAST_H = 2559, - ZM_UI_TOWER_EAST_A = 2558, - ZM_UI_TOWER_WEST_N = 2557, - ZM_UI_TOWER_WEST_H = 2556, - ZM_UI_TOWER_WEST_A = 2555, - - ZM_MAP_TOWER_EAST_N = 2652, - ZM_MAP_TOWER_EAST_H = 2651, - ZM_MAP_TOWER_EAST_A = 2650, - ZM_MAP_GRAVEYARD_H = 2649, - ZM_MAP_GRAVEYARD_A = 2648, - ZM_MAP_GRAVEYARD_N = 2647, - ZM_MAP_TOWER_WEST_N = 2646, - ZM_MAP_TOWER_WEST_H = 2645, - ZM_MAP_TOWER_WEST_A = 2644, - - ZM_MAP_HORDE_FLAG_READY = 2658, - ZM_MAP_HORDE_FLAG_NOT_READY = 2657, - ZM_MAP_ALLIANCE_FLAG_NOT_READY = 2656, - ZM_MAP_ALLIANCE_FLAG_READY = 2655 -}; - enum ZM_TowerStateMask { ZM_TOWERSTATE_N = 1, diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 440738f96..95b7608a5 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -34,6 +34,7 @@ #include "TaskScheduler.h" #include "WaypointMgr.h" #include "World.h" +#include "WorldStateDefines.h" /// @todo: this import is not necessary for compilation and marked as unused by the IDE // however, for some reasons removing it would cause a damn linking issue @@ -186,17 +187,6 @@ public: } }; -/* - * Stranglethorn Vale Fishing Extravaganza World States - */ -enum FishingExtravaganzaWorldStates -{ - STV_FISHING_PREV_WIN_TIME = 197, - STV_FISHING_HAS_WINNER = 198, - STV_FISHING_ANNOUNCE_EVENT_BEGIN = 199, - STV_FISHING_ANNOUNCE_POOLS_DESPAN = 200 -}; - enum RiggleBassbait { RIGGLE_SAY_START = 0, @@ -222,13 +212,13 @@ public: npc_riggle_bassbaitAI(Creature* c) : ScriptedAI(c) { m_uiTimer = 0; - auto prevWinTime = sWorld->getWorldState(STV_FISHING_PREV_WIN_TIME); + auto prevWinTime = sWorld->getWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_PREV_WIN_TIME); if (GameTime::GetGameTime().count() - prevWinTime > DAY) { // reset all after 1 day - sWorld->setWorldState(STV_FISHING_ANNOUNCE_EVENT_BEGIN, 1); - sWorld->setWorldState(STV_FISHING_ANNOUNCE_POOLS_DESPAN, 0); - sWorld->setWorldState(STV_FISHING_HAS_WINNER, 0); + sWorld->setWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_EVENT_BEGIN, 1); + sWorld->setWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_POOLS_DESPAWN, 0); + sWorld->setWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_HAS_WINNER, 0); } } @@ -236,16 +226,16 @@ public: void CheckTournamentState() const { - if (sGameEventMgr->IsActiveEvent(EVENT_FISHING_TURN_INS) && !sWorld->getWorldState(STV_FISHING_HAS_WINNER)) + if (sGameEventMgr->IsActiveEvent(EVENT_FISHING_TURN_INS) && !sWorld->getWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_HAS_WINNER)) { if (!me->IsQuestGiver()) { me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); } - if (sWorld->getWorldState(STV_FISHING_ANNOUNCE_EVENT_BEGIN)) + if (sWorld->getWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_EVENT_BEGIN)) { me->AI()->Talk(RIGGLE_SAY_START); - sWorld->setWorldState(STV_FISHING_ANNOUNCE_EVENT_BEGIN, 0); + sWorld->setWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_EVENT_BEGIN, 0); } } else @@ -258,14 +248,14 @@ public: if (sGameEventMgr->IsActiveEvent(EVENT_FISHING_POOLS)) { // enable announcement: when pools despawn - sWorld->setWorldState(STV_FISHING_ANNOUNCE_POOLS_DESPAN, 1); + sWorld->setWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_POOLS_DESPAWN, 1); } else { - if (sWorld->getWorldState(STV_FISHING_ANNOUNCE_POOLS_DESPAN)) + if (sWorld->getWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_POOLS_DESPAWN)) { me->AI()->Talk(RIGGLE_SAY_POOLS_END); - sWorld->setWorldState(STV_FISHING_ANNOUNCE_POOLS_DESPAN, 0); + sWorld->setWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_POOLS_DESPAWN, 0); } } } @@ -291,7 +281,7 @@ public: player->PrepareQuestMenu(creature->GetGUID()); } - if (sWorld->getWorldState(STV_FISHING_HAS_WINNER)) + if (sWorld->getWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_HAS_WINNER)) { SendGossipMenuFor(player, GOSSIP_EVENT_OVER, creature->GetGUID()); } @@ -308,8 +298,8 @@ public: { creature->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); creature->AI()->Talk(RIGGLE_SAY_WINNER, player); - sWorld->setWorldState(STV_FISHING_PREV_WIN_TIME, GameTime::GetGameTime().count()); - sWorld->setWorldState(STV_FISHING_HAS_WINNER, 1); + sWorld->setWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_PREV_WIN_TIME, GameTime::GetGameTime().count()); + sWorld->setWorldState(WORLD_STATE_STRANGLETHORN_VALE_FISHING_HAS_WINNER, 1); } return true; } From c1d42d2c36d0cc6ef9db71a4b97668e028bf9993 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Sat, 26 Apr 2025 18:35:02 +0000 Subject: [PATCH 25/53] fix (Script/Gruul) Kiggler polymorph targets his tank (#21966) Kiggler the Crazed now targets the tank when casting Greater Polymorph --- .../Outland/GruulsLair/boss_high_king_maulgar.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index 7ad14c2b6..c6624521f 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -286,16 +286,7 @@ struct boss_kiggler_the_crazed : public ScriptedAI context.Repeat(7200ms, 20600ms); }).Schedule(23s, [this](TaskContext context) { - //changed to work similarly to Ikiss poly - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_GREATER_POLYMORPH); - if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, [&] - (Unit* target) -> bool - { - return target && !target->IsImmunedToSpell(spellInfo); - })) - { - DoCast(target, SPELL_GREATER_POLYMORPH); - } + DoCastVictim(SPELL_GREATER_POLYMORPH); context.Repeat(10900ms); }).Schedule(30s, [this](TaskContext context) { From 7503a242664934a8824e269244dbd7abd3f96630 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Sat, 26 Apr 2025 18:37:05 +0000 Subject: [PATCH 26/53] fix(Core/Player) internally handle expertise as float (#21967) The core will no longer truncated the expertise (from float to int) value on the server side. --- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Entities/Player/Player.h | 3 +++ src/server/game/Entities/Unit/StatSystem.cpp | 8 +++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c79fd6f1f..4d9e9655a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5233,9 +5233,9 @@ float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const switch (attType) { case BASE_ATTACK: - return GetUInt32Value(PLAYER_EXPERTISE) / 4.0f; + return m_Expertise / 4.0f; case OFF_ATTACK: - return GetUInt32Value(PLAYER_OFFHAND_EXPERTISE) / 4.0f; + return m_OffhandExpertise / 4.0f; default: break; } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 2545c89e4..844d5f9db 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2884,6 +2884,9 @@ protected: uint8 m_swingErrorMsg; float m_ammoDPS; + float m_Expertise; + float m_OffhandExpertise; + ////////////////////Rest System///////////////////// time_t _restTime; uint32 _innTriggerId; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 49a00a5ae..3e702f846 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -879,7 +879,7 @@ void Player::UpdateExpertise(WeaponAttackType attack) if (attack == RANGED_ATTACK) return; - int32 expertise = int32(GetRatingBonusValue(CR_EXPERTISE)); + float expertise = GetRatingBonusValue(CR_EXPERTISE); Item* weapon = GetWeaponForAttack(attack, true); @@ -900,10 +900,12 @@ void Player::UpdateExpertise(WeaponAttackType attack) switch (attack) { case BASE_ATTACK: - SetUInt32Value(PLAYER_EXPERTISE, expertise); + m_Expertise = expertise; + SetUInt32Value(PLAYER_EXPERTISE, int32(expertise)); break; case OFF_ATTACK: - SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, expertise); + m_OffhandExpertise = expertise; + SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, int32(expertise)); break; default: break; From efe81e16db9ddc28dd08a6f33d4b0e252f5892dc Mon Sep 17 00:00:00 2001 From: sudlud Date: Sat, 26 Apr 2025 20:39:50 +0200 Subject: [PATCH 27/53] fix(deps/PackageList.txt): update for current state of dependencies (#21968) Updated many depedencies for PackageList.txt Co-authored-by: blinkysc <37940565+blinkysc@users.noreply.github.com> --- deps/PackageList.txt | 38 ++++++++++++++++++++++++++++++-------- deps/jemalloc/VERSION | 1 - 2 files changed, 30 insertions(+), 9 deletions(-) delete mode 100644 deps/jemalloc/VERSION diff --git a/deps/PackageList.txt b/deps/PackageList.txt index 323cc9f75..f771c3b73 100644 --- a/deps/PackageList.txt +++ b/deps/PackageList.txt @@ -1,6 +1,6 @@ AzerothCore uses (parts of or in whole) the following opensource software: -argon2 +argon2 (The password hash Argon2) https://github.com/P-H-C/phc-winner-argon2 Version: 62358ba @@ -14,15 +14,22 @@ bzip2 (a freely available, patent free, high-quality data compressor) G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License) http://g3d.sourceforge.net/ - Version: 8.01-Release + Version: v9.0 hotfix7 + +gperftools (Google Performance Tools) + Version: external jemalloc (a general-purpose scalable concurrent malloc-implementation) http://www.canonware.com/jemalloc/ - Version: 5.0.1 + Version: 5.2.1 + +jsonpath (JSONPath implementation in Bash for filtering, merging and modifying JSON) + https://github.com/mclarkson/JSONPath.sh.git + Version: 0.0.14 libMPQ (a library for reading MPQ files) https://libmpq.org/ - Version: 1.0.4 + Version: 0.4.2 libreadline (command line editing library) https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html @@ -34,11 +41,26 @@ OpenSSL (general-purpose cryptography library) MySQL (the world's most popular open source database software) http://www.mysql.com/ - Version: 5.5.9 (GA) + Version: external + +semver_bash (bash parser for semantic versioning) + https://github.com/cloudflare/semver_bash/tree/master + Version: c1133faf0efe17767b654b213f212c326df73fa3 SFMT (SIMD-oriented Fast Mersenne Twister) Based on http://agner.org/random/ - Version: 2010-Aug-03 + Version: 1.5 + +sse2neon (A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation) + https://github.com/DLTcollab/sse2neon + Location: deps\argon2\argon2\blake2\sse2neon.h + Version: 0c0dee02bb9d9848c294db1179fc278a4649979d + +stdfs (filesystem library) + Version: external + +threads + Version: external utf8-cpp (UTF-8 with C++ in a Portable Way) http://utfcpp.sourceforge.net/ @@ -50,11 +72,11 @@ zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library) gSOAP (a portable development toolkit for C and C++ XML Web services and XML data bindings) http://gsoap2.sourceforge.net/ - Version: 2.8.10 + Version: 2.8.105 recastnavigation (Recast is state of the art navigation mesh construction toolset for games) https://github.com/memononen/recastnavigation - Version: 64385e9ed0822427bca5814d03a3f4c4d7a6db9f + Version: c40188c796f089f89a42e0b939d934178dbcfc5c {fmt} is an open-source formatting library providing a fast and safe alternative to C stdio and C++ iostreams. https://github.com/fmtlib/fmt diff --git a/deps/jemalloc/VERSION b/deps/jemalloc/VERSION deleted file mode 100644 index dace31ba7..000000000 --- a/deps/jemalloc/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340 From 30e81f8d679e6e326c86fcacbadbcb289224c7d8 Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Sat, 26 Apr 2025 20:44:51 +0200 Subject: [PATCH 28/53] fix (DB/Creature) Citizen of New Avalon inside Scarlet Tavern now remain dead. (#21996) --- .../updates/pending_db_world/Dead_Bodies.sql | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 data/sql/updates/pending_db_world/Dead_Bodies.sql diff --git a/data/sql/updates/pending_db_world/Dead_Bodies.sql b/data/sql/updates/pending_db_world/Dead_Bodies.sql new file mode 100644 index 000000000..a4e73cc00 --- /dev/null +++ b/data/sql/updates/pending_db_world/Dead_Bodies.sql @@ -0,0 +1,37 @@ + +-- Set Not Selectable for dead bodies inside Scarlet Tavern +UPDATE `creature` SET `unit_flags` = `unit_flags` |33554432 WHERE (`id1` IN(28610, 28939, 28940, 28941, 28942)) AND (`guid` IN(129664, 129682, 129683, 129727, 129769, 130001, 130002)); + +-- Set Timed Action List for reset (to prevent total aura resets) +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2894103) AND (`source_type` = 9) 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 +(2894103, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 52262, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Cornered and Enraged!\''), +(2894103, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 51604, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Serverside - Stun Self\''), +(2894103, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 52716, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Terrified\''), +(2894103, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Set Reactstate Aggressive'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2894203) AND (`source_type` = 9) 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 +(2894203, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 52262, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Cornered and Enraged!\''), +(2894203, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 51604, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Serverside - Stun Self\''), +(2894203, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 52716, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Terrified\''), +(2894203, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Set Reactstate Aggressive'); + +-- Set SmartAI for Citizen of New Avalon +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28941; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28941); +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 +(28941, 0, 0, 0, 4, 0, 100, 512, 0, 0, 0, 0, 0, 0, 87, 2894100, 2894101, 2894102, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aggro - Run Random Script'), +(28941, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2894103, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Reset - Run Script'), +(28941, 0, 2, 3, 23, 1, 100, 0, 52716, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aura \'Terrified\' - Evade (Phase 1)'), +(28941, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aura \'Terrified\' - Set Event Phase 0 (Phase 1)'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28942; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28942); +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 +(28942, 0, 0, 0, 4, 0, 100, 512, 0, 0, 0, 0, 0, 0, 87, 2894100, 2894101, 2894102, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aggro - Run Random Script'), +(28942, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2894103, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Reset - Run Script'), +(28942, 0, 2, 3, 23, 1, 100, 0, 52716, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aura \'Terrified\' - Evade (Phase 1)'), +(28942, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aura \'Terrified\' - Set Event Phase 0 (Phase 1)'); From 40a6d667aa52c05d509055686724450948991083 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 26 Apr 2025 18:45:53 +0000 Subject: [PATCH 29/53] chore(DB): import pending files Referenced commit(s): 30e81f8d679e6e326c86fcacbadbcb289224c7d8 --- .../Dead_Bodies.sql => db_world/2025_04_26_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/Dead_Bodies.sql => db_world/2025_04_26_00.sql} (99%) diff --git a/data/sql/updates/pending_db_world/Dead_Bodies.sql b/data/sql/updates/db_world/2025_04_26_00.sql similarity index 99% rename from data/sql/updates/pending_db_world/Dead_Bodies.sql rename to data/sql/updates/db_world/2025_04_26_00.sql index a4e73cc00..654d0f2a4 100644 --- a/data/sql/updates/pending_db_world/Dead_Bodies.sql +++ b/data/sql/updates/db_world/2025_04_26_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_25_01 -> 2025_04_26_00 -- Set Not Selectable for dead bodies inside Scarlet Tavern UPDATE `creature` SET `unit_flags` = `unit_flags` |33554432 WHERE (`id1` IN(28610, 28939, 28940, 28941, 28942)) AND (`guid` IN(129664, 129682, 129683, 129727, 129769, 130001, 130002)); From 08ca9eb3f2163e78f4767802284f7c9fd6a7de11 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Sun, 27 Apr 2025 07:34:29 +0000 Subject: [PATCH 30/53] fix(Scripts/SunwellPlateau): Make Twin special abilities target one of the highest 6 in threat of the other twin (#21964) --- .../SunwellPlateau/boss_eredar_twins.cpp | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 54cc5f71f..58669b216 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -119,7 +119,7 @@ struct boss_sacrolash : public BossAI scheduler.CancelGroup(GROUP_SPECIAL_ABILITY); ScheduleTimedEvent(20s, [&] { - Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f); + Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false); if (!target) target = me->GetVictim(); @@ -153,7 +153,14 @@ struct boss_sacrolash : public BossAI }, 8s, 12s); scheduler.Schedule(36s, GROUP_SPECIAL_ABILITY, [this](TaskContext context) { - Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f); + Unit* target = nullptr; + if (Creature* alythess = instance->GetCreature(DATA_ALYTHESS)) + { + std::list targets; + alythess->AI()->SelectTargetList(targets, 6, SelectTargetMethod::MaxThreat, 0, 100.0f, true, false); + if (!targets.empty()) + target = Acore::Containers::SelectRandomContainerElement(targets); + } if (!target) target = me->GetVictim(); Talk(EMOTE_SHADOW_NOVA, target); @@ -244,7 +251,7 @@ struct boss_alythess : public BossAI }, 8s, 10s); ScheduleTimedEvent(20s, 26s, [&] { - Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f); + Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false); if (!target) target = me->GetVictim(); DoCast(target, SPELL_SHADOW_NOVA); @@ -280,7 +287,14 @@ struct boss_alythess : public BossAI }, 10s, 15s); scheduler.Schedule(20s, GROUP_SPECIAL_ABILITY, [this](TaskContext context) { - Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f); + Unit* target = nullptr; + if (Creature* sacrolash = instance->GetCreature(DATA_SACROLASH)) + { + std::list targets; + sacrolash->AI()->SelectTargetList(targets, 6, SelectTargetMethod::MaxThreat, 0, 100.0f, true, false); + if (!targets.empty()) + target = Acore::Containers::SelectRandomContainerElement(targets); + } if (!target) target = me->GetVictim(); Talk(EMOTE_CONFLAGRATION, target); From 8ba0b7a4b2418fd71d4aaa8ecbabec8fb2059afc Mon Sep 17 00:00:00 2001 From: NoxMax <50133316+NoxMax@users.noreply.github.com> Date: Tue, 29 Apr 2025 06:41:10 -0600 Subject: [PATCH 31/53] fix(Core/worldserver.conf) Clarification for AllowTwoSide.Interaction.Auction (#22013) --- src/server/apps/worldserver/worldserver.conf.dist | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index c21cbf667..47d8841e5 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -4207,7 +4207,8 @@ AllowTwoSide.Interaction.Arena = 0 # # AllowTwoSide.Interaction.Auction -# Description: Allow auctions between factions. +# Description: Allow auctions between factions. This flags all auction houses as Neutral, +# and would also take a Neutral auction house cut from auctions. # Default: 0 - (Disabled) # 1 - (Enabled) From 025b5798223c41064fb44c00e2e32e30b85cfa33 Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Tue, 29 Apr 2025 15:40:46 +0200 Subject: [PATCH 32/53] fix(DB/Creature) Solve various issues on dk starting area (phase 4). (#22017) --- .../DK_Phase_4_various_corrections.sql | 107 ++++++++++++++++++ .../game/Spells/SpellInfoCorrections.cpp | 6 + 2 files changed, 113 insertions(+) create mode 100644 data/sql/updates/pending_db_world/DK_Phase_4_various_corrections.sql diff --git a/data/sql/updates/pending_db_world/DK_Phase_4_various_corrections.sql b/data/sql/updates/pending_db_world/DK_Phase_4_various_corrections.sql new file mode 100644 index 000000000..f2a8ba67e --- /dev/null +++ b/data/sql/updates/pending_db_world/DK_Phase_4_various_corrections.sql @@ -0,0 +1,107 @@ + +-- Add Waypoint for Knight Commander Plaguefist (sniffed) +DELETE FROM `waypoint_data` WHERE `id` IN (12994700); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(12994700, 1, 1369.2288, -5721.9683, 136.41475, NULL, 0, 0, 0, 100, 0), +(12994700, 2, 1361.9355, -5725.302, 136.41475, NULL, 0, 0, 0, 100, 0), +(12994700, 3, 1353.9138, -5723.0273, 136.41475, NULL, 0, 0, 0, 100, 0), +(12994700, 4, 1348.8505, -5717.2407, 136.41475, NULL, 0, 0, 0, 100, 0), +(12994700, 5, 1353.9138, -5723.0273, 136.41475, NULL, 0, 0, 0, 100, 0), +(12994700, 6, 1361.9355, -5725.302, 136.41475, NULL, 0, 0, 0, 100, 0), +(12994700, 7, 1369.2288, -5721.9683, 136.41475, NULL, 0, 0, 0, 100, 0), +(12994700, 8, 1380.4694, -5711.5713, 136.48778, NULL, 0, 0, 0, 100, 0); + +-- Set Spawn Point and path id for Plaguefist +UPDATE `creature` SET `position_x` = 1380.4694, `position_y` = -5711.5713, `position_z` = 136.48778, `MovementType` = 2 WHERE (`id1` IN(29053)) AND (`guid` IN(129947)); +DELETE FROM `creature_addon` WHERE (`guid` IN (129947)); +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(129947, 12994700, 0, 0, 0, 0, 0, NULL); + +-- Set Rooted on triggers (sniffed) +UPDATE `creature_template_movement` SET `Rooted` = 1 WHERE (`CreatureId` = 29038); + +-- Update Triggers' positions (sniffed) +UPDATE `creature` SET `wander_distance` = 0, `MovementType` = 0 WHERE (`id1` = 29038); +UPDATE `creature` SET `position_x` = 1382.6744, `position_y` = -5700.4575, `position_z` = 156.20384, `orientation` = 2.40855, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129906)); +UPDATE `creature` SET `position_x` = 1366.528, `position_y` = -5701.2534, `position_z` = 147.08313, `orientation` = 1.30899, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129907)); +UPDATE `creature` SET `position_x` = 1365.096, `position_y` = -5699.7446, `position_z` = 138.45604, `orientation` = 5.04400, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129908)); +UPDATE `creature` SET `position_x` = 1371.1465, `position_y` = -5705.8774, `position_z` = 136.49808, `orientation` = 5.25344, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129909)); +UPDATE `creature` SET `position_x` = 1384.8456, `position_y` = -5699.0986, `position_z` = 138.05069, `orientation` = 1.78023, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129910)); +UPDATE `creature` SET `position_x` = 1386.3185, `position_y` = -5704.4565, `position_z` = 137.52542, `orientation` = 2.16420, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129911)); +UPDATE `creature` SET `position_x` = 1373.8696, `position_y` = -5698.5435, `position_z` = 162.48119, `orientation` = 2.33874, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129912)); +UPDATE `creature` SET `position_x` = 1380.1602, `position_y` = -5701.692, `position_z` = 164.21506, `orientation` = 5.16617, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129913)); +UPDATE `creature` SET `position_x` = 1375.4838, `position_y` = -5700.0117, `position_z` = 150.63083, `orientation` = 3.82227, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129914)); +UPDATE `creature` SET `position_x` = 1376.7048, `position_y` = -5700.71, `position_z` = 138.45558, `orientation` = 3.49065, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129915)); +UPDATE `creature` SET `position_x` = 1369.781, `position_y` = -5702.2817, `position_z` = 138.52371, `orientation` = 0.94247, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129916)); +UPDATE `creature` SET `position_x` = 1370.8365, `position_y` = -5700.444, `position_z` = 148.90135, `orientation` = 5.68977, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129917)); +UPDATE `creature` SET `position_x` = 1383.7201, `position_y` = -5700.9634, `position_z` = 145.79176, `orientation` = 1.46607, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129918)); +UPDATE `creature` SET `position_x` = 1372.7944, `position_y` = -5705.7993, `position_z` = 147.11938, `orientation` = 2.72271, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129919)); +UPDATE `creature` SET `position_x` = 1363.2407, `position_y` = -5699.7573, `position_z` = 148.0276, `orientation` = 0.82030, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129920)); +UPDATE `creature` SET `position_x` = 1381.6825, `position_y` = -5694.4004, `position_z` = 151.04852, `orientation` = 4.92182, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129921)); +UPDATE `creature` SET `position_x` = 1376.7838, `position_y` = -5694.987, `position_z` = 164.34004, `orientation` = 1.18682, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129922)); +UPDATE `creature` SET `position_x` = 1382.9271, `position_y` = -5696.133, `position_z` = 164.35858, `orientation` = 6.07374, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129923)); +UPDATE `creature` SET `position_x` = 1381.9062, `position_y` = -5699.478, `position_z` = 165.0547, `orientation` = 6.16101, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129924)); +UPDATE `creature` SET `position_x` = 1353.2142, `position_y` = -5691.629, `position_z` = 138.42285, `orientation` = 4.41568, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129925)); +UPDATE `creature` SET `position_x` = 1360.2578, `position_y` = -5696.7036, `position_z` = 138.42085, `orientation` = 0.73303, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129926)); +UPDATE `creature` SET `position_x` = 1361.8759, `position_y` = -5694.812, `position_z` = 148.35965, `orientation` = 1.04719, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129927)); +UPDATE `creature` SET `position_x` = 1378.0033, `position_y` = -5691.8677, `position_z` = 151.09659, `orientation` = 5.89921, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129928)); +UPDATE `creature` SET `position_x` = 1356.3627, `position_y` = -5690.5327, `position_z` = 148.52733, `orientation` = 3.35103, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129929)); +UPDATE `creature` SET `position_x` = 1367.5154, `position_y` = -5683.803, `position_z` = 150.42963, `orientation` = 5.41052, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129930)); +UPDATE `creature` SET `position_x` = 1357.8496, `position_y` = -5694.9785, `position_z` = 147.40619, `orientation` = 3.00196, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129931)); +UPDATE `creature` SET `position_x` = 1365.8773, `position_y` = -5689.083, `position_z` = 151.89368, `orientation` = 0.48869, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129932)); +UPDATE `creature` SET `position_x` = 1352.3483, `position_y` = -5689.826, `position_z` = 147.72693, `orientation` = 4.71238, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129933)); +UPDATE `creature` SET `position_x` = 1384.1615, `position_y` = -5686.4473, `position_z` = 136.17474, `orientation` = 0.59341, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129934)); +UPDATE `creature` SET `position_x` = 1374.2194, `position_y` = -5687.5293, `position_z` = 150.03831, `orientation` = 3.71755, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129935)); +UPDATE `creature` SET `position_x` = 1372.7466, `position_y` = -5693.947, `position_z` = 152.32385, `orientation` = 2.35619, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129936)); +UPDATE `creature` SET `position_x` = 1368.3043, `position_y` = -5694.866, `position_z` = 150.27689, `orientation` = 5.75958, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129937)); +UPDATE `creature` SET `position_x` = 1377.7802, `position_y` = -5682.7607, `position_z` = 138.39493, `orientation` = 1.93731, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129938)); +UPDATE `creature` SET `position_x` = 1383.7242, `position_y` = -5689.474, `position_z` = 148.14038, `orientation` = 1.51843, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129939)); +UPDATE `creature` SET `position_x` = 1355.9176, `position_y` = -5680.996, `position_z` = 138.38802, `orientation` = 4.46804, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129940)); +UPDATE `creature` SET `position_x` = 1351.64, `position_y` = -5685.475, `position_z` = 135.25368, `orientation` = 3.87463, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129941)); +UPDATE `creature` SET `position_x` = 1354.3893, `position_y` = -5686.206, `position_z` = 150.09084, `orientation` = 5.68977, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129942)); +UPDATE `creature` SET `position_x` = 1360.0142, `position_y` = -5679.5996, `position_z` = 151.54948, `orientation` = 4.59021, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129943)); +UPDATE `creature` SET `position_x` = 1369.0516, `position_y` = -5675.592, `position_z` = 135.7965, `orientation` = 0.19198, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129944)); +UPDATE `creature` SET `position_x` = 1367.1002, `position_y` = -5677.607, `position_z` = 148.00508, `orientation` = 3.96189, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129945)); + +-- Edit SmartAI for Triggers +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 29038; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 29038); +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 +(29038, 0, 0, 0, 8, 0, 100, 0, 52953, 0, 12000, 14000, 0, 0, 11, 52955, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, '[Chapter II] Torch Toss Dummy - On Spellhit \'Torch\' - Cast \'Torch\''); + +-- Add condition for spell torch (Its target must be only a trigger) +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` = 52953) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 24) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 10) AND (`ConditionValue2` = 0) AND (`ConditionValue3` = 0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 52953, 0, 0, 24, 0, 10, 0, 0, 0, 0, 0, '', ''); + +-- Add SmartAI on Death Knights near the Chapel +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28030; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 29030); +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 +(29030, 0, 0, 0, 1, 0, 100, 0, 4000, 10000, 8000, 14000, 0, 0, 11, 52953, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - Out of Combat - Cast \'Torch\''), +(29030, 0, 1, 0, 31, 0, 100, 0, 52953, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - On Target Spellhit \'Torch\' - Play Emote 4'), +(29030, 0, 2, 0, 0, 0, 100, 0, 4000, 6000, 8000, 12000, 0, 0, 11, 52372, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Icy Touch\''), +(29030, 0, 3, 0, 0, 0, 100, 0, 3000, 5000, 8000, 12000, 0, 0, 11, 52373, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Plague Strike\''), +(29030, 0, 4, 0, 0, 0, 100, 0, 4000, 8000, 4000, 8000, 0, 0, 11, 52374, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Blood Strike\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 29031; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 29031); +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 +(29031, 0, 0, 0, 1, 0, 100, 0, 4000, 10000, 8000, 14000, 0, 0, 11, 52953, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - Out of Combat - Cast \'Torch\''), +(29031, 0, 1, 0, 31, 0, 100, 0, 52953, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - On Target Spellhit \'Torch\' - Play Emote 4'), +(29031, 0, 2, 0, 0, 0, 100, 0, 4000, 6000, 8000, 12000, 0, 0, 11, 52372, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Icy Touch\''), +(29031, 0, 3, 0, 0, 0, 100, 0, 3000, 5000, 8000, 12000, 0, 0, 11, 52373, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Plague Strike\''), +(29031, 0, 4, 0, 0, 0, 100, 0, 4000, 8000, 4000, 8000, 0, 0, 11, 52374, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Blood Strike\''); + +-- Set SmartAI for Death Knights inside the tavern. +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28934; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28934); +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 +(28934, 0, 0, 0, 0, 0, 100, 0, 4000, 6000, 8000, 12000, 0, 0, 11, 52372, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Icy Touch\''), +(28934, 0, 1, 0, 0, 0, 100, 0, 3000, 5000, 8000, 12000, 0, 0, 11, 52373, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Plague Strike\''), +(28934, 0, 2, 0, 0, 0, 100, 0, 4000, 8000, 4000, 8000, 0, 0, 11, 52374, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Blood Strike\''), +(28934, 0, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52375, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Death Coil\''); diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 3fa396707..e56ea1a03 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4916,6 +4916,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS; }); + // Torch (Death Knights near the Chapel) + ApplySpellFix({ 52953 }, [](SpellInfo* spellInfo) + { + spellInfo->MaxAffectedTargets = 1; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; From d2be4d9b952d64ff55c730409281f9be2d0490fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 29 Apr 2025 13:42:22 +0000 Subject: [PATCH 33/53] chore(DB): import pending files Referenced commit(s): 025b5798223c41064fb44c00e2e32e30b85cfa33 --- .../2025_04_29_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/DK_Phase_4_various_corrections.sql => db_world/2025_04_29_00.sql} (99%) diff --git a/data/sql/updates/pending_db_world/DK_Phase_4_various_corrections.sql b/data/sql/updates/db_world/2025_04_29_00.sql similarity index 99% rename from data/sql/updates/pending_db_world/DK_Phase_4_various_corrections.sql rename to data/sql/updates/db_world/2025_04_29_00.sql index f2a8ba67e..7a0848527 100644 --- a/data/sql/updates/pending_db_world/DK_Phase_4_various_corrections.sql +++ b/data/sql/updates/db_world/2025_04_29_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_26_00 -> 2025_04_29_00 -- Add Waypoint for Knight Commander Plaguefist (sniffed) DELETE FROM `waypoint_data` WHERE `id` IN (12994700); From 983ca0fbd5f25bb91ab6b9ce27b09f1d565ecb74 Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Tue, 29 Apr 2025 17:50:20 +0200 Subject: [PATCH 34/53] fix(DB/Creature) Solve a wrong SmartAI update in my previous PR. (#22020) --- data/sql/updates/pending_db_world/Fix_SmartAI_Update.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/Fix_SmartAI_Update.sql diff --git a/data/sql/updates/pending_db_world/Fix_SmartAI_Update.sql b/data/sql/updates/pending_db_world/Fix_SmartAI_Update.sql new file mode 100644 index 000000000..644cfaced --- /dev/null +++ b/data/sql/updates/pending_db_world/Fix_SmartAI_Update.sql @@ -0,0 +1,3 @@ + +-- Active SmartAI for female DKs. +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 29030; From dcf6d6e83878382b74d4df97f2f39618494149c3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 29 Apr 2025 15:56:41 +0000 Subject: [PATCH 35/53] chore(DB): import pending files Referenced commit(s): 983ca0fbd5f25bb91ab6b9ce27b09f1d565ecb74 --- .../Fix_SmartAI_Update.sql => db_world/2025_04_29_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/Fix_SmartAI_Update.sql => db_world/2025_04_29_01.sql} (71%) diff --git a/data/sql/updates/pending_db_world/Fix_SmartAI_Update.sql b/data/sql/updates/db_world/2025_04_29_01.sql similarity index 71% rename from data/sql/updates/pending_db_world/Fix_SmartAI_Update.sql rename to data/sql/updates/db_world/2025_04_29_01.sql index 644cfaced..078d6cf10 100644 --- a/data/sql/updates/pending_db_world/Fix_SmartAI_Update.sql +++ b/data/sql/updates/db_world/2025_04_29_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_29_00 -> 2025_04_29_01 -- Active SmartAI for female DKs. UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 29030; From 372c159f0081d9036023abf301b80e439770fce2 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Wed, 30 Apr 2025 00:24:02 +0000 Subject: [PATCH 36/53] fix(Scripts/SunwellPlateau): exclude tank from flame sear (#22014) Grand Warlock Alythess (Twin from Sunwell Plateau) will no longer target the tanks when using Flame Sear --- .../rev_1745876726796753902.sql | 3 +++ .../SunwellPlateau/boss_eredar_twins.cpp | 21 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1745876726796753902.sql diff --git a/data/sql/updates/pending_db_world/rev_1745876726796753902.sql b/data/sql/updates/pending_db_world/rev_1745876726796753902.sql new file mode 100644 index 000000000..712e39fab --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1745876726796753902.sql @@ -0,0 +1,3 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 46771 and `ScriptName` = 'spell_eredar_twins_flame_sear'; +INSERT INTO `spell_script_names` VALUES (46771,'spell_eredar_twins_flame_sear'); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 58669b216..642e7d847 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -247,7 +247,7 @@ struct boss_alythess : public BossAI }); ScheduleTimedEvent(8s, 10s, [&] { - me->CastCustomSpell(SPELL_FLAME_SEAR, SPELLVALUE_MAX_TARGETS, urand(4, 5), me, TRIGGERED_NONE); + DoCast(SPELL_FLAME_SEAR); }, 8s, 10s); ScheduleTimedEvent(20s, 26s, [&] { @@ -283,7 +283,7 @@ struct boss_alythess : public BossAI // FLAME_SEAR Phase 1 ScheduleTimedEvent(10s, 15s, [&] { - me->CastCustomSpell(SPELL_FLAME_SEAR, SPELLVALUE_MAX_TARGETS, urand(4, 5), me, TRIGGERED_NONE); + DoCast(SPELL_FLAME_SEAR); }, 10s, 15s); scheduler.Schedule(20s, GROUP_SPECIAL_ABILITY, [this](TaskContext context) { @@ -395,6 +395,22 @@ class spell_eredar_twins_handle_touch : public SpellScript } }; +class spell_eredar_twins_flame_sear : public SpellScript +{ + PrepareSpellScript(spell_eredar_twins_flame_sear); + + void FilterTargets(std::list& targets) + { + Acore::Containers::RandomResize(targets,5); + targets.remove(GetCaster()->GetVictim()); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eredar_twins_flame_sear::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY); + } +}; + class spell_eredar_twins_blaze : public SpellScript { PrepareSpellScript(spell_eredar_twins_blaze); @@ -480,6 +496,7 @@ void AddSC_boss_eredar_twins() RegisterSpellScriptWithArgs(spell_eredar_twins_apply_touch, "spell_eredar_twins_apply_flame_touched", SPELL_FLAME_TOUCHED); RegisterSpellScript(spell_eredar_twins_handle_touch); RegisterSpellScript(spell_eredar_twins_blaze); + RegisterSpellScript(spell_eredar_twins_flame_sear); RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_dark_touched_periodic", SPELL_DARK_TOUCHED, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE); RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_flame_touched_periodic", SPELL_FLAME_TOUCHED, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL); RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_flame_touched_flame_sear", SPELL_FLAME_TOUCHED, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE); From 1f632c868dfaee07eb5e69454358bb57b1e811c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Apr 2025 00:25:03 +0000 Subject: [PATCH 37/53] chore(DB): import pending files Referenced commit(s): 372c159f0081d9036023abf301b80e439770fce2 --- .../rev_1745876726796753902.sql => db_world/2025_04_30_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1745876726796753902.sql => db_world/2025_04_30_00.sql} (81%) diff --git a/data/sql/updates/pending_db_world/rev_1745876726796753902.sql b/data/sql/updates/db_world/2025_04_30_00.sql similarity index 81% rename from data/sql/updates/pending_db_world/rev_1745876726796753902.sql rename to data/sql/updates/db_world/2025_04_30_00.sql index 712e39fab..4287b47a5 100644 --- a/data/sql/updates/pending_db_world/rev_1745876726796753902.sql +++ b/data/sql/updates/db_world/2025_04_30_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_29_01 -> 2025_04_30_00 -- DELETE FROM `spell_script_names` WHERE `spell_id` = 46771 and `ScriptName` = 'spell_eredar_twins_flame_sear'; INSERT INTO `spell_script_names` VALUES (46771,'spell_eredar_twins_flame_sear'); From e44b8ed939dfbbd6857fd6a0cc19662fdebab6c3 Mon Sep 17 00:00:00 2001 From: chaosua <544218+chaosua@users.noreply.github.com> Date: Wed, 30 Apr 2025 03:43:31 +0300 Subject: [PATCH 38/53] fix(db/locale): Added missing Russian translation for the (Shaman) Totems (#22012) --- .../shaman-totem-ruru-fix.sql | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 data/sql/updates/pending_db_world/shaman-totem-ruru-fix.sql diff --git a/data/sql/updates/pending_db_world/shaman-totem-ruru-fix.sql b/data/sql/updates/pending_db_world/shaman-totem-ruru-fix.sql new file mode 100644 index 000000000..363b5aff6 --- /dev/null +++ b/data/sql/updates/pending_db_world/shaman-totem-ruru-fix.sql @@ -0,0 +1,95 @@ +DELETE FROM `creature_template_locale` WHERE `locale`='ruRU' AND `entry` IN (5927, 7424, 7425, 15487, 31169, 31170, 6012, 7423, 10557, 15485, 31132, 31158, 31133, 7412, 7413, 15486, 31171, 31172, 3906, 3907, 3908, 3909, 15488, 31181, 31182, 31185, 7464, 7465, 7466, 15484, 31166, 31167, 7414, 7415, 7416, 15489, 31186, 31189, 31190, 7468, 7469, 15490, 31173, 31174, 3902, 3903, 3904, 7400, 7402, 15480, 31162, 31164, 31165, 3911, 3912, 3913, 7398, 7399, 15478, 31120, 31121, 31122, 5919, 5920, 7366, 7367, 7368, 15470, 15474, 31175, 31176, 5921, 5922, 7403, 15464, 15479, 30647, 31129, 7483, 7484, 15496, 15497, 11100, 11101, 17061, 7486, 7487, 15463, 30654, 9687, 9688, 9689, 15492); +INSERT INTO `creature_template_locale` (`entry`, `locale`, `Name`, `Title`, `VerifiedBuild`) VALUES +(5927, 'ruRU', 'Тотем сопротивления огню', '', 0), +(7424, 'ruRU', 'Тотем сопротивления огню II', '', 0), +(7425, 'ruRU', 'Тотем сопротивления огню III', '', 0), +(15487, 'ruRU', 'Тотем сопротивления огню IV', '', 0), +(31169, 'ruRU', 'Тотем сопротивления огню V', '', 0), +(31170, 'ruRU', 'Тотем сопротивления огню VI', '', 0), +(6012, 'ruRU', 'Тотем языка пламени II', '', 0), +(7423, 'ruRU', 'Тотем языка пламени III', '', 0), +(10557, 'ruRU', 'Тотем языка пламени IV', '', 0), +(15485, 'ruRU', 'Тотем языка пламени V', '', 0), +(31132, 'ruRU', 'Тотем языка пламени VI', '', 0), +(31158, 'ruRU', 'Тотем языка пламени VII', '', 0), +(31133, 'ruRU', 'Тотем языка пламени VIII', '', 0), +(7412, 'ruRU', 'Тотем сопротивления льду II', '', 0), +(7413, 'ruRU', 'Тотем сопротивления льду III', '', 0), +(15486, 'ruRU', 'Тотем сопротивления льду IV', '', 0), +(31171, 'ruRU', 'Тотем сопротивления льду V', '', 0), +(31172, 'ruRU', 'Тотем сопротивления льду VI', '', 0), +(3906, 'ruRU', 'Тотем исцеляющего потока II', '', 0), +(3907, 'ruRU', 'Тотем исцеляющего потока III', '', 0), +(3908, 'ruRU', 'Тотем исцеляющего потока IV', '', 0), +(3909, 'ruRU', 'Тотем исцеляющего потока V', '', 0), +(15488, 'ruRU', 'Тотем исцеляющего потока VI', '', 0), +(31181, 'ruRU', 'Тотем исцеляющего потока VII', '', 0), +(31182, 'ruRU', 'Тотем исцеляющего потока VIII', '', 0), +(31185, 'ruRU', 'Тотем исцеляющего потока IX', '', 0), +(7464, 'ruRU', 'Тотем магмы II', '', 0), +(7465, 'ruRU', 'Тотем магмы III', '', 0), +(7466, 'ruRU', 'Тотем магмы IV', '', 0), +(15484, 'ruRU', 'Тотем магмы V', '', 0), +(31166, 'ruRU', 'Тотем магмы VI', '', 0), +(31167, 'ruRU', 'Тотем магмы VII', '', 0), +(7414, 'ruRU', 'Тотем источника маны II', '', 0), +(7415, 'ruRU', 'Тотем источника маны III', '', 0), +(7416, 'ruRU', 'Тотем источника маны IV', '', 0), +(15489, 'ruRU', 'Тотем источника маны V', '', 0), +(31186, 'ruRU', 'Тотем источника маны VI', '', 0), +(31189, 'ruRU', 'Тотем источника маны VII', '', 0), +(31190, 'ruRU', 'Тотем источника маны VIII', '', 0), +(7468, 'ruRU', 'Тотем сопротивления силам природы II', '', 0), +(7469, 'ruRU', 'Тотем сопротивления силам природы III', '', 0), +(15490, 'ruRU', 'Тотем сопротивления силам природы IV', '', 0), +(31173, 'ruRU', 'Тотем сопротивления силам природы V', '', 0), +(31174, 'ruRU', 'Тотем сопротивления силам природы VI', '', 0), +(3902, 'ruRU', 'Опаляющий тотем II', '', 0), +(3903, 'ruRU', 'Опаляющий тотем III', '', 0), +(3904, 'ruRU', 'Опаляющий тотем IV', '', 0), +(7400, 'ruRU', 'Опаляющий тотем V', '', 0), +(7402, 'ruRU', 'Опаляющий тотем VI', '', 0), +(15480, 'ruRU', 'Опаляющий тотем VII', '', 0), +(31162, 'ruRU', 'Опаляющий тотем VIII', '', 0), +(31164, 'ruRU', 'Опаляющий тотем IX', '', 0), +(31165, 'ruRU', 'Опаляющий тотем X', '', 0), +(3911, 'ruRU', 'Тотем каменного когтя II', '', 0), +(3912, 'ruRU', 'Тотем каменного когтя III', '', 0), +(3913, 'ruRU', 'Тотем каменного когтя IV', '', 0), +(7398, 'ruRU', 'Тотем каменного когтя V', '', 0), +(7399, 'ruRU', 'Тотем каменного когтя VI', '', 0), +(15478, 'ruRU', 'Тотем каменного когтя VII', '', 0), +(31120, 'ruRU', 'Тотем каменного когтя VIII', '', 0), +(31121, 'ruRU', 'Тотем каменного когтя IX', '', 0), +(31122, 'ruRU', 'Тотем каменного когтя X', '', 0), +(5919, 'ruRU', 'Тотем каменной кожи II', '', 0), +(5920, 'ruRU', 'Тотем каменной кожи III', '', 0), +(7366, 'ruRU', 'Тотем каменной кожи IV', '', 0), +(7367, 'ruRU', 'Тотем каменной кожи V', '', 0), +(7368, 'ruRU', 'Тотем каменной кожи VI', '', 0), +(15470, 'ruRU', 'Тотем каменной кожи VII', '', 0), +(15474, 'ruRU', 'Тотем каменной кожи VIII', '', 0), +(31175, 'ruRU', 'Тотем каменной кожи IX', '', 0), +(31176, 'ruRU', 'Тотем каменной кожи X', '', 0), +(5921, 'ruRU', 'Тотем силы земли II', '', 0), +(5922, 'ruRU', 'Тотем силы земли III', '', 0), +(7403, 'ruRU', 'Тотем силы земли IV', '', 0), +(15464, 'ruRU', 'Тотем силы земли V', '', 0), +(15479, 'ruRU', 'Тотем силы земли VI', '', 0), +(30647, 'ruRU', 'Тотем силы земли VII', '', 0), +(31129, 'ruRU', 'Тотем силы земли VIII', '', 0), +(7483, 'ruRU', 'Тотем неистовства ветра II', '', 0), +(7484, 'ruRU', 'Тотем неистовства ветра III', '', 0), +(15496, 'ruRU', 'Тотем неистовства ветра IV', '', 0), +(15497, 'ruRU', 'Тотем неистовства ветра V', '', 0), +(11100, 'ruRU', 'Тотем прилива маны II', '', 0), +(11101, 'ruRU', 'Тотем прилива маны III', '', 0), +(17061, 'ruRU', 'Тотем прилива маны IV', '', 0), +(7486, 'ruRU', 'Тотем легкости воздуха', '', 0), +(7487, 'ruRU', 'Тотем легкости воздуха II', '', 0), +(15463, 'ruRU', 'Тотем легкости воздуха III', '', 0), +(30654, 'ruRU', 'Тотем гнева IV', '', 0), +(9687, 'ruRU', 'Тотем стены ветра', '', 0), +(9688, 'ruRU', 'Тотем стены ветра II', '', 0), +(9689, 'ruRU', 'Тотем стены ветра III', '', 0), +(15492, 'ruRU', 'Тотем стены ветра IV', '', 0); From b7f75c46737f16db5224fd6c38bdd4bf88cd4ea6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Apr 2025 00:44:38 +0000 Subject: [PATCH 39/53] chore(DB): import pending files Referenced commit(s): e44b8ed939dfbbd6857fd6a0cc19662fdebab6c3 --- .../shaman-totem-ruru-fix.sql => db_world/2025_04_30_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/shaman-totem-ruru-fix.sql => db_world/2025_04_30_01.sql} (99%) diff --git a/data/sql/updates/pending_db_world/shaman-totem-ruru-fix.sql b/data/sql/updates/db_world/2025_04_30_01.sql similarity index 99% rename from data/sql/updates/pending_db_world/shaman-totem-ruru-fix.sql rename to data/sql/updates/db_world/2025_04_30_01.sql index 363b5aff6..952c69dee 100644 --- a/data/sql/updates/pending_db_world/shaman-totem-ruru-fix.sql +++ b/data/sql/updates/db_world/2025_04_30_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_30_00 -> 2025_04_30_01 DELETE FROM `creature_template_locale` WHERE `locale`='ruRU' AND `entry` IN (5927, 7424, 7425, 15487, 31169, 31170, 6012, 7423, 10557, 15485, 31132, 31158, 31133, 7412, 7413, 15486, 31171, 31172, 3906, 3907, 3908, 3909, 15488, 31181, 31182, 31185, 7464, 7465, 7466, 15484, 31166, 31167, 7414, 7415, 7416, 15489, 31186, 31189, 31190, 7468, 7469, 15490, 31173, 31174, 3902, 3903, 3904, 7400, 7402, 15480, 31162, 31164, 31165, 3911, 3912, 3913, 7398, 7399, 15478, 31120, 31121, 31122, 5919, 5920, 7366, 7367, 7368, 15470, 15474, 31175, 31176, 5921, 5922, 7403, 15464, 15479, 30647, 31129, 7483, 7484, 15496, 15497, 11100, 11101, 17061, 7486, 7487, 15463, 30654, 9687, 9688, 9689, 15492); INSERT INTO `creature_template_locale` (`entry`, `locale`, `Name`, `Title`, `VerifiedBuild`) VALUES (5927, 'ruRU', 'Тотем сопротивления огню', '', 0), From d86caa05dbdd5cc2401b0998d330d3ba0366f2a2 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Wed, 30 Apr 2025 00:44:49 +0000 Subject: [PATCH 40/53] fix(DB/Spells) add Battle Squawk to Melee Haste aura stack group (#22021) Battle Squawk no longer stacks melee haste buff(s) --- data/sql/updates/pending_db_world/rev_1745940911894528370.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1745940911894528370.sql diff --git a/data/sql/updates/pending_db_world/rev_1745940911894528370.sql b/data/sql/updates/pending_db_world/rev_1745940911894528370.sql new file mode 100644 index 000000000..5fd22f369 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1745940911894528370.sql @@ -0,0 +1,3 @@ +-- +DELETE FROM `spell_group` WHERE `id` = 1005 AND `spell_id` = 23060; +INSERT INTO `spell_group` VALUES (1005, 23060, 0); From 23dd832b477300f6420b6e49defaa1e3aed08240 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Apr 2025 00:45:42 +0000 Subject: [PATCH 41/53] chore(DB): import pending files Referenced commit(s): b7f75c46737f16db5224fd6c38bdd4bf88cd4ea6 --- .../rev_1745940911894528370.sql => db_world/2025_04_30_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1745940911894528370.sql => db_world/2025_04_30_02.sql} (73%) diff --git a/data/sql/updates/pending_db_world/rev_1745940911894528370.sql b/data/sql/updates/db_world/2025_04_30_02.sql similarity index 73% rename from data/sql/updates/pending_db_world/rev_1745940911894528370.sql rename to data/sql/updates/db_world/2025_04_30_02.sql index 5fd22f369..f3fd98e9d 100644 --- a/data/sql/updates/pending_db_world/rev_1745940911894528370.sql +++ b/data/sql/updates/db_world/2025_04_30_02.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_30_01 -> 2025_04_30_02 -- DELETE FROM `spell_group` WHERE `id` = 1005 AND `spell_id` = 23060; INSERT INTO `spell_group` VALUES (1005, 23060, 0); From 1144c05c2107bbb8f6124ab65494e1e5325f0672 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Wed, 30 Apr 2025 00:46:23 +0000 Subject: [PATCH 42/53] fix(DB/Spells) add K'iru's Song of Victory to Intellect and Stamina aura stack groups (#22022) K'iru's Song of Victory no longer stacks with Intellect and Stamina buff(s) --- .../pending_db_world/rev_1745941039161439470.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1745941039161439470.sql diff --git a/data/sql/updates/pending_db_world/rev_1745941039161439470.sql b/data/sql/updates/pending_db_world/rev_1745941039161439470.sql new file mode 100644 index 000000000..2e4fbb805 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1745941039161439470.sql @@ -0,0 +1,11 @@ +-- +DELETE FROM `spell_group` WHERE `id` = 1024; +DELETE FROM `spell_group_stack_rules` WHERE `group_id` = 1024; +DELETE FROM `spell_group` WHERE `id` = 1019 AND `spell_id` IN (1243,8099,21562,23947,23948,46302,72590); +INSERT INTO `spell_group` VALUES (1019, 1243, 0), +(1019, 8099, 0), +(1019, 21562, 0), +(1019, 23947, 0), +(1019, 23948, 0), +(1019, 46302, 0), +(1019, 72590, 0); From e45b04daecf39cfbcc64134aa126dcf013a77543 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Apr 2025 00:46:47 +0000 Subject: [PATCH 43/53] chore(DB): import pending files Referenced commit(s): 23dd832b477300f6420b6e49defaa1e3aed08240 --- .../rev_1745941039161439470.sql => db_world/2025_04_30_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1745941039161439470.sql => db_world/2025_04_30_03.sql} (89%) diff --git a/data/sql/updates/pending_db_world/rev_1745941039161439470.sql b/data/sql/updates/db_world/2025_04_30_03.sql similarity index 89% rename from data/sql/updates/pending_db_world/rev_1745941039161439470.sql rename to data/sql/updates/db_world/2025_04_30_03.sql index 2e4fbb805..64d74b4c5 100644 --- a/data/sql/updates/pending_db_world/rev_1745941039161439470.sql +++ b/data/sql/updates/db_world/2025_04_30_03.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_30_02 -> 2025_04_30_03 -- DELETE FROM `spell_group` WHERE `id` = 1024; DELETE FROM `spell_group_stack_rules` WHERE `group_id` = 1024; From 775b9ff29a2c7474865a7fcfed6c8d6f2551ce5c Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Wed, 30 Apr 2025 03:09:20 +0200 Subject: [PATCH 44/53] fix(Core/Player): correct SpellPriority logic (#21052) Co-authored-by: killerwife Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --- src/server/game/Entities/Player/Player.cpp | 84 +++---------------- src/server/game/Entities/Player/Player.h | 1 + .../game/Spells/Auras/SpellAuraEffects.cpp | 1 + src/server/game/Spells/Auras/SpellAuras.cpp | 2 +- .../game/Spells/SpellInfoCorrections.cpp | 18 ++-- 5 files changed, 22 insertions(+), 84 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4d9e9655a..64594ebfd 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9791,9 +9791,7 @@ void Player::ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* s { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) - { return; - } float totalmul = 1.0f; int32 totalflat = 0; @@ -9802,25 +9800,24 @@ void Player::ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* s { // xinef: temporary pets cannot use charged mods of owner, needed for mirror image QQ they should use their own auras if (temporaryPet && mod->charges != 0) - { return; - } + + // skip if already instant or cost is free + if (mod->op == SPELLMOD_CASTING_TIME || mod->op == SPELLMOD_COST) + if (((float)basevalue + (float)basevalue * (totalmul - 1.0f) + (float)totalflat) <= 0) + return; if (mod->type == SPELLMOD_FLAT) { // xinef: do not allow to consume more than one 100% crit increasing spell if (mod->op == SPELLMOD_CRITICAL_CHANCE && totalflat >= 100) - { return; - } int32 flatValue = mod->value; // SPELL_MOD_THREAT - divide by 100 (in packets we send threat * 100) if (mod->op == SPELLMOD_THREAT) - { flatValue /= 100; - } totalflat += flatValue; } @@ -9828,35 +9825,23 @@ void Player::ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* s { // skip percent mods for null basevalue (most important for spell mods with charges) if (basevalue == T(0) || totalmul == 0.0f) - { return; - } // special case (skip > 10sec spell casts for instant cast setting) if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100) - { return; - } // xinef: special exception for surge of light, dont affect crit chance if previous mods were not applied else if (mod->op == SPELLMOD_CRITICAL_CHANCE && spell && !HasSpellMod(mod, spell)) - { return; - } // xinef: special case for backdraft gcd reduce with backlast time reduction, dont affect gcd if cast time was not applied else if (mod->op == SPELLMOD_GLOBAL_COOLDOWN && spell && !HasSpellMod(mod, spell)) - { return; - } // xinef: those two mods should be multiplicative (Glyph of Renew) if (mod->op == SPELLMOD_DAMAGE || mod->op == SPELLMOD_DOT) - { totalmul *= CalculatePct(1.0f, 100.0f + mod->value); - } else - { totalmul += CalculatePct(1.0f, mod->value); - } } DropModCharge(mod, spell); @@ -9864,53 +9849,24 @@ void Player::ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* s // Drop charges for triggering spells instead of triggered ones if (m_spellModTakingSpell) - { spell = m_spellModTakingSpell; - } - SpellModifier* chargedMod = nullptr; for (auto mod : m_spellMods[op]) { // Charges can be set only for mods with auras if (!mod->ownerAura) - { ASSERT(!mod->charges); - } if (!IsAffectedBySpellmod(spellInfo, mod, spell)) - { continue; - } - - if (mod->ownerAura->IsUsingCharges()) - { - if (!chargedMod || (chargedMod->ownerAura->GetSpellInfo()->SpellPriority < mod->ownerAura->GetSpellInfo()->SpellPriority)) - { - chargedMod = mod; - } - - continue; - } calculateSpellMod(mod); } - if (chargedMod) - { - calculateSpellMod(chargedMod); - } - - float diff = 0.0f; if (op == SPELLMOD_CASTING_TIME || op == SPELLMOD_DURATION) - { - diff = ((float)basevalue + totalflat) * (totalmul - 1.0f) + (float)totalflat; - } + basevalue = (basevalue + totalflat) > 0 ? (basevalue + totalflat) * totalmul : 0; else - { - diff = (float)basevalue * (totalmul - 1.0f) + (float)totalflat; - } - - basevalue = T((float)basevalue + diff); + basevalue = (basevalue * totalmul) + totalflat; } template AC_GAME_API void Player::ApplySpellMod(uint32 spellId, SpellModOp op, int32& basevalue, Spell* spell, bool temporaryPet); @@ -9918,30 +9874,13 @@ template AC_GAME_API void Player::ApplySpellMod(uint32 spellId, SpellModOp op, u template AC_GAME_API void Player::ApplySpellMod(uint32 spellId, SpellModOp op, float& basevalue, Spell* spell, bool temporaryPet); // Binary predicate for sorting SpellModifiers -class SpellModPred +struct SpellModPredicate { -public: - SpellModPred() {} bool operator() (SpellModifier const* a, SpellModifier const* b) const { if (a->type != b->type) return a->type == SPELLMOD_FLAT; - return a->value < b->value; - } -}; -class MageSpellModPred -{ -public: - MageSpellModPred() {} - bool operator() (SpellModifier const* a, SpellModifier const* b) const - { - if (a->type != b->type) - return a->type == SPELLMOD_FLAT; - if (a->spellId == 44401) - return true; - if (b->spellId == 44401) - return false; - return a->value < b->value; + return a->priority > b->priority; } }; @@ -9978,10 +9917,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) if (apply) { m_spellMods[mod->op].push_back(mod); - if (IsClass(CLASS_MAGE, CLASS_CONTEXT_ABILITY)) - m_spellMods[mod->op].sort(MageSpellModPred()); - else - m_spellMods[mod->op].sort(SpellModPred()); + m_spellMods[mod->op].sort(SpellModPredicate()); } else { diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 844d5f9db..0110fbfe8 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -187,6 +187,7 @@ struct SpellModifier flag96 mask; uint32 spellId{0}; Aura* const ownerAura; + uint32 priority{0}; }; typedef std::unordered_map PlayerTalentMap; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 050647311..50f65fff5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -701,6 +701,7 @@ void AuraEffect::CalculateSpellMod() m_spellmod->spellId = GetId(); m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask; m_spellmod->charges = GetBase()->GetCharges(); + m_spellmod->priority = GetSpellInfo()->SpellPriority; } m_spellmod->value = GetAmount(); break; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 40f087f45..8ffbfde8a 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1659,7 +1659,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (removeMode != AURA_REMOVE_BY_EXPIRE || aurApp->GetBase()->IsExpired()) break; if (target->HasAura(70752)) // Item - Mage T10 2P Bonus - target->CastSpell(target, 70753, true); + target->CastSpell(target, 70753, true); // Pushing the Limit break; default: break; diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index e56ea1a03..4e0b1f0e3 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -272,20 +272,13 @@ void SpellMgr::LoadSpellInfoCorrections() 54741, // Firestarter 64823, // Item - Druid T8 Balance 4P Bonus 34477, // Misdirection - 44401, // Missile Barrage - 18820 // Insight + 18820, // Insight + 57761 // Fireball! }, [](SpellInfo* spellInfo) { spellInfo->ProcCharges = 1; }); - // Fireball - ApplySpellFix({ 57761 }, [](SpellInfo* spellInfo) - { - spellInfo->ProcCharges = 1; - spellInfo->SpellPriority = 50; - }); - // Tidal Wave ApplySpellFix({ 53390 }, [](SpellInfo* spellInfo) { @@ -4922,6 +4915,13 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->MaxAffectedTargets = 1; }); + // Missile Barrage + ApplySpellFix({ 44401 }, [](SpellInfo* spellInfo) + { + spellInfo->ProcCharges = 1; + spellInfo->SpellPriority = 100; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; From d8bc1d179716a4f8c9dcccd3edb271fa0eb332bf Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Wed, 30 Apr 2025 01:17:45 +0000 Subject: [PATCH 45/53] fix(Script/Spell) exclude original target from glyph of holy light (#22002) Glyph of Holy Light no longer applies (10%) to the target --- src/server/scripts/Spells/spell_paladin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 04a596c61..e2350a2c8 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -679,8 +679,9 @@ class spell_pal_glyph_of_holy_light : public SpellScript void FilterTargets(std::list& targets) { - uint32 const maxTargets = GetSpellInfo()->MaxAffectedTargets; + targets.remove(GetExplTargetUnit()); + uint32 const maxTargets = GetSpellInfo()->MaxAffectedTargets; if (targets.size() > maxTargets) { targets.sort(Acore::HealthPctOrderPred()); From 5686f1e87a0079edfed8c5d493d5bcdab9bad3a7 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Tue, 29 Apr 2025 21:19:58 -0400 Subject: [PATCH 46/53] fix(Core/Creature): Implement respond to call for help faction flag. (#21959) --- .../game/Entities/Creature/Creature.cpp | 19 ++++++++----------- src/server/game/Entities/Unit/Unit.h | 7 +++++++ src/server/shared/DataStores/DBCStructure.h | 1 + 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 9d62cfd23..4398579f9 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1937,17 +1937,8 @@ bool Creature::CanStartAttack(Unit const* who) const if (!_IsTargetAcceptable(who)) return false; - // pussywizard: at this point we are either hostile to who or friendly to who->getAttackerForHelper() - // pussywizard: if who is in combat and has an attacker, help him if the distance is right (help because who is hostile or help because attacker is friendly) - bool assist = false; - if (who->IsEngaged() && IsWithinDist(who, ATTACK_DISTANCE)) - if (Unit* victim = who->getAttackerForHelper()) - if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))) - assist = true; - - if (!assist) - if (IsNeutralToAll() || !IsWithinDistInMap(who, GetAggroRange(who) + m_CombatDistance, true, false)) // pussywizard: +m_combatDistance for turrets and similar - return false; + if (IsNeutralToAll() || !IsWithinDistInMap(who, GetAggroRange(who) + m_CombatDistance, true, false)) // pussywizard: +m_combatDistance for turrets and similar + return false; if (!CanCreatureAttack(who)) return false; @@ -1955,6 +1946,9 @@ bool Creature::CanStartAttack(Unit const* who) const if (HasUnitState(UNIT_STATE_STUNNED)) return false; + if (!IsHostileTo(who)) + return false; + return IsWithinLOSInMap(who); } @@ -2537,6 +2531,9 @@ bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction / { if (GetFaction() != u->GetFaction()) return false; + + if (!RespondsToCallForHelp()) + return false; } else { diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5c6330efc..eedca78a0 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -986,6 +986,13 @@ public: return false; } + [[nodiscard]] bool RespondsToCallForHelp() const + { + if (FactionTemplateEntry const* entry = GetFactionTemplateEntry()) + return entry->FactionRespondsToCallForHelp(); + + return false; + } [[nodiscard]] bool IsInSanctuary() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); } [[nodiscard]] bool IsPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); } [[nodiscard]] bool IsFFAPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); } diff --git a/src/server/shared/DataStores/DBCStructure.h b/src/server/shared/DataStores/DBCStructure.h index 027135276..e62cbd68d 100644 --- a/src/server/shared/DataStores/DBCStructure.h +++ b/src/server/shared/DataStores/DBCStructure.h @@ -986,6 +986,7 @@ struct FactionTemplateEntry return hostileMask == 0 && friendlyMask == 0; } [[nodiscard]] bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS) != 0; } + [[nodiscard]] bool FactionRespondsToCallForHelp() const { return (factionFlags & FACTION_TEMPLATE_FLAG_RESPOND_TO_CALL_FOR_HELP) != 0; } }; struct GameObjectArtKitEntry From 0bb8e3cd0c88514497fa3ec23cd702e23a2a2752 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Tue, 29 Apr 2025 20:27:19 -0500 Subject: [PATCH 47/53] fix(Scripts/SunwellPlateau): Dark Fiends should use threat table and not deal melee damage (#21991) --- .../SunwellPlateau/boss_muru.cpp | 51 +++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 63f284452..748303e1e 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -209,7 +209,54 @@ struct npc_dark_fiend : public ScriptedAI me->m_Events.AddEventAtOffset([this]() { me->SetReactState(REACT_AGGRESSIVE); - if (Unit* target = SelectTargetFromPlayerList(200.0f, 0, true)) + Unit* target = nullptr; + if (InstanceScript* instance = me->GetInstanceScript()) + { + if (Creature* muru = instance->GetCreature(DATA_MURU)) + { + if (muru->IsAlive() && !muru->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)) + { + std::list const& threatList = muru->GetThreatMgr().GetThreatList(); + std::vector validTargets; + + for (HostileReference* ref : threatList) + { + if (Unit* unit = ObjectAccessor::GetUnit(*muru, ref->getUnitGuid())) + { + if (unit->IsPlayer() && unit->IsAlive() && unit->IsWithinDist(me, 50.0f)) + validTargets.push_back(unit); + } + } + + if (!validTargets.empty()) + target = validTargets[urand(0, validTargets.size() - 1)]; + } + else + { + if (Creature* entropius = me->FindNearestCreature(NPC_ENTROPIUS, 100.0f)) + { + std::list const& threatList = entropius->GetThreatMgr().GetThreatList(); + std::vector validTargets; + + for (HostileReference* ref : threatList) + { + if (Unit* unit = ObjectAccessor::GetUnit(*entropius, ref->getUnitGuid())) + { + if (unit->IsPlayer() && unit->IsAlive() && unit->IsWithinDist(me, 50.0f)) + { + validTargets.push_back(unit); + } + } + } + + if (!validTargets.empty()) + target = validTargets[urand(0, validTargets.size() - 1)]; + } + } + } + } + + if (target) { AttackStart(target); me->AddThreat(target, 100000.0f); @@ -255,8 +302,6 @@ struct npc_dark_fiend : public ScriptedAI me->DespawnOrUnsummon(); }, 1s); } - - DoMeleeAttackIfReady(); } private: From f1751c0c188e8d016af1d8dca2555aa91239b752 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Tue, 29 Apr 2025 21:47:19 -0500 Subject: [PATCH 48/53] fix(Scripts/SunwellPlateau): Ensure proper reset for Kil'jaeden encounter (#22024) Kil'jaeden will now properly reset --- .../scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 69660f575..517e6bdba 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -525,6 +525,7 @@ struct boss_kiljaeden : public BossAI void JustSummoned(Creature* summon) override { + BossAI::JustSummoned(summon); if (summon->GetEntry() == NPC_ARMAGEDDON_TARGET) { summon->SetCanFly(true); From b2a810f96cf60b345a49b42218741a182e320725 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Wed, 30 Apr 2025 15:46:36 +0200 Subject: [PATCH 49/53] =?UTF-8?q?chore(Core/Spells):=20move=20db=20`spell?= =?UTF-8?q?=5Fdbc`=20corrections=20to=20SpellInfoCorre=E2=80=A6=20(#21819)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rev_1743358272289715719.sql | 2 + .../rev_1743363476685228915.sql | 28 +++ src/server/game/Spells/SpellDefines.h | 2 +- .../game/Spells/SpellInfoCorrections.cpp | 176 ++++++++++++++++++ 4 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/rev_1743358272289715719.sql create mode 100644 data/sql/updates/pending_db_world/rev_1743363476685228915.sql diff --git a/data/sql/updates/pending_db_world/rev_1743358272289715719.sql b/data/sql/updates/pending_db_world/rev_1743358272289715719.sql new file mode 100644 index 000000000..f896967a5 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1743358272289715719.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `spell_dbc` WHERE `ID` IN (75, 1454, 1455, 1456, 11687, 11688, 11689, 27222, 57946, 4074, 4511, 7922, 9457, 10732, 20252, 20253, 20335, 20336, 20337, 22736, 23272, 30298, 33271, 36500, 39183, 47747, 49214, 54469, 58620, 58621, 60474, 64382); diff --git a/data/sql/updates/pending_db_world/rev_1743363476685228915.sql b/data/sql/updates/pending_db_world/rev_1743363476685228915.sql new file mode 100644 index 000000000..5d5040d06 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1743363476685228915.sql @@ -0,0 +1,28 @@ +-- +SET @SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS := 268435456; +SET @SPELL_ATTR5_ALLOW_WHILE_STUNNED := 8; +SET @SPELL_ATTR2_IGNORE_LINE_OF_SIGHT := 4; +-- Update server-side spell 43360 - model after 41295 Fixate +UPDATE `spell_dbc` SET +`AttributesEx2`= `AttributesEx2` & ~(@SPELL_ATTR2_IGNORE_LINE_OF_SIGHT), +`AttributesEx3`= `AttributesEx3` | @SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS, +`AttributesEx5`= `AttributesEx5` | @SPELL_ATTR5_ALLOW_WHILE_STUNNED, +`RangeIndex` = 36, +`Effect_1` = 6, +`EffectRadiusIndex_1` = 27, +`EffectAura_1` = 11, +`SpellIconID` = 1, +`ImplicitTargetA_1` = 7, +`Description_Lang_enUS` = 'The target is fixated upon the caster.', +`Name_Lang_enUS`='Fixate' +WHERE `ID` = 43360; + +DELETE FROM `spell_script_names` WHERE `spell_id` = 43359 AND `ScriptName` = 'spell_call_of_the_beast'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES(43359, 'spell_call_of_the_beast'); + +-- Amani'shi Beast Tamer +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24059; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24059); +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 +(24059, 0, 0, 0, 0, 0, 100, 0, 8000, 12000, 10000, 15000, 0, 0, 11, 43359, 0, 0, 0, 0, 0, 5, 100, 1, 0, 43359, 0, 0, 0, 0, 'Amani\'shi Beast Tamer - In Combat - Cast \'Call of the Beast\''), +(24059, 0, 1, 0, 0, 0, 100, 0, 6000, 12000, 9000, 18000, 0, 0, 11, 43361, 0, 0, 0, 0, 0, 5, 100, 1, 0, 0, 0, 0, 0, 0, 'Amani\'shi Beast Tamer - In Combat - Cast \'Domesticate\''); diff --git a/src/server/game/Spells/SpellDefines.h b/src/server/game/Spells/SpellDefines.h index 22caee957..89dda8dfe 100644 --- a/src/server/game/Spells/SpellDefines.h +++ b/src/server/game/Spells/SpellDefines.h @@ -28,7 +28,7 @@ enum SpellInterruptFlags SPELL_INTERRUPT_FLAG_UNK3 = 0x04, // any info? SPELL_INTERRUPT_FLAG_INTERRUPT = 0x08, // interrupt SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10, // _complete_ interrupt on direct damage - //SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph" + SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph" }; // See SpellAuraInterruptFlags for other values definitions diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 4e0b1f0e3..7f219af1e 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4922,6 +4922,182 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->SpellPriority = 100; }); + // Auto Shot + ApplySpellFix({ 75 }, [](SpellInfo* spellInfo) + { + spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); // 0s + spellInfo->InterruptFlags &= ~SPELL_INTERRUPT_UNK; + }); + + // Life Tap + ApplySpellFix({ 1454 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0.0f; + }); + + // Life Tap + ApplySpellFix({ 1455, 1456, 11687, 11688, 11689, 27222, 57946 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0.0f; + spellInfo->MaxLevel = 16; + spellInfo->BaseLevel = 6; + spellInfo->SpellLevel = 6; + }); + + // Explosive Sheep + ApplySpellFix({ 4074 }, [](SpellInfo* spellInfo) + { + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(25); + }); + + // Phase Shift + ApplySpellFix({ 4511 }, [](SpellInfo* spellInfo) + { + spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_MELEE_ATTACK; + spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST; + }); + + // Charge Stun + ApplySpellFix({ 7922 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes |= SPELL_ATTR0_NO_ACTIVE_DEFENSE; + }); + + // Tharnariun's Heal + ApplySpellFix({ 9457 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx2 &= ~SPELL_ATTR2_IGNORE_LINE_OF_SIGHT; + spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS; + spellInfo->Effects[EFFECT_0].DieSides = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY); + }); + + // Supercharge + ApplySpellFix({ 10732 }, [](SpellInfo* spellInfo) + { + spellInfo->CategoryEntry = sSpellCategoryStore.LookupEntry(0); + spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_DO_NOT_SHEATH); + spellInfo->Attributes |= SPELL_ATTR0_NOT_SHAPESHIFTED; + spellInfo->AttributesEx |= SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL; + spellInfo->AttributesEx2 |= SPELL_ATTR2_NO_TARGET_PER_SECOND_COST; + spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_FROM_PROCS; + spellInfo->FacingCasterFlags |= SPELL_FACING_FLAG_INFRONT; + spellInfo->InterruptFlags |= (SPELL_INTERRUPT_FLAG_MOVEMENT | SPELL_INTERRUPT_FLAG_PUSH_BACK | + SPELL_INTERRUPT_FLAG_UNK3 | SPELL_INTERRUPT_FLAG_INTERRUPT); + spellInfo->ChannelInterruptFlags &= ~AURA_INTERRUPT_FLAG_JUMP; + spellInfo->ChannelInterruptFlags |= AURA_INTERRUPT_FLAG_UNK14; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY); + spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY); + spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY); + spellInfo->Effects[EFFECT_0].Amplitude = 3000; + spellInfo->Effects[EFFECT_1].Amplitude = 3000; + spellInfo->Effects[EFFECT_2].Amplitude = 3000; + spellInfo->SpellVisual[0] = 12656; + }); + + // Intercept + ApplySpellFix({ 20252 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_NOT_SHAPESHIFTED | SPELL_ATTR0_DO_NOT_SHEATH); + spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP; + }); + + // Intercept + ApplySpellFix({ 20253 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_NOT_SHAPESHIFTED | SPELL_ATTR0_DO_NOT_SHEATH); + spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP; + spellInfo->AttributesEx7 |= (SPELL_ATTR7_NO_ATTACK_DODGE | SPELL_ATTR7_NO_ATTACK_PARRY); + spellInfo->SpellLevel = 0; + }); + + // Heart of the Crusader + ApplySpellFix({ 20335, 20336, 20337 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA; + spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY); + spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_DUMMY; + }); + + // Gordok Ogre Suit + ApplySpellFix({ 22736 }, [](SpellInfo* spellInfo) + { + spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_MOUNT; + }); + + // Soul Flame + ApplySpellFix({ 23272 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + }); + + // Tree Disguise + ApplySpellFix({ 30298 }, [](SpellInfo* spellInfo) + { + spellInfo->InterruptFlags |= (SPELL_INTERRUPT_FLAG_MOVEMENT | SPELL_INTERRUPT_FLAG_PUSH_BACK | + SPELL_INTERRUPT_FLAG_UNK3 | SPELL_INTERRUPT_FLAG_INTERRUPT); + spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_MOD_STUN; + }); + + // Internal Shake Camera w/ rumble sound + ApplySpellFix({ 33271 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes |= SPELL_ATTR0_ALLOW_WHILE_MOUNTED; + }); + + // Glaive + ApplySpellFix({ 36500 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes &= ~SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL; + spellInfo->Effects[EFFECT_0].DieSides = 68; + spellInfo->Effects[EFFECT_0].BasePoints = 201; + }); + + // Create Anchorite Relic + ApplySpellFix({ 39183 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(0); + }); + + // Charge Rifts + ApplySpellFix({ 47747 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_45_YARDS); + }); + + // New Summon Test + ApplySpellFix({ 49214 }, [](SpellInfo* spellInfo) + { + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(3); + }); + + // Plague Strike + ApplySpellFix({ 54469 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS); + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS); + spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS); + }); + + // Glyph of Chains of Ice: + ApplySpellFix({ 58620 }, [](SpellInfo* spellInfo) + { + spellInfo->SpellLevel = 0; + }); + + // Exit Portal + ApplySpellFix({ 60474 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx6 |= SPELL_ATTR6_ALLOW_WHILE_RIDING_VEHICLE; + }); + + // Shattering Throw + ApplySpellFix({ 64382 }, [](SpellInfo* spellInfo) + { + spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_NOT_SHAPESHIFTED | SPELL_ATTR0_DO_NOT_SHEATH); + spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; From 8797e8ad280aabc8314bc175c3a6284aa2b6deaf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Apr 2025 13:47:36 +0000 Subject: [PATCH 50/53] chore(DB): import pending files Referenced commit(s): b2a810f96cf60b345a49b42218741a182e320725 --- .../rev_1743358272289715719.sql => db_world/2025_04_30_04.sql} | 1 + .../rev_1743363476685228915.sql => db_world/2025_04_30_05.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1743358272289715719.sql => db_world/2025_04_30_04.sql} (85%) rename data/sql/updates/{pending_db_world/rev_1743363476685228915.sql => db_world/2025_04_30_05.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1743358272289715719.sql b/data/sql/updates/db_world/2025_04_30_04.sql similarity index 85% rename from data/sql/updates/pending_db_world/rev_1743358272289715719.sql rename to data/sql/updates/db_world/2025_04_30_04.sql index f896967a5..426580f6b 100644 --- a/data/sql/updates/pending_db_world/rev_1743358272289715719.sql +++ b/data/sql/updates/db_world/2025_04_30_04.sql @@ -1,2 +1,3 @@ +-- DB update 2025_04_30_03 -> 2025_04_30_04 -- DELETE FROM `spell_dbc` WHERE `ID` IN (75, 1454, 1455, 1456, 11687, 11688, 11689, 27222, 57946, 4074, 4511, 7922, 9457, 10732, 20252, 20253, 20335, 20336, 20337, 22736, 23272, 30298, 33271, 36500, 39183, 47747, 49214, 54469, 58620, 58621, 60474, 64382); diff --git a/data/sql/updates/pending_db_world/rev_1743363476685228915.sql b/data/sql/updates/db_world/2025_04_30_05.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1743363476685228915.sql rename to data/sql/updates/db_world/2025_04_30_05.sql index 5d5040d06..52e5069f2 100644 --- a/data/sql/updates/pending_db_world/rev_1743363476685228915.sql +++ b/data/sql/updates/db_world/2025_04_30_05.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_30_04 -> 2025_04_30_05 -- SET @SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS := 268435456; SET @SPELL_ATTR5_ALLOW_WHILE_STUNNED := 8; From 8358e17ac17932765e5008649e47e42ff975f3cf Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Thu, 1 May 2025 01:54:37 +0200 Subject: [PATCH 51/53] Revert "Fix(Core/Player): Energy regen rate bonuses (#20321)" (#22032) --- src/server/game/Entities/Player/Player.cpp | 23 ++-------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 64594ebfd..cd49be1ad 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1896,27 +1896,8 @@ void Player::Regenerate(Powers power) } } break; - case POWER_ENERGY: - { - float baseRegenRate = 10.0f * sWorld->getRate(RATE_POWER_ENERGY); - float hasteModifier = 1.0f; - - // Apply Vitality - if (HasAura(61329)) - hasteModifier += 0.25f; - - // Apply Overkill - if (HasAura(58426)) - hasteModifier += 0.30f; - - // Apply Adrenaline Rush - if (HasAura(13750)) - hasteModifier += 1.0f; - - float adjustedRegenRate = baseRegenRate * hasteModifier; - - addvalue += adjustedRegenRate * 0.001f * m_regenTimer; - } + case POWER_ENERGY: // Regenerate energy (rogue) + addvalue += 0.01f * m_regenTimer * sWorld->getRate(RATE_POWER_ENERGY); break; case POWER_RUNIC_POWER: { From 41a1612283767b7b5003fa029555e5c8e4bfcc24 Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Thu, 1 May 2025 17:15:16 +0200 Subject: [PATCH 52/53] fix (DB/Creature) The Horses' pack and the single horse now have a path and jump the fence. (#22033) --- .../pending_db_world/Horses_inside_fences.sql | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 data/sql/updates/pending_db_world/Horses_inside_fences.sql diff --git a/data/sql/updates/pending_db_world/Horses_inside_fences.sql b/data/sql/updates/pending_db_world/Horses_inside_fences.sql new file mode 100644 index 000000000..c7083e482 --- /dev/null +++ b/data/sql/updates/pending_db_world/Horses_inside_fences.sql @@ -0,0 +1,71 @@ + +-- Add waypoints +DELETE FROM `waypoint_data` WHERE `id` IN ("12921200"); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +("12921200", 1, 2212.1313, -5812.2856, 101.33683, NULL, 0, 0, 0, 100, 0), +("12921200", 2, 2204.9878, -5801.3545, 101.352875, NULL, 0, 0, 0, 100, 0), +("12921200", 3, 2183.3723, -5812.831, 101.349945, NULL, 0, 0, 0, 100, 0), +("12921200", 4, 2178.0305, -5838.2285, 101.35527, NULL, 0, 0, 0, 100, 0), +("12921200", 5, 2187.962, -5859.553, 101.332436, NULL, 0, 0, 0, 100, 0), +("12921200", 6, 2221.1243, -5861.5303, 101.47864, NULL, 0, 0, 0, 100, 0), +("12921200", 7, 2250.3555, -5834.3096, 101.25951, NULL, 0, 0, 0, 100, 0), +("12921200", 8, 2217.0012, -5826.042, 101.37887, NULL, 0, 0, 0, 100, 0), +("12921200", 9, 2191.5737, -5828.108, 101.93167, NULL, 0, 0, 0, 100, 0), +("12921200", 10, 2199.251, -5852.3496, 101.37288, NULL, 0, 0, 0, 100, 0), +("12921200", 11, 2225.122, -5850.7876, 101.233604, NULL, 0, 0, 0, 100, 0), +("12921200", 12, 2252.0554, -5834.1104, 101.232346, NULL, 0, 0, 0, 100, 0), +("12921200", 13, 2246.5051, -5829.7847, 101.24832, NULL, 0, 0, 0, 100, 0), +("12921200", 14, 2221.6838, -5823.5996, 101.55388, NULL, 0, 0, 0, 100, 0); + +DELETE FROM `waypoint_data` WHERE `id` IN ("12921000"); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +("12921000", 1, 2222.3447, -5818.2954, 101.58636, NULL, 0, 0, 0, 100, 0), +("12921000", 2, 2193.6536, -5804.279, 101.345184, NULL, 0, 0, 0, 100, 0), +("12921000", 3, 2190.4019, -5833.695, 101.39836, NULL, 0, 0, 0, 100, 0), +("12921000", 4, 2192.386, -5848.4937, 101.35042, NULL, 0, 0, 0, 100, 0), +("12921000", 5, 2202.781, -5858.187, 101.56625, NULL, 0, 0, 0, 100, 0), +("12921000", 6, 2217.3516, -5860.6836, 101.396805, NULL, 0, 0, 0, 100, 0), +("12921000", 7, 2228.4097, -5858.6533, 101.26566, NULL, 0, 0, 0, 100, 0), +("12921000", 8, 2233.331, -5851.655, 101.59271, NULL, 0, 0, 0, 100, 0); + +-- Remove Wrong guids (Havenshire Stallion, Mare, Colt). +DELETE FROM `creature` WHERE (`id1` = 28605) AND (`guid` IN (129216, 129217)); +DELETE FROM `creature` WHERE (`id1` = 28606) AND (`guid` IN (129237)); +DELETE FROM `creature` WHERE (`id1` = 28607) AND (`guid` IN (129252)); +DELETE FROM `creature_addon` WHERE (`guid` IN (129237, 129252)); + +-- Set MT waypoint for Pack Leader +UPDATE `creature` SET `MovementType` = 2 WHERE (`id1` = 28605) AND (`guid` IN (129212)); + +DELETE FROM `creature_addon` WHERE (`guid` IN (129212)); +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(129212, 12921200, 0, 0, 0, 0, 0, NULL); + +-- Add Formation for horse's pack +DELETE FROM `creature_formations` WHERE `leaderGUID` = 129212; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(129212, 129212, 0, 0, 512, 0, 0), +(129212, 129230, 3, 220, 512, 0, 0), +(129212, 129208, 3.5, 160, 512, 0, 0), +(129212, 129243, 4, 200, 512, 0, 0), +(129212, 129234, 4.5, 180, 512, 0, 0); + +-- Add comment for the single Horse +UPDATE `creature` SET `Comment` = 'has guid specific SAI' WHERE (`id1` = 28605) AND (`guid` IN (129210)); + +-- Set Action List +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2860500); +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 +(2860500, 9, 0, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1.6, 'Havenshire Stallion - Actionlist - Set Orientation 1.6'), +(2860500, 9, 1, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 5, 377, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - Actionlist - Play Emote 377'), +(2860500, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 136, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - Actionlist - Set Walk Speed to 2.0'), +(2860500, 9, 3, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2232.89, -5840.03, 101.482, 0, 'Havenshire Stallion - Actionlist - Move To Self'), +(2860500, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 97, 10, 10, 1, 0, 0, 0, 202, 0, 0, 1, 0, 2231.45, -5828.9, 101.371, 0, 'Havenshire Stallion - Actionlist - Jump To Pos'), +(2860500, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 232, 12921000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - Actionlist - Start Path 12921000'); + +-- Set personal SmartAI +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = -129210); +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 +(-129210, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 232, 12921000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - On Respawn - Start Path 12921000'), +(-129210, 0, 1, 2, 108, 0, 100, 0, 8, 12921000, 0, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - On Point 8 of Path 12921000 Reached - Stop Movement'), +(-129210, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2860500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - On Point 8 of Path 12921000 Reached - Run Script'); From b9704d4fa1b06df88081d25bf45063df53de2951 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 1 May 2025 15:16:17 +0000 Subject: [PATCH 53/53] chore(DB): import pending files Referenced commit(s): 41a1612283767b7b5003fa029555e5c8e4bfcc24 --- .../Horses_inside_fences.sql => db_world/2025_05_01_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/Horses_inside_fences.sql => db_world/2025_05_01_00.sql} (99%) diff --git a/data/sql/updates/pending_db_world/Horses_inside_fences.sql b/data/sql/updates/db_world/2025_05_01_00.sql similarity index 99% rename from data/sql/updates/pending_db_world/Horses_inside_fences.sql rename to data/sql/updates/db_world/2025_05_01_00.sql index c7083e482..31113ab55 100644 --- a/data/sql/updates/pending_db_world/Horses_inside_fences.sql +++ b/data/sql/updates/db_world/2025_05_01_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_04_30_05 -> 2025_05_01_00 -- Add waypoints DELETE FROM `waypoint_data` WHERE `id` IN ("12921200");