Merge branch 'breathTimerConfig' into Playerbot

This commit is contained in:
郑佩茹
2022-06-16 10:06:05 -06:00
4 changed files with 16 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 = static_cast<int32>(sWorld->getFloatConfig(CONFIG_WATER_BREATH_TIMER) * MINUTE * IN_MILLISECONDS);
AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING);
for (AuraEffectList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
AddPct(UnderWaterTime, (*i)->GetAmount());