function onThink(cid)
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureOutfit(pid).lookType == 129 then
if getPlayerVocation(pid) ~= 3 then
doPlayerSetVocation(pid, 3)
doPlayerSendTextMessage(pid,25,"You have changed you class to paladin")
end
end
end
return true
end
local o = { --OUTFIT LOOKTYPE, VOCATION ID
[130] = 1, --sorcerer
[140] = 2, --druid
[150] = 3, --paladin
[160] = 4, --knight
}
function onOutfit(cid, old, current)
if o[current.lookType] and getPlayerVocation(cid) ~= o[current.lookType] then
doPlayerSetVocation(cid, o[current.lookType])
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have changed you class to '.. getPlayerVocationName(cid) ..'.')
end
return true
end
<event type="outfit" name="vocation" event="script" value="outfit.lua"/>
registerCreatureEvent(cid, "vocation")
local o = { --OUTFIT LOOKTYPE, VOCATION ID
--sorcerer
[149] = 1,
[145] = 1,
--druid
[148] = 2,
[144] = 2,
--paladin
[137] = 3,
[129] = 3,
--knight
[139] = 4,
[131] = 4
}
function onOutfit(cid, old, current)
if old.lookType ~= current.lookType and o[current.lookType] then
doPlayerSetVocation(cid, o[current.lookType])
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have changed you class to '.. getPlayerVocationName(cid) ..'.')
end
return true
end