landsandboat/scripts/items/potion.lua

22 lines
511 B
Lua
Raw Permalink Normal View History

2021-01-18 12:51:02 -05:00
-----------------------------------
2016-01-16 01:26:33 -05:00
-- ID: 4112
-- Item: Potion
-- Item Effect: Restores 50 HP
2021-01-18 12:51:02 -05:00
-----------------------------------
---@type TItem
local itemObject = {}
2016-01-16 01:26:33 -05:00
itemObject.onItemCheck = function(target, item, caster)
if target:getHP() == target:getMaxHP() then
2021-04-01 15:10:15 -04:00
return xi.msg.basic.ITEM_UNABLE_TO_USE
2017-11-11 00:34:58 -05:00
end
return 0
end
2016-01-16 01:26:33 -05:00
itemObject.onItemUse = function(target)
target:messageBasic(xi.msg.basic.RECOVERS_HP, 0, target:addHP(50 * xi.settings.main.ITEM_POWER))
end
2021-01-17 11:55:03 -05:00
return itemObject