local disteffect = 35
[COLOR=rgb(0, 0, 0)]local effect = 66
local ITEM_IDS = {
[10311] = 10312,
[10312] = 10314,
[10314] = 10311,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not ITEM_IDS[item.itemid]) then
return false
end
if (exhaustion.check(cid, 17024)) then
doPlayerSendCancel(cid, "You will be able to use this GEM again in "..tostring(exhaustion.get(cid, 17024)).." seconds.")
return true
end
local position = getCreaturePosition(cid)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, disteffect)
end
doPlayerSendTextMessage(cid, 22, "You changed "..getItemInfo(item.itemid).name.." to "..getItemInfo(ITEM_IDS[item.itemid]).name..".")
exhaustion.set(cid, 17024, 5)
doTransformItem(item.uid, ITEM_IDS[item.itemid])
doDecayItem(item.uid)
doSendMagicEffect(getCreaturePosition(cid), 29)
return true
end