Core/Spells: Fixed Hunter's Arcane Shot and Multi-Shot focus generation

Closes #19872
This commit is contained in:
Defu
2017-07-13 19:15:21 +02:00
committed by Shauren
parent 9128b00f59
commit bf55ebb2c4
2 changed files with 80 additions and 0 deletions

View File

@@ -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');

View File

@@ -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();