function onUse(cid, item, frompos, item2, topos)
if item.uid == 50049 and item.itemid == 1945 then
player1pos = {x=2459, y=2518, z=8, stackpos=253}
player1 = getThingfromPos(player1pos)
player2pos = {x=2460, y=2518, z=8, stackpos=253}
player2 = getThingfromPos(player2pos)
player3pos = {x=2461, y=2518, z=8, stackpos=253}
player3 = getThingfromPos(player3pos)
if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 then
queststatus1 = getPlayerStorageValue(player1.uid,50049)
queststatus2 = getPlayerStorageValue(player2.uid,50049)
queststatus3 = getPlayerStorageValue(player3.uid,50049)
if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 then
nplayer1pos = {x=2527, y=2566, z=8}
nplayer2pos = {x=2528, y=2566, z=8}
nplayer3pos = {x=2529, y=2566, z=8}
doSendMagicEffect(player1pos,2)
doSendMagicEffect(player2pos,2)
doSendMagicEffect(player3pos,2)
doTeleportThing(player1.uid,nplayer1pos)
doTeleportThing(player2.uid,nplayer2pos)
doTeleportThing(player3.uid,nplayer3pos)
doSendMagicEffect(nplayer1pos,100)
doSendMagicEffect(nplayer2pos,100)
doSendMagicEffect(nplayer3pos,100)
doTransformItem(item.uid,item.itemid+1)
else
doPlayerSendCancel(cid,"Somebody in your team has already done this quest.")
end
else
doPlayerSendCancel(cid,"You need three players for this quest.")
end
elseif item.uid ==50049 and item.itemid == 1946 then
if getPlayerLevel(cid) >= 400 then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
else
return 0
end
return 1
end