Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. local target = { -- add targets u want to heal and at what percent
  2. ['Furpan'] = 40,
  3. ['Furpans Friend'] = 40
  4. }
  5.  
  6. local option = {
  7. sio = true, -- use sio to heal friend
  8. rune = true, -- use rune to heal friend
  9. potion = true, -- use potion to heal friend
  10. rune_id = 3160, -- what rune to heal friend
  11. potion_id = 236, -- what potion to heal friend
  12. max_range = 5, -- maximum range to heal person
  13. min_hp = 1000, -- dont cast if below this health
  14. min_mana = 1000 -- dont cast if below this mana
  15. }
  16.  
  17. local prio = {'sio', 'rune', 'potion'} -- in what order should we check?
  18.  
  19. Module.New('HEAL', function(mod)
  20. local breaking = false
  21. for i = 1, 3 do
  22. if (option[prio[i]]) then
  23. if (prio[i] == 'sio') then
  24. for name, percent in pairs(target) do
  25. local c = Creature.New(name)
  26. if (c:isOnScreen()) then
  27. if (c:HealthPercent() < percent and c:DistanceFromSelf() =< option['max_range'] and c:isAlive() and Self.Health() > option['min_hp'] and Self.Mana() > option['min_mana']) then
  28. Self.Say('exura sio "' .. name)
  29. breaking = true
  30. break
  31. end
  32. end
  33. end
  34. if (breaking) then break end
  35. elseif (prio[i] == 'rune') then
  36. for name, percent in pairs(target) do
  37. local c = Creature.New(name)
  38. if (c:isOnScreen()) then
  39. if (c:HealthPercent() < percent and c:DistanceFromSelf() =< option['max_range'] and c:isAlive() and Self.Health() > option['min_hp'] and Self.Mana() > option['min_mana']) then
  40. Self.UseItemWithCreature(option['rune_id'], c:ID())
  41. breaking = true
  42. break
  43. end
  44. end
  45. end
  46. if (breaking) then break end
  47. elseif (prio[i] == 'potion') then
  48. for name, percent in pairs(target) do
  49. local c = Creature.New(name)
  50. if (c:isOnScreen()) then
  51. if (c:HealthPercent() < percent and c:DistanceFromSelf() == 1 and c:isAlive() and Self.Health() > option['min_hp'] and Self.Mana() > option['min_mana']) then
  52. Self.UseItemWithCreature(option['potion_id'], c:ID())
  53. breaking = true
  54. break
  55. end
  56. end
  57. end
  58. if (breaking) then break end
  59. end
  60. end
  61. end
  62. mod:Delay(500)
  63. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement