From 154e5aa1cd3ac7e5ba57496a88f8ef0d5391daef Mon Sep 17 00:00:00 2001 From: Skold177 <113406182+Skold177@users.noreply.github.com> Date: Fri, 16 Jan 2026 02:01:06 -0500 Subject: [PATCH] [lua] Kindred Spirits chooseAction conversion Converts Kindred Spirits to a chooseAction spell script --- .../Throne_Room/mobs/Count_Andromalius.lua | 20 +++---- .../zones/Throne_Room/mobs/Duke_Amduscias.lua | 60 +++++++------------ 2 files changed, 30 insertions(+), 50 deletions(-) diff --git a/scripts/zones/Throne_Room/mobs/Count_Andromalius.lua b/scripts/zones/Throne_Room/mobs/Count_Andromalius.lua index 852827d4596..5b303080048 100644 --- a/scripts/zones/Throne_Room/mobs/Count_Andromalius.lua +++ b/scripts/zones/Throne_Room/mobs/Count_Andromalius.lua @@ -18,21 +18,15 @@ end entity.onMobSpellChoose = function(mob, target, spellId) local spellList = { - xi.magic.spell.THUNDER, - xi.magic.spell.BLIZZARD, - xi.magic.spell.ABSORB_TP, - xi.magic.spell.DRAIN, + [1] = { xi.magic.spell.THUNDER, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [2] = { xi.magic.spell.BLIZZARD, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [3] = { xi.magic.spell.DRAIN, target, false, xi.action.type.DRAIN_HP, nil, 0, 100 }, + [4] = { xi.magic.spell.ASPIR, target, false, xi.action.type.DRAIN_MP, nil, 0, 100 }, + [5] = { xi.magic.spell.STUN, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.STUN, 0, 100 }, + [6] = { xi.magic.spell.ABSORB_TP, target, false, xi.action.type.NONE, nil, 0, 100 }, } - if target:getMP() > 0 then - table.insert(spellList, xi.magic.spell.ASPIR) - end - - if not target:hasStatusEffect(xi.effect.STUN) then - table.insert(spellList, xi.magic.spell.STUN) - end - - return spellList[math.random(1, #spellList)] + return xi.combat.behavior.chooseAction(mob, target, nil, spellList) end return entity diff --git a/scripts/zones/Throne_Room/mobs/Duke_Amduscias.lua b/scripts/zones/Throne_Room/mobs/Duke_Amduscias.lua index 980b489304a..d17ce61be6f 100644 --- a/scripts/zones/Throne_Room/mobs/Duke_Amduscias.lua +++ b/scripts/zones/Throne_Room/mobs/Duke_Amduscias.lua @@ -1,18 +1,6 @@ ---@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, 6) @@ -23,33 +11,31 @@ end entity.onMobSpellChoose = function(mob, target, spellId) local spellList = { - xi.magic.spell.AERO_III, - xi.magic.spell.WATER_III, - xi.magic.spell.FIRE_III, - xi.magic.spell.FIRAGA_II, - xi.magic.spell.BLIZZAGA_II, - xi.magic.spell.THUNDAGA_II, - 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.WATER_III, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 3] = { xi.magic.spell.FIRE_III, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 4] = { xi.magic.spell.FIRAGA_II, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 5] = { xi.magic.spell.BLIZZAGA_II, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 6] = { xi.magic.spell.THUNDAGA_II, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 7] = { xi.magic.spell.FLARE, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 8] = { xi.magic.spell.FLOOD, target, false, xi.action.type.DAMAGE_TARGET, nil, 0, 100 }, + [ 9] = { xi.magic.spell.DRAIN, target, false, xi.action.type.DRAIN_HP, nil, 0, 100 }, + [10] = { xi.magic.spell.ASPIR, target, false, xi.action.type.DRAIN_MP, nil, 0, 100 }, + [11] = { xi.magic.spell.STUN, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.STUN, 0, 100 }, + [12] = { xi.magic.spell.BURN, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.BURN, 0, 100 }, + [13] = { xi.magic.spell.SHOCK, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SHOCK, 0, 100 }, + [14] = { xi.magic.spell.CHOKE, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.CHOKE, 0, 100 }, + [15] = { xi.magic.spell.BIO_II, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.BIO, 4, 100 }, + [16] = { xi.magic.spell.POISONGA_II, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.POISON, 0, 100 }, + [17] = { xi.magic.spell.BLIND, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.BLINDNESS, 0, 100 }, + [18] = { xi.magic.spell.SLEEP, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLEEP_I, 0, 25 }, + [19] = { xi.magic.spell.SLEEP_II, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLEEP_I, 0, 25 }, + [20] = { xi.magic.spell.SLEEPGA, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLEEP_I, 0, 25 }, + [21] = { xi.magic.spell.SLEEPGA_II, target, false, xi.action.type.ENFEEBLING_TARGET, xi.effect.SLEEP_I, 0, 25 }, + [22] = { 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