Esempio n. 1
0
        private static void TriggerOnDetectSkillshot(DetectionType detectionType,
            SpellData spellData,
            int startT,
            Vector2 start,
            Vector2 end,
            Obj_AI_Base unit)
        {
            var skillshot = new Skillshot(detectionType, spellData, startT, start, end, unit);

            if (OnDetectSkillshot != null)
            {
                OnDetectSkillshot(skillshot);
            }
        }
Esempio n. 2
0
        public static Vector2 GetCollisionPoint(Skillshot skillshot)
        {
            var collisions = new List<DetectedCollision>();
            var from = skillshot.GetMissilePosition(0);
            skillshot.ForceDisabled = false;
            foreach (var cObject in skillshot.SpellData.CollisionObjects)
            {
                switch (cObject)
                {
                    case CollisionObjectTypes.Minion:

                        collisions.AddRange(
                            from minion in
                                MinionManager.GetMinions(
                                    @from.To3D(), 1200, MinionTypes.All,
                                    skillshot.Unit.Team == ObjectManager.Player.Team
                                        ? MinionTeam.NotAlly
                                        : MinionTeam.NotAllyForEnemy)
                            let pred =
                                FastPrediction(
                                    @from, minion,
                                    Math.Max(
                                        0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)),
                                    skillshot.SpellData.MissileSpeed)
                            let pos = pred.PredictedPosVector2
                            let w =
                                skillshot.SpellData.RawRadius + (!pred.IsMoving ? (minion.BoundingRadius - 15) : 0) -
                                pos.LSDistance(@from, skillshot.End, true)
                            where w > 0
                            select
                                new DetectedCollision
                                {
                                    PositionVector2 =
                                        pos.LSProjectOn(skillshot.End, skillshot.Start).LinePoint +
                                        skillshot.Direction * 30,
                                    UnitAiBase = minion,
                                    Type = CollisionObjectTypes.Minion,
                                    Distance = pos.LSDistance(@from),
                                    Difference = w
                                });

                        break;

                    case CollisionObjectTypes.Champion:
                        collisions.AddRange(
                            from hero in
                                ObjectManager.Get<AIHeroClient>()
                                    .Where(
                                        h =>
                                            (h.LSIsValidTarget(1200, false) && h.Team == ObjectManager.Player.Team &&
                                             !h.IsMe || h.Team != ObjectManager.Player.Team))
                            let pred =
                                FastPrediction(
                                    @from, hero,
                                    Math.Max(
                                        0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)),
                                    skillshot.SpellData.MissileSpeed)
                            let pos = pred.PredictedPosVector2
                            let w = skillshot.SpellData.RawRadius + 30 - pos.LSDistance(@from, skillshot.End, true)
                            where w > 0
                            select
                                new DetectedCollision
                                {
                                    PositionVector2 =
                                        pos.LSProjectOn(skillshot.End, skillshot.Start).LinePoint +
                                        skillshot.Direction * 30,
                                    UnitAiBase = hero,
                                    Type = CollisionObjectTypes.Minion,
                                    Distance = pos.LSDistance(@from),
                                    Difference = w
                                });
                        break;

                    case CollisionObjectTypes.YasuoWall:
                        if (
                            !ObjectManager.Get<AIHeroClient>()
                                .Any(
                                    hero =>
                                        hero.LSIsValidTarget(float.MaxValue, false) &&
                                        hero.Team == ObjectManager.Player.Team && hero.ChampionName == "Yasuo"))
                        {
                            break;
                        }
                        GameObject wall = null;
                        foreach (
                            var gameObject in
                                ObjectManager.Get<GameObject>()
                                    .Where(
                                        gameObject =>
                                            gameObject.IsValid &&
                                            Regex.IsMatch(
                                                gameObject.Name, "_w_windwall.\\.troy", RegexOptions.IgnoreCase)))
                        {
                            wall = gameObject;
                        }
                        if (wall == null)
                        {
                            break;
                        }
                        var level = wall.Name.Substring(wall.Name.Length - 6, 1);
                        var wallWidth = (300 + 50 * Convert.ToInt32(level));

                        var wallDirection = (wall.Position.LSTo2D() - _yasuoWallVector2).LSNormalized().LSPerpendicular();
                        var fraction = wallWidth / 0x2; // 0x2 = 2
                        var wallStart = wall.Position.LSTo2D() + fraction * wallDirection;
                        var wallEnd = wallStart - wallWidth * wallDirection;
                        var wallPolygon = new Geometry.Rectangle(wallStart, wallEnd, 75).ToPolygon();
                        var intersections = new List<Vector2>();

                        for (var i = 0; i < wallPolygon.Points.Count; i++)
                        {
                            var inter =
                                wallPolygon.Points[i].LSIntersection(
                                    wallPolygon.Points[i != wallPolygon.Points.Count - 1 ? i + 1 : 0], from,
                                    skillshot.End);
                            if (inter.Intersects)
                            {
                                intersections.Add(inter.Point);
                            }
                        }

                        if (intersections.Count > 0)
                        {
                            var intersection = intersections.OrderBy(item => item.LSDistance(from)).ToList()[0];
                            var collisionT = Environment.TickCount +
                                             Math.Max(
                                                 0,
                                                 skillshot.SpellData.Delay -
                                                 (Environment.TickCount - skillshot.StartTick)) + 100 +
                                             (1000 * intersection.LSDistance(from)) / skillshot.SpellData.MissileSpeed;
                            if (collisionT - _wallCastTick < 4000)
                            {
                                if (skillshot.SpellData.Type != SkillShotType.SkillshotMissileLine)
                                {
                                    skillshot.ForceDisabled = true;
                                }
                                return intersection;
                            }
                        }

                        break;
                }
            }

            return collisions.Count > 0
                ? collisions.OrderBy(c => c.Distance).ToList()[0].PositionVector2
                : new Vector2();
        }
