landsandboat/scripts/items/bottle_of_potion_drops.lua

22 lines
564 B
Lua

-----------------------------------
-- ID: 5327
-- Item: Potion Drop
-- Item Effect: Restores 60 HP
-----------------------------------
---@type TItem
local itemObject = {}
itemObject.onItemCheck = function(target, item, caster)
if target:hasStatusEffect(xi.effect.MEDICINE) then
return xi.msg.basic.ITEM_NO_USE_MEDICATED
end
return 0
end
itemObject.onItemUse = function(target, user)
target:addHP(60 * xi.settings.main.ITEM_POWER)
target:addStatusEffect(xi.effect.MEDICINE, { duration = 300, origin = user })
end
return itemObject