local CONFIG =
{ --!< Nazwa Questa
[xxxx] = { -- Chest Unique ID
chestLevel = xxx, -- Player Level
chestStorage = xxx, -- Storage
items = {{NAGRODA,1}}, -- {ITEM_ID,COUNT}
},
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(exhaustion.check(cid, 43523)) then
return true
end
local questStatus = getPlayerStorageValue(cid, CONFIG[item.uid].chestStorage)
if (questStatus == -1) then
if getPlayerLevel(cid) >= CONFIG[item.uid].chestLevel then
for i = 1, #CONFIG[item.uid].items do
doPlayerAddItem(cid, CONFIG[item.uid].items[i][1], CONFIG[item.uid].items[i][2])
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have found a treasure!.")
doSendAnimatedText(getCreaturePosition(cid), "[Succes!]", TEXTCOLOR_RED)
setPlayerStorageValue(cid, CONFIG[item.uid].chestStorage, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to be at least ".. CONFIG[item.uid].chestLevel.." level to open this chest.")
end
else
doSendAnimatedText(fromPosition, "[Empty!]", TEXTCOLOR_WHITE)
end
exhaustion.set(cid, 43523, 2)
return true
end