sestorme
Member
I want to set a cooldown/exhaust on certain item. It's not magic, just an item. How can you do that?
local storage = 1000
local time = 100
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not exhaustion.check(cid, 100) then
xxxx
exhaustion.set(cid, 100, time
else
doPlayerSendCancel(cid, 'You are exhausted.')
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 1000
local time = 120000
if not exhaustion.get(cid, 100) then
doRemoveCondition(cid, CONDITION_POISON)
doCreatureSay(itemEx.uid, "Gulp.", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
doPlayerGiveItem(cid, 2548,1)
exhaustion.set(cid, 100, time)
else
doPlayerSendCancel(cid, 'You cannot drink more antidote yet.')
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 1000
local time = 120 -- seconds
if(exhaustion.check(cid, storage) == false) then
doRemoveCondition(cid, CONDITION_POISON)
doCreatureSay(itemEx.uid, "Gulp.", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
doPlayerGiveItem(cid, 2548,1)
exhaustion.set(cid, storagae, time)
else
doPlayerSendCancel(cid, 'You cannot drink more antidote yet.')
end
return TRUE
end