landsandboat/scripts/items/leaf_bench.lua

25 lines
577 B
Lua
Raw Permalink Normal View History

2021-01-18 12:51:02 -05:00
-----------------------------------
-- ID: 6412
-- Item: Leaf Bench
-- Item Effect: Grant Leaf bench 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.LEAF_BENCH
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, 6412, keyItemId)
end
2021-01-17 11:55:03 -05:00
return itemObject