Fix (Core/Scripts): Warrior T3 8P Bonus Fix (#10561)

* Fix (Core/Scripts): Warrior T3 8P Bonus Fix

* Update spell_warrior.cpp

* Update spell_warrior.cpp
This commit is contained in:
TheDdraig
2022-02-09 18:56:24 +00:00
committed by GitHub
parent 7bed30a52d
commit 336967b324
2 changed files with 37 additions and 0 deletions

View File

@@ -795,6 +795,38 @@ class spell_warr_glyph_of_sunder_armor : public AuraScript
}
};
// Spell 28845 - Cheat Death
enum CheatDeath
{
SPELL_CHEAT_DEATH_TRIGGER = 28846
};
class spell_warr_t3_prot_8p_bonus : public AuraScript
{
PrepareAuraScript(spell_warr_t3_prot_8p_bonus);
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetActionTarget() && eventInfo.GetActionTarget()->GetHealthPct() <= 20.0f;
}
void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
if (Unit* target = eventInfo.GetActionTarget())
{
target->CastSpell(target, SPELL_CHEAT_DEATH_TRIGGER, true);
}
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_warr_t3_prot_8p_bonus::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_warr_t3_prot_8p_bonus::HandleEffectProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 20230 - Retaliation
class spell_warr_retaliation : public AuraScript
{
@@ -854,4 +886,5 @@ void AddSC_warrior_spell_scripts()
RegisterSpellScript(spell_warr_sweeping_strikes);
RegisterSpellScript(spell_warr_vigilance);
RegisterSpellScript(spell_warr_vigilance_trigger);
RegisterSpellScript(spell_warr_t3_prot_8p_bonus);
}