From b2e1d6152ccad6dd3540e11a617993697c33c323 Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Thu, 23 Apr 2026 21:57:06 +0200 Subject: [PATCH] Fixes Bind allowed resist state value and duration calculation Co-authored-by: WinterSolstice8 --- scripts/data/status_effect_tables.lua | 2 +- scripts/globals/spells/enfeebling_spell.lua | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/data/status_effect_tables.lua b/scripts/data/status_effect_tables.lua index df25a3230ca..a54a98a23f9 100644 --- a/scripts/data/status_effect_tables.lua +++ b/scripts/data/status_effect_tables.lua @@ -37,7 +37,7 @@ xi.data.statusEffect.dataTable = [xi.effect.ADDLE ] = { 2, 0, 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 ] = { 2, 0, 0, 0, xi.element.FIRE, 0, xi.mod.AMNESIARES, 0, xi.mod.AMNESIA_MEVA, 0 }, [xi.effect.ATTACK_DOWN ] = { 3, 0, 0, 0, xi.element.WATER, 0, 0, 0, 0, 0 }, - [xi.effect.BIND ] = { 1, 0, 0, 0, xi.element.ICE, xi.immunity.BIND, xi.mod.BINDRES, xi.mod.BIND_RES_RANK, xi.mod.BIND_MEVA, xi.mod.BIND_IMMUNOBREAK }, + [xi.effect.BIND ] = { 2, 0, 0, 0, xi.element.ICE, xi.immunity.BIND, xi.mod.BINDRES, xi.mod.BIND_RES_RANK, xi.mod.BIND_MEVA, xi.mod.BIND_IMMUNOBREAK }, [xi.effect.BIO ] = { 4, 0, xi.effect.DIA, 0, xi.element.DARK, 0, 0, 0, 0, 0 }, [xi.effect.BLINDNESS ] = { 1, 0, 0, 0, xi.element.DARK, xi.immunity.BLIND, xi.mod.BLINDRES, xi.mod.BLIND_RES_RANK, xi.mod.BLIND_MEVA, xi.mod.BLIND_IMMUNOBREAK }, [xi.effect.BURN ] = { 2, xi.effect.DROWN, 0, xi.effect.FROST, xi.element.FIRE, 0, 0, 0, 0, 0 }, diff --git a/scripts/globals/spells/enfeebling_spell.lua b/scripts/globals/spells/enfeebling_spell.lua index 21fb38b4f2f..1ec62942f4e 100644 --- a/scripts/globals/spells/enfeebling_spell.lua +++ b/scripts/globals/spells/enfeebling_spell.lua @@ -319,13 +319,8 @@ end xi.spells.enfeebling.calculateDuration = function(caster, target, spellId, spellEffect, skillType) local duration = pTable[spellId][column.BASE_DURATION] -- Get base duration. - -- BIND spells have a special random duration the follows a normal distribution with mean=30 and std=12 if spellEffect == xi.effect.BIND then - -- Use the Box-Muller transform to change uniform dist sample to the normal dist sample - local z0 = math.sqrt(-2 * math.log(math.random())) * math.cos(2 * math.pi * math.random()) - - ---@cast duration integer - duration = utils.clamp(math.floor(30 + z0 * 12), 1, duration) + duration = math.random(13, 60) end -- Additions to base duration.