24 lines
717 B
Lua
24 lines
717 B
Lua
-----------------------------------
|
|
-- ID: 4125
|
|
-- Item: Max-Potion +1
|
|
-- Item Effect: Restores 550 HP
|
|
-----------------------------------
|
|
---@type TItem
|
|
local itemObject = {}
|
|
|
|
itemObject.onItemCheck = function(target, item, caster)
|
|
if target:getHP() == target:getMaxHP() 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_HP, 0, target:addHP(550 * xi.settings.main.ITEM_POWER))
|
|
target:addStatusEffect(xi.effect.MEDICINE, { duration = 900, origin = user })
|
|
end
|
|
|
|
return itemObject
|