--All credits to Teckman
function onUse(cid, item, fromPosition, itemEx, toPosition)
local monster1 = {x=15019, y=15800, z=7}
local monster2 = {x=15015, y=15800, z=7}
local monster3 = {x=15015, y=15802, z=7}
local monster4 = {x=15019, y=15802, z=7}
local newcharm = 3001
if itemEx.itemid == 471 and itemEx.uid == 1005 then
queststatus = getPlayerStorageValue(cid,3001)
queststatus2 = getPlayerStorageValue(cid,2010)
if queststatus == 1 and queststatus2 == -1 then
setPlayerStorageValue(cid,2010,1)
elseif itemEx.itemid == 471 and itemEx.uid == 1005 then
queststatus = getPlayerStorageValue(cid,3001)
queststatus2 = getPlayerStorageValue(cid,201)
if queststatus == 1 and queststatus2 == 1 then
setPlayerStorageValue(cid,2010,-1)
doTransformItem(item,newcharm)
doSendMagicEffect(toPosition,13)
doSummonCreature("Tormented Ghost", monster1)
doSummonCreature("Tormented Ghost", monster2)
doSummonCreature("Tormented Ghost", monster3)
doSummonCreature("Tormented Ghost", monster4)
else
doPlayerSendCancel(cid,"You can not use this object.")
end
else
return FALSE
end
return TRUE
end