From 63069bc0c536f00b64d0aa2524298ab4a1a419d8 Mon Sep 17 00:00:00 2001 From: Aqua Deus <95978183+aquadeus@users.noreply.github.com> Date: Thu, 19 Feb 2026 20:53:01 +0100 Subject: [PATCH] Scripts/Spells: Implement dk talent Blood Bond talent (#31652) --- .../world/master/2026_02_19_03_world.sql | 7 ++ src/server/scripts/Pet/pet_dk.cpp | 30 +++++++-- src/server/scripts/Spells/spell_dk.cpp | 65 +++++++++++++++++++ 3 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 sql/updates/world/master/2026_02_19_03_world.sql diff --git a/sql/updates/world/master/2026_02_19_03_world.sql b/sql/updates/world/master/2026_02_19_03_world.sql new file mode 100644 index 0000000000..7d8596a566 --- /dev/null +++ b/sql/updates/world/master/2026_02_19_03_world.sql @@ -0,0 +1,7 @@ +UPDATE `creature_template` SET `RegenHealth`=0, `ScriptName`='npc_pet_dk_risen_ghoul' WHERE `entry`=26125; +UPDATE `creature_template` SET `ScriptName`='npc_pet_dk_bloodworm' WHERE `entry`=28017; + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_dk_birth', 'spell_dk_blood_bond_periodic'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(1217740, 'spell_dk_birth'), +(1267044, 'spell_dk_blood_bond_periodic'); diff --git a/src/server/scripts/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp index 55f7fb6d13..dfbc3629cc 100644 --- a/src/server/scripts/Pet/pet_dk.cpp +++ b/src/server/scripts/Pet/pet_dk.cpp @@ -28,12 +28,27 @@ enum DeathKnightSpells { + SPELL_DK_BIRTH = 1217740, SPELL_DK_SUMMON_GARGOYLE_1 = 49206, SPELL_DK_SUMMON_GARGOYLE_2 = 50514, SPELL_DK_DISMISS_GARGOYLE = 50515, SPELL_DK_SANCTUARY = 54661 }; +// 28017 - Bloodworm +struct npc_pet_dk_bloodworm : public AggressorAI +{ + npc_pet_dk_bloodworm(Creature* creature) : AggressorAI(creature) { } + + bool CanAIAttack(Unit const* target) const override + { + Unit* owner = me->GetOwner(); + if (owner && !target->IsInCombatWith(owner)) + return false; + return AggressorAI::CanAIAttack(target); + } +}; + struct npc_pet_dk_ebon_gargoyle : CasterAI { npc_pet_dk_ebon_gargoyle(Creature* creature) : CasterAI(creature) { } @@ -100,23 +115,28 @@ struct npc_pet_dk_ebon_gargoyle : CasterAI } }; -struct npc_pet_dk_guardian : public AggressorAI +// 26125 - Risen Ghoul +struct npc_pet_dk_risen_ghoul : public AggressorAI { - npc_pet_dk_guardian(Creature* creature) : AggressorAI(creature) { } + npc_pet_dk_risen_ghoul(Creature* creature) : AggressorAI(creature) { } bool CanAIAttack(Unit const* target) const override { - if (!target) - return false; Unit* owner = me->GetOwner(); if (owner && !target->IsInCombatWith(owner)) return false; return AggressorAI::CanAIAttack(target); } + + void JustAppeared() override + { + me->CastSpell(me, SPELL_DK_BIRTH, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } }; void AddSC_deathknight_pet_scripts() { + RegisterCreatureAI(npc_pet_dk_bloodworm); RegisterCreatureAI(npc_pet_dk_ebon_gargoyle); - RegisterCreatureAI(npc_pet_dk_guardian); + RegisterCreatureAI(npc_pet_dk_risen_ghoul); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 79d3cdb35e..6c2ecae1fa 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -46,6 +46,10 @@ enum DeathKnightSpells SPELL_DK_BLINDING_SLEET_SLOW = 317898, SPELL_DK_BLOOD = 137008, SPELL_DK_BLOODDRINKER_DEBUFF = 458687, + SPELL_DK_BLOOD_BOND_PERIODIC = 1267044, + SPELL_DK_BLOOD_BOND_TALENT = 1267028, + SPELL_DK_BLOOD_BOND_GHOUL_HEALTH_PCT = 1267032, + SPELL_DK_BLOOD_BOND_PLAYER_HEAL_PCT = 1277365, SPELL_DK_BLOOD_PLAGUE = 55078, SPELL_DK_BLOOD_SHIELD_ABSORB = 77535, SPELL_DK_BLOOD_SHIELD_MASTERY = 77513, @@ -72,6 +76,7 @@ enum DeathKnightSpells SPELL_DK_FROST_FEVER = 55095, SPELL_DK_FROST_SCYTHE = 207230, SPELL_DK_FROST_SHIELD = 207203, + SPELL_DK_GHOUL_BIRTH = 1217759, SPELL_DK_GLYPH_OF_FOUL_MENAGERIE = 58642, SPELL_DK_GLYPH_OF_THE_GEIST = 58640, SPELL_DK_GLYPH_OF_THE_SKELETON = 146652, @@ -273,6 +278,35 @@ class spell_dk_army_transform : public SpellScript } }; +// 1217740 - Birth (used by ghoul on spawn) +class spell_dk_birth : public SpellScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DK_GHOUL_BIRTH, SPELL_DK_BLOOD_BOND_TALENT, SPELL_DK_BLOOD_BOND_PERIODIC }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) const + { + Unit* caster = GetCaster(); + Unit* owner = GetCaster()->GetOwner(); + + CastSpellExtraArgs args; + args.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR; + args.TriggeringSpell = GetSpell(); + + caster->CastSpell(caster, SPELL_DK_GHOUL_BIRTH, args); + + if (owner->HasAura(SPELL_DK_BLOOD_BOND_TALENT)) + caster->CastSpell(caster, SPELL_DK_BLOOD_BOND_PERIODIC, args); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_dk_birth::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + // 207167 - Blinding Sleet class spell_dk_blinding_sleet : public AuraScript { @@ -338,6 +372,35 @@ class spell_dk_blood_boil : public SpellScript } }; +// 1267044 - Blood Bond +class spell_dk_blood_bond_periodic : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DK_BLOOD_BOND_TALENT, SPELL_DK_BLOOD_BOND_PLAYER_HEAL_PCT, SPELL_DK_BLOOD_BOND_GHOUL_HEALTH_PCT }); + } + + void HandleDummyTick(AuraEffect const* aurEff) const + { + Unit* owner = GetTarget()->GetOwner(); + Unit* target = GetTarget(); + SpellInfo const* bloodBondTalent = sSpellMgr->AssertSpellInfo(SPELL_DK_BLOOD_BOND_TALENT, GetCastDifficulty()); + if (owner->GetHealthPct() >= bloodBondTalent->GetEffect(EFFECT_0).CalcValue(owner)) + return; + + CastSpellExtraArgs args; + args.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR; + args.TriggeringAura = aurEff; + target->CastSpell(target, SPELL_DK_BLOOD_BOND_GHOUL_HEALTH_PCT, args); + owner->CastSpell(owner, SPELL_DK_BLOOD_BOND_PLAYER_HEAL_PCT, args); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_dk_blood_bond_periodic::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } +}; + // 374504 - Brittle class spell_dk_brittle : public AuraScript { @@ -1436,9 +1499,11 @@ void AddSC_deathknight_spell_scripts() RegisterSpellScriptWithArgs(spell_dk_apply_bone_shield, "spell_dk_marrowrend_apply_bone_shield", EFFECT_2); RegisterSpellScriptWithArgs(spell_dk_apply_bone_shield, "spell_dk_deaths_caress_apply_bone_shield", EFFECT_2); RegisterSpellScript(spell_dk_army_transform); + RegisterSpellScript(spell_dk_birth); RegisterSpellScript(spell_dk_blinding_sleet); RegisterSpellScript(spell_dk_blooddrinker); RegisterSpellScript(spell_dk_blood_boil); + RegisterSpellScript(spell_dk_blood_bond_periodic); RegisterSpellScript(spell_dk_brittle); RegisterSpellScript(spell_dk_crimson_scourge); RegisterSpellScript(spell_dk_dancing_rune_weapon);