From 902b217d885b5def817a62cf469b56d8eb547706 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 30 Jan 2024 09:39:40 -0500 Subject: [PATCH] Core/Auras: Implement SPELL_ATTR13_PERIODIC_REFRESH_EXTENDS_DURATION Port From (https://github.com/TrinityCore/TrinityCore/commit/e1f345756ba34ccf4d4dd07b90c254097a240b51) --- Source/Game/Spells/Auras/Aura.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index 1ec98040f..d7b1aca8e 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -817,7 +817,18 @@ namespace Game.Spells { m_maxDuration = CalcMaxDuration(); + // Pandemic Mechanic + if (m_spellInfo.HasAttribute(SpellAttr13.PeriodicRefreshExtendsDuration)) + { + // Pandemic doesn't reset periodic timer + resetPeriodicTimer = false; + + int pandemicDuration = MathFunctions.CalculatePct(m_maxDuration, 30.0f); + m_maxDuration = Math.Max(GetDuration(), Math.Min(pandemicDuration, GetDuration()) + m_maxDuration); + } + RefreshDuration(); + Unit caster = GetCaster(); for (byte i = 0; i < SpellConst.MaxEffects; ++i) {