diff --git a/scripts/actions/weaponskills/tachi_gekko.lua b/scripts/actions/weaponskills/tachi_gekko.lua index 420bcc3456f..f34e915c867 100644 --- a/scripts/actions/weaponskills/tachi_gekko.lua +++ b/scripts/actions/weaponskills/tachi_gekko.lua @@ -28,7 +28,7 @@ weaponskillObject.onUseWeaponSkill = function(player, target, wsID, tp, primary, end local damage, criticalHit, tpHits, extraHits = xi.weaponskills.doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar) - + -- Handle status effect local effectId = xi.effect.SILENCE local actionElement = xi.element.WIND diff --git a/scripts/effects/nocturne.lua b/scripts/effects/nocturne.lua new file mode 100644 index 00000000000..b2c1b60ef6f --- /dev/null +++ b/scripts/effects/nocturne.lua @@ -0,0 +1,20 @@ +----------------------------------- +-- xi.effect.NOCTURNE +----------------------------------- +---@type TEffect +local effectObject = {} + +effectObject.onEffectGain = function(target, effect) + local power = effect:getPower() + + effect:addMod(xi.mod.FASTCAST, -power) + effect:addMod(xi.mod.MACC, -power) +end + +effectObject.onEffectTick = function(target, effect) +end + +effectObject.onEffectLose = function(target, effect) +end + +return effectObject diff --git a/scripts/enum/immunity.lua b/scripts/enum/immunity.lua index 1a2f4f8da8c..8b38fc9b463 100644 --- a/scripts/enum/immunity.lua +++ b/scripts/enum/immunity.lua @@ -3,22 +3,23 @@ xi = xi or {} ---@enum xi.immunity xi.immunity = { - NONE = 0x00000000, - ADDLE = 0x00000001, - GRAVITY = 0x00000002, - BIND = 0x00000004, - STUN = 0x00000008, - SILENCE = 0x00000010, -- 16 - PARALYZE = 0x00000020, -- 32 - BLIND = 0x00000040, -- 64 - SLOW = 0x00000080, -- 128 - POISON = 0x00000100, -- 256 - ELEGY = 0x00000200, -- 512 - REQUIEM = 0x00000400, -- 1024 - LIGHT_SLEEP = 0x00000800, -- 2048 - DARK_SLEEP = 0x00001000, -- 4096 - ASPIR = 0x00002000, -- 8192 - TERROR = 0x00004000, -- 16384 - DISPEL = 0x00008000, -- 32768 - PETRIFY = 0x00010000, -- 65536 + NONE = 0x00000000, -- 0 + ADDLE = 0x00000001, -- 1 + GRAVITY = 0x00000002, -- 2 + BIND = 0x00000004, -- 4 + STUN = 0x00000008, -- 8 + SILENCE = 0x00000010, -- 16 + PARALYZE = 0x00000020, -- 32 + BLIND = 0x00000040, -- 64 + SLOW = 0x00000080, -- 128 + POISON = 0x00000100, -- 256 + ELEGY = 0x00000200, -- 512 + REQUIEM = 0x00000400, -- 1024 + LIGHT_SLEEP = 0x00000800, -- 2048 + DARK_SLEEP = 0x00001000, -- 4096 + ASPIR = 0x00002000, -- 8192 + TERROR = 0x00004000, -- 16384 + DISPEL = 0x00008000, -- 32768 + PETRIFY = 0x00010000, -- 65536 + PLAGUE = 0x00020000, -- 131064 } diff --git a/scripts/globals/combat/status_effect_tables.lua b/scripts/globals/combat/status_effect_tables.lua index 460f0adca5c..92b93b7613e 100644 --- a/scripts/globals/combat/status_effect_tables.lua +++ b/scripts/globals/combat/status_effect_tables.lua @@ -32,27 +32,28 @@ local column = -- Table associating an status effect with their corresponding immunobreak, MEVA and resistance modifiers and immunities. xi.combat.statusEffect.dataTable = { - [xi.effect.ADDLE ] = { 0, 0, xi.element.FIRE, xi.immunity.ADDLE, xi.mod.SLOWRES, 0, 0, xi.mod.ADDLE_IMMUNOBREAK }, - [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 }, - [xi.effect.CHOKE ] = { xi.effect.FROST, 0, xi.element.WIND, 0, 0, 0, 0, 0 }, - [xi.effect.CURSE_I ] = { 0, 0, xi.element.DARK, xi.immunity.NONE, xi.mod.CURSERES, 0, xi.mod.CURSE_MEVA, 0 }, - [xi.effect.DROWN ] = { xi.effect.SHOCK, 0, xi.element.WATER, 0, 0, 0, 0, 0 }, - [xi.effect.FLASH ] = { 0, 0, xi.element.LIGHT, xi.immunity.BLIND, xi.mod.BLINDRES, 0, xi.mod.BLIND_MEVA, xi.mod.BLIND_IMMUNOBREAK }, - [xi.effect.FROST ] = { xi.effect.BURN, 0, xi.element.ICE, 0, 0, 0, 0, 0 }, - [xi.effect.NONE ] = { 0, 0, xi.element.DARK, xi.immunity.DISPEL, 0, 0, 0, 0 }, - [xi.effect.PARALYSIS ] = { 0, 0, xi.element.ICE, xi.immunity.PARALYZE, xi.mod.PARALYZERES, 0, xi.mod.PARALYZE_MEVA, xi.mod.PARALYZE_IMMUNOBREAK }, - [xi.effect.PETRIFICATION] = { 0, 0, xi.element.EARTH, xi.immunity.PETRIFY, xi.mod.PETRIFYRES, 0, xi.mod.PETRIFY_MEVA, xi.mod.PETRIFY_IMMUNOBREAK }, - [xi.effect.PLAGUE ] = { 0, 0, xi.element.FIRE, xi.immunity.NONE, xi.mod.VIRUSRES, 0, xi.mod.VIRUS_MEVA, 0 }, - [xi.effect.POISON ] = { 0, 0, xi.element.WATER, xi.immunity.POISON, xi.mod.POISONRES, 0, xi.mod.POISON_MEVA, xi.mod.POISON_IMMUNOBREAK }, - [xi.effect.RASP ] = { xi.effect.CHOKE, 0, xi.element.EARTH, 0, 0, 0, 0, 0 }, - [xi.effect.SHOCK ] = { xi.effect.RASP, 0, xi.element.THUNDER, 0, 0, 0, 0, 0 }, - [xi.effect.SILENCE ] = { 0, 0, xi.element.WIND, xi.immunity.SILENCE, xi.mod.SILENCERES, 0, xi.mod.SILENCE_MEVA, xi.mod.SILENCE_IMMUNOBREAK }, - [xi.effect.SLEEP_I ] = { 0, 0, xi.element.DARK, xi.immunity.DARK_SLEEP, xi.mod.SLEEPRES, 0, xi.mod.SLEEP_MEVA, xi.mod.SLEEP_IMMUNOBREAK }, - [xi.effect.SLOW ] = { 0, 0, xi.element.EARTH, xi.immunity.SLOW, xi.mod.SLOWRES, 0, xi.mod.SLOW_MEVA, xi.mod.SLOW_IMMUNOBREAK }, - [xi.effect.STUN ] = { 0, 0, xi.element.THUNDER, xi.immunity.STUN, xi.mod.STUNRES, 0, xi.mod.STUN_MEVA, 0 }, - [xi.effect.WEIGHT ] = { 0, 0, xi.element.WIND, xi.immunity.GRAVITY, xi.mod.GRAVITYRES, 0, xi.mod.GRAVITY_MEVA, xi.mod.GRAVITY_IMMUNOBREAK }, + [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.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 }, + [xi.effect.CHOKE ] = { xi.effect.FROST, 0, xi.element.WIND, 0, 0, 0, 0, 0 }, + [xi.effect.CURSE_I ] = { 0, 0, xi.element.DARK, xi.immunity.NONE, xi.mod.CURSERES, 0, xi.mod.CURSE_MEVA, 0 }, + [xi.effect.DROWN ] = { xi.effect.SHOCK, 0, xi.element.WATER, 0, 0, 0, 0, 0 }, + [xi.effect.FLASH ] = { 0, 0, xi.element.LIGHT, xi.immunity.BLIND, xi.mod.BLINDRES, 0, xi.mod.BLIND_MEVA, xi.mod.BLIND_IMMUNOBREAK }, + [xi.effect.FROST ] = { xi.effect.BURN, 0, xi.element.ICE, 0, 0, 0, 0, 0 }, + [xi.effect.NOCTURNE ] = { xi.effect.ADDLE, 0, xi.element.FIRE, xi.immunity.ADDLE, xi.mod.SLOWRES, 0, 0, 0 }, + [xi.effect.NONE ] = { 0, 0, xi.element.DARK, xi.immunity.DISPEL, 0, 0, 0, 0 }, + [xi.effect.PARALYSIS ] = { 0, 0, xi.element.ICE, xi.immunity.PARALYZE, xi.mod.PARALYZERES, 0, xi.mod.PARALYZE_MEVA, xi.mod.PARALYZE_IMMUNOBREAK }, + [xi.effect.PETRIFICATION] = { 0, 0, xi.element.EARTH, xi.immunity.PETRIFY, xi.mod.PETRIFYRES, 0, xi.mod.PETRIFY_MEVA, xi.mod.PETRIFY_IMMUNOBREAK }, + [xi.effect.PLAGUE ] = { 0, 0, xi.element.FIRE, xi.immunity.PLAGUE, xi.mod.VIRUSRES, 0, xi.mod.VIRUS_MEVA, 0 }, + [xi.effect.POISON ] = { 0, 0, xi.element.WATER, xi.immunity.POISON, xi.mod.POISONRES, 0, xi.mod.POISON_MEVA, xi.mod.POISON_IMMUNOBREAK }, + [xi.effect.RASP ] = { xi.effect.CHOKE, 0, xi.element.EARTH, 0, 0, 0, 0, 0 }, + [xi.effect.SHOCK ] = { xi.effect.RASP, 0, xi.element.THUNDER, 0, 0, 0, 0, 0 }, + [xi.effect.SILENCE ] = { 0, 0, xi.element.WIND, xi.immunity.SILENCE, xi.mod.SILENCERES, 0, xi.mod.SILENCE_MEVA, xi.mod.SILENCE_IMMUNOBREAK }, + [xi.effect.SLEEP_I ] = { 0, 0, xi.element.DARK, xi.immunity.DARK_SLEEP, xi.mod.SLEEPRES, 0, xi.mod.SLEEP_MEVA, xi.mod.SLEEP_IMMUNOBREAK }, + [xi.effect.SLOW ] = { 0, 0, xi.element.EARTH, xi.immunity.SLOW, xi.mod.SLOWRES, 0, xi.mod.SLOW_MEVA, xi.mod.SLOW_IMMUNOBREAK }, + [xi.effect.STUN ] = { 0, 0, xi.element.THUNDER, xi.immunity.STUN, xi.mod.STUNRES, 0, xi.mod.STUN_MEVA, 0 }, + [xi.effect.WEIGHT ] = { 0, 0, xi.element.WIND, xi.immunity.GRAVITY, xi.mod.GRAVITYRES, 0, xi.mod.GRAVITY_MEVA, xi.mod.GRAVITY_IMMUNOBREAK }, } ----------------------------------- @@ -213,10 +214,10 @@ xi.combat.statusEffect.isTargetResistant = function(actor, target, effectId) end xi.combat.statusEffect.isEffectNullified = function(target, effectId) - local effectId = xi.combat.statusEffect.getNullificatingEffect(effectId) + local nullificatingEffect = xi.combat.statusEffect.getNullificatingEffect(effectId) if - effectId > 0 and - target:hasStatusEffect(effectId) + nullificatingEffect > 0 and + target:hasStatusEffect(nullificatingEffect) then return true end diff --git a/scripts/globals/spells/enfeebling_spell.lua b/scripts/globals/spells/enfeebling_spell.lua index 7b0e5cbf09a..a1cb28adbc7 100644 --- a/scripts/globals/spells/enfeebling_spell.lua +++ b/scripts/globals/spells/enfeebling_spell.lua @@ -330,7 +330,7 @@ xi.spells.enfeebling.handleEffectNullification = function(caster, target, spell, end -- Target already has an status effect that nullifies current. - if xi.combat.statusEffect.isEffectNullified(spellEffect) then + if xi.combat.statusEffect.isEffectNullified(target, spellEffect) then spell:setMsg(xi.msg.basic.MAGIC_NO_EFFECT) return true diff --git a/scripts/globals/weaponskills.lua b/scripts/globals/weaponskills.lua index f186dbb68e9..97aa6bcec83 100644 --- a/scripts/globals/weaponskills.lua +++ b/scripts/globals/weaponskills.lua @@ -1436,7 +1436,7 @@ xi.weaponskills.handleWeaponskillEffect = function(actor, target, effectId, acti not target:hasStatusEffect(effectId) and not xi.combat.statusEffect.isTargetImmune(target, effectId, actionElement) and not xi.combat.statusEffect.isTargetResistant(actor, target, effectId) and - not xi.combat.statusEffect.isEffectNullified(effectId) + not xi.combat.statusEffect.isEffectNullified(target, effectId) then target:addStatusEffect(effectId, power, 0, duration) end diff --git a/src/map/entities/battleentity.h b/src/map/entities/battleentity.h index de3dd25b280..73d9c388e12 100644 --- a/src/map/entities/battleentity.h +++ b/src/map/entities/battleentity.h @@ -457,24 +457,25 @@ DECLARE_FORMAT_AS_UNDERLYING(SKILLCHAIN_ELEMENT); enum IMMUNITY : uint32 { - IMMUNITY_NONE = 0x00000000, - IMMUNITY_ADDLE = 0x00000001, - IMMUNITY_GRAVITY = 0x00000002, - IMMUNITY_BIND = 0x00000004, - IMMUNITY_STUN = 0x00000008, - IMMUNITY_SILENCE = 0x00000010, // 16 - IMMUNITY_PARALYZE = 0x00000020, // 32 - IMMUNITY_BLIND = 0x00000040, // 64 - IMMUNITY_SLOW = 0x00000080, // 128 - IMMUNITY_POISON = 0x00000100, // 256 - IMMUNITY_ELEGY = 0x00000200, // 512 - IMMUNITY_REQUIEM = 0x00000400, // 1024 - IMMUNITY_LIGHT_SLEEP = 0x00000800, // 2048 - IMMUNITY_DARK_SLEEP = 0x00001000, // 4096 - IMMUNITY_ASPIR = 0x00002000, // 8192 - IMMUNITY_TERROR = 0x00004000, // 16384 - IMMUNITY_DISPEL = 0x00008000, // 32768 - IMMUNITY_PETRIFY = 0x00010000, // 65536 + IMMUNITY_NONE = 0x00000000, // 0 + IMMUNITY_ADDLE = 0x00000001, // 1 + IMMUNITY_GRAVITY = 0x00000002, // 2 + IMMUNITY_BIND = 0x00000004, // 4 + IMMUNITY_STUN = 0x00000008, // 8 + IMMUNITY_SILENCE = 0x00000010, // 16 + IMMUNITY_PARALYZE = 0x00000020, // 32 + IMMUNITY_BLIND = 0x00000040, // 64 + IMMUNITY_SLOW = 0x00000080, // 128 + IMMUNITY_POISON = 0x00000100, // 256 + IMMUNITY_ELEGY = 0x00000200, // 512 + IMMUNITY_REQUIEM = 0x00000400, // 1024 + IMMUNITY_LIGHT_SLEEP = 0x00000800, // 2048 + IMMUNITY_DARK_SLEEP = 0x00001000, // 4096 + IMMUNITY_ASPIR = 0x00002000, // 8192 + IMMUNITY_TERROR = 0x00004000, // 16384 + IMMUNITY_DISPEL = 0x00008000, // 32768 + IMMUNITY_PETRIFY = 0x00010000, // 65536 + IMMUNITY_PLAGUE = 0x00020000, // 131064 }; DECLARE_FORMAT_AS_UNDERLYING(IMMUNITY);