local QUESTS =
{
[2453]={itemadd = 2453, count = 1, storage = 2453}, -- arcane staff - poi - same storage
[6528]={itemadd = 6528, count = 1, storage = 2453}, -- avenger - poi - same storage
[5803]={itemadd = 5803, count = 1, storage = 2453}, -- arbalest - poi - same storage
[2152]={itemadd = 2152, count = 100, storage = 2152}, -- 100 platinum coins - poi
[6132]={itemadd = 6132, count = 1, storage = 6132}, -- soft boots - poi
[2365]={itemadd = 2365, count = 1, storage = 2365}, -- backpack of holding - poi
[5791]={itemadd = 5791, count = 1, storage = 5791}, -- stuffed dragon - poi
[2361]={itemadd = 2361, count = 1, storage = 2361} -- frozen starlight - poi
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, QUESTS[item.actionid].storage) == -1 then
if getPlayerFreeCap(cid) >= getItemWeightById(QUESTS[item.actionid].itemadd, QUESTS[item.actionid].count) then
doPlayerSendTextMessage(cid,22,"You have found a " .. getItemNameById(QUESTS[item.actionid].itemadd) .. ".")
doPlayerAddItem(cid, QUESTS[item.actionid].itemadd, QUESTS[item.actionid].count)
setPlayerStorageValue(cid, QUESTS[item.actionid].storage, 1)
else
doPlayerSendTextMessage(cid, TALKTYPE_BROADCAST, "You don\'t have enough capacity, You need " .. getItemWeightById(QUESTS[item.actionid].itemadd, QUESTS[item.actionid].count) .. " oz cap free.")
end
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return TRUE
end