Scripts/Spells: Implement demon hunter talent "Essence Break" (#30555)

This commit is contained in:
Aqua Deus
2025-01-15 14:49:46 +01:00
committed by GitHub
parent 2c4d9ac977
commit e761a00672
3 changed files with 41 additions and 0 deletions

View File

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

View File

@@ -5262,6 +5262,12 @@ void SpellMgr::LoadSpellInfoTargetCaps()
spellInfo->_LoadSqrtTargetLimit(8, 0, 453034, EFFECT_1, {}, {});
});
// Essence Break
ApplySpellFix({ 258860 }, [](SpellInfo* spellInfo)
{
spellInfo->_LoadSqrtTargetLimit(8, 0, {}, EFFECT_1, {}, {});
});
// Inner Demon
ApplySpellFix({ 390137 }, [](SpellInfo* spellInfo)
{

View File

@@ -87,6 +87,7 @@ enum DemonHunterSpells
SPELL_DH_DEMONIC_TRAMPLE_DMG = 208645,
SPELL_DH_DEMONIC_TRAMPLE_STUN = 213491,
SPELL_DH_DEMONS_BITE = 162243,
SPELL_DH_ESSENCE_BREAK_DEBUFF = 320338,
SPELL_DH_EYE_BEAM = 198013,
SPELL_DH_EYE_BEAM_DAMAGE = 198030,
SPELL_DH_EYE_OF_LEOTHERAS_DMG = 206650,
@@ -594,6 +595,36 @@ class spell_dh_demon_spikes : public SpellScript
}
};
// 258860 - Essence Break
class spell_dh_essence_break : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DH_ESSENCE_BREAK_DEBUFF });
}
void HandleDebuff(SpellEffIndex /*effIndex*/) const
{
Unit* caster = GetCaster();
// debuff application is slightly delayed on official servers (after animation fully finishes playing)
caster->m_Events.AddEventAtOffset([caster, targets = CastSpellTargetArg(GetHitUnit())]() mutable
{
if (!targets.Targets)
return;
targets.Targets->Update(caster);
caster->CastSpell(targets, SPELL_DH_ESSENCE_BREAK_DEBUFF, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
}, 300ms);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dh_essence_break::HandleDebuff, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
// 198013 - Eye Beam
class spell_dh_eye_beam : public AuraScript
{
@@ -1307,6 +1338,7 @@ void AddSC_demon_hunter_spell_scripts()
RegisterSpellScript(spell_dh_darkness);
RegisterSpellScript(spell_dh_deflecting_spikes);
RegisterSpellScript(spell_dh_demon_spikes);
RegisterSpellScript(spell_dh_essence_break);
RegisterSpellScript(spell_dh_eye_beam);
RegisterSpellScript(spell_dh_fel_devastation);
RegisterSpellScript(spell_dh_fel_flame_fortification);