Esempio n. 3
0
 private static void OnDeleteMissile(Skillshot skillshot, MissileClient missile)
 {
     if (skillshot.SpellData.SpellName == "VelkozQ")
     {
         var spellData = SpellDatabase.GetByName("VelkozQSplit");
         var direction = skillshot.Direction.Perpendicular();
         if (EvadeDetectedSkillshots.Count(s => s.SpellData.SpellName == "VelkozQSplit") == 0)
         {
             for (var i = -1; i <= 1; i = i + 2)
             {
                 var skillshotToAdd = new Skillshot(
                     DetectionType.ProcessSpell, spellData, Environment.TickCount, missile.Position.LSTo2D(),
                     missile.Position.LSTo2D() + i * direction * spellData.Range, skillshot.Unit);
                 EvadeDetectedSkillshots.Add(skillshotToAdd);
             }
         }
     }
 }
Esempio n. 4
0
        private static void OnDetectSkillshot(Skillshot skillshot)
        {
            var alreadyAdded = false;

            foreach (var item in EvadeDetectedSkillshots)
            {
                if (item.SpellData.SpellName == skillshot.SpellData.SpellName &&
                    (item.Unit.NetworkId == skillshot.Unit.NetworkId &&
                     (skillshot.Direction).AngleBetween(item.Direction) < 5 &&
                     (skillshot.Start.LSDistance(item.Start) < 100 || skillshot.SpellData.FromObjects.Length == 0)))
                {
                    alreadyAdded = true;
                }
            }

            //Check if the skillshot is from an ally.
            if (skillshot.Unit.Team == ObjectManager.Player.Team)
            {
                return;
            }

            //Check if the skillshot is too far away.
            if (skillshot.Start.LSDistance(ObjectManager.Player.ServerPosition.LSTo2D()) >
                (skillshot.SpellData.Range + skillshot.SpellData.Radius + 1000) * 1.5)
            {
                return;
            }

            //Add the skillshot to the detected skillshot list.
            if (!alreadyAdded)
            {
                //Multiple skillshots like twisted fate Q.
                if (skillshot.DetectionType == DetectionType.ProcessSpell)
                {
                    if (skillshot.SpellData.MultipleNumber != -1)
                    {
                        var originalDirection = skillshot.Direction;

                        for (var i = -(skillshot.SpellData.MultipleNumber - 1) / 2;
                            i <= (skillshot.SpellData.MultipleNumber - 1) / 2;
                            i++)
                        {
                            var end = skillshot.Start +
                                      skillshot.SpellData.Range *
                                      originalDirection.Rotated(skillshot.SpellData.MultipleAngle * i);
                            var skillshotToAdd = new Skillshot(
                                skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, end,
                                skillshot.Unit);

                            EvadeDetectedSkillshots.Add(skillshotToAdd);
                        }
                        return;
                    }

                    if (skillshot.SpellData.SpellName == "UFSlash")
                    {
                        skillshot.SpellData.MissileSpeed = 1600 + (int)skillshot.Unit.MoveSpeed;
                    }

                    if (skillshot.SpellData.Invert)
                    {
                        var newDirection = -(skillshot.End - skillshot.Start).Normalized();
                        var end = skillshot.Start + newDirection * skillshot.Start.LSDistance(skillshot.End);
                        var skillshotToAdd = new Skillshot(
                            skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, skillshot.Start, end,
                            skillshot.Unit);
                        EvadeDetectedSkillshots.Add(skillshotToAdd);
                        return;
                    }

                    if (skillshot.SpellData.Centered)
                    {
                        var start = skillshot.Start - skillshot.Direction * skillshot.SpellData.Range;
                        var end = skillshot.Start + skillshot.Direction * skillshot.SpellData.Range;
                        var skillshotToAdd = new Skillshot(
                            skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, start, end,
                            skillshot.Unit);
                        EvadeDetectedSkillshots.Add(skillshotToAdd);
                        return;
                    }

                    if (skillshot.SpellData.SpellName == "SyndraE" || skillshot.SpellData.SpellName == "syndrae5")
                    {
                        var angle = 60;
                        var edge1 =
                            (skillshot.End - skillshot.Unit.ServerPosition.LSTo2D()).Rotated(
                                -angle / 2 * (float)Math.PI / 180);
                        var edge2 = edge1.Rotated(angle * (float)Math.PI / 180);

                        foreach (var minion in ObjectManager.Get<Obj_AI_Minion>())
                        {
                            var v = minion.ServerPosition.LSTo2D() - skillshot.Unit.ServerPosition.LSTo2D();
                            if (minion.Name == "Seed" && edge1.CrossProduct(v) > 0 && v.CrossProduct(edge2) > 0 &&
                                minion.LSDistance(skillshot.Unit) < 800 &&
                                (minion.Team != ObjectManager.Player.Team))
                            {
                                var start = minion.ServerPosition.LSTo2D();
                                var end = skillshot.Unit.ServerPosition.LSTo2D()
                                    .LSExtend(
                                        minion.ServerPosition.LSTo2D(),
                                        skillshot.Unit.LSDistance(minion) > 200 ? 1300 : 1000);

                                var skillshotToAdd = new Skillshot(
                                    skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, start, end,
                                    skillshot.Unit);
                                EvadeDetectedSkillshots.Add(skillshotToAdd);
                            }
                        }
                        return;
                    }

                    if (skillshot.SpellData.SpellName == "AlZaharCalloftheVoid")
                    {
                        var start = skillshot.End - skillshot.Direction.Perpendicular() * 400;
                        var end = skillshot.End + skillshot.Direction.Perpendicular() * 400;
                        var skillshotToAdd = new Skillshot(
                            skillshot.DetectionType, skillshot.SpellData, skillshot.StartTick, start, end,
                            skillshot.Unit);
                        EvadeDetectedSkillshots.Add(skillshotToAdd);
                        return;
                    }

                    if (skillshot.SpellData.SpellName == "ZiggsQ")
                    {
                        var d1 = skillshot.Start.LSDistance(skillshot.End);
                        var d2 = d1 * 0.4f;
                        var d3 = d2 * 0.69f;

                        var bounce1SpellData = SpellDatabase.GetByName("ZiggsQBounce1");
                        var bounce2SpellData = SpellDatabase.GetByName("ZiggsQBounce2");

                        var bounce1Pos = skillshot.End + skillshot.Direction * d2;
                        var bounce2Pos = bounce1Pos + skillshot.Direction * d3;

                        bounce1SpellData.Delay =
                            (int)(skillshot.SpellData.Delay + d1 * 1000f / skillshot.SpellData.MissileSpeed + 500);
                        bounce2SpellData.Delay =
                            (int)(bounce1SpellData.Delay + d2 * 1000f / bounce1SpellData.MissileSpeed + 500);

                        var bounce1 = new Skillshot(
                            skillshot.DetectionType, bounce1SpellData, skillshot.StartTick, skillshot.End, bounce1Pos,
                            skillshot.Unit);
                        var bounce2 = new Skillshot(
                            skillshot.DetectionType, bounce2SpellData, skillshot.StartTick, bounce1Pos, bounce2Pos,
                            skillshot.Unit);

                        EvadeDetectedSkillshots.Add(bounce1);
                        EvadeDetectedSkillshots.Add(bounce2);
                    }

                    if (skillshot.SpellData.SpellName == "ZiggsR")
                    {
                        skillshot.SpellData.Delay =
                            (int)(1500 + 1500 * skillshot.End.LSDistance(skillshot.Start) / skillshot.SpellData.Range);
                    }

                    if (skillshot.SpellData.SpellName == "JarvanIVDragonStrike")
                    {
                        var endPos = new Vector2();

                        foreach (var s in EvadeDetectedSkillshots)
                        {
                            if (s.Unit.NetworkId == skillshot.Unit.NetworkId && s.SpellData.Slot == SpellSlot.E)
                            {
                                endPos = s.End;
                            }
                        }

                        foreach (var m in ObjectManager.Get<Obj_AI_Minion>())
                        {
                            if (m.CharData.BaseSkinName == "jarvanivstandard" && m.Team == skillshot.Unit.Team &&
                                skillshot.IsDanger(m.Position.LSTo2D()))
                            {
                                endPos = m.Position.LSTo2D();
                            }
                        }

                        if (!endPos.IsValid())
                        {
                            return;
                        }

                        skillshot.End = endPos + 200 * (endPos - skillshot.Start).Normalized();
                        skillshot.Direction = (skillshot.End - skillshot.Start).Normalized();
                    }
                }

                if (skillshot.SpellData.SpellName == "OriannasQ")
                {
                    var endCSpellData = SpellDatabase.GetByName("OriannaQend");

                    var skillshotToAdd = new Skillshot(
                        skillshot.DetectionType, endCSpellData, skillshot.StartTick, skillshot.Start, skillshot.End,
                        skillshot.Unit);

                    EvadeDetectedSkillshots.Add(skillshotToAdd);
                }

                //Dont allow fow detection.
                if (skillshot.SpellData.DisableFowDetection && skillshot.DetectionType == DetectionType.RecvPacket)
                {
                    return;
                }
            #if DEBUG
                    Console.WriteLine(Environment.TickCount + "Adding new skillshot: " + skillshot.SpellData.SpellName);
            #endif

                EvadeDetectedSkillshots.Add(skillshot);
            }
        }
