From e74d30024f52b97cc56980abc85f2d40be64eb06 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 22 Feb 2021 16:01:43 -0500 Subject: [PATCH] Core/Auras: Implemented new spell modifier type to change aura stack size on apply Port From (https://github.com/TrinityCore/TrinityCore/commit/51a9d2a9c20f36f5343049a340663601c1c1165b) --- Source/Framework/Constants/Spells/SpellConst.cs | 3 ++- Source/Game/Spells/Auras/Aura.cs | 2 +- Source/Game/Spells/Spell.cs | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 1abb5d330..2b121356c 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -348,12 +348,13 @@ namespace Framework.Constants ResistDispelChance = 28, CritDamageBonus2 = 29, //One Not Used Spell SpellCostRefundOnFail = 30, + StackAmount = 31, Effect4 = 32, Effect5 = 33, SpellCost2 = 34, // Used when SpellPowerEntry.PowerIndex == 1 JumpDistance = 35, // spellmod 36 - StackAmount2 = 37, // same as SPELLMOD_STACK_AMOUNT but affects tooltips + MaxStackAmount = 37, // spellmod 38 SpellCost3 = 39, diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index 183d834e2..722778573 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -870,7 +870,7 @@ namespace Game.Spells { Player modOwner = caster.GetSpellModOwner(); if (modOwner != null) - modOwner.ApplySpellMod(m_spellInfo.Id, SpellModOp.StackAmount2, ref maxStackAmount); + modOwner.ApplySpellMod(m_spellInfo.Id, SpellModOp.MaxStackAmount, ref maxStackAmount); } return maxStackAmount; } diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 0a39bdead..60a8c3ebb 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -66,6 +66,10 @@ namespace Game.Spells } } + Player modOwner = caster.GetSpellModOwner(); + if (modOwner != null) + modOwner.ApplySpellMod(info.Id, SpellModOp.StackAmount, ref m_spellValue.AuraStackAmount, this); + if (!originalCasterGUID.IsEmpty()) m_originalCasterGUID = originalCasterGUID; else @@ -2160,7 +2164,7 @@ namespace Game.Spells if (m_spellValue.AuraStackAmount > 1) { if (!refresh) - m_spellAura.SetStackAmount(m_spellValue.AuraStackAmount); + m_spellAura.SetStackAmount((byte)m_spellValue.AuraStackAmount); else m_spellAura.ModStackAmount(m_spellValue.AuraStackAmount); } @@ -7718,7 +7722,7 @@ namespace Game.Spells public uint CustomBasePointsMask; public uint MaxAffectedTargets; public float RadiusMod; - public byte AuraStackAmount; + public int AuraStackAmount; } // Spell modifier (used for modify other spells)