local t = {
[6001] = {8001,"crocodile boots",3982,1},
[6002] = {8002,"crystal coin",2160,10},
[6003] = {8003,"rope",2120,1},
[6004] = {8004,"blue robe",2656,1},
[6005] = {8005,"knight legs",2477,1},
[6006] = {8006,"spellbook",2175,1},
[6007] = {8007,"golden armor",2466,1},
[6008] = {8008,"steel boots",2645,1},
[6009] = {8009,"crystal coin",2160,10},
[6010] = {8010,"demon helmet",2493,1},
[6011] = {8011,"dragon shield",2516,1},
[6012] = {8012,"warrior helmet",2475,1},
[6013] = {8002,"robe of the underworld",8890,1},
[6014] = {8003,"demon legs",2495,1},
[6015] = {8003,"rainbow shield",8905,1},
[6016] = {8003,"spellbook of dark mysteries",8918,1},
[6017] = {8003,"royal crossbow",8851,1},
[6018] = {8004,"serpent sword",2409,1}
}
function onUse(cid,item,fromPosition,itemEx,toPosition)
local v = t[item.uid]
if getPlayerStorageValue(cid,v[1]) == -1 and getPlayerFreeCap(cid) >= (getItemWeightById(v[3])) then
setPlayerStorageValue(cid,v[1],1)
doPlayerAddItem(cid,v[3],v[4])
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a " .. v[2] .. "!")
elseif getPlayerStorageValue(cid,v[1]) == 1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty")
elseif getPlayerFreeCap(cid) < (getItemWeightById(v[3])) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You need " .. getItemWeightById(v[3]) .. ".00 oz in order to get the item")
end
return true
end