local exhausted_storagevalue = 50000
local exhausted_seconds = 2
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) ---- what the color of the effect. you can do like RED/BLUE
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
function onCastSpell(cid, var)
if os.time() > getPlayerStorageValue(cid, exhausted_storagevalue) then
doPlayerAddMana(cid, 1000) ---- how much it heal .
doPlayerSetStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
end