local t = {
39001, {
[20] = {2160, 2, "You have been awarded with 2 crystal coin for reaching level 20!", 1},
[35] = {2160, 3, "You have been awarded with 3 crystal coins for reaching level 50!", 2},
[50] = {2160, 5, "You have been awarded with 5 crystal coins for reaching level 75!", 3},
[100] = {2160, 10, "You have been awarded with 10 crystal coins for reaching level 100!", 4},
[150] = {2160, 15, "You have been awarded with 15 crystal coins for reaching level 100!", 5},
[200] = {2160, 20, "You have been awarded with 20 crystal coins for reaching level 200!", 6}
}
}
function onAdvance(cid, skill, oldlevel, newlevel)
local player = Player(cid)
for level, v in pairs(t[2]) do
if skill == 8 and oldlevel < level and player:getLevel() >= level and player:getStorageValue(t[1]) < v[4] then
player:addItem(v[1], v[2])
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, v[3])
player:setStorageValue(t[1], v[4])
break
end
end
player:save()
return true
end