landsandboat/scripts/items/portable_container.lua

25 lines
623 B
Lua
Raw Permalink Normal View History

2021-01-18 12:51:02 -05:00
-----------------------------------
-- ID: 6408
-- Item: Portable Container
-- Item Effect: Grant Portable container key item
2021-01-18 12:51:02 -05:00
-----------------------------------
---@type TItem
local itemObject = {}
2021-04-01 15:10:15 -04:00
local keyItemId = xi.ki.PORTABLE_CONTAINER
itemObject.onItemCheck = function(target, item, caster)
if target:hasKeyItem(keyItemId) then
2021-04-01 15:10:15 -04:00
return xi.msg.basic.ALREADY_HAVE_KEY_ITEM, 0, keyItemId
end
return 0
end
itemObject.onItemUse = function(target)
target:addKeyItem(keyItemId)
target:messageBasic(xi.msg.basic.OBTAINED_KEY_ITEM, xi.item.PORTABLE_CONTAINER, keyItemId)
end
2021-01-17 11:55:03 -05:00
return itemObject