Esempio n. 5
0
 public static bool wontHitOnDash(Skillshot ss, Obj_AI_Base jumpOn, Skillshot skillShot, Vector2 dashDir)
 {
     float currentDashSpeed = 700 + myHero.MoveSpeed;//At least has to be like this
     //Get intersection point
     Vector2 intersectionPoint = LineIntersectionPoint(myHero.Position.LSTo2D(), V2E(myHero.Position, jumpOn.Position, 475), ss.Start, ss.End);
     //Time when yasuo will be in intersection point
     float arrivingTime = Vector2.Distance(myHero.Position.LSTo2D(), intersectionPoint) / currentDashSpeed;
     //Estimated skillshot position
     Vector2 skillshotPosition = ss.GetMissilePosition((int)(arrivingTime * 1000));
     if (Vector2.DistanceSquared(skillshotPosition, intersectionPoint) <
         (ss.SpellData.Radius + myHero.BoundingRadius) && !willColide(skillShot, myHero.Position.LSTo2D(), 700f + myHero.MoveSpeed, dashDir, myHero.BoundingRadius + skillShot.SpellData.Radius))
         return false;
     return true;
 }
Esempio n. 6
0
 public static bool willColide(Skillshot ss, Vector2 from, float speed, Vector2 direction, float radius)
 {
     Vector2 ssVel = ss.Direction.Normalized() * ss.SpellData.MissileSpeed;
     Vector2 dashVel = direction * speed;
     Vector2 a = ssVel - dashVel;//true direction + speed
     Vector2 realFrom = from.LSExtend(direction, ss.SpellData.Delay + speed);
     if (!ss.IsAboutToHit((int)((dashVel.Length() / 475) * 1000) + Game.Ping + 100, ObjectManager.Player))
         return false;
     if (ss.IsAboutToHit(1000, ObjectManager.Player) && interCir(ss.MissilePosition, ss.MissilePosition.LSExtend(ss.MissilePosition + a, ss.SpellData.Range + 50), from,
         radius))
         return true;
     return false;
 }
