Core/Spells: Fix periodic rolling adding bonuses twice
Port From (https://github.com/TrinityCore/TrinityCore/commit/9fa95b4b57c1d843392d0c321cdabbc3a21e1d69)
This commit is contained in:
@@ -58,6 +58,7 @@ namespace Game.Spells
|
||||
targetList.Add(app.GetTarget());
|
||||
}
|
||||
}
|
||||
|
||||
void GetApplicationList(out List<AuraApplication> applicationList)
|
||||
{
|
||||
applicationList = new List<AuraApplication>();
|
||||
@@ -120,6 +121,17 @@ namespace Game.Spells
|
||||
break;
|
||||
}
|
||||
|
||||
if (GetSpellInfo().HasAttribute(SpellAttr10.RollingPeriodic))
|
||||
{
|
||||
var periodicAuras = GetBase().GetUnitOwner().GetAuraEffectsByType(GetAuraType());
|
||||
amount = periodicAuras.Aggregate(0, (val, aurEff) =>
|
||||
{
|
||||
if (aurEff.GetCasterGUID() == GetCasterGUID() && aurEff.GetId() == GetId() && aurEff.GetEffIndex() == GetEffIndex() && aurEff.GetTotalTicks() > 0)
|
||||
val += aurEff.GetAmount() * (int)aurEff.GetRemainingTicks() / (int)aurEff.GetTotalTicks();
|
||||
return val;
|
||||
});
|
||||
}
|
||||
|
||||
GetBase().CallScriptEffectCalcAmountHandlers(this, ref amount, ref m_canBeRecalculated);
|
||||
if (!GetSpellEffectInfo().EffectAttributes.HasFlag(SpellEffectAttributes.NoScaleWithStack))
|
||||
amount *= GetBase().GetStackAmount();
|
||||
|
||||
Reference in New Issue
Block a user