Example #1
0
 public static bool IsOverWall(Vector3 start, Vector3 end)
 {
     double distance = Vector3.Distance(start, end);
     for (uint i = 0; i < distance; i += 10)
     {
         var tempPosition = start.LSExtend(end, i).LSTo2D();
         if (tempPosition.LSIsWall())
         {
             return true;
         }
     }
     return false;
 }
Example #2
0
        public static Vector3 GetFirstWallPoint(Vector3 start, Vector3 end)
        {
            double distance = Vector3.Distance(start, end);
            for (uint i = 0; i < distance; i += 10)
            {
                var tempPosition = start.LSExtend(end, i);
                if (tempPosition.LSIsWall())
                {
                    return tempPosition.LSExtend(start, -35);
                }
            }

            return Vector3.Zero;
        }
Example #3
0
        /// <summary>
        ///     Collideses the with wall.
        /// </summary>
        /// <param name="start">The start.</param>
        /// <param name="end">The end.</param>
        /// <returns></returns>
        internal static bool CollidesWithWall(Vector3 start, Vector3 end)
        {
            if (Environment.TickCount - _wallCastT > 4000)
            {
                return false;
            }

            GameObject wall = null;
            foreach (var gameObject in
                ObjectManager.Get<GameObject>()
                    .Where(
                        gameObject =>
                            gameObject.IsValid &&
                            Regex.IsMatch(
                                gameObject.Name, "_w_windwall_enemy_0.\\.troy", RegexOptions.IgnoreCase))
                )
            {
                wall = gameObject;
            }
            if (wall == null)
            {
                return false;
            }
            var level = wall.Name.Substring(wall.Name.Length - 6, 1);
            var wallWidth = 300 + 50*Convert.ToInt32(level);

            var wallDirection =
                (wall.Position.LSTo2D() - _yasuoWallCastedPos).Normalized().Perpendicular();
            var wallStart = wall.Position.LSTo2D() + wallWidth/2f*wallDirection;
            var wallEnd = wallStart - wallWidth*wallDirection;

            for (var i = 0; i < start.LSDistance(end); i += 30)
            {
                var currentPosition = start.LSExtend(end, i);
                if (wallStart.Intersection(wallEnd, currentPosition.LSTo2D(), start.LSTo2D()).Intersects)
                {
                    return true;
                }
            }

            return false;
        }
Example #4
0
        public static float GetWallLength(Vector3 start, Vector3 end)
        {
            double distance = Vector3.Distance(start, end);
            var firstPosition = Vector3.Zero;
            var lastPosition = Vector3.Zero;

            for (uint i = 0; i < distance; i += 10)
            {
                var tempPosition = start.LSExtend(end, i);
                if (tempPosition.LSIsWall() && firstPosition == Vector3.Zero)
                {
                    firstPosition = tempPosition;
                }

                lastPosition = tempPosition;
                if (!lastPosition.LSIsWall() && firstPosition != Vector3.Zero)
                {
                    break;
                }
            }

            return Vector3.Distance(firstPosition, lastPosition);
        }
Example #5
0
        private static void JumpUnderTurret(float extrarange, Vector3 objectPosition)
        {
            float mindistance = 100000;
            //Getting next Turret
            Obj_AI_Turret turretToJump = null;

            foreach (int NetID in AllAllyTurret)
            {
                Obj_AI_Turret turret = ObjectManager.GetUnitByNetworkId<Obj_AI_Turret>((uint)NetID);
                if (turret != null && !turret.IsDead)
                {
                    float distance = Player.Position.LSDistance(turret.Position);
                    if (mindistance >= distance)
                    {
                        mindistance = distance;
                        turretToJump = turret;
                    }

                }
            }
            if (turretToJump != null && !TurretHasAggro[turretToJump.NetworkId] && Player.Position.LSDistance(turretToJump.Position) < 1500)
            {
                int i = 0;

                do
                {
                    Vector3 extPos = Player.Position.LSExtend(turretToJump.Position, 685 - i);
                    float dist = objectPosition.LSDistance(extPos + extrarange);
                    Vector3 predictedPosition = objectPosition.LSExtend(extPos, dist);
                    if (predictedPosition.LSDistance(turretToJump.Position) <= 890 && !predictedPosition.LSIsWall())
                    {
                        WardJump(Player.Position.LSExtend(turretToJump.Position, 650 - i), false);
                        JumpPosition = Player.Position.LSExtend(turretToJump.Position, 650 - i);
                        ShallJumpNow = true;
                        break;
                    }

                    i += 50;
                } while (i <= 300 || !Player.Position.LSExtend(turretToJump.Position, 650 - i).LSIsWall());
            }
        }
