mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
feat(Core/Config): Configurable Water Breath Timer (#11945)
* feat(Core/Config): Configurable Water Breath Timer * Config Formatting Add missing linebreaks * Use int instead of float for water breath timer * Correctly get CONFIG_WATER_BREATH as Int instead of Float value * Move CONFIG_WATER_BREATH_TIMER to WorldInt configs * More logical WaterBreath configuration
This commit is contained in:
@@ -2423,8 +2423,17 @@ Rate.InstanceResetTime = 1
|
||||
# The lower the rate the less experience is required.
|
||||
# Default: 0.05
|
||||
#
|
||||
|
||||
Rate.Pet.LevelXP = 0.05
|
||||
|
||||
#
|
||||
# WaterBreath.Timer
|
||||
# Description: The timer for player's breath underwater in milliseconds
|
||||
# Default: 180000 (3 minutes)
|
||||
#
|
||||
|
||||
WaterBreath.Timer = 180000
|
||||
|
||||
#
|
||||
# SkillGain.Crafting
|
||||
# SkillGain.Defense
|
||||
|
||||
@@ -813,7 +813,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
||||
{
|
||||
if (!IsAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_DISABLE_BREATHING)))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
int32 UnderWaterTime = 3 * MINUTE * IN_MILLISECONDS;
|
||||
int32 UnderWaterTime = sWorld->getIntConfig(CONFIG_WATER_BREATH_TIMER);
|
||||
AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING);
|
||||
for (AuraEffectList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
|
||||
AddPct(UnderWaterTime, (*i)->GetAmount());
|
||||
|
||||
@@ -401,6 +401,7 @@ enum WorldIntConfigs
|
||||
CONFIG_LFG_MAX_KICK_COUNT,
|
||||
CONFIG_LFG_KICK_PREVENTION_TIMER,
|
||||
CONFIG_CHANGE_FACTION_MAX_MONEY,
|
||||
CONFIG_WATER_BREATH_TIMER,
|
||||
INT_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -1184,6 +1184,13 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetOption<bool>("OffhandCheckAtSpellUnlearn", true);
|
||||
m_int_configs[CONFIG_CREATURE_STOP_FOR_PLAYER] = sConfigMgr->GetOption<uint32>("Creature.MovingStopTimeForPlayer", 3 * MINUTE * IN_MILLISECONDS);
|
||||
|
||||
m_int_configs[CONFIG_WATER_BREATH_TIMER] = sConfigMgr->GetOption<uint32>("WaterBreath.Timer", 180000);
|
||||
if (m_int_configs[CONFIG_WATER_BREATH_TIMER] <= 0)
|
||||
{
|
||||
LOG_ERROR("server.loading", "WaterBreath.Timer ({}) must be > 0. Using 180000 instead.", m_int_configs[CONFIG_WATER_BREATH_TIMER]);
|
||||
m_int_configs[CONFIG_WATER_BREATH_TIMER] = 180000;
|
||||
}
|
||||
|
||||
if (int32 clientCacheId = sConfigMgr->GetOption<int32>("ClientCacheVersion", 0))
|
||||
{
|
||||
// overwrite DB/old value
|
||||
|
||||
Reference in New Issue
Block a user