From 850053a136e0ae25abde6f43cd98022f189dc9b4 Mon Sep 17 00:00:00 2001 From: Fryguy Date: Fri, 14 Jun 2024 12:51:33 -0400 Subject: [PATCH] [Bug] Prevent Resurrection Spells from being resisted (#4393) * [Bug] Prevent Ressurection Spells from being resisted Added IsRessurectionSpell(uint16 spell_id) to assist with checking on a spell is a ressurection spell. This was noticed when Dragons of Norrath launched and the Tier 5 Progression AA provided SPA 180 2% SE_ResistSpellChance * Helps if I spell it correctly * Update per feedback --- common/spdat.cpp | 10 ++++++++++ common/spdat.h | 1 + zone/spells.cpp | 9 +++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/common/spdat.cpp b/common/spdat.cpp index aa2946145..1a0014e46 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -431,6 +431,16 @@ bool IsCharmSpell(uint16 spell_id) return IsEffectInSpell(spell_id, SE_Charm); } +bool IsResurrectionSicknessSpell(uint16 spell_id) { + return ( + spell_id == SPELL_RESURRECTION_SICKNESS || + spell_id == SPELL_RESURRECTION_SICKNESS2 || + spell_id == SPELL_RESURRECTION_SICKNESS3 || + spell_id == SPELL_RESURRECTION_SICKNESS4 || + spell_id == SPELL_REVIVAL_SICKNESS + ); +} + bool IsBlindSpell(uint16 spell_id) { return IsEffectInSpell(spell_id, SE_Blind); diff --git a/common/spdat.h b/common/spdat.h index 25b7bdffe..9508db9d5 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -1522,6 +1522,7 @@ bool IsSummonPetSpell(uint16 spell_id); bool IsSummonPCSpell(uint16 spell_id); bool IsPetSpell(uint16 spell_id); bool IsCharmSpell(uint16 spell_id); +bool IsResurrectionSicknessSpell(uint16 spell_id); bool IsBlindSpell(uint16 spell_id); bool IsHealthSpell(uint16 spell_id); bool IsCastTimeReductionSpell(uint16 spell_id); diff --git a/zone/spells.cpp b/zone/spells.cpp index 50266ec51..e9a523909 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -5315,19 +5315,16 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use } } - if (!CharmTick){ - + if (!CharmTick) { //Check for Spell Effect specific resistance chances (ie AA Mental Fortitude) int se_resist_bonuses = GetSpellEffectResistChance(spell_id); - if(se_resist_bonuses && zone->random.Roll(se_resist_bonuses)) - { + if (se_resist_bonuses && zone->random.Roll(se_resist_bonuses)) { return 0; } // Check for Chance to Resist Spell bonuses (ie Sanctification Discipline) int resist_bonuses = CalcResistChanceBonus(); - if(resist_bonuses && zone->random.Roll(resist_bonuses)) - { + if (resist_bonuses && zone->random.Roll(resist_bonuses) && !IsResurrectionSicknessSpell(spell_id)) { LogSpells("Resisted spell in sanctification, had [{}] chance to resist", resist_bonuses); return 0; }