local config = {
exhausttime = 120, -- time in seconds
exhauststorage = 2309
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 15389 and itemEx.itemid == 14772 then
if exhaustion.check(cid, config.exhauststorage) then
local time = exhaustion.get(cid, config.exhauststorage)
local minutes, seconds = math.floor ((time - ((math.floor (time / 3600)) * 3600))/ 60), time - ((math.floor (time/60)) * 60)
if time >= 120 then
text = ""..minutes.." minutes and "..seconds.." seconds"
elseif time >= 60 then
text = ""..minutes.." minute and "..seconds.." seconds"
else
text = ""..seconds.." seconds"
end
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need to wait "..text.." before you can use this again.")
return true
end
if getPlayerStorageValue(cid, 77878) >= 0 and getPlayerStorageValue(cid, 77878) < 8 then
setPlayerStorageValue(cid, 77878, getPlayerStorageValue(cid, 77878) + 1)
doSendMagicEffect(toPosition, 31)
doTransformItem(itemEx.uid, 14773)
doPlayerSendTextMessage(cid,18,"The Antennae has been blinded.")
exhaustion.set(cid, config.exhauststorage, config.exhausttime)
else
doPlayerSendTextMessage(cid,18,"You have already blinded this antenna.")
end
end
return true
end