From de9b3c30c4bd47b0ce57d8458cc0cfbe5026092e Mon Sep 17 00:00:00 2001 From: Skold <113406182+Skold177@users.noreply.github.com> Date: Sun, 10 May 2026 00:24:15 -0400 Subject: [PATCH] [lua] Bahamut TP Move Cleanup Cleans out unused code in Giga/Mega/Teraflare --- scripts/actions/mobskills/gigaflare.lua | 21 +-------------------- scripts/actions/mobskills/megaflare.lua | 24 +----------------------- scripts/actions/mobskills/teraflare.lua | 12 ++++++++++-- 3 files changed, 12 insertions(+), 45 deletions(-) diff --git a/scripts/actions/mobskills/gigaflare.lua b/scripts/actions/mobskills/gigaflare.lua index 9a207d415e1..9fb67733998 100644 --- a/scripts/actions/mobskills/gigaflare.lua +++ b/scripts/actions/mobskills/gigaflare.lua @@ -8,16 +8,7 @@ local mobskillObject = {} mobskillObject.onMobSkillCheck = function(target, mob, skill) - -- TODO: This logic should probably be in mob script. - local mobhp = mob:getHPP() - - if mobhp <= 10 then -- Set up Gigaflare for being called by the script again. - mob:setLocalVar('GigaFlare', 0) - mob:setMobAbilityEnabled(false) -- Disable mobskills/spells until Gigaflare is used successfully (don't want to delay it/queue Megaflare) - mob:setMagicCastingEnabled(false) - end - - return 1 + return 0 end mobskillObject.onMobWeaponSkill = function(mob, target, skill, action) @@ -45,16 +36,6 @@ mobskillObject.onMobWeaponSkill = function(mob, target, skill, action) target:takeDamage(info.damage, mob, info.attackType, info.damageType) end - -- TODO: This logic can probably be in the mob script. - mob:setLocalVar('GigaFlare', 1) -- When set to 1 the script won't call it. - mob:setLocalVar('tauntShown', 0) - mob:setMobAbilityEnabled(true) -- Enable the spells/other mobskills again - mob:setMagicCastingEnabled(true) - - if bit.band(mob:getBehavior(), xi.behavior.NO_TURN) == 0 then -- re-enable noturn - mob:setBehavior(bit.bor(mob:getBehavior(), xi.behavior.NO_TURN)) - end - return info.damage end diff --git a/scripts/actions/mobskills/megaflare.lua b/scripts/actions/mobskills/megaflare.lua index eabaf7dcf0f..851f6aa120f 100644 --- a/scripts/actions/mobskills/megaflare.lua +++ b/scripts/actions/mobskills/megaflare.lua @@ -8,17 +8,7 @@ local mobskillObject = {} mobskillObject.onMobSkillCheck = function(target, mob, skill) - local mobhp = mob:getHPP() - - -- TODO: Handle this in mobscripts? - if - mobhp <= 10 and - mob:getLocalVar('GigaFlare') ~= 0 -- make sure Gigaflare has happened first - don't want a random Megaflare to block it. - then - mob:setLocalVar('MegaFlareQueue', 1) -- set up Megaflare for being called by the script again. - end - - return 1 + return 0 end mobskillObject.onMobWeaponSkill = function(mob, target, skill, action) @@ -46,18 +36,6 @@ mobskillObject.onMobWeaponSkill = function(mob, target, skill, action) target:takeDamage(info.damage, mob, info.attackType, info.damageType) end - -- TODO: Handle this in mob scripts instead. - mob:setLocalVar('MegaFlareQueue', mob:getLocalVar('MegaFlareQueue') - 1) - mob:setLocalVar('FlareWait', 0) -- reset the variables for Megaflare. - mob:setLocalVar('tauntShown', 0) - mob:setMobAbilityEnabled(true) -- re-enable the other actions on success - mob:setMagicCastingEnabled(true) - mob:setAutoAttackEnabled(true) - - if bit.band(mob:getBehavior(), xi.behavior.NO_TURN) == 0 then -- re-enable noturn - mob:setBehavior(bit.bor(mob:getBehavior(), xi.behavior.NO_TURN)) - end - return info.damage end diff --git a/scripts/actions/mobskills/teraflare.lua b/scripts/actions/mobskills/teraflare.lua index e5f167ca3cc..e30d23806f2 100644 --- a/scripts/actions/mobskills/teraflare.lua +++ b/scripts/actions/mobskills/teraflare.lua @@ -15,15 +15,23 @@ mobskillObject.onMobWeaponSkill = function(mob, target, skill, action) local params = {} params.baseDamage = mob:getMainLvl() - params.fTP = { 20, 20, 20 } + params.fTP = { 19, 19, 19 } params.element = xi.element.FIRE - params.dStatMultiplier = 1.5 params.attackType = xi.attackType.MAGICAL params.damageType = xi.damageType.FIRE params.shadowBehavior = xi.mobskills.shadowBehavior.WIPE_SHADOWS + params.dStatMultiplier = 1.5 local info = xi.mobskills.mobMagicalMove(mob, target, skill, action, params) + -- Targets that are not the primary target take 300 less damage. + if + target:getID() ~= skill:getPrimaryTargetID() and + info.damage > 0 -- Damage was not nullified or absorbed. + then + info.damage = math.max(0, info.damage - 300) + end + if xi.mobskills.processDamage(mob, target, skill, action, info) then target:takeDamage(info.damage, mob, info.attackType, info.damageType) end