Core/Auras: Implemented SPELL_AURA_MOD_RECOVERY_RATE and SPELL_AURA_MOD_RECOVERY_RATE_BY_SPELL_LABEL
Port From (https://github.com/TrinityCore/TrinityCore/commit/0c198938005bb22f20a0d150a6505324a2d941de)
This commit is contained in:
@@ -5813,6 +5813,35 @@ namespace Game.Spells
|
||||
target.RemoveSpellCategoryCooldownMod(GetMiscValue(), GetAmount());
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModRecoveryRate)]
|
||||
void HandleModRecoveryRate(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask))
|
||||
return;
|
||||
|
||||
float rate = 100.0f / (Math.Max(GetAmount(), -99.0f) + 100.0f);
|
||||
|
||||
aurApp.GetTarget().GetSpellHistory().UpdateCooldownRecoveryRate(cooldown =>
|
||||
{
|
||||
return IsAffectingSpell(Global.SpellMgr.GetSpellInfo(cooldown.SpellId, Difficulty.None));
|
||||
}, rate, apply);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModRecoveryRateBySpellLabel)]
|
||||
void HandleModRecoveryRateBySpellLabel(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask))
|
||||
return;
|
||||
|
||||
float rate = 100.0f / (Math.Max(GetAmount(), -99.0f) + 100.0f);
|
||||
|
||||
aurApp.GetTarget().GetSpellHistory().UpdateCooldownRecoveryRate(cooldown =>
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(cooldown.SpellId, Difficulty.None);
|
||||
return spellInfo.HasLabel((uint)GetMiscValue()) || (GetMiscValueB() != 0 && spellInfo.HasLabel((uint)GetMiscValueB()));
|
||||
}, rate, apply);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ShowConfirmationPrompt)]
|
||||
[AuraEffectHandler(AuraType.ShowConfirmationPromptWithDifficulty)]
|
||||
void HandleShowConfirmationPrompt(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
|
||||
Reference in New Issue
Block a user