Em data/creaturescripts/scripts crie um arquivo.lua nomeie para upgain e adicione:
local vocationsItem = {
[1] = 7759,
[2] = 7760,
[3] = 7761,
[4] = 7762
}
local lvlGain = 20
function onAdvance(cid, skill, oldLevel, newLevel)
if (getPlayerLevel(cid) == lvlGain and getPlayerStorageValue(cid, 403245) ~= 1) then
doPlayerAddItem(cid, vocationsItem[getPlayerVocation(cid)])
setPlayerStorageValue(cid, 403245, 1)
end
return true
end
Editando:
-Vermelho: Id da vocação
-Laranja: Id do item
-Verde: Level para ganhar o item
Em creaturescripts.xml adicione:
<event type="advance" name="upgain" event="script" value="upgain.lua"/>
Para adicionar mais itens faça o seguinte:
Copie o arquivo em roxo:
[1] = 7759,
[2] = 7760,
[3] = 7761,
[4] = 7762
}
Duplique no seguinte lugar (em marrom):
[1] = 7759,
[2] = 7760,
[2] = 7760,
[3] = 7761,
[4] = 7762
}
E depois apenas edite o id da vocação e do item.
Ex:
[1] = 7759,
[2] = 7760,
[5] = 8595,
[3] = 7761,
[4] = 7762
-Verde: O que foi editado
Obs: O script não é meu, eu achei ele aqui em uma pasta de meu ot server e resolvi postar.