Core/Spells: Implemented SpellAuraInterruptFlags2::ReleaseEmpower
Port From (https://github.com/TrinityCore/TrinityCore/commit/2c06e7fcdab677df4e5908f69b9655577e08fe69)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -3492,7 +3492,7 @@ namespace Game.Spells
|
||||
|
||||
if (IsEmpowerSpell())
|
||||
{
|
||||
int getCompletedEmpowerStages()
|
||||
int completedStages = new Func<int>(() =>
|
||||
{
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user