[Spells] Update to SPA 378 SE_SpellEffectResistChance (#4845)

* SPA 378 update

Update to SPA 378

SE_SpellEffectResistChance provides chance to resist specific spell effects.

This updates allows support for multiple resistance checks against different effects in same spell.

Example. If a spell has a silence and a blind effect and the target has an AA that gives 10% chance to resist silence and 5% chance to resist blind. It will roll against effect respectively each giving a chance to resist the spell.

* Update spells.cpp

Unresistable spells (resisttype = 0) do not ever resist a spell even with SPA378

Example: Pheonix Charm in Plane of Fire, or Storm Comet in Bastion of Thunder. Parsed both and never got a resist despite having the AA that has effect specific resists which both those spells match.
This commit is contained in:
KayenEQ
2025-04-09 22:23:39 -04:00
committed by GitHub
parent 5522eda6e4
commit 8e2961dda5
4 changed files with 37 additions and 17 deletions
+1 -2
View File
@@ -5359,8 +5359,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
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 (resist_type != RESIST_NONE && TrySpellEffectResist(spell_id)) {
return 0;
}