Core/Spells: Fix unrelenting assault not proccing aura when overpower is used while target is casting.

Closes #5965
This commit is contained in:
Kandera
2012-04-05 12:46:51 -04:00
parent e3fd50b7f5
commit 9ae22e06f6
2 changed files with 52 additions and 0 deletions

View File

@@ -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');

View File

@@ -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();
}