Advertisement
Guest User

Untitled

a guest
May 19th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. private function PickPoisonLobTarget takes nothing returns unit
  2. local group g = CreateGroup()
  3. local group h = CreateGroup()
  4. local real x = Karrix:locX
  5. local real y = Karrix:locY
  6. local integer c = 0
  7.  
  8. call GroupEnumUnitsInRange(g, x, y, BOSS_TARGET_RANGE, Condition(function ValidAlly))
  9. loop
  10. set u = FirstOfGroup(g)
  11. if DistBetweenLoc(x, y, u:locX, u:locY) >= 450 then
  12. call GroupAddUnit(h, u)
  13. endif
  14. call GroupRemoveUnit(g, u)
  15. endloop
  16.  
  17. set c = CountUnitsInGroup(h)
  18.  
  19. if c == 0 then
  20. return Boss_RandomTarget(Karrix)
  21.  
  22. elseif NUM_PLAYERS <= 4 then
  23. if c >= 1 then
  24. return GroupPickRandomUnit(h)
  25. else
  26. return return Boss_RandomTarget(Karrix)
  27. endif
  28.  
  29. elseif NUM_PLAYERS > 4 and <= 6
  30. if c >= 2 then
  31. return GroupPickRandomUnit(h)
  32. else
  33. return return Boss_RandomTarget(Karrix)
  34. endif
  35. else
  36. if c >= 3 then
  37. return GroupPickRandomUnit(h)
  38. else
  39. return return Boss_RandomTarget(Karrix)
  40. endif
  41. endif
  42.  
  43. call DestroyGroup(g)
  44. call DestroyGroup(h)
  45. set g=null
  46. set h=null
  47. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement