mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Core/Spells: Reset Mangle cooldown in Berserk (#22000)
This commit is contained in:
@@ -93,6 +93,11 @@ enum DruidSpells
|
||||
SPELL_DRUID_FRENZIED_REGENERATION_HEAL = 22845
|
||||
};
|
||||
|
||||
enum MiscSpells
|
||||
{
|
||||
SPELL_CATEGORY_MANGLE_BEAR = 971
|
||||
};
|
||||
|
||||
// 22812 - Barkskin
|
||||
class spell_dru_barkskin : public SpellScriptLoader
|
||||
{
|
||||
@@ -177,6 +182,27 @@ class spell_dru_bear_form_passive : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -50334 - Berserk
|
||||
class spell_dru_berserk : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dru_berserk);
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
// Remove cooldown on Mangle (bear)
|
||||
GetTarget()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||
return spellInfo && spellInfo->GetCategory() == SPELL_CATEGORY_MANGLE_BEAR;
|
||||
}, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dru_berserk::HandleEffectApply, EFFECT_1, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// -1850 - Dash
|
||||
class spell_dru_dash : public SpellScriptLoader
|
||||
{
|
||||
@@ -2355,6 +2381,7 @@ void AddSC_druid_spell_scripts()
|
||||
{
|
||||
new spell_dru_barkskin();
|
||||
new spell_dru_bear_form_passive();
|
||||
RegisterAuraScript(spell_dru_berserk);
|
||||
new spell_dru_dash();
|
||||
new spell_dru_eclipse();
|
||||
new spell_dru_enrage();
|
||||
|
||||
Reference in New Issue
Block a user