landsandboat/scripts/items/pro-ether_+2.lua

24 lines
716 B
Lua

-----------------------------------
-- ID: 4142
-- Item: Pro-Ether +2
-- Item Effect: Restores 310 MP
-----------------------------------
---@type TItem
local itemObject = {}
itemObject.onItemCheck = function(target, item, caster)
if target:getMP() == target:getMaxMP() then
return xi.msg.basic.ITEM_UNABLE_TO_USE
elseif target:hasStatusEffect(xi.effect.MEDICINE) then
return xi.msg.basic.ITEM_NO_USE_MEDICATED
end
return 0
end
itemObject.onItemUse = function(target, user)
target:messageBasic(xi.msg.basic.RECOVERS_MP, 0, target:addMP(310 * xi.settings.main.ITEM_POWER))
target:addStatusEffect(xi.effect.MEDICINE, { duration = 900, origin = user })
end
return itemObject