From 46e439b0aa85059e47344e59ebf7e7bb45ee11bd Mon Sep 17 00:00:00 2001 From: Will Buck Date: Tue, 22 Apr 2025 22:35:21 -0500 Subject: [PATCH 1/2] Implement status resist in mob status moves --- scripts/globals/combat/status_effect_tables.lua | 1 + scripts/globals/mobskills.lua | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/globals/combat/status_effect_tables.lua b/scripts/globals/combat/status_effect_tables.lua index b75714e1c6b..c028b1d2716 100644 --- a/scripts/globals/combat/status_effect_tables.lua +++ b/scripts/globals/combat/status_effect_tables.lua @@ -35,6 +35,7 @@ local column = xi.combat.statusEffect.dataTable = { [xi.effect.ADDLE ] = { 0, xi.effect.NOCTURNE, xi.element.FIRE, xi.immunity.ADDLE, xi.mod.SLOWRES, 0, 0, xi.mod.ADDLE_IMMUNOBREAK }, -- Addle cant be immunobroken? + [xi.effect.AMNESIA ] = { 0, 0, xi.element.FIRE, xi.immunity.AMNESIA, xi.mod.AMNESIARES, 0, xi.mod.AMNESIA_MEVA, 0 }, [xi.effect.BIND ] = { 0, 0, xi.element.ICE, xi.immunity.BIND, xi.mod.BINDRES, 0, xi.mod.BIND_MEVA, xi.mod.BIND_IMMUNOBREAK }, [xi.effect.BLINDNESS ] = { 0, 0, xi.element.DARK, xi.immunity.BLIND, xi.mod.BLINDRES, 0, xi.mod.BLIND_MEVA, xi.mod.BLIND_IMMUNOBREAK }, [xi.effect.BURN ] = { xi.effect.DROWN, 0, xi.element.FIRE, 0, 0, 0, 0, 0 }, diff --git a/scripts/globals/mobskills.lua b/scripts/globals/mobskills.lua index 2852dee5228..283e0a3a989 100644 --- a/scripts/globals/mobskills.lua +++ b/scripts/globals/mobskills.lua @@ -629,9 +629,14 @@ end -- Adds a status effect to a target xi.mobskills.mobStatusEffectMove = function(mob, target, typeEffect, power, tick, duration, subType, subPower, tier) if target:canGainStatusEffect(typeEffect, power) then - local statmod = xi.mod.INT - local element = mob:getStatusEffectElement(typeEffect) - local resist = xi.mobskills.applyPlayerResistance(mob, typeEffect, target, mob:getStat(statmod)-target:getStat(statmod), 0, element) + local statmod = xi.mod.INT + local element = mob:getStatusEffectElement(typeEffect) + local fullResist = xi.combat.statusEffect.isTargetResistant(mob, target, typeEffect) + local resist = xi.mobskills.applyPlayerResistance(mob, typeEffect, target, mob:getStat(statmod)-target:getStat(statmod), 0, element) + + if fullResist then + return xi.msg.basic.SKILL_MISS -- resist ! + end if resist >= 0.25 then local totalDuration = utils.clamp(duration * resist, 1) From 5a52565efe93cc73eb0f8e0edea8b76e8d99c559 Mon Sep 17 00:00:00 2001 From: Will Buck Date: Tue, 22 Apr 2025 23:18:28 -0500 Subject: [PATCH 2/2] Removed non-existant amnesia immunity --- scripts/globals/combat/status_effect_tables.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/globals/combat/status_effect_tables.lua b/scripts/globals/combat/status_effect_tables.lua index c028b1d2716..f905deceb8e 100644 --- a/scripts/globals/combat/status_effect_tables.lua +++ b/scripts/globals/combat/status_effect_tables.lua @@ -35,7 +35,7 @@ local column = xi.combat.statusEffect.dataTable = { [xi.effect.ADDLE ] = { 0, xi.effect.NOCTURNE, xi.element.FIRE, xi.immunity.ADDLE, xi.mod.SLOWRES, 0, 0, xi.mod.ADDLE_IMMUNOBREAK }, -- Addle cant be immunobroken? - [xi.effect.AMNESIA ] = { 0, 0, xi.element.FIRE, xi.immunity.AMNESIA, xi.mod.AMNESIARES, 0, xi.mod.AMNESIA_MEVA, 0 }, + [xi.effect.AMNESIA ] = { 0, 0, xi.element.FIRE, 0, xi.mod.AMNESIARES, 0, xi.mod.AMNESIA_MEVA, 0 }, [xi.effect.BIND ] = { 0, 0, xi.element.ICE, xi.immunity.BIND, xi.mod.BINDRES, 0, xi.mod.BIND_MEVA, xi.mod.BIND_IMMUNOBREAK }, [xi.effect.BLINDNESS ] = { 0, 0, xi.element.DARK, xi.immunity.BLIND, xi.mod.BLINDRES, 0, xi.mod.BLIND_MEVA, xi.mod.BLIND_IMMUNOBREAK }, [xi.effect.BURN ] = { xi.effect.DROWN, 0, xi.element.FIRE, 0, 0, 0, 0, 0 },