From 337ba82a92a7ffeea0ba1ed2f108443d3352e213 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 5 Aug 2024 14:55:03 -0400 Subject: [PATCH] Core/Auras: Fixed SPELL_ATTR10_ROLLING_PERIODIC for auras that have 0 base amount and only scale from spell/attack power Port From (https://github.com/TrinityCore/TrinityCore/commit/3545285ad7f95cb96500760b084fe40c36a26e04) --- Source/Game/Spells/Auras/AuraEffect.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index a269ed715..1c7dcdb3a 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -107,12 +107,16 @@ namespace Game.Spells if (GetSpellInfo().HasAttribute(SpellAttr10.RollingPeriodic)) { var periodicAuras = GetBase().GetUnitOwner().GetAuraEffectsByType(GetAuraType()); - amount = periodicAuras.Aggregate(0, (val, aurEff) => + uint totalTicks = GetTotalTicks(); + if (totalTicks != 0) { - if (aurEff.GetCasterGUID() == GetCasterGUID() && aurEff.GetId() == GetId() && aurEff.GetEffIndex() == GetEffIndex() && aurEff.GetTotalTicks() > 0) - val += aurEff.GetAmount() * (int)aurEff.GetRemainingTicks() / (int)aurEff.GetTotalTicks(); - return val; - }); + amount = periodicAuras.Aggregate(amount, (val, aurEff) => + { + if (aurEff.GetCasterGUID() == GetCasterGUID() && aurEff.GetId() == GetId() && aurEff.GetEffIndex() == GetEffIndex()) + val += (int)(aurEff.GetEstimatedAmount().GetValueOrDefault(aurEff.GetAmount()) * (float)aurEff.GetRemainingTicks() / (float)aurEff.GetTotalTicks()); + return val; + }); + } } GetBase().CallScriptEffectCalcAmountHandlers(this, ref amount, ref m_canBeRecalculated);