local t = {
pos = {x = 100, y = 100, z = 7},
effect = CONST_ME_MAGIC_RED,
required = {
2464, 2465
},
new = 2463
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
local it = {}
for i = 1, #t.required do
it[i] = getTileItemById(t.pos, t.required[i]).uid
if it[i] == 0 then
return doPlayerSendCancel(cid, 'Sorry, not possible')
end
end
for i = 1, #it do
doRemoveItem(it[i])
end
doCreateItem(t.new, 1, t.pos)
doSendMagicEffect(t.pos, t.effect)
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end