diff options
author | Kandera <KanderaDev@gmail.com> | 2012-04-05 12:46:51 -0400 |
---|---|---|
committer | Kandera <KanderaDev@gmail.com> | 2012-04-05 12:46:51 -0400 |
commit | 9ae22e06f658f91b3064a2ac3f5dec9d2bde662a (patch) | |
tree | 706d549d1a5fe5b70a602e418f1a109550526246 | |
parent | e3fd50b7f5af048501cc952499a87c277b9d22d3 (diff) |
Core/Spells: Fix unrelenting assault not proccing aura when overpower is used while target is casting.
Closes #5965
-rw-r--r-- | sql/updates/world/2012_04_05_00_world_spell_script_names.sql | 6 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 46 |
2 files changed, 52 insertions, 0 deletions
diff --git a/sql/updates/world/2012_04_05_00_world_spell_script_names.sql b/sql/updates/world/2012_04_05_00_world_spell_script_names.sql new file mode 100644 index 00000000000..43f6760e8d6 --- /dev/null +++ b/sql/updates/world/2012_04_05_00_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` in (7384,7887,11584,11585); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(7384, 'spell_warr_overpower'), +(7887, 'spell_warr_overpower'), +(11584, 'spell_warr_overpower'), +(11585, 'spell_warr_overpower'); 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(); } |