local c = {
ruby_id = 2466, -- id of red ruby
ruby_place = {
[1] = {pos = {x=93,y=122,z=7}}, -- first rube place
[2] = {pos = {x=97,y=122,z=7}} -- second ruby place
},
diamond = {x=96,y=123,z=7}, -- place of diamond created
diamond_id= 2446, -- diamond id
removal = true, -- remove ruby on create item
cancel_msg = "2 rubys must be placed on basin." --- cancel message
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
result = false
for i = 1,2 do
if getTileItemById(c.ruby_place[i].pos,c.ruby_id).uid > 0 then
result = true
else
result = false
break
end
end
if result == true then
if c.removal == true then
for i = 1,2 do
doRemoveItem(getTileItemById(c.ruby_place[i].pos,c.ruby_id).uid)
doSendMagicEffect(c.ruby_place[i].pos,2)
end
end
doCreateItem(c.diamond_id,1,c.diamond)
else
doPlayerSendCancel(cid,c.cancel_msg)
end
return doTransformItem(item.uid,( item.itemid == 1945 and 1946 or 1945 ) )
end