mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Core/Spells: Fix unrelenting assault not proccing aura when overpower is used while target is casting.
Closes #5965
This commit is contained in:
@@ -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');
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user