Core/Auras: Fixed SPELL_ATTR13_PERIODIC_REFRESH_EXTENDS_DURATION
Port From (https://github.com/TrinityCore/TrinityCore/commit/92773e207c94e355fd37b266a219aad977cce9e2)
This commit is contained in:
@@ -851,9 +851,6 @@ namespace Game.Spells
|
||||
{
|
||||
// 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();
|
||||
@@ -3100,7 +3097,6 @@ namespace Game.Spells
|
||||
public void SetBaseAmount(int[] bp) { BaseAmount = bp; }
|
||||
public void SetCastItem(ObjectGuid guid, uint itemId, int itemLevel) { CastItemGUID = guid; CastItemId = itemId; CastItemLevel = itemLevel; }
|
||||
public void SetPeriodicReset(bool reset) { ResetPeriodicTimer = reset; }
|
||||
public void SetIsRefresh(bool isRefresh) { IsRefresh = isRefresh; }
|
||||
public void SetStackAmount(int stackAmount) { StackAmount = stackAmount > 0 ? stackAmount : 1; }
|
||||
public void SetOwnerEffectMask(uint effMask) { _targetEffectMask = effMask; }
|
||||
public void SetAuraEffectMask(uint effMask) { _auraEffectMask = effMask; }
|
||||
|
||||
@@ -2392,6 +2392,12 @@ namespace Game.Spells
|
||||
if (hitInfo.AuraDuration == 0)
|
||||
hitInfo.AuraDuration = (int)(origDuration * m_originalCaster.m_unitData.ModCastingSpeed);
|
||||
}
|
||||
|
||||
if (createInfo.IsRefresh && m_spellInfo.HasAttribute(SpellAttr13.PeriodicRefreshExtendsDuration))
|
||||
{
|
||||
int newDuration = hitInfo.AuraDuration + hitInfo.HitAura.GetDuration();
|
||||
hitInfo.AuraDuration = Math.Min(newDuration, MathFunctions.CalculatePct(hitInfo.AuraDuration, 130));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user