Example #6
0
 public static Vector3 ClosestWall(Vector3 StartPos, Vector3 EndPos)
 {
     var distance = StartPos.LSDistance(EndPos);
     for (int i = 1; i < 8; i++)
     {
         if (StartPos.LSExtend(EndPos, distance + 55 * i).LSIsWall())
         {
             return StartPos.LSExtend(EndPos, distance + 55 * i);
         }
     }
     return EndPos;
 }
Example #7
0
 public static bool CheckWalls(Vector3 player, Vector3 enemy)
 {
     var distance = player.LSDistance(enemy);
     for (var i = 1; i < 6; i++)
     {
         if (player.LSExtend(enemy, distance + 55*i).IsWall())
         {
             return true;
         }
     }
     return false;
 }
Example #8
0
 private static void GapByFlashR(AIHeroClient target, Vector3 posBehind)
 {
     if (PortAIO.OrbwalkerManager.CanMove(0))
     {
         lastMoveTime = Variables.TickCount;
         PortAIO.OrbwalkerManager.MoveA(
             posBehind.LSExtend(GetPositionKickTo(target), -(GetDistance(target) + Player.BoundingRadius / 2)));
     }
     lastFlashPos = posBehind;
     lastEndPos = GetPositionAfterKick(target);
     lastInsecTime = lastFlashRTime = Variables.TickCount;
     PortAIO.OrbwalkerManager.ForcedTarget(target);
     Player.Spellbook.CastSpell(Flash, posBehind);
 }
Example #9
0
        private void CastW(AIHeroClient target, Vector3 from, Vector3 to)
        {
            var positions = new List<Vector3>();

            for (var i = 1; i < 11; i++)
            {
                positions.Add(from.LSExtend(to, 42*i));
            }
            var best =
                positions.OrderByDescending(p => p.LSDistance(target.Position))
                    .FirstOrDefault(
                        p => !p.IsWall() && p.LSDistance(player.Position) < W.Range && p.LSDistance(target.Position) > 350);
            if (best != null && best.IsValid())
            {
                W.Cast(best, getCheckBoxItem(config, "packets"));
            }
        }
Example #10
0
 public static bool IsWallBetween(Vector3 start, Vector3 end, int step = 3)
 {
     if (start.IsValid() && end.IsValid() && step > 0)
     {
         var distance = start.LSDistance(end);
         for (var i = 0; i < distance; i = i + step)
         {
             if (NavMesh.GetCollisionFlags(start.LSExtend(end, i)) == CollisionFlags.Wall)
             {
                 return true;
             }
         }
     }
     return false;
 }
Example #11
0
 private static void GapByWardJump(AIHeroClient target, Vector3 posBehind)
 {
     if (!WardManager.Place(posBehind, 1))
     {
         return;
     }
     if (Orbwalker.CanMove)
     {
         lastMoveTime = Variables.TickCount;
         Orbwalker.MoveTo(posBehind.LSExtend(GetPositionKickTo(target), -(DistWard + Player.BoundingRadius / 2)));
     }
     lastEndPos = GetPositionAfterKick(target);
     lastInsecTime = WardManager.LastInsecWardTime = WardManager.LastInsecJumpTme = Variables.TickCount;
     Orbwalker.ForcedTarget = target;
 }