Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. local exhaust = createConditionObject(CONDITION_EXHAUST)
  2. setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
  3.  
  4. function onUse(cid, item, fromPosition, itemEx, toPosition)
  5. local hpmax, min, max, vocation = getCreatureMaxHealth(cid), 75, 90, {1, 5}
  6. local hp_add = math.random(hpmax * min / 100, hpmax * max / 100)
  7.  
  8. if(hasCondition(cid, CONDITION_EXHAUST)) then
  9. return doPlayerSendCancel(cid, "You are exhausted"), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF), false
  10. end
  11.  
  12. if isInArray(vocation, getPlayerVocation(cid)) and getPlayerLevel(cid) >= 10000 then
  13. doCreatureAddHealth(cid, hp_add)
  14. doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
  15. doAddCondition(cid, exhaust)
  16. end
  17. return true
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement