local rewards = {
-- {{item_id, amount}, {item_id, amount}}
{{1111, 1}, {2222, 10}}, -- common
{{1111, 1}, {2222, 10}}, -- uncommon
{{1111, 1}, {2222, 10}} -- rare
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local index = 1
local rand = math.random(1000)
if rand > 950 then
index = 3
elseif rand > 800 then
index = 2
end
rand = math.random(#rewards[index])
doPlayerAddItem(cid, rewards[index][rand][1], rewards[index][rand][2])
return true
end