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:
ZhengPeiRu21
2022-07-10 12:14:27 -06:00
committed by GitHub
parent 5930eed646
commit a6e8f060a5
4 changed files with 18 additions and 1 deletions

View File

@@ -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());