local t = {
[3900] = {{{x=x, y=y, z=z}, 3051}, {{x=x, y=y, z=z}, 2000} }
--[action id of the lever] = {{{position to check}, item id to check}, {{pos of the teleport}, actionid of the teleport}}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[item.actionid]
if getTileItemById(v[1][1], v[1][2]) == true then
doItemSetAttribute(doCreateItem(1387, 1, v[2][1]), 'aid', v[2][2])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
else
doPlayerSendCancel(cid, 'Sorry, not possible')
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return (item.itemid == 1945 and doTransformItem(item.uid,1946) or doTransformItem(item.uid,1945)) and true
end