Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public static TrinityActor BestLOSEliteInRange(float range, bool objectsInAoe = false)
  2. {
  3. return (from u in SafeList(objectsInAoe)
  4. where u.IsUnit &&
  5. u.IsElite &&
  6. u.IsInLineOfSight &&
  7. u.Distance <= range
  8. orderby
  9. u.NearbyUnitsWithinDistance(15) descending,
  10. u.HitPointsPct descending
  11. select u).FirstOrDefault();
  12.  
  13. }
  14.  
  15. public static TrinityActor BestRangedAoeUnit(float clusterRadius = 7, float maxSearchRange = 50, int unitCount = 3, bool useWeights = false, bool includeUnitsInAoE = true)
  16. {
  17. return BestLOSEliteInRange(maxSearchRange, includeUnitsInAoE) ??
  18. GetFarthestClusterUnit(clusterRadius, maxSearchRange, unitCount, useWeights, includeUnitsInAoE);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement