示例#1
0
        public static Obj_AI_Base GetBestObjectFarFrom(Vector3 Position)
        {
            var minion         = AllyMinionManager.GetFurthestTo(Position);
            var ally           = AllyHeroManager.GetFurthestTo(Position);
            var ward           = WardManager.GetFurthestTo(Position);
            var miniondistance = minion != null?Extensions.Distance(Position, minion, true) : 0;

            var allydistance = ally != null?Extensions.Distance(Position, ally, true) : 0;

            var warddistance = ward != null?Extensions.Distance(Position, ward, true) : 0;

            var best = Math.Max(miniondistance, Math.Max(allydistance, warddistance));

            if (best > 0f)
            {
                if (best == allydistance)
                {
                    return(ally);
                }
                else if (best == miniondistance)
                {
                    return(minion);
                }
                else if (best == warddistance)
                {
                    return(ward);
                }
            }
            return(null);
        }
示例#2
0
        public static Obj_AI_Base GetBestObjectNearTo(Vector3 Position)
        {
            var minion         = AllyMinionManager.GetNearestTo(Position);
            var ally           = AllyHeroManager.GetNearestTo(Position);
            var ward           = WardManager.GetNearestTo(Position);
            var miniondistance = minion != null?Extensions.Distance(Position, minion, true) : 999999999f;

            var allydistance = ally != null?Extensions.Distance(Position, ally, true) : 999999999f;

            var warddistance = ward != null?Extensions.Distance(Position, ward, true) : 999999999f;

            var best = Math.Min(miniondistance, Math.Min(allydistance, warddistance));

            if (best <= Math.Pow(250f, 2))
            {
                if (best == allydistance)
                {
                    return(ally);
                }
                else if (best == miniondistance)
                {
                    return(minion);
                }
                else if (best == warddistance)
                {
                    return(ward);
                }
            }
            return(null);
        }
示例#3
0
        public static Obj_AI_Base GetBestObjectFarFrom(Vector3 position)
        {
            var minion         = AllyMinionManager.GetFurthestTo(position);
            var ally           = AllyHeroManager.GetFurthestTo(position);
            var ward           = WardManager.GetFurthestTo(position);
            var miniondistance = minion != null?position.Distance(minion, true) : 0;

            var allydistance = ally != null?position.Distance(ally, true) : 0;

            var warddistance = ward != null?position.Distance(ward, true) : 0;

            var best = Math.Max(miniondistance, Math.Max(allydistance, warddistance));

            if (best > 0f)
            {
                if (Math.Abs(best - allydistance) < float.Epsilon)
                {
                    return(ally);
                }
                if (Math.Abs(best - miniondistance) < float.Epsilon)
                {
                    return(minion);
                }
                if (Math.Abs(best - warddistance) < float.Epsilon)
                {
                    return(ward);
                }
            }
            return(null);
        }
示例#4
0
 private static void Game_OnWndProc(WndEventArgs args)
 {
     if (args.Msg == (uint)WindowMessages.LeftButtonDown)
     {
         if (IsReady)
         {
             var target = EloBuddy.SDK.TargetSelector.GetTarget(200f, TargetSelector.damageType, Util.mousePos);
             if (target.IsValidTarget())
             {
             }
             else
             {
                 var ally = AllyHeroManager.GetNearestTo(Util.mousePos);
                 if (ally != null && Extensions.Distance(ally, Util.mousePos) <= 200f)
                 {
                     AllySelected        = ally;
                     PositionSelected    = Vector3.Zero;
                     LastSetPositionTime = Game.Time;
                 }
                 else
                 {
                     AllySelected        = null;
                     PositionSelected    = new Vector3(Util.mousePos.X, Util.mousePos.Y, Util.mousePos.Z);
                     LastSetPositionTime = Game.Time;
                 }
             }
         }
     }
 }
示例#5
0
        public static Obj_AI_Base GetBestObjectNearTo(Vector3 position)
        {
            var minion         = AllyMinionManager.GetNearestTo(position);
            var ally           = AllyHeroManager.GetNearestTo(position);
            var ward           = WardManager.GetNearestTo(position);
            var miniondistance = minion != null?position.Distance(minion, true) : 999999999f;

            var allydistance = ally != null?position.Distance(ally, true) : 999999999f;

            var warddistance = ward != null?position.Distance(ward, true) : 999999999f;

            var best = Math.Min(miniondistance, Math.Min(allydistance, warddistance));

            if (best <= Math.Pow(250f, 2))
            {
                if (Math.Abs(best - allydistance) < float.Epsilon)
                {
                    return(ally);
                }
                if (Math.Abs(best - miniondistance) < float.Epsilon)
                {
                    return(minion);
                }
                if (Math.Abs(best - warddistance) < float.Epsilon)
                {
                    return(ward);
                }
            }
            return(null);
        }