Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function PickPoisonLobTarget takes nothing returns unit
- local group g = CreateGroup()
- local group h = CreateGroup()
- local real x = Karrix:locX
- local real y = Karrix:locY
- local integer c = 0
- call GroupEnumUnitsInRange(g, x, y, BOSS_TARGET_RANGE, Condition(function ValidAlly))
- loop
- set u = FirstOfGroup(g)
- if DistBetweenLoc(x, y, u:locX, u:locY) >= 450 then
- call GroupAddUnit(h, u)
- endif
- call GroupRemoveUnit(g, u)
- endloop
- set c = CountUnitsInGroup(h)
- if c == 0 then
- return Boss_RandomTarget(Karrix)
- elseif NUM_PLAYERS <= 4 then
- if c >= 1 then
- return GroupPickRandomUnit(h)
- else
- return return Boss_RandomTarget(Karrix)
- endif
- elseif NUM_PLAYERS > 4 and <= 6
- if c >= 2 then
- return GroupPickRandomUnit(h)
- else
- return return Boss_RandomTarget(Karrix)
- endif
- else
- if c >= 3 then
- return GroupPickRandomUnit(h)
- else
- return return Boss_RandomTarget(Karrix)
- endif
- endif
- call DestroyGroup(g)
- call DestroyGroup(h)
- set g=null
- set h=null
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement