Core/Spells: Fix warrior ability "Rallying Cry"

thx to @timh52280 for base script
Closes #10088
This commit is contained in:
Vincent-Michael
2013-06-24 19:55:07 +02:00
parent e6363ce2c5
commit ab8c3c2c9e
2 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=97462;
INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES
(97462, 'spell_warr_rallying_cry');

View File

@@ -41,6 +41,7 @@ enum WarriorSpells
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976,
SPELL_WARRIOR_RALLYING_CRY = 97463,
SPELL_WARRIOR_SLAM = 50782,
SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK = 26654,
SPELL_WARRIOR_TAUNT = 355,
@@ -435,6 +436,47 @@ class spell_warr_overpower : public SpellScriptLoader
}
};
// 97462 - Rallying Cry
class spell_warr_rallying_cry : public SpellScriptLoader
{
public:
spell_warr_rallying_cry() : SpellScriptLoader("spell_warr_rallying_cry") { }
class spell_warr_rallying_cry_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_rallying_cry_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_RALLYING_CRY))
return false;
return true;
}
bool Load()
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
int32 basePoints0 = int32(GetHitUnit()->CountPctFromMaxHealth(GetEffectValue()));
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_RALLYING_CRY, &basePoints0, NULL, NULL, true);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_rallying_cry_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_warr_rallying_cry_SpellScript();
}
};
// -772 - Rend
class spell_warr_rend : public SpellScriptLoader
{
@@ -736,6 +778,7 @@ void AddSC_warrior_spell_scripts()
new spell_warr_intimidating_shout();
new spell_warr_last_stand();
new spell_warr_overpower();
new spell_warr_rallying_cry();
new spell_warr_rend();
new spell_warr_shattering_throw();
new spell_warr_slam();