From 07e9cef70fdba57878b04f8dc2b23bb66f96d6fe Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sat, 21 Feb 2026 10:42:27 -0600 Subject: [PATCH] fix(Scripts/Spells): Remove duplicate Sacred Shield script with wrong caster attribution (#24791) Co-authored-by: blinkysc --- .../rev_1771684443067867140.sql | 1 + src/server/scripts/Spells/spell_paladin.cpp | 101 ------------------ 2 files changed, 1 insertion(+), 101 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1771684443067867140.sql diff --git a/data/sql/updates/pending_db_world/rev_1771684443067867140.sql b/data/sql/updates/pending_db_world/rev_1771684443067867140.sql new file mode 100644 index 000000000..94cb8b822 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1771684443067867140.sql @@ -0,0 +1 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_pal_sacred_shield_base'; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index a57be2921..163899a46 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -288,106 +288,6 @@ class spell_pal_sacred_shield : public AuraScript } }; -class spell_pal_sacred_shield_base : public AuraScript -{ - PrepareAuraScript(spell_pal_sacred_shield_base); - - static constexpr uint32 SACRED_SHIELD_ICD = 6 * IN_MILLISECONDS; - uint32 _cooldownEnd = 0; - - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) - { - if (Unit* caster = GetCaster()) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell); - amount = spellInfo->Effects[EFFECT_0].CalcValue(); - - // +75.00% from sp bonus - amount += CalculatePct(caster->SpellBaseDamageBonusDone(spellInfo->GetSchoolMask()), 75.0f); - - // Xinef: removed divine guardian because it will affect triggered spell with increased amount - // Arena - Dampening - if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_ARENA_DAMPENING, EFFECT_0)) - { - AddPct(amount, dampening->GetAmount()); - } - // Battleground - Dampening - else if (AuraEffect const* dampening2 = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0)) - { - AddPct(amount, dampening2->GetAmount()); - } - } - } - - bool CheckProc(ProcEventInfo& eventInfo) - { - HealInfo* healinfo = eventInfo.GetHealInfo(); - DamageInfo* damageinfo = eventInfo.GetDamageInfo(); - return !(eventInfo.GetHitMask() & PROC_EX_INTERNAL_HOT) && ((healinfo && healinfo->GetHeal() > 0) || (damageinfo && damageinfo->GetDamage() > 0)); - } - - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - PreventDefaultAction(); - - if (eventInfo.GetTypeMask() & PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS) - { - Unit* caster = eventInfo.GetActor(); - - HealInfo* healinfo = eventInfo.GetHealInfo(); - - if (!healinfo || !healinfo->GetHeal()) - { - return; - } - - SpellInfo const* procSpell = healinfo->GetSpellInfo(); - if (!procSpell) - { - return; - } - - if (caster && procSpell->SpellFamilyName == SPELLFAMILY_PALADIN && - procSpell->SpellFamilyFlags.HasFlag(0x40000000) && caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_PALADIN, 3021, 0)) // need infusion of light - { - int32 basepoints = int32(float(healinfo->GetHeal()) / 12.0f); - // Item - Paladin T9 Holy 4P Bonus (Flash of Light) - if (AuraEffect const* aurEffect = caster->GetAuraEffect(67191, EFFECT_0)) - AddPct(basepoints, aurEffect->GetAmount()); - - caster->CastCustomSpell(eventInfo.GetActionTarget(), 66922, &basepoints, nullptr, nullptr, true, nullptr, aurEff, caster->GetGUID()); - return; - } - - return; - } - - uint32 now = GameTime::GetGameTimeMS().count(); - if (_cooldownEnd > now) - return; - - uint32 cooldown = SACRED_SHIELD_ICD; - - // Item - Paladin T8 Holy 4P Bonus - if (Unit* caster = aurEff->GetCaster()) - if (AuraEffect const* aurEffect = caster->GetAuraEffect(64895, 0)) - cooldown = aurEffect->GetAmount() * IN_MILLISECONDS; - - _cooldownEnd = now + cooldown; - - uint32 triggered_spell_id = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; - int32 basepoints = aurEff->GetAmount(); - eventInfo.GetActionTarget()->CastCustomSpell(eventInfo.GetActionTarget(), triggered_spell_id, &basepoints, nullptr, nullptr, true, nullptr, aurEff, eventInfo.GetActionTarget()->GetGUID()); - } - - void Register() override - { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_sacred_shield_base::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY); - DoCheckProc += AuraCheckProcFn(spell_pal_sacred_shield_base::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_pal_sacred_shield_base::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); - } -}; - // 31850 - Ardent Defender class spell_pal_ardent_defender : public AuraScript { @@ -2271,7 +2171,6 @@ void AddSC_paladin_spell_scripts() RegisterSpellScript(spell_pal_divine_purpose); RegisterSpellScript(spell_pal_seal_of_light); RegisterSpellScript(spell_pal_sacred_shield); - RegisterSpellScript(spell_pal_sacred_shield_base); RegisterSpellScript(spell_pal_ardent_defender); RegisterSpellScript(spell_pal_aura_mastery); RegisterSpellScript(spell_pal_aura_mastery_immune);