Esempio n. 7
0
        public static void useWSmart(Skillshot skillShot)
        {
            //try douge with E if cant windWall
            var WDelay = getSliderItem(smartWMenu, "smartWDelay");

            if (!W.IsReady() || skillShot.SpellData.Type == SkillShotType.SkillshotCircle || skillShot.SpellData.Type == SkillShotType.SkillshotRing)
                return;
            if (skillShot.IsAboutToHit(WDelay, myHero))
            {
                var sd = SpellDatabase.GetByMissileName(skillShot.SpellData.MissileSpellName);
                if (sd == null)
                    return;

                //If enabled
                if (!EvadeSpellEnabled(sd.MenuItemName))
                    return;

                //if only dangerous
                if (getCheckBoxItem(smartWMenu, "wwDanger") && skillShotIsDangerous(sd.MenuItemName))
                {
                    myHero.Spellbook.CastSpell(SpellSlot.W, skillShot.Start.To3D(), skillShot.Start.To3D());
                }
                if (!getCheckBoxItem(smartWMenu, "wwDanger") && skillShotMenu["DangerLevel" + sd.MenuItemName] != null && skillShotMenu["DangerLevel" + sd.MenuItemName].Cast<Slider>().CurrentValue >= getSliderItem(smartWMenu, "smartWDanger"))
                {
                    myHero.Spellbook.CastSpell(SpellSlot.W, skillShot.Start.To3D(), skillShot.Start.To3D());
                }
            }
        }
