local config = {
-- [actionid] = vocation
[1234] = 1,
[2345] = 2,
[3456] = 3,
[4567] = 4
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
for actionid, vocation in pairs(config) do
if item.actionid == actionid and getPlayerVocation(cid) == 0 then
doPlayerSetVocation(cid, vocation)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, now you are ".. getPlayerVocationName(cid)..".")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not pick a vocation.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
return true
end