From 5162b0106d1a13de52debb6bf4e3065ff2637acb Mon Sep 17 00:00:00 2001 From: Skold177 <113406182+Skold177@users.noreply.github.com> Date: Fri, 16 Jan 2026 10:48:49 -0500 Subject: [PATCH] [lua] Jungle Boogymen chooseAction conversion Converts spell scripts in Jungle Boogymen to chooseAction scripts --- .../mobs/Cyaneous-toed_Yallberry.lua | 41 ++++-------- .../mobs/Sable-tongued_Gonberry.lua | 62 +++++++------------ 2 files changed, 36 insertions(+), 67 deletions(-) diff --git a/scripts/zones/Sacrificial_Chamber/mobs/Cyaneous-toed_Yallberry.lua b/scripts/zones/Sacrificial_Chamber/mobs/Cyaneous-toed_Yallberry.lua index 2950a755002..0333bc1f3c3 100644 --- a/scripts/zones/Sacrificial_Chamber/mobs/Cyaneous-toed_Yallberry.lua +++ b/scripts/zones/Sacrificial_Chamber/mobs/Cyaneous-toed_Yallberry.lua @@ -14,14 +14,6 @@ mixins = ---@type TMobEntity local entity = {} -local enfeebleTable = -{ - [1] = { xi.magic.spell.DOKUMORI_NI, xi.effect.POISON }, - [2] = { xi.magic.spell.KURAYAMI_NI, xi.effect.BLINDNESS }, - [3] = { xi.magic.spell.HOJO_NI, xi.effect.SLOW }, - [4] = { xi.magic.spell.JUBAKU_NI, xi.effect.PARALYSIS }, -} - entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.MAGIC_COOL, 20) mob:setMod(xi.mod.LIGHT_SLEEP_RES_RANK, 8) @@ -30,31 +22,22 @@ entity.onMobInitialize = function(mob) end entity.onMobSpellChoose = function(mob, target, spellId) - -- Base Elemental Wheel local spellList = { - xi.magic.spell.DOTON_NI, - xi.magic.spell.HYOTON_NI, - xi.magic.spell.HUTON_NI, - xi.magic.spell.KATON_NI, - xi.magic.spell.RAITON_NI, - xi.magic.spell.SUITON_NI, + [ 1] = { xi.magic.spell.DOTON_NI, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 2] = { xi.magic.spell.HYOTON_NI, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 3] = { xi.magic.spell.HUTON_NI, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 4] = { xi.magic.spell.KATON_NI, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 5] = { xi.magic.spell.RAITON_NI, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 6] = { xi.magic.spell.SUITON_NI, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 7] = { xi.magic.spell.DOKUMORI_NI, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.POISON, 0, 100 }, + [ 8] = { xi.magic.spell.KURAYAMI_NI, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.BLINDNESS, 0, 100 }, + [ 9] = { xi.magic.spell.HOJO_NI, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLOW, 4, 100 }, + [10] = { xi.magic.spell.JUBAKU_NI, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.PARALYSIS, 0, 100 }, + [11] = { xi.magic.spell.UTSUSEMI_NI, mob, false, xi.action.type.ENHANCING_TARGET, xi.effect.COPY_IMAGE, 0, 100 }, } - -- Add Utsusemi if we don't have it - if not mob:hasStatusEffect(xi.effect.COPY_IMAGE) then - table.insert(spellList, xi.magic.spell.UTSUSEMI_NI) - end - - -- Add enfeebles if they are missing from our target - for i = 1, #enfeebleTable do - if not target:hasStatusEffect(enfeebleTable[i][2]) then - table.insert(spellList, enfeebleTable[i][1]) - end - end - - -- Return a random spell from the compiled list - return spellList[math.random(#spellList)] + return xi.combat.behavior.chooseAction(mob, target, nil, spellList) end return entity diff --git a/scripts/zones/Sacrificial_Chamber/mobs/Sable-tongued_Gonberry.lua b/scripts/zones/Sacrificial_Chamber/mobs/Sable-tongued_Gonberry.lua index 942f0c5006a..57e2689c441 100644 --- a/scripts/zones/Sacrificial_Chamber/mobs/Sable-tongued_Gonberry.lua +++ b/scripts/zones/Sacrificial_Chamber/mobs/Sable-tongued_Gonberry.lua @@ -13,18 +13,6 @@ mixins = ---@type TMobEntity local entity = {} -local enfeebleTable = -{ - [1] = { xi.magic.spell.BURN, xi.effect.BURN }, - [2] = { xi.magic.spell.SHOCK, xi.effect.SHOCK }, - [3] = { xi.magic.spell.CHOKE, xi.effect.CHOKE }, - [4] = { xi.magic.spell.BIO_II, xi.effect.BIO }, - [5] = { xi.magic.spell.POISONGA_II, xi.effect.POISON }, - [6] = { xi.magic.spell.BLIND, xi.effect.BLINDNESS }, - [7] = { xi.magic.spell.SLEEPGA, xi.effect.SLEEP_I }, - [8] = { xi.magic.spell.SLEEPGA_II, xi.effect.SLEEP_I }, -} - entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.MAGIC_COOL, 20) mob:setMod(xi.mod.LIGHT_SLEEP_RES_RANK, 8) @@ -36,34 +24,32 @@ end entity.onMobSpellChoose = function(mob, target, spellId) local spellList = { - xi.magic.spell.AERO_III, - xi.magic.spell.FIRE_III, - xi.magic.spell.BLIZZARD_III, - xi.magic.spell.BLIZZAGA_II, - xi.magic.spell.THUNDAGA_II, - xi.magic.spell.STONEGA_III, - xi.magic.spell.BURST, - xi.magic.spell.FLARE, - xi.magic.spell.FLOOD, - xi.magic.spell.DRAIN, - xi.magic.spell.STUN, + [ 1] = { xi.magic.spell.AERO_III, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 2] = { xi.magic.spell.FIRE_III, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 3] = { xi.magic.spell.BLIZZARD_III, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 4] = { xi.magic.spell.BLIZZAGA_II, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 5] = { xi.magic.spell.THUNDAGA_II, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 6] = { xi.magic.spell.STONEGA_III, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 7] = { xi.magic.spell.BURST, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 8] = { xi.magic.spell.FLARE, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 9] = { xi.magic.spell.FLOOD, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [10] = { xi.magic.spell.DRAIN, target, false, xi.action.type.DRAIN_HP, nil, 0, 100 }, + [11] = { xi.magic.spell.ASPIR, target, false, xi.action.type.DRAIN_MP, nil, 0, 100 }, + [12] = { xi.magic.spell.STUN, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.STUN, 0, 100 }, + [13] = { xi.magic.spell.BURN, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.BURN, 0, 100 }, + [14] = { xi.magic.spell.SHOCK, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SHOCK, 0, 100 }, + [15] = { xi.magic.spell.CHOKE, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.CHOKE, 0, 100 }, + [16] = { xi.magic.spell.BIO_II, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.BIO, 4, 100 }, + [17] = { xi.magic.spell.POISONGA_II, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.POISON, 0, 100 }, + [18] = { xi.magic.spell.BLIND, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.BLINDNESS, 0, 100 }, + [19] = { xi.magic.spell.SLEEP, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLEEP_I, 0, 25 }, + [20] = { xi.magic.spell.SLEEP_II, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLEEP_I, 0, 25 }, + [21] = { xi.magic.spell.SLEEPGA, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLEEP_I, 0, 25 }, + [22] = { xi.magic.spell.SLEEPGA_II, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLEEP_I, 0, 25 }, + [23] = { xi.magic.spell.BLAZE_SPIKES, mob, false, xi.action.type.ENHANCING_FORCE_SELF, xi.effect.BLAZE_SPIKES, 0, 100 }, } - if target:getMP() > 0 then - table.insert(spellList, xi.magic.spell.ASPIR) - end - - if not mob:hasStatusEffect(xi.effect.BLAZE_SPIKES) then - table.insert(spellList, xi.magic.spell.BLAZE_SPIKES) - end - - for i = 1, #enfeebleTable do - if not target:hasStatusEffect(enfeebleTable[i][2]) then - table.insert(spellList, enfeebleTable[i][1]) - end - end - - return spellList[math.random(1, #spellList)] + return xi.combat.behavior.chooseAction(mob, target, nil, spellList) end return entity