mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
Core/Spells: Fix warrior talent "Vigilance" vengeance effect
This commit is contained in:
@@ -38,7 +38,6 @@ enum WarriorSpells
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC = 12721,
|
||||
SPELL_WARRIOR_EXECUTE = 20647,
|
||||
SPELL_WARRIOR_GLYPH_OF_EXECUTION = 58367,
|
||||
SPELL_WARRIOR_GLYPH_OF_VIGILANCE = 63326,
|
||||
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
|
||||
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
|
||||
SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976,
|
||||
@@ -56,7 +55,9 @@ enum WarriorSpells
|
||||
SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859,
|
||||
SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_2 = 46860,
|
||||
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849,
|
||||
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850
|
||||
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850,
|
||||
SPELL_WARRIOR_VIGILANCE_PROC = 50725,
|
||||
SPELL_WARRIOR_VENGEANCE = 76691
|
||||
};
|
||||
|
||||
enum MiscSpells
|
||||
@@ -926,6 +927,70 @@ class spell_warr_victorious : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 50720 - Vigilance
|
||||
class spell_warr_vigilance : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_vigilance() : SpellScriptLoader("spell_warr_vigilance") { }
|
||||
|
||||
class spell_warr_vigilance_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warr_vigilance_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_VENGEANCE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load() OVERRIDE
|
||||
{
|
||||
_procTarget = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
_procTarget = GetCaster();
|
||||
return _procTarget && eventInfo.GetDamageInfo();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()));
|
||||
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_VIGILANCE_PROC, true, NULL, aurEff);
|
||||
_procTarget->CastCustomSpell(_procTarget, SPELL_WARRIOR_VENGEANCE, &damage, &damage, &damage, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (caster->HasAura(SPELL_WARRIOR_VENGEANCE))
|
||||
caster->RemoveAurasDueToSpell(SPELL_WARRIOR_VENGEANCE);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_warr_vigilance_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_vigilance_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _procTarget;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const OVERRIDE
|
||||
{
|
||||
return new spell_warr_vigilance_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 50725 Vigilance
|
||||
class spell_warr_vigilance_trigger : public SpellScriptLoader
|
||||
{
|
||||
@@ -981,5 +1046,6 @@ void AddSC_warrior_spell_scripts()
|
||||
new spell_warr_sweeping_strikes();
|
||||
new spell_warr_sword_and_board();
|
||||
new spell_warr_victorious();
|
||||
new spell_warr_vigilance();
|
||||
new spell_warr_vigilance_trigger();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user