Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local exhaust = createConditionObject(CONDITION_EXHAUST)
- setConditionParam(exhaust, CONDITION_PARAM_TICKS, 750) -- time in seconds x1000
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local healthmax = getCreatureMaxHealth(cid)
- local min = 30 -- this means 30% minimum healing
- local max = 50 -- this means 50% maximum healing
- local health_add = math.random((healthmax * (min/100)), (healthmax * (max/100)))
- if(hasCondition(cid, CONDITION_EXHAUST)) then
- doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
- doPlayerSendCancel(cid, "You are exhausted")
- return true
- end
- doPlayerAddHealth(cid, health_add)
- doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
- doSendAnimatedText(getPlayerPosition(cid),"+"..health_add.."", TEXTCOLOR_LIGHTBLUE)
- doAddCondition(cid, exhaust)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement