aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDefu <estafeitor@gmail.com>2017-07-13 19:15:21 +0200
committerShauren <shauren.trinity@gmail.com>2017-07-13 19:15:21 +0200
commitbf55ebb2c4cbf07f3bfe2e9b50e1758fedd83e73 (patch)
treec4590b36000c6891e2d72ba5656181ee1861a9a7
parent9128b00f591432a7d17cedfd7934b46b99acae30 (diff)
Core/Spells: Fixed Hunter's Arcane Shot and Multi-Shot focus generation
Closes #19872
-rw-r--r--sql/updates/world/master/2017_07_13_00_world.sql5
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp75
2 files changed, 80 insertions, 0 deletions
diff --git a/sql/updates/world/master/2017_07_13_00_world.sql b/sql/updates/world/master/2017_07_13_00_world.sql
new file mode 100644
index 00000000000..1ffa26e243a
--- /dev/null
+++ b/sql/updates/world/master/2017_07_13_00_world.sql
@@ -0,0 +1,5 @@
+-- Arcane shot
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_hun_arcane_shot','spell_hun_multi_shot');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(185358,'spell_hun_arcane_shot'),
+(2643,'spell_hun_multi_shot');
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index bc2a781f3ab..c7798b25c37 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -32,6 +32,7 @@
enum HunterSpells
{
+ SPELL_HUNTER_ARCANE_SHOT_FOCUS = 187675,
SPELL_HUNTER_ASPECT_CHEETAH_SLOW = 186258,
SPELL_HUNTER_BESTIAL_WRATH = 19574,
SPELL_HUNTER_CHIMERA_SHOT_HEAL = 53353,
@@ -46,6 +47,7 @@ enum HunterSpells
SPELL_HUNTER_LONE_WOLF = 155228,
SPELL_HUNTER_MASTERS_CALL_TRIGGERED = 62305,
SPELL_HUNTER_MISDIRECTION_PROC = 35079,
+ SPELL_HUNTER_MULTI_SHOT_FOCUS = 213363,
SPELL_HUNTER_PET_LAST_STAND_TRIGGERED = 53479,
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX = 55709,
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114,
@@ -116,6 +118,38 @@ class spell_hun_ancient_hysteria : public SpellScriptLoader
}
};
+// 185358 - Arcane Shot
+class spell_hun_arcane_shot : public SpellScriptLoader
+{
+ public:
+ spell_hun_arcane_shot() : SpellScriptLoader("spell_hun_arcane_shot") { }
+
+ class spell_hun_arcane_shot_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hun_arcane_shot_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_HUNTER_ARCANE_SHOT_FOCUS });
+ }
+
+ void HandleOnHit()
+ {
+ GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_ARCANE_SHOT_FOCUS, true);
+ }
+
+ void Register() override
+ {
+ OnHit += SpellHitFn(spell_hun_arcane_shot_SpellScript::HandleOnHit);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_hun_arcane_shot_SpellScript();
+ }
+};
+
// 186257 - Aspect of the Cheetah
class spell_hun_aspect_cheetah : public SpellScriptLoader
{
@@ -532,6 +566,45 @@ class spell_hun_misdirection_proc : public SpellScriptLoader
}
};
+// 2643 - Multi-Shot
+class spell_hun_multi_shot : public SpellScriptLoader
+{
+ public:
+ spell_hun_multi_shot() : SpellScriptLoader("spell_hun_multi_shot") { }
+
+ class spell_hun_multi_shot_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hun_multi_shot_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_HUNTER_MULTI_SHOT_FOCUS });
+ }
+
+ bool Load() override
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleOnHit()
+ {
+ // We need to check hunter's spec because it doesn't generate focus on other specs than MM
+ if (GetCaster()->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID) == TALENT_SPEC_HUNTER_MARKSMAN)
+ GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_MULTI_SHOT_FOCUS, true);
+ }
+
+ void Register() override
+ {
+ OnHit += SpellHitFn(spell_hun_multi_shot_SpellScript::HandleOnHit);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_hun_multi_shot_SpellScript();
+ }
+};
+
// 54044 - Pet Carrion Feeder
class spell_hun_pet_carrion_feeder : public SpellScriptLoader
{
@@ -1057,6 +1130,7 @@ class spell_hun_tnt : public SpellScriptLoader
void AddSC_hunter_spell_scripts()
{
new spell_hun_ancient_hysteria();
+ new spell_hun_arcane_shot();
new spell_hun_aspect_cheetah();
new spell_hun_chimera_shot();
new spell_hun_cobra_shot();
@@ -1068,6 +1142,7 @@ void AddSC_hunter_spell_scripts()
new spell_hun_masters_call();
new spell_hun_misdirection();
new spell_hun_misdirection_proc();
+ new spell_hun_multi_shot();
new spell_hun_pet_carrion_feeder();
new spell_hun_pet_heart_of_the_phoenix();
new spell_hun_readiness();