diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 404ad2e05..3484b9fa1 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -176,6 +176,7 @@ namespace Framework.Constants ChallengeModeStart = 0x400000, // Implemented in Unit::AtStartOfEncounter StartOfEncounter = 0x800000, // Implemented in Unit::AtStartOfEncounter EndOfEncounter = 0x1000000, // Implemented in Unit::AtEndOfEncounter + ReleaseEmpower = 0x02000000, // Implemented in Spell::update } // Enum with EffectRadiusIndex and their actual radius diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 9459f6ab0..1ed053151 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -3492,7 +3492,7 @@ namespace Game.Spells if (IsEmpowerSpell()) { - int getCompletedEmpowerStages() + int completedStages = new Func(() => { TimeSpan passed = TimeSpan.FromMilliseconds(m_channeledDuration - m_timer); for (int i = 0; i < m_empower.StageDurations.Count; ++i) @@ -3503,9 +3503,8 @@ namespace Game.Spells } return m_empower.StageDurations.Count; - }; + })(); - int completedStages = getCompletedEmpowerStages(); if (completedStages != m_empower.CompletedStages) { SpellEmpowerSetStage empowerSetStage = new(); @@ -3518,6 +3517,7 @@ namespace Game.Spells m_caster.ToUnit().SetSpellEmpowerStage((sbyte)completedStages); CallScriptEmpowerStageCompletedHandlers(completedStages); + m_caster.ToUnit().RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.ReleaseEmpower, m_spellInfo); } if (CanReleaseEmpowerSpell())