local items = {
{13,2389,-1},
{19,3965,0},
{22,7378,1},
{26,7367,2},
{33,7368,3},
{99999999999}
}
local stuff = {2389,3965,7378,7367,7368}
function onAdvance(cid, skill, oldlevel, newlevel)
local place = 0
local st = 23636
local blala = newLevel
if isInArray({3,7},getPlayerVocation(cid)) then
if skill == 8 then
for x = 1, #items do
if newlevel >= items[x][1] and newlevel < items[x+1][1] then
place = x
end
end
if place > 0 then
if getPlayerStorageValue(cid,st) <= items[place][4] then
local byvoc = getPlayerVocation(cid)
if getPlayerVocation(cid) > 4 then
byvoc = getPlayerVocation(cid)-4
end
if isInArray(stuff,getPlayerSlotItem(cid,3).itemid) then
doRemoveItem(getPlayerSlotItem(cid,3).uid)
elseif isInArray(stuff,getPlayerSlotItem(cid,7).itemid) then
doRemoveItem(getPlayerSlotItem(cid,7).uid)
end
doPlayerAddItem(cid,items[place][byvoc+1],1)
doPlayerSendTextMessage(cid,4,"While upar his wand also evolved: "..getItemNameById(items[place][byvoc+1])..".")
setPlayerStorageValue(cid,st,items[place][4]+1)
end
end
end
end
return TRUE
end
Obs.: alterei os "local Itens" e o "stuff" porém o lvl mantive o mesmo (13,19,22,26,33), se quiser alterar os leveis eh so mudar os valores.