Em data/creaturescripts/scripts, duplica um arquivo e nomeia para "vocations_gain" sem as aspas e nele cole:
local vocationsItem = {
[1] = 1234, -- sorcerer, troque os 1234 pelo id do item.
[2] = 1234, -- druid
[3] = 1234, -- paladin
[4] = 1234 -- knight
}
local lvlGain = 20 -- lvl para ganhar
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
Agora em
creaturescripts.xml cole a tag:
<event type="advance" name="VocationsGain" event="script" value="vocations_gain.lua"/>
E por último em data/creaturescripts/scripts/login.lua, cole a tag antes do último "return true":
registerCreatureEvent(cid, "VocationsGain")




info
Grupo: Visconde
Registrado: 22/06/08
Posts: 489
Reputação: +137
Gênero: Masculino
Olá, encontrei aqui no xtibia alguns scripts de dar um certo item quando o player alcança X level.Será que alguém poderia fazer um ou me mandar, que o item fosse de acordo com o level e a vocação? Exemplo:
-Se um kina alcançar lvl 20, ele ganha uma ice rapier.
-Se um sorcerer alcançar lvl 20, ganha uma boots of haste.
Se alguém puder ajudar...rep+