Beispiel #1
0
        private static Vector3 GetTumblePos(this Obj_AI_Base target)
        {
            if (!Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                return(GetAggressiveTumblePos(target));
            }

            var cursorPos = Game.CursorPos;

            if (!cursorPos.IsDangerousPosition())
            {
                return(cursorPos);
            }
            //if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ )
            if (!target.IsMelee && Variables._Player.CountEnemiesInRange(800) == 1)
            {
                return(cursorPos);
            }

            var aRC            = new AJSGeometry.Circle(Variables._Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath();
            var targetPosition = target.ServerPosition;
            var pList          = (from p in aRC
                                  select new Vector2(p.X, p.Y).To3D()
                                  into v3
                                  let dist = v3.Distance(targetPosition)
                                             where !v3.IsDangerousPosition() && dist < 500
                                             select v3).ToList();

            if (Variables.UnderEnemyTower((Vector2)Variables._Player.ServerPosition) || Variables._Player.CountEnemiesInRange(800) == 1 ||
                cursorPos.CountEnemiesInRange(450) <= 1)
            {
                return(pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero);
            }
            return(pList.Count > 1
                ? pList.OrderByDescending(el => el.Distance(cursorPos)).FirstOrDefault()
                : Vector3.Zero);
        }
Beispiel #2
0
        private static Vector3 GetTumblePos(this Obj_AI_Base target)
        {
            if (!Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                return GetAggressiveTumblePos(target);

            var cursorPos = Game.CursorPos;

            if (!cursorPos.IsDangerousPosition()) return cursorPos;
            //if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ )
            if (!target.IsMelee && Variables._Player.CountEnemiesInRange(800) == 1) return cursorPos;

            var aRC = new AJSGeometry.Circle(Variables._Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath();
            var targetPosition = target.ServerPosition;
            var pList = (from p in aRC
                         select new Vector2(p.X, p.Y).To3D()
                    into v3
                         let dist = v3.Distance(targetPosition)
                         where !v3.IsDangerousPosition() && dist < 500
                         select v3).ToList();

            if (Variables.UnderEnemyTower((Vector2)Variables._Player.ServerPosition) || Variables._Player.CountEnemiesInRange(800) == 1 ||
                cursorPos.CountEnemiesInRange(450) <= 1)
            {
                return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero;
            }
            return pList.Count > 1
                ? pList.OrderByDescending(el => el.Distance(cursorPos)).FirstOrDefault()
                : Vector3.Zero;
        }