Scripts/Spells: Implement dh talent "Soul Carver" (#31503)

This commit is contained in:
Aqua Deus
2026-01-31 23:08:08 +01:00
committed by GitHub
parent 930d86abd0
commit ac08915142
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dh_soul_carver';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(207407, 'spell_dh_soul_carver');

View File

@@ -1928,6 +1928,45 @@ using at_dh_shattered_souls_vengeance_demon = at_dh_shattered_souls<SPELL_DH_CON
using at_dh_shattered_souls_vengeance_lesser = at_dh_shattered_souls<SPELL_DH_CONSUME_SOUL_VENGEANCE_LESSER>;
using at_dh_shattered_souls_vengeance_shattered = at_dh_shattered_souls<SPELL_DH_CONSUME_SOUL_VENGEANCE_SHATTERED>;
// 207407 - Soul Carver
class spell_dh_soul_carver : public SpellScript
{
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } })
&& spell_dh_shattered_souls_base_lesser::Validate();
}
void HandleSoulFragments(SpellEffIndex /*effIndex*/) const
{
spell_dh_shattered_souls_base_lesser::CreateFragments(GetHitUnit(), GetCaster(), GetEffectInfo(EFFECT_2).CalcValue(GetCaster()));
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dh_soul_carver::HandleSoulFragments, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
class spell_dh_soul_carver_aura : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return spell_dh_shattered_souls_base_lesser::Validate();
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) const
{
if (Unit* caster = GetCaster())
spell_dh_shattered_souls_base_lesser::CreateFragments(GetTarget(), caster, GetEffectInfo(EFFECT_3).CalcValue(caster));
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dh_soul_carver_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
// 210788 - Soul Fragments
class spell_dh_soul_fragments_damage_taken_tracker : public AuraScript
{
@@ -2322,6 +2361,7 @@ void AddSC_demon_hunter_spell_scripts()
RegisterSpellScript(spell_dh_sigil_of_flame);
RegisterSpellScriptWithArgs(spell_dh_elysian_decree, "spell_dh_sigil_of_spite", SPELL_DH_SIGIL_OF_SPITE);
RegisterSpellScript(spell_dh_soulmonger);
RegisterSpellAndAuraScriptPair(spell_dh_soul_carver, spell_dh_soul_carver_aura);
RegisterSpellScript(spell_dh_soul_fragments_damage_taken_tracker);
RegisterSpellScript(spell_dh_student_of_suffering);
RegisterSpellScript(spell_dh_tactical_retreat);