Esempio n. 8
0
        public static void useEtoSafe(Skillshot skillShot)
        {
            if (!E.IsReady())
                return;
            float closest = float.MaxValue;
            Obj_AI_Base closestTarg = null;
            float currentDashSpeed = 700 + myHero.MoveSpeed;
            foreach (Obj_AI_Base enemy in ObjectManager.Get<Obj_AI_Base>().Where(ob => ob.NetworkId != skillShot.Unit.NetworkId && enemyIsJumpable(ob) && ob.LSDistance(myHero) < E.Range).OrderBy(ene => ene.LSDistance(Game.CursorPos, true)))
            {
                var pPos = myHero.Position.LSTo2D();
                Vector2 posAfterE = V2E(myHero.Position, enemy.Position, 475);
                Vector2 dashDir = (posAfterE - myHero.Position.LSTo2D()).Normalized();

                if (isSafePoint(posAfterE).IsSafe && wontHitOnDash(skillShot, enemy, skillShot, dashDir) /*&& skillShot.IsSafePath(new List<Vector2>() { posAfterE }, 0, (int)currentDashSpeed, 0).IsSafe*/)
                {
                    float curDist = Vector2.DistanceSquared(Game.CursorPos.LSTo2D(), posAfterE);
                    if (curDist < closest)
                    {
                        closestTarg = enemy;
                        closest = curDist;
                    }
                }
            }
            if (closestTarg != null && closestTarg.CountEnemiesInRange(600) <= 2 && skillShotMenu["DangerLevel" + skillShot.SpellData.MenuItemName] != null && skillShotMenu["DangerLevel" + skillShot.SpellData.MenuItemName].Cast<Slider>().CurrentValue >= getSliderItem(smartWMenu, "smartEDogueDanger"))
                useENormal(closestTarg);
        }
