local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local min = level + (mlevel * 1.8) + 10
local max = level + (mlevel * 2) + 20
local mana_add = math.random(min, max)
if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return doPlayerSendCancel(cid, "You are exhausted")
end
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "+"..mana_add.." mana", getCreaturePosition(cid), mana_add, TEXTCOLOR_TEAL)
doAddCondition(cid, exhaust)
return true
end