Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions modules/soa/lua/flame_holder.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
-----------------------------------
-- Flame Holder
-- Reverts Flame Holder to its pre-2019 functionality - Where it consumed Fire Maneuvers on skill execution.
-- Source : https://wiki.ffo.jp/html/11183.html
-----------------------------------
require('modules/module_utils')
-----------------------------------
local m = Module:new('era_flame_holder')

local validSkills = set
{
xi.automaton.abilities.ARCUBALLISTA,
xi.automaton.abilities.ARMOR_PIERCER,
xi.automaton.abilities.ARMOR_SHATTERER,
xi.automaton.abilities.BONE_CRUSHER,
xi.automaton.abilities.CANNIBAL_BLADE,
xi.automaton.abilities.CHIMERA_RIPPER,
xi.automaton.abilities.DAZE,
xi.automaton.abilities.KNOCKOUT,
xi.automaton.abilities.MAGIC_MORTAR,
xi.automaton.abilities.SLAPSTICK,
xi.automaton.abilities.STRING_CLIPPER,
xi.automaton.abilities.STRING_SHREDDER,
}

m:addOverride('xi.actions.abilities.pets.attachments.flame_holder.onEquip', function(pet, attachment)
pet:addListener('WEAPONSKILL_STATE_ENTER', 'AUTO_FLAME_HOLDER_START', function(automaton, skillId)
-- Not a valid skill for Flame Holder
if not validSkills[skillId] then
return
end

local master = automaton:getMaster()

if not master then
return
end

-- Fetch the amount of active Fire Maneuvers on weaponskill state entry.
local fireManeuvers = master:countEffect(xi.effect.FIRE_MANEUVER)

-- No Fire Maneuvers
if fireManeuvers == 0 then
return
end

-- Set the WEAPONSKILL_DAMAGE_BASE mod to 125% / 150% / 175% based on the number of Fire Maneuvers active.
local flameHolderAmount = 100 + 25 * fireManeuvers

automaton:setLocalVar('fireManeuvers', fireManeuvers)
automaton:setLocalVar('flameHolderAmount', flameHolderAmount)
automaton:addMod(xi.mod.WEAPONSKILL_DAMAGE_BASE, flameHolderAmount)
end)

pet:addListener('WEAPONSKILL_STATE_EXIT', 'AUTO_FLAME_HOLDER_END', function(automaton, skillId, wasExecuted)
local flameHolderAmount = automaton:getLocalVar('flameHolderAmount')

-- If no Flame Holder bonus is active, do nothing.
if flameHolderAmount == 0 then
return
end

local fireManeuvers = automaton:getLocalVar('fireManeuvers')
local master = automaton:getMaster()

if not master then
return
end

-- Consume all Fire Maneuvers on execution.
for i = 1, fireManeuvers do
master:delStatusEffectSilent(xi.effect.FIRE_MANEUVER)
end

-- Remove the Flame Holder bonus and reset local variables.
automaton:delMod(xi.mod.WEAPONSKILL_DAMAGE_BASE, flameHolderAmount)
automaton:setLocalVar('flameHolderAmount', 0)
automaton:setLocalVar('fireManeuvers', 0)
end)
end)

m:addOverride('xi.actions.abilities.pets.attachments.flame_holder.onUnequip', function(pet, attachment)
local amount = pet:getLocalVar('flameHolderAmount')

-- Should be nearly impossible, but just in case.
if amount ~= 0 then
pet:delMod(xi.mod.WEAPONSKILL_DAMAGE_BASE, amount)
end

pet:setLocalVar('flameHolderAmount', 0)
pet:setLocalVar('fireManeuvers', 0)
pet:removeListener('AUTO_FLAME_HOLDER_START')
pet:removeListener('AUTO_FLAME_HOLDER_END')
end)

m:addOverride('xi.actions.abilities.pets.attachments.flame_holder.onManeuverGain', function(pet, attachment, maneuvers)
end)

m:addOverride('xi.actions.abilities.pets.attachments.flame_holder.onManeuverLose', function(pet, attachment, maneuvers)
end)

m:addOverride('xi.actions.abilities.pets.attachments.flame_holder.onUpdate', function(pet, attachment, maneuvers)
end)

