-------------Script made by Tozao----------------------
----------------Created for version 8.4-------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
-------------------variaveis(variables)-------------------
actid = XXXX --action id
kinapos = {x=32673, y=32093, z=8, stackpos=255} --knight position
pallypos = {x=32673, y=32085, z=8, stackpos=255} --paladin position
sorcpos = {x=32677, y=32089, z=8, stackpos=255} --sorcerer position
druidpos = {x=32669, y=32089, z=8, stackpos=255} --druid position
newpos = {x=32671, y=32069, z=8} --posição fora da sala(position out of room)
----------------não modifique(do not modify)--------------
local druidVoc = {2,6}
local pallyVoc = {3,7}
local kinaVoc = {4,8}
local sorcVoc = {1,5}
sorc = getThingFromPos(sorcpos)
pally = getThingFromPos(pallypos)
kina = getThingFromPos(kinapos)
druid = getThingFromPos(druidpos)
if item.actionid == actid and item.itemid == 1945 then
if isPlayer(sorc.uid) == TRUE and isPlayer(pally.uid) == TRUE and isPlayer(kina.uid) == TRUE and isPlayer(druid.uid) == TRUE then
if getPlayerLevel(sorc.uid) >= 20 and getPlayerLevel(pally.uid) >= 20 and getPlayerLevel(druid.uid) >= 20 and getPlayerLevel(kina.uid) >= 20 then
if(isInArray(sorcVoc, getPlayerVocation(sorc.uid)) == TRUE) and (isInArray(druidVoc, getPlayerVocation(druid.uid)) == TRUE) and (isInArray(kinaVoc, getPlayerVocation(kina.uid)) == TRUE) and (isInArray(pallyVoc, getPlayerVocation(pally.uid)) == TRUE) then
doTeleportThing(sorc.uid, newpos)
doTeleportThing(druid.uid, newpos)
doTeleportThing(kina.uid, newpos)
doTeleportThing(pally.uid, newpos)
doTransformItem(item.uid,item.itemid+1)
else
doPlayerSendTextMessage(cid,26, "You need a player for each vocation.")
end
else
doPlayerSendTextMessage(cid,26, "All players have to be level 20 or higher.")
end
else
doPlayerSendTextMessage(cid,26, "You need 4 players.")
end
elseif item.actionid == actid and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
end
return TRUE
end