local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions') - 100)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not isPlayer(itemEx.uid)) then doPlayerSendCancel(cid, "You cannot use this object.") end
if(hasCondition(cid, CONDITION_EXHAUST)) then doPlayerSendCancel(cid, "You are exhausted.") end
local lvl, ml, min, max = getPlayerLevel(cid), getPlayerMagLevel(cid), nil, nil
min = ((lvl * 3.3) + (ml * 3.0) - 50)
max = ((lvl * 3.9) + (ml * 3.0))
local mana = math.random(min, max)
doPlayerAddMana(cid, mana)
doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_BLUE)
doCreatureSay(cid, "Aaaah...", TALKTYPE_MONSTER)
return
end