public static Composite SelectClosestTarget() { // Just use the leader's target if it's in range. return(new Decorator(ret => (PossibleTargets.Count > 0), new TreeSharp.Action(delegate { SetTarget(PossibleTargets.OrderBy(tar => tar.DistanceSqr).FirstOrDefault(), TargetMode.SingleTarget); }) )); }
public static Composite SelectFocusTarget() { return(new Decorator(ret => PossibleTargets.Any(TargetManager.IsFocusTarget), new TreeSharp.Action(delegate { //target any focus mobs, attack the one with the least amount of health. SetTarget(PossibleTargets.OrderBy(unit => unit.CurrentHealth).First(IsFocusTarget), TargetMode.FocusTarget); }) )); }