diff options
| author | DanVS <33371360+DanVS@users.noreply.github.com> | 2018-06-05 04:01:27 +0300 |
|---|---|---|
| committer | Keader <keader.android@gmail.com> | 2018-06-04 22:01:27 -0300 |
| commit | 3bd9337d9fe95b78751bf3aa90ee27daf6935872 (patch) | |
| tree | 094dac16aa879dc624cb720ce798a0a5beddcb70 | |
| parent | 6cf8bd5ae755a4af07f59642cf98a7bbf6ddd48e (diff) | |
Core/Spells: Reset Mangle cooldown in Berserk (#22000)
| -rw-r--r-- | sql/updates/world/3.3.5/2018_06_04_00_world.sql | 3 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 27 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2018_06_04_00_world.sql b/sql/updates/world/3.3.5/2018_06_04_00_world.sql new file mode 100644 index 00000000000..be9eebe90cc --- /dev/null +++ b/sql/updates/world/3.3.5/2018_06_04_00_world.sql @@ -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'); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 61db9b82bc5..589f7825041 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -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(); |
