Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local exhaust = createConditionObject(CONDITION_EXHAUST)
- setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local hpmax, min, max, vocation = getCreatureMaxHealth(cid), 75, 90, {1, 5}
- local hp_add = math.random(hpmax * min / 100, hpmax * max / 100)
- if(hasCondition(cid, CONDITION_EXHAUST)) then
- return doPlayerSendCancel(cid, "You are exhausted"), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF), false
- end
- if isInArray(vocation, getPlayerVocation(cid)) and getPlayerLevel(cid) >= 10000 then
- doCreatureAddHealth(cid, hp_add)
- doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
- doAddCondition(cid, exhaust)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement