fix(Scripts/BoreanTundra): Script Soul Deflection spell (#22931)

This commit is contained in:
Andrew
2025-09-16 06:59:02 -03:00
committed by GitHub
parent f31a7281bd
commit 56f2a8e4f3
2 changed files with 33 additions and 0 deletions

View File

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

View File

@@ -2143,6 +2143,34 @@ class spell_necropolis_beam: public SpellScript
} }
}; };
enum SoulDeflectionSpells
{
SPELL_SOUL_DEFLECTION_DAMAGE = 51011
};
class spell_soul_deflection : public AuraScript
{
PrepareAuraScript(spell_soul_deflection);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SOUL_DEFLECTION_DAMAGE });
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
if (!eventInfo.GetDamageInfo() || !eventInfo.GetDamageInfo()->GetDamage() || !GetTarget())
return;
GetCaster()->CastCustomSpell(SPELL_SOUL_DEFLECTION_DAMAGE, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), GetTarget(), true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_soul_deflection::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
void AddSC_borean_tundra() void AddSC_borean_tundra()
{ {
RegisterSpellScript(spell_q11919_q11940_drake_hunt_aura); RegisterSpellScript(spell_q11919_q11940_drake_hunt_aura);
@@ -2168,4 +2196,5 @@ void AddSC_borean_tundra()
new npc_bloodmage_laurith(); new npc_bloodmage_laurith();
RegisterCreatureAI(npc_jenny); RegisterCreatureAI(npc_jenny);
RegisterSpellScript(spell_necropolis_beam); RegisterSpellScript(spell_necropolis_beam);
RegisterSpellScript(spell_soul_deflection);
} }