Suponho que saiba fazer a tag.
data/talkactions/scripts:
local config = {
itemid = 6103, --Item necessário para trocar de vocação.
level = 50000, --Level necessário.
reset_amount = 10, --Quantidade mínima de resets necessária.
reset_func = getPlayerReset, --Função responsável por retornar quantos resets o jogador possui.
vocations = {
--["vocation_name"] = id,
["knight"] = 1,
["paladin"] = 2,
--etc
}
}
function onSay(cid, words, param)
local vocation = config.vocations[param:lower()]
if config.reset_func(cid) < config.reset_amount then
doPlayerSendCancel(cid, "You need "..config.reset_amount.." resets.")
return true
elseif getPlayerLevel(cid) < config.level then
doPlayerSendCancel(cid, "You need at least level "..config.level..".")
return true
elseif not vocation then
doPlayerSendCancel(cid, "This vocation doesn't exist or isn't available by this command.")
return true
elseif vocation == getPlayerVocation(cid) then
doPlayerSendCancel(cid, "You already belong to this vocation.")
return true
elseif not doPlayerRemoveItem(cid, config.itemid, 1) then
doPlayerSendCancel(cid, "You need 1x "..getItemNameById(config.itemid)..".")
return true
end
doPlayerSendTextMessage(cid, 27, "Congratulations, now you're a "..param.."!")
doPlayerSetVocation(cid, vocation)
return true
end


info
Grupo: Artesão
Registrado: 09/02/11
Posts: 147
Reputação: +24
Char no Tibia: Soul Of Street
Ola , gostaria de fazer um pedido de script de change vocation.
O script seria para escolher a vocation como já diz no nome do tópico, o player teria que ter um item na BP que seria no caso o item id= 6103 , ai ao ter o item dentro de sua BP ele falaria o comando !changevoc VOCAÇÃO (ou seja: sorcerer, druid, paladin ou knight) ai o cara que for usar esse comando ele teria que ter 10 resets e estar no level 50.000 exatamente.
Bom resumidamente é isso, se alguém mudar me ajudar dou ++rep !!!
OBS: Meu server é 8.60 / EXP ALTA.
Ainda não fiz o sistema de resets caso alguem pergunte, mas ja estou começando... pois faz parte deste Script acima também.
SEGUE UMA IMAGEM DE EXEMPLO.