Skip to content
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

Scripts/Spells: Updated paladin script for spell Blinding Light #30609

Merged
merged 4 commits into from
Feb 18, 2025
Merged
Changes from 1 commit
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
11 changes: 7 additions & 4 deletions src/server/scripts/Spells/spell_paladin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,18 @@ class spell_pal_blinding_light : public SpellScript
return ValidateSpellInfo({ SPELL_PALADIN_BLINDING_LIGHT_EFFECT });
}

void HandleDummy(SpellEffIndex /*effIndex*/)
void HandleOnHit()
{
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, SPELL_PALADIN_BLINDING_LIGHT_EFFECT, true);
Unit* caster = GetHitUnit();
caster->CastSpell(caster, SPELL_PALADIN_BLINDING_LIGHT_EFFECT, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.TriggeringSpell = GetSpell()
});
}

void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pal_blinding_light::HandleDummy, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
OnHit += SpellHitFn(spell_pal_blinding_light::HandleOnHit);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not OnEffectHitTarget? I'm curious

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, why?

Copy link
Contributor

@Nyr97 Nyr97 Feb 15, 2025

Choose a reason for hiding this comment

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

I think he might have a sort of mixed thought: since the triggered spell uses AoE target as TargetB, he might have thought that he doesn't need to hook to OnEffectHitTarget. However, the main spell uses TARGET_UNIT_CASTER, so OnEffectHitTarget should be ok here.

}
};

Expand Down
Loading