local Timer_01 = 00 local Timer_02 = 00 local Timer_03 = 00 local Timer_04 = 00 function onUse(player, item, fromPosition, target, toPosition, isHotkey) local Player_01 = Tile(3617, 1264, 8) local Player_02 = Tile(3620, 1267, 8) local Player_03 = Tile(3617, 1270, 8) local Player_04 = Tile(3614, 1267, 8) local Player_One = Player_01:getTopCreature() local Player_Two = Player_02:getTopCreature() local Player_Tre = Player_03:getTopCreature() local Player_Fou = Player_04:getTopCreature() if item.itemid == 1946 then item:transform(1945) return true end if Player_One and Player_One:isPlayer() and Player_Two and Player_Two:isPlayer() and Player_Tre and Player_Tre:isPlayer() and Player_Fou and Player_Fou:isPlayer() then item:transform(1946) Player_One:teleportTo({x=3619, y=1296, z=08}) Player_One:getPosition():sendMagicEffect(CONST_ME_TELEPORT) Timer_01 = 59 addEvent(onTesouroUm, 1000) Player_Two:teleportTo({x=3619, y=1310, z=08}) Player_Two:getPosition():sendMagicEffect(CONST_ME_TELEPORT) Timer_02 = 59 addEvent(onTesouroDois, 1000) Player_Tre:teleportTo({x=3619, y=1324, z=08}) Player_Tre:getPosition():sendMagicEffect(CONST_ME_TELEPORT) Timer_03 = 59 addEvent(onTesouroTres, 1000) Player_Fou:teleportTo({x=3619, y=1338, z=08}) Player_Fou:getPosition():sendMagicEffect(CONST_ME_TELEPORT) Timer_04 = 59 addEvent(onTesouroQuatro, 1000) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Todos precisam ficar em suas posições.") player:getPosition():sendMagicEffect(03) end return true end function onTesouroUm() local from = {x=3616, y=1293, z=08} local to = {x=3622, y=1299, z=08} for A = from.x, to.x do for B = from.y, to.y do for C = from.z, to.z do local tile = Tile(A, B, C) if tile ~= nil then local creature = tile:getTopCreature() if creature and creature:isPlayer() then if Timer_01 == 00 then creature:teleportTo({x=3602, y=1261, z=08}) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) break else Timer_01 = Timer_01 - 01 addEvent(onTesouroUm, 1000) break end end end end end end end function onTesouroDois() local from = {x=3616, y=1307, z=08} local to = {x=3622, y=1313, z=08} for A = from.x, to.x do for B = from.y, to.y do for C = from.z, to.z do local tile = Tile(A, B, C) if tile ~= nil then local creature = tile:getTopCreature() if creature and creature:isPlayer() then if Timer_02 == 00 then creature:teleportTo({x=3602, y=1261, z=08}) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) break else Timer_02 = Timer_02 - 01 addEvent(onTesouroDois, 1000) break end end end end end end end function onTesouroTres() local from = {x=3616, y=1321, z=08} local to = {x=3622, y=1327, z=08} for A = from.x, to.x do for B = from.y, to.y do for C = from.z, to.z do local tile = Tile(A, B, C) if tile ~= nil then local creature = tile:getTopCreature() if creature and creature:isPlayer() then if Timer_03 == 00 then creature:teleportTo({x=3602, y=1261, z=08}) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) break else Timer_03 = Timer_03 - 01 addEvent(onTesouroTres, 1000) break end end end end end end end function onTesouroQuatro() local from = {x=3616, y=1335, z=08} local to = {x=3622, y=1341, z=08} for A = from.x, to.x do for B = from.y, to.y do for C = from.z, to.z do local tile = Tile(A, B, C) if tile ~= nil then local creature = tile:getTopCreature() if creature and creature:isPlayer() then if Timer_04 == 00 then creature:teleportTo({x=3602, y=1261, z=08}) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) break else Timer_04 = Timer_04 - 01 addEvent(onTesouroQuatro, 1000) break end end end end end end end