landsandboat/scripts/effects/astral_flow.lua
claywar 7bba1bdc3a
[type] Add type annotations to Effect scripts
Fix delStatusEffect in atma.lua
2024-08-24 21:26:29 -04:00

42 lines
1.4 KiB
Lua

-----------------------------------
-- xi.effect.ASTRAL_FLOW
-----------------------------------
---@type TEffect
local effectObject = {}
effectObject.onEffectGain = function(target, effect)
target:recalculateAbilitiesTable()
if target:isPC() then
local jpBonus = target:getJobPointLevel(xi.jp.ASTRAL_FLOW_EFFECT) * 5
if jpBonus > 0 then
target:addPetMod(xi.mod.STR, jpBonus)
target:addPetMod(xi.mod.DEX, jpBonus)
target:addPetMod(xi.mod.VIT, jpBonus)
target:addPetMod(xi.mod.AGI, jpBonus)
target:addPetMod(xi.mod.INT, jpBonus)
target:addPetMod(xi.mod.MND, jpBonus)
target:addPetMod(xi.mod.CHR, jpBonus)
end
end
end
effectObject.onEffectTick = function(target, effect)
end
effectObject.onEffectLose = function(target, effect)
target:recalculateAbilitiesTable()
if target:isPC() then
local jpBonus = target:getJobPointLevel(xi.jp.ASTRAL_FLOW_EFFECT) * 5
if jpBonus > 0 then
target:delPetMod(xi.mod.STR, jpBonus)
target:delPetMod(xi.mod.DEX, jpBonus)
target:delPetMod(xi.mod.VIT, jpBonus)
target:delPetMod(xi.mod.AGI, jpBonus)
target:delPetMod(xi.mod.INT, jpBonus)
target:delPetMod(xi.mod.MND, jpBonus)
target:delPetMod(xi.mod.CHR, jpBonus)
end
end
end
return effectObject