From e135e83183d26da86825ee74171afe6a2cd7d481 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Thu, 19 Feb 2026 14:29:08 -0600 Subject: [PATCH] fix(Scripts/Spells): fix Blood Presence not healing for damage dealt (#24765) Co-authored-by: blinkysc Co-authored-by: mik1893 --- .../rev_1771531781265186556.sql | 2 ++ src/server/scripts/Spells/spell_dk.cpp | 29 +++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1771531781265186556.sql diff --git a/data/sql/updates/pending_db_world/rev_1771531781265186556.sql b/data/sql/updates/pending_db_world/rev_1771531781265186556.sql new file mode 100644 index 000000000..35eaa2c31 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1771531781265186556.sql @@ -0,0 +1,2 @@ +-- Blood Presence (63611): rename script to match new class name +UPDATE `spell_script_names` SET `ScriptName` = 'spell_dk_improved_blood_presence_triggered' WHERE `spell_id` = 63611; diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 7b164e32d..06afadf85 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -60,6 +60,7 @@ enum DeathKnightSpells SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1 = 50365, SPELL_DK_IMPROVED_FROST_PRESENCE_R1 = 50384, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1 = 50391, + SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL = 50475, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962, @@ -492,19 +493,35 @@ class spell_dk_summon_gargoyle : public SpellScript } }; -// 63611 - Improved Blood Presence -class spell_dk_improved_blood_presence_proc : public AuraScript +// 63611 - Improved Blood Presence Triggered +class spell_dk_improved_blood_presence_triggered : public AuraScript { - PrepareAuraScript(spell_dk_improved_blood_presence_proc); + PrepareAuraScript(spell_dk_improved_blood_presence_triggered); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL }); + } bool CheckProc(ProcEventInfo& eventInfo) { - return eventInfo.GetDamageInfo() && eventInfo.GetDamageInfo()->GetDamage(); + return eventInfo.GetActor()->IsPlayer(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo()) + { + int32 bp0 = CalculatePct(static_cast(dmgInfo->GetDamage()), aurEff->GetAmount()); + eventInfo.GetActor()->CastCustomSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL, SPELLVALUE_BASE_POINT0, bp0, eventInfo.GetActor(), true, nullptr, aurEff); + } } void Register() override { - DoCheckProc += AuraCheckProcFn(spell_dk_improved_blood_presence_proc::CheckProc); + DoCheckProc += AuraCheckProcFn(spell_dk_improved_blood_presence_triggered::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_dk_improved_blood_presence_triggered::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); } }; @@ -2995,7 +3012,7 @@ void AddSC_deathknight_spell_scripts() RegisterSpellAndAuraScriptPair(spell_dk_chains_of_ice, spell_dk_chains_of_ice_aura); RegisterSpellScript(spell_dk_bloodworms); RegisterSpellScript(spell_dk_summon_gargoyle); - RegisterSpellScript(spell_dk_improved_blood_presence_proc); + RegisterSpellScript(spell_dk_improved_blood_presence_triggered); RegisterSpellScript(spell_dk_wandering_plague_aura); RegisterSpellScript(spell_dk_rune_of_the_fallen_crusader); RegisterSpellScript(spell_dk_bone_shield);