feat(Core/Maps): Implement dynamic respawn rates (#21417)

Co-authored-by: r00ty-tc <r00ty-tc@users.noreply.github.com>
Co-authored-by: Jelle Meeus <sogladev@gmail.com>
Co-authored-by Treeston

This is a partial cherry-pick of: https://github.com/TrinityCore/TrinityCore/pull/19056/commits/59db2eeea0a35028779fd76372ae06cc98c8086f
This commit is contained in:
Andrew
2025-02-12 15:06:42 -03:00
committed by GitHub
parent 5421f13c13
commit 16fa25b7a9
8 changed files with 118 additions and 2 deletions
+4
View File
@@ -201,6 +201,8 @@ enum WorldFloatConfigs
CONFIG_ARENA_WIN_RATING_MODIFIER_2,
CONFIG_ARENA_LOSE_RATING_MODIFIER,
CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER,
CONFIG_RESPAWN_DYNAMICRATE_GAMEOBJECT,
CONFIG_RESPAWN_DYNAMICRATE_CREATURE,
FLOAT_CONFIG_VALUE_COUNT
};
@@ -420,6 +422,8 @@ enum WorldIntConfigs
CONFIG_AUCTIONHOUSE_WORKERTHREADS,
CONFIG_SPELL_QUEUE_WINDOW,
CONFIG_SUNSREACH_COUNTER_MAX,
CONFIG_RESPAWN_DYNAMICMINIMUM_GAMEOBJECT,
CONFIG_RESPAWN_DYNAMICMINIMUM_CREATURE,
INT_CONFIG_VALUE_COUNT
};
+7
View File
@@ -1295,6 +1295,13 @@ void World::LoadConfigSettings(bool reload)
_int_configs[CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD] = sConfigMgr->GetOption<uint32>("DailyRBGArenaPoints.MinLevel", 71);
// Respawn
_float_configs[CONFIG_RESPAWN_DYNAMICRATE_CREATURE] = sConfigMgr->GetOption<float>("Respawn.DynamicRateCreature", 1.0f);
_int_configs[CONFIG_RESPAWN_DYNAMICMINIMUM_CREATURE] = sConfigMgr->GetOption<int32>("Respawn.DynamicMinimumCreature", 10);
_float_configs[CONFIG_RESPAWN_DYNAMICRATE_GAMEOBJECT] = sConfigMgr->GetOption<float>("Respawn.DynamicRateGameObject", 1.0f);
_int_configs[CONFIG_RESPAWN_DYNAMICMINIMUM_GAMEOBJECT] = sConfigMgr->GetOption<int32>("Respawn.DynamicMinimumGameObject", 10);
///- Read the "Data" directory from the config file
std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))