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:
Hondacrx
2025-06-16 17:21:48 -04:00
parent 3d043f984d
commit 7d46284519
3 changed files with 113 additions and 3 deletions
+29
View File
@@ -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)