function onUse(cid, item, frompos, item2, topos)
local outfit = getCreatureOutfit(cid)
-- IDS DOS ITENS ---
itemidum = 6215
itemiddois = 6216
itemidtres = 6217
itemidquatro = 6218
questlevel = 140
switchUniqueID = 1912 -- unique id da alavanca
--- POSS DOS ITENS ---
garlicp1 = {x=33143, y=32871, z=9, stackpos=1}
garlicp2 = {x=33146, y=32871, z=9, stackpos=1}
garlicp3 = {x=33149, y=32871, z=9, stackpos=1}
garlicp4 = {x=33152, y=32871, z=9, stackpos=1}
--- POSSO PARA ONDE OS PLAYER VAI ---
local newposs = {x=33127, y=32490, z=9}
--- NÃO MEXER ! --
garlic1 = getThingfromPos(garlicp1)
garlic2 = getThingfromPos(garlicp2)
garlic3 = getThingfromPos(garlicp3)
garlic4 = getThingfromPos(garlicp4)
--- POSS DOS PLAYERS
player1pos = {x=33145, y=32864, z=9, stackpos=253}
player1 = getThingfromPos(player1pos)
player2pos = {x=33146, y=32864, z=9, stackpos=253}
player2 = getThingfromPos(player2pos)
player3pos = {x=33147, y=32864, z=9, stackpos=253}
player3 = getThingfromPos(player3pos)
player4pos = {x=33148, y=32864, z=9, stackpos=253}
player4 = getThingfromPos(player4pos)
---- NÃO MEXA ---
knightvoc = getPlayerVocation(player1.uid)
sorcvoc = getPlayerVocation(player2.uid)
druidvoc = getPlayerVocation(player3.uid)
paladinvoc = getPlayerVocation(player4.uid)
--- NÃO MEXA ---
player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)
player3level = getPlayerLevel(player3.uid)
player4level = getPlayerLevel(player4.uid)
if knightvoc == 4 or knightvoc == 8 and
paladinvoc == 3 or paladinvoc == 7 and
druidvoc == 2 or druidvoc == 6 and
sorcvoc == 1 or sorcvoc == 5 then
if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then
if item.uid == switchUniqueID and garlic1.itemid == itemidum and garlic2.itemid == itemiddois and garlic3.itemid == itemidtres and garlic4.itemid == itemidquatro and getCreatureCondition(cid, CONDITION_DRUNK) and outfit.lookType == 21 then
doRemoveItem(garlic1.uid,1)
doRemoveItem(garlic2.uid,1)
doRemoveItem(garlic3.uid,1)
doRemoveItem(garlic4.uid,1)
doTeleportThing(player1.uid,newposs)
doSendMagicEffect(newposs,10)
doTeleportThing(player2.uid,newposs)
doSendMagicEffect(newposs,10)
doTeleportThing(player3.uid,newposs)
doSendMagicEffect(newposs,10)
doTeleportThing(player4.uid,newposs)
doSendMagicEffect(newposs,10)
end
else
return 0
end
else
doPlayerSendCancel(cid,"Sorry, all players in your team must to be level " .. questlevel .. " drunk and transformed into rats or, all 4 players must be on right positions.")
end
end
return 1
end