Core/Spells: Fixed Impending Victory and prevent activating victory rush in fury spec

Closes #19297
This commit is contained in:
HannibalRoG
2017-05-14 22:06:16 +02:00
committed by Shauren
parent 0cec2af762
commit cfdf0b2a86
2 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
-- Class: Warrior, Spec: Arms, Protection, Spells: Impending Victory & Victorious State
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warr_impending_victory','spell_warr_victorious_state');
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(202168,'spell_warr_impending_victory'),
(32215,'spell_warr_victorious_state');

View File

@@ -44,6 +44,8 @@ enum WarriorSpells
SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP = 159708,
SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP_BUFF = 133278,
SPELL_WARRIOR_HEROIC_LEAP_JUMP = 178368,
SPELL_WARRIOR_IMPENDING_VICTORY = 202168,
SPELL_WARRIOR_IMPENDING_VICTORY_HEAL = 202166,
SPELL_WARRIOR_IMPROVED_HEROIC_LEAP = 157449,
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
@@ -419,6 +421,40 @@ public:
}
};
// 202168 - Impending Victory
class spell_warr_impending_victory : public SpellScriptLoader
{
public:
spell_warr_impending_victory() : SpellScriptLoader("spell_warr_impending_victory") { }
class spell_warr_impending_victory_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_impending_victory_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_IMPENDING_VICTORY_HEAL });
}
void HandleAfterCast()
{
Unit* caster = GetCaster();
caster->CastSpell(caster, SPELL_WARRIOR_IMPENDING_VICTORY_HEAL, true);
caster->RemoveAurasDueToSpell(SPELL_WARRIOR_VICTORIOUS);
}
void Register() override
{
AfterCast += SpellCastFn(spell_warr_impending_victory_SpellScript::HandleAfterCast);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_warr_impending_victory_SpellScript();
}
};
// 5246 - Intimidating Shout
class spell_warr_intimidating_shout : public SpellScriptLoader
{
@@ -1128,6 +1164,41 @@ class spell_warr_t3_prot_8p_bonus : public SpellScriptLoader
}
};
// 32215 - Victorious State
class spell_warr_victorious_state : public SpellScriptLoader
{
public:
spell_warr_victorious_state() : SpellScriptLoader("spell_warr_victorious_state") { }
class spell_warr_victorious_state_Aurascript : public AuraScript
{
PrepareAuraScript(spell_warr_victorious_state_Aurascript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_IMPENDING_VICTORY });
}
void HandleOnProc(AuraEffect const* /*aurEff*/, ProcEventInfo& procInfo)
{
if (procInfo.GetActor()->GetTypeId() == TYPEID_PLAYER && procInfo.GetActor()->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID) == TALENT_SPEC_WARRIOR_FURY)
PreventDefaultAction();
procInfo.GetActor()->GetSpellHistory()->ResetCooldown(SPELL_WARRIOR_IMPENDING_VICTORY, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_warr_victorious_state_Aurascript::HandleOnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_warr_victorious_state_Aurascript();
}
};
// 34428 - Victory Rush
class spell_warr_victory_rush : public SpellScriptLoader
{
@@ -1280,6 +1351,7 @@ void AddSC_warrior_spell_scripts()
new spell_warr_execute();
new spell_warr_heroic_leap();
new spell_warr_heroic_leap_jump();
new spell_warr_impending_victory();
new spell_warr_intimidating_shout();
new spell_warr_item_t10_prot_4p_bonus();
new spell_warr_lambs_to_the_slaughter();
@@ -1298,6 +1370,7 @@ void AddSC_warrior_spell_scripts()
new spell_warr_sweeping_strikes();
new spell_warr_sword_and_board();
new spell_warr_t3_prot_8p_bonus();
new spell_warr_victorious_state();
new spell_warr_victory_rush();
new spell_warr_vigilance();
new spell_warr_vigilance_trigger();