fix(Scripts): Victory rush killing blow (#6349)

This commit is contained in:
Cláudio Costa
2021-06-18 16:07:33 +01:00
committed by GitHub
parent 289f140ab1
commit 3a30fe3d71
2 changed files with 40 additions and 0 deletions

View File

@@ -93,6 +93,41 @@ public:
}
};
class spell_warr_victory_rush : public SpellScriptLoader
{
public:
spell_warr_victory_rush() : SpellScriptLoader("spell_warr_victory_rush") { }
class spell_warr_victory_rush_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_victory_rush_SpellScript);
void VictoryRushHit()
{
if (Unit* player = GetCaster())
{
if (Unit* victim = GetHitUnit())
{
if (victim->isDead())
{
player->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, true);
}
}
}
}
void Register() override
{
AfterHit += SpellHitFn(spell_warr_victory_rush_SpellScript::VictoryRushHit);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_warr_victory_rush_SpellScript();
}
};
class spell_warr_intervene : public SpellScriptLoader
{
public:
@@ -963,6 +998,7 @@ void AddSC_warrior_spell_scripts()
new spell_warr_intervene();
new spell_warr_improved_spell_reflection();
new spell_warr_improved_spell_reflection_trigger();
new spell_warr_victory_rush();
// Theirs
new spell_warr_bloodthirst();