Core/Spells: Fix periodic rolling adding bonuses twice

Port From (https://github.com/TrinityCore/TrinityCore/commit/9fa95b4b57c1d843392d0c321cdabbc3a21e1d69)
This commit is contained in:
hondacrx
2021-09-08 22:52:23 -04:00
parent d3530ddf1c
commit f9779537a8
9 changed files with 16 additions and 34 deletions
-16
View File
@@ -2370,22 +2370,6 @@ namespace Game.Entities
m_Diminishing[i].Clear();
}
public uint GetRemainingPeriodicAmount(ObjectGuid caster, uint spellId, AuraType auraType, int effectIndex = 0)
{
uint amount = 0;
var periodicAuras = GetAuraEffectsByType(auraType);
foreach (var aurEff in periodicAuras)
{
if (aurEff.GetCasterGUID() != caster || aurEff.GetId() != spellId || aurEff.GetEffIndex() != effectIndex || aurEff.GetTotalTicks() == 0)
continue;
amount += (uint)((aurEff.GetAmount() * aurEff.GetRemainingTicks()) / aurEff.GetTotalTicks());
break;
}
return amount;
}
// Interrupts
public void InterruptNonMeleeSpells(bool withDelayed, uint spell_id = 0, bool withInstant = true)
{