return m
20 changes: 14 additions & 6 deletions scripts/actions/abilities/pets/attachments/barrage_turbine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ attachmentObject.onEquip = function(pet)
pet:addListener('AUTOMATON_ATTACHMENT_CHECK', 'ATTACHMENT_BARRAGE_TURBINE', function(automaton, target)
local master = automaton:getMaster()

if
not automaton:hasRecast(xi.recast.ABILITY, xi.automaton.abilities.BARRAGE_TURBINE) and
master and
master:countEffect(xi.effect.WIND_MANEUVER) > 0
then
automaton:useMobAbility(xi.automaton.abilities.BARRAGE_TURBINE, target)
if not master then
return
end

-- If no Wind Maneuvers are active, do nothing.
if master:countEffect(xi.effect.WIND_MANEUVER) == 0 then
return
end

-- If Barrage Turbine is still on cooldown, do nothing.
if automaton:hasRecast(xi.recast.ABILITY, xi.automaton.abilities.BARRAGE_TURBINE) then
return
end

automaton:useMobAbility(xi.automaton.abilities.BARRAGE_TURBINE, target)
end)
end

Expand Down
67 changes: 13 additions & 54 deletions scripts/actions/abilities/pets/attachments/flame_holder.lua
Original file line number Diff line number Diff line change
@@ -1,70 +1,29 @@
-----------------------------------
-- Attachment: Flame Holder
-- Description : Adds fire maneuver burden to increase weapon skill damage.
-- 25% at 0, 100% at 1, 175% at 2, and 250% at 3. Ex. at 3 fire maneuvers, 10 fTP will be 25 fTP.
-----------------------------------
---@type TAttachment
local attachmentObject = {}

local validskills = set{
1940,
1941,
1942,
1943,
2065,
2066,
2067,
2299,
2300,
2301,
2743,
2744,
}

attachmentObject.onEquip = function(automaton)
automaton:addListener('WEAPONSKILL_STATE_ENTER', 'AUTO_FLAME_HOLDER_START', function(pet, skill)
if not validskills[skill] then
return
end

local master = pet:getMaster()
local maneuvers = master:countEffect(xi.effect.FIRE_MANEUVER)

if maneuvers < 1 or maneuvers > 3 then
return
end

local amount = 25 * maneuvers
pet:setLocalVar('flameholdermaneuvers', maneuvers)

pet:addMod(xi.mod.WEAPONSKILL_DAMAGE_BASE, amount)
pet:setLocalVar('flameholder', amount)
end)

automaton:addListener('WEAPONSKILL_STATE_EXIT', 'AUTO_FLAME_HOLDER_END', function(pet, skillId, wasExecuted)
local master = pet:getMaster()
local toremove = pet:getLocalVar('flameholdermaneuvers')
if toremove == 0 then
return
end

for i = 1, toremove do
master:delStatusEffectSilent(xi.effect.FIRE_MANEUVER)
end
attachmentObject.onEquip = function(pet, attachment)
xi.automaton.onAttachmentEquip(pet, attachment)
end

pet:delMod(xi.mod.WEAPONSKILL_DAMAGE_BASE, pet:getLocalVar('flameholder'))
pet:setLocalVar('flameholder', 0)
pet:setLocalVar('flameholdermaneuvers', 0)
end)
attachmentObject.onUnequip = function(pet, attachment)
xi.automaton.onAttachmentUnequip(pet, attachment)
end

attachmentObject.onUnequip = function(pet)
pet:removeListener('AUTO_FLAME_HOLDER_START')
pet:removeListener('AUTO_FLAME_HOLDER_END')
attachmentObject.onManeuverGain = function(pet, attachment, maneuvers)
xi.automaton.onManeuverGain(pet, attachment, maneuvers)
end

attachmentObject.onManeuverGain = function(pet, maneuvers)
attachmentObject.onManeuverLose = function(pet, attachment, maneuvers)
xi.automaton.onManeuverLose(pet, attachment, maneuvers)
end

attachmentObject.onManeuverLose = function(pet, maneuvers)
attachmentObject.onUpdate = function(pet, attachment, maneuvers)
xi.automaton.updateAttachmentModifier(pet, attachment, maneuvers)
end

return attachmentObject
44 changes: 33 additions & 11 deletions scripts/actions/abilities/pets/automaton/arcuballista.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
-----------------------------------
-- Arcuballista
-- Description: Delivers a single attack. Damage varies with TP.
-----------------------------------
---@type TAbilityAutomaton
local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand All @@ -14,22 +16,42 @@ abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
end

