Core/Spells: Reset Mangle cooldown in Berserk (#22000)

This commit is contained in:
DanVS
2018-06-05 04:01:27 +03:00
committed by Keader
parent 6cf8bd5ae7
commit 3bd9337d9f
2 changed files with 30 additions and 0 deletions

View File

@@ -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();