local storage = 12345
local BODY = XXXX
local pos = { x=100, y=100, z=7 }
function onUse(cid, item, fromPosition, itemEx, toPosition)
local monster = getThingfromPos((pos).BODY)
local playerStorage = getPlayerStorageValue(cid, storage)
if (item.itemid == 1945) then
if (playerStorage == 1) then
if (monster == TRUE) then
doTeleportThing(cid, pos)
doSendMagicEffect(toPosition, CONST_ME_TELEPORT)
doRemoveItem(monster.uid)
else
doPlayerSendCancel(cid, "You must place the orshabaal on the tile.")
end
else
doPlayerSendCancel(cid, "You have not killed the monster.")
end
elseif (item.itemid == 1946) then
doTransformItem(item.uid,item.itemid-1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return true
end