Esempio n. 9
0
        public static Vector2 GetCollisionPoint(Skillshot skillshot)
        {
            var collisions = new List <DetectedCollision>();
            var from       = skillshot.GetMissilePosition(0);

            skillshot.ForceDisabled = false;
            foreach (var cObject in skillshot.SpellData.CollisionObjects)
            {
                switch (cObject)
                {
                case CollisionObjectTypes.Minion:

                    collisions.AddRange(
                        from minion in
                        MinionManager.GetMinions(
                            @from.To3D(), 1200, MinionTypes.All,
                            skillshot.Unit.Team == ObjectManager.Player.Team
                                        ? MinionTeam.NotAlly
                                        : MinionTeam.NotAllyForEnemy)
                        let pred =
                            FastPrediction(
                                @from, minion,
                                Math.Max(
                                    0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)),
                                skillshot.SpellData.MissileSpeed)
                            let pos                 = pred.PredictedPosVector2
                                              let w =
                                skillshot.SpellData.RawRadius + (!pred.IsMoving ? (minion.BoundingRadius - 15) : 0) -
                                pos.Distance(@from, skillshot.End, true)
                                where w > 0
                                select
                                new DetectedCollision
                    {
                        PositionVector2 =
                            pos.ProjectOn(skillshot.End, skillshot.Start).LinePoint +
                            skillshot.Direction * 30,
                        UnitAiBase = minion,
                        Type       = CollisionObjectTypes.Minion,
                        Distance   = pos.Distance(@from),
                        Difference = w
                    });

                    break;

                case CollisionObjectTypes.Champion:
                    collisions.AddRange(
                        from hero in
                        ObjectManager.Get <AIHeroClient>()
                        .Where(
                            h =>
                            (h.IsValidTarget(1200, false) && h.Team == ObjectManager.Player.Team &&
                             !h.IsMe || h.Team != ObjectManager.Player.Team))
                        let pred =
                            FastPrediction(
                                @from, hero,
                                Math.Max(
                                    0, skillshot.SpellData.Delay - (Environment.TickCount - skillshot.StartTick)),
                                skillshot.SpellData.MissileSpeed)
                            let pos                 = pred.PredictedPosVector2
                                              let w = skillshot.SpellData.RawRadius + 30 - pos.Distance(@from, skillshot.End, true)
                                                      where w > 0
                                                      select
                                                      new DetectedCollision
                    {
                        PositionVector2 =
                            pos.ProjectOn(skillshot.End, skillshot.Start).LinePoint +
                            skillshot.Direction * 30,
                        UnitAiBase = hero,
                        Type       = CollisionObjectTypes.Minion,
                        Distance   = pos.Distance(@from),
                        Difference = w
                    });
                    break;

                case CollisionObjectTypes.YasuoWall:
                    if (
                        !ObjectManager.Get <AIHeroClient>()
                        .Any(
                            hero =>
                            hero.IsValidTarget(float.MaxValue, false) &&
                            hero.Team == ObjectManager.Player.Team && hero.ChampionName == "Yasuo"))
                    {
                        break;
                    }
                    GameObject wall = null;
                    foreach (
                        var gameObject in
                        ObjectManager.Get <GameObject>()
                        .Where(
                            gameObject =>
                            gameObject.IsValid &&
                            Regex.IsMatch(
                                gameObject.Name, "_w_windwall.\\.troy", RegexOptions.IgnoreCase)))
                    {
                        wall = gameObject;
                    }
                    if (wall == null)
                    {
                        break;
                    }
                    var level     = wall.Name.Substring(wall.Name.Length - 6, 1);
                    var wallWidth = (300 + 50 * Convert.ToInt32(level));


                    var wallDirection = (wall.Position.To2D() - _yasuoWallVector2).Normalized().Perpendicular();
                    var fraction      = wallWidth / 0x2; // 0x2 = 2
                    var wallStart     = wall.Position.To2D() + fraction * wallDirection;
                    var wallEnd       = wallStart - wallWidth * wallDirection;
                    var wallPolygon   = new Geometry.Rectangle(wallStart, wallEnd, 75).ToPolygon();
                    var intersections = new List <Vector2>();

                    for (var i = 0; i < wallPolygon.Points.Count; i++)
                    {
                        var inter =
                            wallPolygon.Points[i].Intersection(
                                wallPolygon.Points[i != wallPolygon.Points.Count - 1 ? i + 1 : 0], from,
                                skillshot.End);
                        if (inter.Intersects)
                        {
                            intersections.Add(inter.Point);
                        }
                    }

                    if (intersections.Count > 0)
                    {
                        var intersection = intersections.OrderBy(item => item.Distance(from)).ToList()[0];
                        var collisionT   = Environment.TickCount +
                                           Math.Max(
                            0,
                            skillshot.SpellData.Delay -
                            (Environment.TickCount - skillshot.StartTick)) + 100 +
                                           (1000 * intersection.Distance(from)) / skillshot.SpellData.MissileSpeed;
                        if (collisionT - _wallCastTick < 4000)
                        {
                            if (skillshot.SpellData.Type != SkillShotType.SkillshotMissileLine)
                            {
                                skillshot.ForceDisabled = true;
                            }
                            return(intersection);
                        }
                    }

                    break;
                }
            }

            return(collisions.Count > 0
                ? collisions.OrderBy(c => c.Distance).ToList()[0].PositionVector2
                : new Vector2());
        }