aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKandera <KanderaDev@gmail.com>2012-04-05 12:46:51 -0400
committerKandera <KanderaDev@gmail.com>2012-04-05 12:46:51 -0400
commit9ae22e06f658f91b3064a2ac3f5dec9d2bde662a (patch)
tree706d549d1a5fe5b70a602e418f1a109550526246 /src
parente3fd50b7f5af048501cc952499a87c277b9d22d3 (diff)
Core/Spells: Fix unrelenting assault not proccing aura when overpower is used while target is casting.
Closes #5965
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp46
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();
}