local bridgepos = {x=32410, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos2 = {x=32410, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos3 = {x=32411, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos4 = {x=32411, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local bridgeposCheck = {x=32410, y=32231, z=10}
local bridgepos2Check = {x=32411, y=32232, z=10}
local jogaPlayerMonstro = {x=32409, y=32231, z=10}
local frompos = {x=32409, y=32231, z=10}
local splash = {x=32413, y=32230, z=10, stackpos=1} -- Position of the liquid pool
local leverUID = 15004 -- Unique ID of the lever
local liquidId = 4611 -- Item ID of the liquid pool
local liquidType = 0 -- Subtype of the liquid pool
function onUse(cid, item, frompos, item2, topos, topos)
local bridge = getThingfromPos(bridgepos)
local bridge2 = getThingfromPos(bridgepos2)
local bridge3 = getThingfromPos(bridgepos3)
local bridge4 = getThingfromPos(bridgepos4)
local liquid = getThingfromPos(splash)
for x = bridgeposCheck.x, bridgepos2Check.x do
for y = bridgeposCheck.y, bridgepos2Check.y do
if isMonster(getThingFromPos({x=x, y=y, z=bridgeposCheck.z, stackpos=253}).uid) then
doTeleportThing(getThingFromPos({x=x, y=y, z=bridgeposCheck.z, stackpos=253}).uid,jogaPlayerMonstro)
end
end
end
for x = bridgeposCheck.x, bridgepos2Check.x do
for y = bridgeposCheck.y, bridgepos2Check.y do
if isPlayer(getThingFromPos({x=x, y=y, z=bridgeposCheck.z, stackpos=253}).uid) then
doTeleportThing(getThingFromPos({x=x, y=y, z=bridgeposCheck.z, stackpos=253}).uid,jogaPlayerMonstro)
end
end
end
if item.uid == leverUID and item.itemid == 1946 and bridge.itemid == 5769 then
doTransformItem(bridge.uid, 4611)
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTransformItem(item.uid, 1945)
end
if item.uid == leverUID and item.itemid == 1945 and bridge.itemid == 4611 then
doTransformItem(bridge.uid, 5769)
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTransformItem(item.uid, 1946)
end
if item.uid == leverUID and item.itemid == 1946 and bridge2.itemid == 5769 then
doTransformItem(bridge2.uid, 4611)
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTransformItem(item.uid, 1945)
end
if item.uid == leverUID and item.itemid == 1945 and bridge2.itemid == 4611 then
doTransformItem(bridge2.uid, 5769)
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTransformItem(item.uid, 1946)
end
if item.uid == leverUID and item.itemid == 1946 and bridge3.itemid == 5769 then
doTransformItem(bridge3.uid, 4611)
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTransformItem(item.uid, 1945)
end
if item.uid == leverUID and item.itemid == 1945 and bridge3.itemid == 4611 then
doTransformItem(bridge3.uid, 5769)
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTransformItem(item.uid, 1946)
end
if item.uid == leverUID and item.itemid == 1946 and bridge4.itemid == 5769 then
doTransformItem(bridge4.uid, 4611)
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTransformItem(item.uid, 1945)
end
if item.uid == leverUID and item.itemid == 1945 and bridge4.itemid == 4611 then
doTransformItem(bridge4.uid, 5769)
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTransformItem(item.uid, 1946)
end
return TRUE
end