diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 1084398c37d..c87c2e05289 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -413,6 +413,51 @@ class spell_warr_bloodthirst : public SpellScriptLoader } }; +enum Overpower +{ + SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859, + SPELL_UNRELENTING_ASSAULT_RANK_2 = 46860, + SPELL_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, + SPELL_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, +}; + +class spell_warr_overpower : public SpellScriptLoader +{ +public: + spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { } + + class spell_warr_overpower_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_overpower_SpellScript); + + void HandleEffect(SpellEffIndex /* effIndex */) + { + uint32 spellId = 0; + if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_1)) + spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_1; + else if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_2)) + spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_2; + + if (!spellId) + return; + + Unit* target = GetHitUnit(); + if (target->HasUnitState(UNIT_STATE_CASTING)) + GetCaster()->CastSpell(target, spellId, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_overpower_SpellScript(); + } +}; + void AddSC_warrior_spell_scripts() { new spell_warr_last_stand(); @@ -424,4 +469,5 @@ void AddSC_warrior_spell_scripts() new spell_warr_execute(); new spell_warr_concussion_blow(); new spell_warr_bloodthirst(); + new spell_warr_overpower(); } |