landsandboat/scripts/actions/weaponskills/omniscience.lua
Skold177 55cb6c11a3 [lua] Minor Staff Weaponskills fixes
Fixes a few things for staff weaponskills and leaves some useful comments for the future
2026-01-11 17:23:25 -05:00

46 lines
1.8 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-----------------------------------
-- Omniscience
-- Staff weapon skill
-- Skill Level: N/A
-- Lowers target's magic attack. Duration of effect varies with TP. Tupsimati: Aftermath effect varies with TP.
-- Reduces enemy's magic attack by -10.
-- Available only after completing the Unlocking a Myth (Scholar) quest.
-- Aligned with the Shadow Gorget, Soil Gorget & Light Gorget.
-- Aligned with the Shadow Belt, Soil Belt & Light Belt.
-- Element: Dark
-- Modifiers: MND:80%
-- 100%TP 200%TP 300%TP
-- 2.00 2.00 2.00
-----------------------------------
---@type TWeaponSkill
local weaponskillObject = {}
weaponskillObject.onUseWeaponSkill = function(player, target, wsID, tp, primary, action, taChar)
local params = {}
params.ftpMod = { 2, 2, 2 }
params.mnd_wsc = 0.3
params.ele = xi.element.DARK
params.skill = xi.skill.STAFF
params.includemab = true
-- params.dStat = xi.mod.MND (pMND-mMND)×2 (Not supported in weaponskills.lua currently)
if xi.settings.main.USE_ADOULIN_WEAPON_SKILL_CHANGES then
params.mnd_wsc = 0.8
end
local damage, criticalHit, tpHits, extraHits = xi.weaponskills.doMagicWeaponskill(player, target, wsID, params, tp, action, primary)
-- Apply Aftermath
xi.aftermath.addStatusEffect(player, tp, xi.slot.MAIN, xi.aftermath.type.MYTHIC)
-- Handle status effect
local effectId = xi.effect.MAGIC_ATK_DOWN
local actionElement = xi.element.DARK
local power = 10
local duration = math.floor(6 * tp / 100 * applyResistanceAddEffect(player, target, actionElement, 0))
xi.weaponskills.handleWeaponskillEffect(player, target, effectId, actionElement, damage, power, duration)
return tpHits, extraHits, criticalHit, damage
end
return weaponskillObject