Skip to content

Core/Spells: Implement druid talent Crashing Star #30783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=202497;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(202497, 'spell_dru_crashing_star');
25 changes: 25 additions & 0 deletions src/server/scripts/Spells/spell_druid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ enum DruidSpells
SPELL_DRUID_BRAMBLES_REFLECT = 203958,
SPELL_DRUID_BRISTLING_FUR_GAIN_RAGE = 204031,
SPELL_DRUID_CAT_FORM = 768,
SPELL_DRUID_CRASHING_STAR_TALENT = 468978,
SPELL_DRUID_CRASHING_STAR_DAMAGE = 468981,
SPELL_DRUID_CULTIVATION = 200390,
SPELL_DRUID_CULTIVATION_HEAL = 200389,
SPELL_DRUID_CURIOUS_BRAMBLEPATCH = 330670,
Expand Down Expand Up @@ -425,6 +427,28 @@ class spell_dru_celestial_alignment : public SpellScript
}
};

// Called by 202497 - Shooting Stars
class spell_dru_crashing_star : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_CRASHING_STAR_TALENT, SPELL_DRUID_CRASHING_STAR_DAMAGE });
}

void HandleDamage(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

caster never null in `SpellScript´ unless gob target is involved

if (AuraEffect const* shootingStars = caster->GetAuraEffect(SPELL_DRUID_CRASHING_STAR_TALENT, EFFECT_0))
if (roll_chance_i(shootingStars->GetAmount()))
caster->CastSpell(GetHitUnit(), SPELL_DRUID_CRASHING_STAR_DAMAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
}

void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dru_crashing_star::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};

// 774 - Rejuvenation
// 155777 - Rejuventation (Germination)
class spell_dru_cultivation : public AuraScript
Expand Down Expand Up @@ -2329,6 +2353,7 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_bristling_fur);
RegisterSpellScript(spell_dru_cat_form);
RegisterSpellScript(spell_dru_celestial_alignment);
RegisterSpellScript(spell_dru_crashing_star);
RegisterSpellScript(spell_dru_cultivation);
RegisterSpellScript(spell_dru_dash);
RegisterSpellScript(spell_dru_earthwarden);
Expand Down
Loading