Core/Spells: Implemented SpellAuraInterruptFlags2::ReleaseEmpower

Port From (https://github.com/TrinityCore/TrinityCore/commit/2c06e7fcdab677df4e5908f69b9655577e08fe69)
This commit is contained in:
Hondacrx
2024-09-26 13:07:53 -04:00
parent cab0752c25
commit eee80bad68
2 changed files with 4 additions and 3 deletions
@@ -176,6 +176,7 @@ namespace Framework.Constants
ChallengeModeStart = 0x400000, // Implemented in Unit::AtStartOfEncounter ChallengeModeStart = 0x400000, // Implemented in Unit::AtStartOfEncounter
StartOfEncounter = 0x800000, // Implemented in Unit::AtStartOfEncounter StartOfEncounter = 0x800000, // Implemented in Unit::AtStartOfEncounter
EndOfEncounter = 0x1000000, // Implemented in Unit::AtEndOfEncounter EndOfEncounter = 0x1000000, // Implemented in Unit::AtEndOfEncounter
ReleaseEmpower = 0x02000000, // Implemented in Spell::update
} }
// Enum with EffectRadiusIndex and their actual radius // Enum with EffectRadiusIndex and their actual radius
+3 -3
View File
@@ -3492,7 +3492,7 @@ namespace Game.Spells
if (IsEmpowerSpell()) if (IsEmpowerSpell())
{ {
int getCompletedEmpowerStages() int completedStages = new Func<int>(() =>
{ {
TimeSpan passed = TimeSpan.FromMilliseconds(m_channeledDuration - m_timer); TimeSpan passed = TimeSpan.FromMilliseconds(m_channeledDuration - m_timer);
for (int i = 0; i < m_empower.StageDurations.Count; ++i) for (int i = 0; i < m_empower.StageDurations.Count; ++i)
@@ -3503,9 +3503,8 @@ namespace Game.Spells
} }
return m_empower.StageDurations.Count; return m_empower.StageDurations.Count;
}; })();
int completedStages = getCompletedEmpowerStages();
if (completedStages != m_empower.CompletedStages) if (completedStages != m_empower.CompletedStages)
{ {
SpellEmpowerSetStage empowerSetStage = new(); SpellEmpowerSetStage empowerSetStage = new();
@@ -3518,6 +3517,7 @@ namespace Game.Spells
m_caster.ToUnit().SetSpellEmpowerStage((sbyte)completedStages); m_caster.ToUnit().SetSpellEmpowerStage((sbyte)completedStages);
CallScriptEmpowerStageCompletedHandlers(completedStages); CallScriptEmpowerStageCompletedHandlers(completedStages);
m_caster.ToUnit().RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.ReleaseEmpower, m_spellInfo);
} }
if (CanReleaseEmpowerSpell()) if (CanReleaseEmpowerSpell())