efekt = 10
tabela =
{
[1] = {level = 1, newvoc = 2},
[2] = {level = 1, newvoc = 3},
}
local talkState = {}
function onCreatureSay(cid, type, msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local wokacja = tabela[getPlayerVocation(cid)]
if(msg == "hi") then
selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, true)
if (wokacja) then
if getPlayerLevel(cid) >= wokacja.level then
doPlayerSetVocation(cid, wokacja.newvoc)
doSendMagicEffect(getPlayerPosition(cid), efekt)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "You are have now new vocation!")
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "Do you need " .. wokacja.level .. " level")
return true
end
end
end
end