fix(Scripts/Spells): Remove duplicate Sacred Shield script with wrong caster attribution (#24791)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-02-21 10:42:27 -06:00
committed by GitHub
parent 1c91f96e02
commit 07e9cef70f
2 changed files with 1 additions and 101 deletions

View File

@@ -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);