Core/Spells: Fix hunter "Steady Shot" focus regen

Closes #9553
This commit is contained in:
Vincent-Michael
2013-07-22 02:48:40 +02:00
parent 95407b1b9d
commit 41311da2de
2 changed files with 44 additions and 0 deletions

View File

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

View File

@@ -53,6 +53,7 @@ enum HunterSpells
SPELL_HUNTER_READINESS = 23989,
SPELL_HUNTER_SNIPER_TRAINING_R1 = 53302,
SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 = 64418,
SPELL_HUNTER_STEADY_SHOT_FOCUS = 77443,
SPELL_HUNTER_THRILL_OF_THE_HUNT = 34720,
SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543,
};
@@ -811,6 +812,45 @@ class spell_hun_sniper_training : public SpellScriptLoader
}
};
// 56641 - Steady Shot
class spell_hun_steady_shot : public SpellScriptLoader
{
public:
spell_hun_steady_shot() : SpellScriptLoader("spell_hun_steady_shot") { }
class spell_hun_steady_shot_SpellScript : public SpellScript
{
PrepareSpellScript(spell_hun_steady_shot_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_STEADY_SHOT_FOCUS))
return false;
return true;
}
bool Load() OVERRIDE
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void HandleOnHit()
{
GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_STEADY_SHOT_FOCUS, true);
}
void Register() OVERRIDE
{
OnHit += SpellHitFn(spell_hun_steady_shot_SpellScript::HandleOnHit);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_hun_steady_shot_SpellScript();
}
};
// 1515 - Tame Beast
class spell_hun_tame_beast : public SpellScriptLoader
{
@@ -993,6 +1033,7 @@ void AddSC_hunter_spell_scripts()
new spell_hun_readiness();
new spell_hun_scatter_shot();
new spell_hun_sniper_training();
new spell_hun_steady_shot();
new spell_hun_tame_beast();
new spell_hun_target_only_pet_and_owner();
new spell_hun_thrill_of_the_hunt();