aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2013-07-22 02:48:40 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2013-07-22 02:49:19 +0200
commit41311da2dec98de97be32b4ac265332e6068f071 (patch)
tree308800d6df0805f374ffc79dbad51d28e8977e9c
parent95407b1b9d904488e25dff94c87fdce000192587 (diff)
Core/Spells: Fix hunter "Steady Shot" focus regen
Closes #9553
-rw-r--r--sql/updates/world/2013_07_22_02_world_spell_spell_script_names_434.sql3
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp41
2 files changed, 44 insertions, 0 deletions
diff --git a/sql/updates/world/2013_07_22_02_world_spell_spell_script_names_434.sql b/sql/updates/world/2013_07_22_02_world_spell_spell_script_names_434.sql
new file mode 100644
index 00000000000..3723575d273
--- /dev/null
+++ b/sql/updates/world/2013_07_22_02_world_spell_spell_script_names_434.sql
@@ -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');
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 3335442b106..7ead0966fad 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -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();