local t = {
-- [storage], level, itemid, count
[15512] = {50, 2160, 5}
}
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL__LEVEL then
for storage, v in pairs(t) do
if newLevel >= v[1] and getPlayerStorageValue(cid, storage) < 1 then
doPlayerAddItem(cid, v[2], v[3])
setPlayerStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "CONGRATULATIONS! You've reached level " .. v[1] .. ".")
break
end
end
end
return true
end