Scripts/Druid: Implemented Shooting Stars (#29125)

This commit is contained in:
Aqua Deus
2023-07-13 19:24:08 +02:00
committed by GitHub
parent 008c15ab6b
commit e66f2ada53
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_dru_shooting_stars';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(164812, 'spell_dru_shooting_stars'),
(164815, 'spell_dru_shooting_stars');

View File

@@ -85,6 +85,8 @@ enum DruidSpells
SPELL_DRUID_REJUVENATION_T10_PROC = 70691,
SPELL_DRUID_RESTORATION_T10_2P_BONUS = 70658,
SPELL_DRUID_SAVAGE_ROAR = 62071,
SPELL_DRUID_SHOOTING_STARS = 202342,
SPELL_DRUID_SHOOTING_STARS_DAMAGE = 202497,
SPELL_DRUID_SKULL_BASH_CHARGE = 221514,
SPELL_DRUID_SKULL_BASH_INTERRUPT = 93985,
SPELL_DRUID_SUNFIRE_DAMAGE = 164815,
@@ -972,6 +974,31 @@ class spell_dru_savage_roar_aura : public AuraScript
}
};
// 164815 - Sunfire
// 164812 - Moonfire
class spell_dru_shooting_stars : public AuraScript
{
PrepareAuraScript(spell_dru_shooting_stars);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_SHOOTING_STARS, SPELL_DRUID_SHOOTING_STARS_DAMAGE });
}
void OnTick(AuraEffect const* /*aurEff*/)
{
if (Unit* caster = GetCaster())
if (AuraEffect const* shootingStars = caster->GetAuraEffect(SPELL_DRUID_SHOOTING_STARS, EFFECT_0))
if (roll_chance_i(shootingStars->GetAmount()))
caster->CastSpell(GetTarget(), SPELL_DRUID_SHOOTING_STARS_DAMAGE, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dru_shooting_stars::OnTick, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
}
};
// 106839 - Skull Bash
class spell_dru_skull_bash : public SpellScript
{
@@ -1662,6 +1689,7 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_prowl);
RegisterSpellScript(spell_dru_rip);
RegisterSpellAndAuraScriptPair(spell_dru_savage_roar, spell_dru_savage_roar_aura);
RegisterSpellScript(spell_dru_shooting_stars);
RegisterSpellScript(spell_dru_skull_bash);
RegisterSpellScript(spell_dru_stampeding_roar);
RegisterSpellScript(spell_dru_starfall_dummy);