diff options
author | Jelle Meeus <sogladev@gmail.com> | 2025-09-14 07:25:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-14 11:25:18 -0300 |
commit | 7a43b0f13ec35fa7726c5008d4673671a5775bcf (patch) | |
tree | 78da160505ba32cbfc740610af969e473e694da9 | |
parent | 17a9f93cfd2dddfaeff1a43688f5fe294d83a930 (diff) |
feat(World/WorldConfig): ScourgeInvasion Add config BattlesWon tresholds (#22913)
-rw-r--r-- | src/server/apps/worldserver/worldserver.conf.dist | 13 | ||||
-rw-r--r-- | src/server/game/World/WorldConfig.cpp | 4 | ||||
-rw-r--r-- | src/server/game/World/WorldConfig.h | 3 | ||||
-rw-r--r-- | src/server/game/World/WorldState.cpp | 11 |
4 files changed, 27 insertions, 4 deletions
diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 9618e31a7b..2150118d10 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -4394,6 +4394,19 @@ Event.Announce = 0 Sunsreach.CounterMax = 10000 # +# ScourgeInvasion.CounterFirst +# ScourgeInvasion.CounterSecond +# ScourgeInvasion.CounterThird +# Description: Counter thresholds to be reached to transition phases +# Default: 50 - (ScourgeInvasion.CounterFirst) +# 100 - (ScourgeInvasion.CounterSecond) +# 150 - (ScourgeInvasion.CounterThird) + +ScourgeInvasion.CounterFirst = 50 +ScourgeInvasion.CounterSecond = 100 +ScourgeInvasion.CounterThird = 150 + +# ################################################################################################### ################################################################################################### diff --git a/src/server/game/World/WorldConfig.cpp b/src/server/game/World/WorldConfig.cpp index c38b36ff0b..99fd8b0d41 100644 --- a/src/server/game/World/WorldConfig.cpp +++ b/src/server/game/World/WorldConfig.cpp @@ -656,7 +656,11 @@ void WorldConfig::BuildConfigCache() SetConfigValue<bool>(CONFIG_SPELL_QUEUE_ENABLED, "SpellQueue.Enabled", true); SetConfigValue<uint32>(CONFIG_SPELL_QUEUE_WINDOW, "SpellQueue.Window", 400); + // World State SetConfigValue<uint32>(CONFIG_SUNSREACH_COUNTER_MAX, "Sunsreach.CounterMax", 10000); + SetConfigValue<uint32>(CONFIG_SCOURGEINVASION_COUNTER_FIRST, "ScourgeInvasion.CounterFirst", 50); + SetConfigValue<uint32>(CONFIG_SCOURGEINVASION_COUNTER_SECOND, "ScourgeInvasion.CounterSecond", 100); + SetConfigValue<uint32>(CONFIG_SCOURGEINVASION_COUNTER_THIRD, "ScourgeInvasion.CounterThird", 150); SetConfigValue<std::string>(CONFIG_NEW_CHAR_STRING, "PlayerStart.String", ""); } diff --git a/src/server/game/World/WorldConfig.h b/src/server/game/World/WorldConfig.h index 475bed337a..c06dd52f9d 100644 --- a/src/server/game/World/WorldConfig.h +++ b/src/server/game/World/WorldConfig.h @@ -378,6 +378,9 @@ enum ServerConfigs CONFIG_AUCTIONHOUSE_WORKERTHREADS, CONFIG_SPELL_QUEUE_WINDOW, CONFIG_SUNSREACH_COUNTER_MAX, + CONFIG_SCOURGEINVASION_COUNTER_FIRST, + CONFIG_SCOURGEINVASION_COUNTER_SECOND, + CONFIG_SCOURGEINVASION_COUNTER_THIRD, CONFIG_RESPAWN_DYNAMICMINIMUM_GAMEOBJECT, CONFIG_RESPAWN_DYNAMICMINIMUM_CREATURE, RATE_HEALTH, diff --git a/src/server/game/World/WorldState.cpp b/src/server/game/World/WorldState.cpp index 106e8fd991..83ed3b5c46 100644 --- a/src/server/game/World/WorldState.cpp +++ b/src/server/game/World/WorldState.cpp @@ -25,6 +25,7 @@ #include "UnitAI.h" #include "Weather.h" #include "WorldState.h" +#include "WorldConfig.h" #include "WorldStateDefines.h" #include <chrono> @@ -1564,20 +1565,22 @@ void WorldState::BroadcastSIWorldstates() void WorldState::HandleDefendedZones() { - if (m_siData.m_battlesWon < 50) + if (m_siData.m_battlesWon < sWorld->getIntConfig(CONFIG_SCOURGEINVASION_COUNTER_FIRST)) { sGameEventMgr->StopEvent(GAME_EVENT_SCOURGE_INVASION_50_INVASIONS); sGameEventMgr->StopEvent(GAME_EVENT_SCOURGE_INVASION_100_INVASIONS); sGameEventMgr->StopEvent(GAME_EVENT_SCOURGE_INVASION_150_INVASIONS); } - else if (m_siData.m_battlesWon >= 50 && m_siData.m_battlesWon < 100) + else if (m_siData.m_battlesWon >= sWorld->getIntConfig(CONFIG_SCOURGEINVASION_COUNTER_FIRST) && + m_siData.m_battlesWon < sWorld->getIntConfig(CONFIG_SCOURGEINVASION_COUNTER_SECOND)) sGameEventMgr->StartEvent(GAME_EVENT_SCOURGE_INVASION_50_INVASIONS); - else if (m_siData.m_battlesWon >= 100 && m_siData.m_battlesWon < 150) + else if (m_siData.m_battlesWon >= sWorld->getIntConfig(CONFIG_SCOURGEINVASION_COUNTER_SECOND) && + m_siData.m_battlesWon < sWorld->getIntConfig(CONFIG_SCOURGEINVASION_COUNTER_THIRD)) { sGameEventMgr->StopEvent(GAME_EVENT_SCOURGE_INVASION_50_INVASIONS); sGameEventMgr->StartEvent(GAME_EVENT_SCOURGE_INVASION_100_INVASIONS); } - else if (m_siData.m_battlesWon >= 150) + else if (m_siData.m_battlesWon >= sWorld->getIntConfig(CONFIG_SCOURGEINVASION_COUNTER_THIRD)) { sGameEventMgr->StopEvent(GAME_EVENT_SCOURGE_INVASION); sGameEventMgr->StopEvent(GAME_EVENT_SCOURGE_INVASION_50_INVASIONS); |