Advertisement
Oskar1121

Untitled

Oct 3rd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. local cooldown = 70004
  2. local cooldown_s = 3
  3.  
  4. local combat = createCombatObject()
  5. setCombatParam(combat, COMBAT_PARAM_EFFECT, 46)
  6. setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
  7.  
  8. local function selfRegeneration(cid, n)
  9. if not isCreature(cid) or n <= 0 then
  10. return true
  11. end
  12.  
  13. doTargetCombatHealth(cid, cid, COMBAT_HEALING, (getCreatureMaxHealth(cid) * 0.40), (getCreatureMaxHealth(cid) * 0.40), 46)
  14. addEvent(selfRegeneration, 1000, cid, n - 1)
  15. end
  16.  
  17. function onCastSpell(cid, var)
  18. if exhaustion.check(cid, cooldown) == false then
  19. exhaustion.set(cid, cooldown, cooldown_s)
  20. selfRegeneration(cid, 2)
  21. doCombat(cid, combat, var)
  22. else
  23. if isPlayer(cid) then
  24. doPlayerSendCancel(cid, "Wait: [" ..tostring(exhaustion.get(cid, cooldown)).."]")
  25. doSendMagicEffect(getCreaturePosition(cid), 2)
  26. end
  27.  
  28. return false
  29. end
  30. return true
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement