local config = {
--[vocation id] = { level, nova voc, looktype, efeito}
-- Goku
[1] = { 25, 2, 3, 32},
[2] = { 50, 3, 4, 32},
[3] = { 75, 4, 5, 32},
[4] = { 100, 5, 7, 32},
[5] = { 125, 6, 6, 32},
[6] = { 150, 7, 8, 32},
[7] = { 200, 8, 9, 32},
[8] = { 250, 9, 17, 32},
[9] = { 300, 10, 630, 32}
}
function onSay(player, words, param)
local vocation = player:getVocation():getId()
local voc = config[vocation]
if(not(voc))then
return(player:sendTextMessage(MESSAGE_STATUS_SMALL, player:getName() .. " Nao é possível se transformar.") and false)
end
if(player:getLevel() >= voc[1])then
player:setVocation(voc[2])
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, player:getName() .. " Voce se transformou!")
player:say("Transformar")
player:setOutfitLookType(voc[3])
player:getPosition():sendMagicEffect(voc[4])
return(false)
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, player:getName() .. " Nao é possível se transformar.")
return(false)
end
end
Coloque em lib/core/creature.lua :
function Creature:setOutfitLookType(value)
local outfit = self:getOutfit()
outfit.lookType = value
self:setOutfit(outfit)
return(true)
end