Advertisement
Guest User

Untitled

a guest
Sep 7th, 2016
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.51 KB | None | 0 0
  1.  
  2. local group = "party"
  3.  
  4. local target1 = group.tostring(1)
  5. local target2 = group.tostring(2)
  6. local target3 = group.tostring(3)
  7. local target4 = group.tostring(4)
  8. local target5 = group.tostring(5)
  9.  
  10. local lowest = "NUL"
  11.  
  12. local target1hp = 100 * ( UnitHealth(target1) + incomingheal ) / UnitHealthMax(target1)
  13. local target2hp = 100 * ( UnitHealth(target2) + incomingheal ) / UnitHealthMax(target2)
  14. local target3hp = 100 * ( UnitHealth(target3) + incomingheal ) / UnitHealthMax(target3)
  15. local target4hp = 100 * ( UnitHealth(target4) + incomingheal ) / UnitHealthMax(target4)
  16. local target5hp = 100 * ( UnitHealth(target5) + incomingheal ) / UnitHealthMax(target5)
  17. local lowesthp = 100
  18.  
  19. -- Check --
  20.     if
  21.         UnitExists(target1)
  22.     and
  23.         UnitInRange(target1)
  24.     and
  25.         UnitIsCharmed(target1) == nil
  26.     and
  27.         UnitIsDeadOrGhost(target1) == nil
  28.     and
  29.         PQR_IsOutOfSight(target1) == false
  30.     then
  31.             if
  32.             target1hp < 80
  33.         and
  34.             target1hp < lowesthp
  35.         then
  36.                 lowest = target1
  37.             lowesthp = target1hp
  38.         end
  39.     end
  40.    
  41. -- Check 2 --
  42.     if
  43.         UnitExists(target2)
  44.     and
  45.         UnitInRange(target2)
  46.     and
  47.         UnitIsCharmed(target2) == nil
  48.     and
  49.         UnitIsDeadOrGhost(target2) == nil
  50.     and
  51.         PQR_IsOutOfSight(target2) == false
  52.     then
  53.             if
  54.             target2hp < 80
  55.         and
  56.             target2hp < lowesthp
  57.         then
  58.                 lowest = target2
  59.             lowesthp = target2hp
  60.         end
  61.     end
  62.    
  63. -- Check 3 --
  64.     if
  65.         UnitExists(target3)
  66.     and
  67.         UnitInRange(target3)
  68.     and
  69.         UnitIsCharmed(target3) == nil
  70.     and
  71.         UnitIsDeadOrGhost(target3) == nil
  72.     and
  73.         PQR_IsOutOfSight(target3) == false
  74.     then
  75.             if
  76.             target3hp < 80
  77.         and
  78.             target3hp < lowesthp
  79.         then
  80.                 lowest = target3
  81.             lowesthp = target3hp
  82.         end
  83.     end
  84.    
  85. -- Check 4 --
  86.     if
  87.         UnitExists(target4)
  88.     and
  89.         UnitInRange(target4)
  90.     and
  91.         UnitIsCharmed(target4) == nil
  92.     and
  93.         UnitIsDeadOrGhost(target4) == nil
  94.     and
  95.         PQR_IsOutOfSight(target4) == false
  96.     then
  97.             if
  98.             target4hp < 80
  99.         and
  100.             target4hp < lowesthp
  101.         then
  102.                 lowest = target4
  103.             lowesthp = target1hp
  104.         end
  105.     end
  106.    
  107. -- Check 5 --
  108.     if
  109.         UnitExists(target5)
  110.     and
  111.         UnitInRange(target5)
  112.     and
  113.         UnitIsCharmed(target5) == nil
  114.     and
  115.         UnitIsDeadOrGhost(target5) == nil
  116.     and
  117.         PQR_IsOutOfSight(target5) == false
  118.     then
  119.             if
  120.             target5hp < 80
  121.         and
  122.             target5hp < lowesthp
  123.         then
  124.                 lowest = target5
  125.             lowesthp = target5hp
  126.         end
  127.     end
  128.    
  129. if
  130.     lowesthp > 80
  131. then
  132.     lowest = "NUL"
  133. end
  134.  
  135. PQR_CustomTarget = lowest
  136.  
  137. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement