From a3e2e957c9317f046baa9b956bcc9495a2a5e420 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 9 Feb 2021 12:50:35 -0500 Subject: [PATCH] Core/Auras: Implement spell effect attribute NoScaleWithStack (0x40) Port From (https://github.com/TrinityCore/TrinityCore/commit/b832ed2479c039958bce40c3c26294fc67acf744) --- Source/Framework/Constants/CliDBConst.cs | 10 ++++++++++ Source/Game/DataStorage/Structs/S_Records.cs | 2 +- Source/Game/Spells/Auras/AuraEffect.cs | 3 ++- Source/Game/Spells/SpellInfo.cs | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Source/Framework/Constants/CliDBConst.cs b/Source/Framework/Constants/CliDBConst.cs index 7786e1f28..8663f6bde 100644 --- a/Source/Framework/Constants/CliDBConst.cs +++ b/Source/Framework/Constants/CliDBConst.cs @@ -1672,6 +1672,16 @@ namespace Framework.Constants CooldownExpiresAtDailyReset = 0x08 } + public enum SpellEffectAttributes + { + None = 0, + UnaffectedByInvulnerability = 0x01, // not cancelled by immunities + NoScaleWithStack = 0x40, + StackAuraAmountOnRecast = 0x8000, // refreshing periodic auras with this attribute will add remaining damage to new aura + AllowAnyExplicitTarget = 0x100000, + IgnoreDuringCooldownTimeRateCalculation = 0x800000 + } + public enum SpellProcsPerMinuteModType : byte { Haste = 1, diff --git a/Source/Game/DataStorage/Structs/S_Records.cs b/Source/Game/DataStorage/Structs/S_Records.cs index 01efab6b9..be15ae4b3 100644 --- a/Source/Game/DataStorage/Structs/S_Records.cs +++ b/Source/Game/DataStorage/Structs/S_Records.cs @@ -271,7 +271,7 @@ namespace Game.DataStorage public uint EffectIndex; public uint Effect; public float EffectAmplitude; - public int EffectAttributes; + public SpellEffectAttributes EffectAttributes; public uint EffectAuraPeriod; public float EffectBonusCoefficient; public float EffectChainAmplitude; diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 23b6c7ed7..3dc208268 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -122,7 +122,8 @@ namespace Game.Spells } GetBase().CallScriptEffectCalcAmountHandlers(this, ref amount, ref m_canBeRecalculated); - amount *= GetBase().GetStackAmount(); + if (!GetSpellEffectInfo().EffectAttributes.HasFlag(SpellEffectAttributes.NoScaleWithStack)) + amount *= GetBase().GetStackAmount(); return amount; } public void CalculatePeriodic(Unit caster, bool resetPeriodicTimer = true, bool load = false) diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 629d192bd..da31a9706 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -3666,6 +3666,7 @@ namespace Game.Spells Scaling.Coefficient = effect.Coefficient; Scaling.Variance = effect.Variance; Scaling.ResourceCoefficient = effect.ResourceCoefficient; + EffectAttributes = effect.EffectAttributes; ImplicitTargetConditions = null; @@ -4408,6 +4409,7 @@ namespace Game.Spells public FlagArray128 SpellClassMask; public float BonusCoefficientFromAP; public List ImplicitTargetConditions; + public SpellEffectAttributes EffectAttributes; public ScalingInfo Scaling; ImmunityInfo _immunityInfo;