local t = {
{ [B][COLOR="red"]{x=100, y=100, z=7}[/COLOR][/B], [B][COLOR="red"]1234[/COLOR][/B]},
{ [B][COLOR="red"]{x=101, y=101, z=7}[/COLOR][/B], [B][COLOR="red"]5678[/COLOR][/B]},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
local k = {}
for i = 1, #t do
local v = getTileItemById(t[i][1], t[i][2]).uid
if v == 0 then
return doPlayerSendCancel(cid, 'Some items are missing.')
else
table.insert(k, v)
end
end
for i = 1, #k do
doSendMagicEffect(t[i][1], [B][COLOR="red"]CONST_ME_MAGIC_RED[/COLOR][/B])
doRemoveItem(k[i])
end
doCreateItem([B][COLOR="red"]2468[/COLOR][/B], [B][COLOR="red"]1[/COLOR][/B], [B][COLOR="red"]{x=105, y=105, z=7}[/COLOR][/B])
doSendMagicEffect([B][COLOR="red"]{x=105, y=105, z=7}[/COLOR][/B], [B][COLOR="red"]CONST_ME_MAGIC_GREEN[/COLOR][/B])
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end