Scripts/Hunter: Implement Rapid Fire (#29099)

This commit is contained in:
Naddley
2023-06-27 20:57:41 +02:00
committed by GitHub
parent 3d0831e80a
commit acb7e72470
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
-- 257044 - Rapid Fire
DELETE FROM `spell_script_names` WHERE `spell_id` IN (257044, 257045);
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(257044, 'spell_hun_rapid_fire'),
(257045, 'spell_hun_rapid_fire_damage');

View File

@@ -50,6 +50,8 @@ enum HunterSpells
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711,
SPELL_HUNTER_POSTHASTE_INCREASE_SPEED = 118922,
SPELL_HUNTER_POSTHASTE_TALENT = 109215,
SPELL_HUNTER_RAPID_FIRE_DAMAGE = 257045,
SPELL_HUNTER_RAPID_FIRE_ENERGIZE = 263585,
SPELL_HUNTER_STEADY_SHOT_FOCUS = 77443,
SPELL_HUNTER_T9_4P_GREATNESS = 68130,
SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481
@@ -430,6 +432,49 @@ class spell_hun_posthaste : public SpellScript
}
};
// 257044 - Rapid Fire
class spell_hun_rapid_fire : public AuraScript
{
PrepareAuraScript(spell_hun_rapid_fire);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_HUNTER_RAPID_FIRE_DAMAGE });
}
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
if (Unit* caster = GetCaster())
caster->CastSpell(GetTarget(), SPELL_HUNTER_RAPID_FIRE_DAMAGE, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_rapid_fire::HandlePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
// 257045 - Rapid Fire Damage
class spell_hun_rapid_fire_damage : public SpellScript
{
PrepareSpellScript(spell_hun_rapid_fire_damage);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_HUNTER_RAPID_FIRE_ENERGIZE });
}
void HandleHit(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(nullptr, SPELL_HUNTER_RAPID_FIRE_ENERGIZE, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_hun_rapid_fire_damage::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
// 53480 - Roar of Sacrifice
class spell_hun_roar_of_sacrifice : public AuraScript
{
@@ -643,6 +688,8 @@ void AddSC_hunter_spell_scripts()
RegisterSpellScript(spell_hun_multi_shot);
RegisterSpellScript(spell_hun_pet_heart_of_the_phoenix);
RegisterSpellScript(spell_hun_posthaste);
RegisterSpellScript(spell_hun_rapid_fire);
RegisterSpellScript(spell_hun_rapid_fire_damage);
RegisterSpellScript(spell_hun_roar_of_sacrifice);
RegisterSpellScript(spell_hun_scatter_shot);
RegisterSpellScript(spell_hun_steady_shot);