abilityObject.onAutomatonAbility = function(target, automaton, skill, master, action)
local params =
{
numHits = 1,
atkmulti = 1,
accBonus = 100,
ftpMod = { 2.5, 3.0, 4.0 },
dex_wsc = 0.5,
}
local params = {}

params.baseDamage = xi.automaton.getRangedBaseDamage(automaton)
params.numHits = 1
params.fTP = { 2.5, 3.0, 4.0 }
params.dex_wSC = 0.60
params.accuracyModifier = { 100, 100, 100 }
params.attackType = xi.attackType.RANGED
params.damageType = xi.damageType.PIERCING
params.shadowBehavior = xi.mobskills.shadowBehavior.NUMSHADOWS_1
params.skipParry = true
params.skipGuard = true
params.skipBlock = true

if xi.settings.main.USE_ADOULIN_WEAPON_SKILL_CHANGES then
params.ftpMod = { 7.0, 10.0, 13.0 }
params.fTP = { 7.0, 10.0, 13.0 }
end

-- Flame Holder Adjustment
local flameHolderfTP = automaton:getMod(xi.mod.WEAPONSKILL_DAMAGE_BASE) / 100
if flameHolderfTP > 0 then
params.fTP =
{
params.fTP[1] * flameHolderfTP,
params.fTP[2] * flameHolderfTP,
params.fTP[3] * flameHolderfTP,
}
end

local damage = xi.autows.doAutoRangedWeaponskill(automaton, target, 0, params, skill:getTP(), true, skill, action)
local info = xi.mobskills.mobRangedMove(automaton, target, skill, action, params)

if xi.mobskills.processDamage(automaton, target, skill, action, info) then
target:takeDamage(info.damage, automaton, info.attackType, info.damageType)
end

return damage
return info.damage
end

return abilityObject
47 changes: 34 additions & 13 deletions scripts/actions/abilities/pets/automaton/armor_piercer.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
-----------------------------------
-- Armor Piercer
-- Description: Delivers a single hit attack. Damage varies with TP. Ignores 50% of targets defence during weapon skill.
-----------------------------------
---@type TAbilityAutomaton
local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand All @@ -14,24 +16,43 @@ abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
end

abilityObject.onAutomatonAbility = function(target, automaton, skill, master, action)
local params =
{
numHits = 1,
atkmulti = 1.5,
accBonus = 100,
ftpMod = { 3.0, 3.0, 3.0 },
ignoredDefense = { 0.4, 0.5, 0.7 },
dex_wsc = 0.6,
}
local params = {}

params.baseDamage = xi.automaton.getRangedBaseDamage(automaton)
params.numHits = 1
params.fTP = { 3.0, 3.5, 4.0 }
params.dex_wSC = 0.60
params.ignoreDefense = { 0.5, 0.5, 0.5 }
params.accuracyModifier = { 100, 100, 100 }
params.attackType = xi.attackType.RANGED
params.damageType = xi.damageType.PIERCING
params.shadowBehavior = xi.mobskills.shadowBehavior.NUMSHADOWS_1
params.skipParry = true
params.skipGuard = true
params.skipBlock = true

if xi.settings.main.USE_ADOULIN_WEAPON_SKILL_CHANGES then
params.ftpMod = { 4.0, 5.5, 7.0 }
params.ignoredDefense = { 0.5, 0.5, 0.5 }
params.fTP = { 4.0, 5.5, 7.0 }
end

-- Flame Holder Adjustment
local flameHolderfTP = automaton:getMod(xi.mod.WEAPONSKILL_DAMAGE_BASE) / 100
if flameHolderfTP > 0 then
params.fTP =
{
params.fTP[1] * flameHolderfTP,
params.fTP[2] * flameHolderfTP,
params.fTP[3] * flameHolderfTP,
}
end

local damage = xi.autows.doAutoRangedWeaponskill(automaton, target, 0, params, skill:getTP(), true, skill, action)
local info = xi.mobskills.mobRangedMove(automaton, target, skill, action, params)

if xi.mobskills.processDamage(automaton, target, skill, action, info) then
target:takeDamage(info.damage, automaton, info.attackType, info.damageType)
end

return damage
return info.damage
end

return abilityObject
Loading
Loading