Core/Spells: Reset Mangle cooldown in Berserk

This commit is contained in:
Aokromes
2018-06-09 07:32:16 +02:00
parent ad3dff69c1
commit c8f2f0c097
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dru_berserk';
INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES
(-50334,'spell_dru_berserk');

View File

@@ -67,6 +67,32 @@ enum DruidSpells
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178
};
enum MiscSpells
{
SPELL_CATEGORY_MANGLE_BEAR = 971
};
// -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
{
@@ -1283,6 +1309,7 @@ class spell_dru_wild_growth : public SpellScriptLoader
void AddSC_druid_spell_scripts()
{
RegisterAuraScript(spell_dru_berserk);
new spell_dru_dash();
new spell_dru_eclipse("spell_dru_eclipse_lunar");
new spell_dru_eclipse("spell_dru_eclipse_solar");