Beispiel #1
0
        public static bool notVisibleAndMostLieklyNotThere(Obj_AI_Base unit)
        {
            var distEneNex        = Geometry.Distance(ARAMSimulator.toNex.Position, unit.Position);
            var distEneNexDeepest = Geometry.Distance(ARAMSimulator.toNex.Position, ARAMSimulator.deepestAlly.Position);

            return(!ARAMSimulator.deepestAlly.IsDead && distEneNexDeepest + 1500 < distEneNex);
        }
Beispiel #2
0
        private static void ECast(AIHeroClient enemy)
        {
            var range = Orbwalking.GetRealAutoAttackRange(enemy);
            var path  = Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.LSTo2D(),
                                                          Prediction.GetPrediction(enemy, 0.25f).UnitPosition.LSTo2D(), LucianSpells.E.Range, range);

            if (path.Count() > 0)
            {
                var epos = path.MinOrDefault(x => x.LSDistance(Game.CursorPos));
                if (epos.To3D().UnderTurret(true) || epos.To3D().LSIsWall())
                {
                    return;
                }

                if (epos.To3D().CountEnemiesInRange(LucianSpells.E.Range - 100) > 0)
                {
                    return;
                }
                LucianSpells.E.Cast(epos);
            }
            if (path.Count() == 0)
            {
                var epos = ObjectManager.Player.ServerPosition.LSExtend(enemy.ServerPosition, -LucianSpells.E.Range);
                if (epos.UnderTurret(true) || epos.LSIsWall())
                {
                    return;
                }

                // no intersection or target to close
                LucianSpells.E.Cast(ObjectManager.Player.ServerPosition.LSExtend(enemy.ServerPosition,
                                                                                 -LucianSpells.E.Range));
            }
        }
Beispiel #3
0
        public static void stackQ()
        {
            if (!Q.IsReady() || isQEmpovered() || !YasuoSharp.Config.Item("fleeStack").GetValue <bool>())//fleeStack
            {
                return;
            }
            var minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range + 50);

            if (!isDashigPro)
            {
                List <Vector2> minionPs = YasMath.GetCastMinionsPredictedPositions(minions, getNewQSpeed() * 0.3f, 30f,
                                                                                   float.MaxValue, Player.ServerPosition, 465, false, SkillshotType.SkillshotLine);
                Vector2 clos = Geometry.Closest(Player.ServerPosition.To2D(), minionPs);
                if (Player.Distance(clos) < 475)
                {
                    Q.Cast(clos, false);
                    return;
                }
            }
            else
            {
                if (minions.Count(min => !min.IsDead && min.IsValid && min.Distance(getDashEndPos()) < QCir.Range) >
                    1)
                {
                    QCir.Cast(Player.Position, false);
                    return;
                }
            }
        }
Beispiel #4
0
        private static void CastQ(Obj_AI_Base target)
        {
            var myPosition = Game.CursorPos;

            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.tumble.smartq") && _spells[SpellSlot.E].IsReady())
            {
                const int currentStep = 30;
                var       direction   = ObjectManager.Player.Direction.To2D().Perpendicular();
                for (var i = 0f; i < 360f; i += currentStep)
                {
                    var         angleRad        = Geometry.DegreeToRadian(i);
                    var         rotatedPosition = ObjectManager.Player.Position.To2D() + (300 * direction.Rotated(angleRad));
                    Obj_AI_Hero myTarget;
                    if (CondemnCheck(rotatedPosition.To3D(), out myTarget) && Helpers.OkToQ(rotatedPosition.To3D()))
                    {
                        myPosition = rotatedPosition.To3D();
                        break;
                    }
                }
            }
            if (_spells[SpellSlot.R].IsEnabledAndReady(Mode.Combo) && (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo) && ObjectManager.Player.CountEnemiesInRange(Orbwalking.GetRealAutoAttackRange(null)) >= MenuHelper.getSliderValue("dz191.vhr.combo.r.minenemies"))
            {
                _spells[SpellSlot.R].Cast();
            }
            CastTumble(myPosition, target);
        }
Beispiel #5
0
        /// <summary>
        /// Raises the <see cref="E:Draw" /> event.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
        public static void OnDraw(EventArgs args)
        {
            var closeWard =
                WardTrackerVariables.detectedWards.FirstOrDefault(
                    w => w.Position.Distance(Game.CursorPos, true) < 80 * 80);

            if (closeWard != null)
            {
                if (MenuExtensions.GetItemValue <KeyBind>("dz191.dza.ward.extrainfo").Active)
                {
                    var polyPoints  = GetWardPolygon(closeWard);
                    var currentPath = polyPoints.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
                    var currentPoly = Geometry.ToPolygon(currentPath);
                    currentPoly.Draw(GetWardColor(closeWard.WardTypeW));
                }
            }
            foreach (var ward in WardTrackerVariables.detectedWards)
            {
                if (closeWard != null && ward.Position.Distance(closeWard.Position) < float.Epsilon && MenuExtensions.GetItemValue <KeyBind>("dz191.dza.ward.extrainfo").Active)
                {
                    continue;
                }

                var position = ward.Position;
                var shape    = Helper.GetPolygonVertices(
                    new Vector2(position.X, position.Y + 15.5f).To3D(),
                    MenuExtensions.GetItemValue <Slider>("dz191.dza.ward.sides").Value, 65f, 0);
                var list        = shape.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
                var currentPoly = Geometry.ToPolygon(list);
                var colour      = GetWardColor(ward.WardTypeW);
                currentPoly.Draw(colour);
            }
        }
Beispiel #6
0
        /// <summary>
        /// Raises the <see cref="E:Draw" /> event.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
        public static void OnDraw(EventArgs args)
        {
            if (!WardTrackerBase.moduleMenu["dz191.dza.ward.track"].Cast <CheckBox>().CurrentValue)
            {
                return;
            }

            var closeWard =
                WardTrackerVariables.detectedWards.FirstOrDefault(
                    w => w.Position.LSDistance(Game.CursorPos, true) < 80 * 80);

            if (closeWard != null)
            {
                if (WardTrackerBase.moduleMenu["dz191.dza.ward.extrainfo"].Cast <KeyBind>().CurrentValue)
                {
                    var polyPoints  = GetWardPolygon(closeWard);
                    var currentPath = polyPoints.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
                    var currentPoly = Geometry.ToPolygon(currentPath);
                    currentPoly.Draw(GetWardColor(closeWard.WardTypeW));
                }
            }
            foreach (var ward in WardTrackerVariables.detectedWards)
            {
                if (Environment.TickCount > ward.startTick + ward.WardTypeW.WardDuration)
                {
                    continue;
                }

                if (closeWard != null && ward.Position.LSDistance(closeWard.Position) < float.Epsilon && WardTrackerBase.moduleMenu["dz191.dza.ward.extrainfo"].Cast <KeyBind>().CurrentValue)
                {
                    continue;
                }

                var position = ward.Position;

                switch (WardTrackerBase.moduleMenu["dz191.dza.ward.type"].Cast <ComboBox>().CurrentValue)
                {
                case 0:
                    Render.Circle.DrawCircle(position, 125f, GetWardColor(ward.WardTypeW));
                    break;

                case 1:
                    var shape = Helper.GetPolygonVertices(
                        new Vector2(position.X, position.Y + 15.5f).To3D(),
                        WardTrackerBase.moduleMenu["dz191.dza.ward.sides"].Cast <Slider>().CurrentValue, 65f, 0);
                    var list        = shape.Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
                    var currentPoly = Geometry.ToPolygon(list);
                    var colour      = GetWardColor(ward.WardTypeW);
                    currentPoly.Draw(colour);
                    break;
                }
            }
        }
Beispiel #7
0
 public static void CastSafePosition(Spell spell, AIHeroClient hero)
 {
     if (
         Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.To2D(),
                                           Prediction.GetPrediction(hero, 0f, hero.AttackRange).UnitPosition.To2D(), spell.Range,
                                           Orbwalking.GetRealAutoAttackRange(hero)).Count() > 0)
     {
         spell.Cast(
             Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.To2D(),
                                               Prediction.GetPrediction(hero, 0f, hero.AttackRange).UnitPosition.To2D(), spell.Range,
                                               Orbwalking.GetRealAutoAttackRange(hero)).MinOrDefault(i => i.Distance(Game.CursorPos)));
     }
     else
     {
         spell.Cast(ObjectManager.Player.ServerPosition.Extend(hero.ServerPosition, -spell.Range));
     }
 }
Beispiel #8
0
        public static int balanceAroundPointAdvanced(Vector2 point, float rangePlus, int fearCompansate = 0)
        {
            int balance = (point.To3D().UnderTurret(true)) ? -80 : (point.To3D().UnderTurret(false)) ? 110 : 0;

            foreach (var ene in enemy_champions)
            {
                var eneBalance = 0;
                var reach      = ene.reach + rangePlus;
                if (!ene.hero.IsDead && ene.hero.Distance(point, true) < reach * reach && !unitIsUseless(ene.hero) && !notVisibleAndMostLieklyNotThere(ene.hero))
                {
                    eneBalance -= (int)((ene.hero.HealthPercent + 20 - ene.hero.Deaths * 4 + ene.hero.ChampionsKilled * 4));
                    if (!ene.hero.IsFacing(ObjectManager.Player))
                    {
                        eneBalance = (int)(eneBalance * 0.64f);
                    }
                    var focus = ene.getFocusTarget();
                    if (focus != null && focus.IsValid && focus.IsAlly && focus is Obj_AI_Hero)
                    {
                        eneBalance = (int)(eneBalance * (focus.IsMe?1.20:0.80));
                    }
                    eneBalance += getMinionImpactOnHero(ene);
                }
                balance += eneBalance;
                balance -= getMinionImpactOnHero(myControler);
            }


            foreach (var aly in ally_champions)
            {
                var reach = (aly.reach - 200 < 500)?500:(aly.reach - 200);
                if (!aly.hero.IsDead && /*aly.hero.Distance(point, true) < reach * reach &&*/
                    (Geometry.Distance(aly.hero, ARAMSimulator.toNex.Position) + reach < (Geometry.Distance(point, ARAMSimulator.toNex.Position) + fearDistance + fearCompansate + (ARAMSimulator.tankBal * -5) + (ARAMSimulator.agrobalance * 3))))
                {
                    balance += ((int)aly.hero.HealthPercent + 20 + 20 - aly.hero.Deaths * 4 + aly.hero.ChampionsKilled * 4);
                }
            }
            var myBal = ((int)myControler.hero.HealthPercent + 20 + 20 - myControler.hero.Deaths * 4 +
                         myControler.hero.ChampionsKilled * 4) + myControler.hero.Assists / 2 + myControler.bonusSpellBalance();

            balance += (myBal < 0)?10:myBal;
            return(balance);
        }
Beispiel #9
0
        /// <summary>
        ///     Gets the QE position for the Tumble-Condemn combo.
        /// </summary>
        /// <returns></returns>
        public static Vector3 GetQEPosition()
        {
            if (!Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || !Program.E.IsReady())
            {
                return(Vector3.Zero);
            }

            var direction = ObjectManager.Player.Direction.To2D().LSPerpendicular();

            for (var i = 0f; i < 360f; i += 45)
            {
                var angleRad        = Geometry.DegreeToRadian(i);
                var rotatedPosition = ObjectManager.Player.Position.To2D() + 300f * direction.LSRotated(angleRad);
                if (Provider.GetTarget(rotatedPosition.To3D()).IsValidTarget() && rotatedPosition.To3D().IsSafe())
                {
                    return(rotatedPosition.To3D());
                }
            }

            return(Vector3.Zero);
        }
Beispiel #10
0
 public QPosition(Vector3 position,
     FioraPassive.PassiveType passiveType = FioraPassive.PassiveType.None,
     Geometry.Polygon polygon = null,
     Geometry.Polygon simplePolygon = null)
 {
     Position = position;
     PassiveType = passiveType;
     Polygon = polygon;
     SimplePolygon = simplePolygon;
 }
Beispiel #11
0
        public static void doLaneClear(Obj_AI_Hero target)
        {
            List <Obj_AI_Base> minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, 1000, MinionTypes.All, MinionTeam.NotAlly);

            if (YasuoSharp.Config.Item("useElc").GetValue <bool>() && E.IsReady())
            {
                foreach (var minion in minions.Where(minion => minion.IsValidTarget(E.Range) && enemyIsJumpable(minion)))
                {
                    if (minion.Health < Player.GetSpellDamage(minion, E.Slot) ||
                        Q.IsReady() && minion.Health < (Player.GetSpellDamage(minion, E.Slot) + Player.GetSpellDamage(minion, Q.Slot)))
                    {
                        if (useENormal(minion))
                        {
                            return;
                        }
                    }
                }
            }

            if (Q.IsReady() && YasuoSharp.Config.Item("useQlc").GetValue <bool>())
            {
                if (isQEmpovered() && !(target != null && Player.Distance(target) < 1050))
                {
                    if (canCastFarQ())
                    {
                        List <Vector2>             minionPs = YasMath.GetCastMinionsPredictedPositions(minions, getNewQSpeed(), 50f, 1200f, Player.ServerPosition, 900f, false, SkillshotType.SkillshotLine);
                        MinionManager.FarmLocation farm     = QEmp.GetLineFarmLocation(minionPs); //MinionManager.GetBestLineFarmLocation(minionPs, 50f, 900f);
                        if (farm.MinionsHit >= YasuoSharp.Config.Item("useEmpQHit").GetValue <Slider>().Value)
                        {
                            //Console.WriteLine("Cast q simp Emp");
                            QEmp.Cast(farm.Position, false);
                            return;
                        }
                    }
                    else
                    {
                        if (minions.Count(min => min.IsValid && !min.IsDead && min.Distance(getDashEndPos()) < QCir.Range) >= YasuoSharp.Config.Item("useEmpQHit").GetValue <Slider>().Value)
                        {
                            QCir.Cast(Player.Position, false);
                            Console.WriteLine("Cast q circ simp");
                        }
                    }
                }
                else
                {
                    if (!isDashigPro)
                    {
                        List <Vector2> minionPs = YasMath.GetCastMinionsPredictedPositions(minions, getNewQSpeed() * 0.3f, 30f, float.MaxValue, Player.ServerPosition, 465, false, SkillshotType.SkillshotLine);
                        Vector2        clos     = Geometry.Closest(Player.ServerPosition.To2D(), minionPs);
                        if (Player.Distance(clos) < 475)
                        {
                            Console.WriteLine("Cast q simp");

                            Q.Cast(clos, false);
                            return;
                        }
                    }
                    else
                    {
                        if (minions.Count(min => !min.IsDead && min.IsValid && min.Distance(getDashEndPos()) < QCir.Range) > 1)
                        {
                            QCir.Cast(Player.Position, false);
                            Console.WriteLine("Cast q circ simp");
                            return;
                        }
                    }
                }
            }
        }
Beispiel #12
0
        /// <summary>
        /// Checks Yasuo wall collisions
        /// </summary>
        /// <param name="poly">Polygon to check collision</param>
        /// <returns>true if collision found</returns>
        public bool CheckYasuoWallCollision(Geometry.Polygon poly)
        {
            if (Utils.TickCount - yasuoWallCastedTick > 4000)
                return false;

            GameObject yasuoWall = ObjectManager.Get<GameObject>().Where(p => p.IsValid && Regex.IsMatch(p.Name, "_w_windwall_enemy_0.\\.troy", RegexOptions.IgnoreCase)).FirstOrDefault();

            if (yasuoWall == null)
                return false;

            Vector2 yasuoWallDirection = (yasuoWall.Position.To2D() - yasuoWallCastedPos).Normalized().Perpendicular();
            float yasuoWallWidth = 300 + 50 * yasuoWallLevel;

            Vector2 yasuoWallStart = yasuoWall.Position.To2D() + yasuoWallWidth / 2f * yasuoWallDirection;
            Vector2 yasuoWallEnd = yasuoWallStart - yasuoWallWidth * yasuoWallDirection;

            Geometry.Polygon yasuoWallPoly = ClipperWrapper.DefineRectangle(yasuoWallStart, yasuoWallEnd, 5);

            return ClipperWrapper.IsIntersects(ClipperWrapper.MakePaths(yasuoWallPoly), ClipperWrapper.MakePaths(poly));
        }
Beispiel #13
0
        public static List <Vector2> PathFind(Vector2 start, Vector2 end)
        {
            var result = new List <Vector2>();

            try
            {
                var innerPolygonList = new List <Geometry.Polygon>();
                var outerPolygonList = new List <Geometry.Polygon>();

                foreach (var skillshot in Evade.EvadeMain.DetectedSkillshots)
                {
                    if (skillshot.Evade())
                    {
                        innerPolygonList.Add(skillshot.PathFindingInnerPolygon);
                        outerPolygonList.Add(skillshot.PathFindingPolygon);
                    }
                }

                var innerPolygons = Geometry.ToPolygons(Geometry.ClipPolygons(innerPolygonList));
                var outerPolygons = Geometry.ToPolygons(Geometry.ClipPolygons(outerPolygonList));


                if (outerPolygons.Aggregate(false, (current, poly) => current || !poly.IsOutside(end)))
                {
                    end = Evader.GetClosestOutsidePoint(end, outerPolygons);
                }

                if (outerPolygons.Aggregate(false, (current, poly) => current || !poly.IsOutside(start)))
                {
                    start = Evader.GetClosestOutsidePoint(start, outerPolygons);
                }

                if (Utils.CanReach(start, end, innerPolygons, true))
                {
                    return(new List <Vector2> {
                        start, end
                    });
                }

                outerPolygons.Add(new Geometry.Polygon {
                    Points = new List <Vector2> {
                        start, end
                    }
                });

                var nodes = new List <Node>();

                foreach (var pol in outerPolygons)
                {
                    for (int i = 0; i < pol.Points.Count; i++)
                    {
                        if (pol.Points.Count == 2 || !Utils.IsVertexConcave(pol.Points, i))
                        {
                            var node = nodes.FirstOrDefault(node1 => node1.Point == pol.Points[i]);
                            if (node == null)
                            {
                                node = new Node(pol.Points[i]);
                            }

                            nodes.Add(node);
                            foreach (var polygon in outerPolygons)
                            {
                                foreach (var point in polygon.Points)
                                {
                                    if (Utils.CanReach(pol.Points[i], point, innerPolygons, true))
                                    {
                                        var nodeToAdd = nodes.FirstOrDefault(node1 => node1.Point == point);
                                        if (nodeToAdd == null)
                                        {
                                            nodeToAdd = new Node(point);
                                        }
                                        nodes.Add(nodeToAdd);
                                        node.Neightbours.Add(nodeToAdd);
                                    }
                                }
                            }
                        }
                    }
                }

                var startNode = nodes.FirstOrDefault(n => n.Point == start);
                var endNode   = nodes.FirstOrDefault(n => n.Point == end);

                if (endNode == null)
                {
                    return(result);
                }

                Func <Node, Node, double> distance = (node1, node2) => node1.Point.Distance(node2.Point);
                Func <Node, double>       estimate = t => t.Point.Distance(endNode.Point);

                var foundPath = FindPath(startNode, endNode, distance, estimate);

                if (foundPath == null)
                {
                    return(result);
                }

                result.AddRange(foundPath.Select(node => node.Point));
                result.Reverse();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            return(result);
        }
Beispiel #14
0
        public static Vector3 FindTumblePosition(AIHeroClient target)
        {
            if (Program.Only2W && target.GetBuffCount("vaynesilvereddebuff") == 1)
            {
                // == 1 cuz calling this after attack which is aa missile still flying
                return(Vector3.Zero);
            }

            if (Program.Wall)
            {
                var outRadius = ObjectManager.Player.BoundingRadius / (float)Math.Cos(2 * Math.PI / 8);

                for (var i = 1; i <= 8; i++)
                {
                    var angle    = i * 2 * Math.PI / 8;
                    var x        = ObjectManager.Player.Position.X + outRadius * (float)Math.Cos(angle);
                    var y        = ObjectManager.Player.Position.Y + outRadius * (float)Math.Sin(angle);
                    var colFlags = NavMesh.GetCollisionFlags(x, y);
                    if (colFlags.HasFlag(CollisionFlags.Wall) || colFlags.HasFlag(CollisionFlags.Building))
                    {
                        return(new Vector3(x, y, 0));
                    }
                }
            }

            if (Program.sacMode == 0)
            {
                var vec = target.ServerPosition;

                if (target.Path.Length > 0)
                {
                    if (ObjectManager.Player.LSDistance(vec) < ObjectManager.Player.LSDistance(target.Path.Last()))
                    {
                        return(IsSafe(target, Game.CursorPos));
                    }
                    return(IsSafe(target,
                                  Game.CursorPos.LSTo2D()
                                  .LSRotated(
                                      Geometry.DegreeToRadian(
                                          (vec - ObjectManager.Player.ServerPosition).LSTo2D()
                                          .LSAngleBetween((Game.CursorPos - ObjectManager.Player.ServerPosition).LSTo2D()) %
                                          90))
                                  .To3D()));
                }
                if (target.IsMelee)
                {
                    return(IsSafe(target, Game.CursorPos));
                }

                return(IsSafe(target,
                              ObjectManager.Player.ServerPosition +
                              (target.ServerPosition - ObjectManager.Player.ServerPosition).LSNormalized()
                              .LSTo2D()
                              .LSRotated(
                                  Geometry.DegreeToRadian(90 -
                                                          (vec - ObjectManager.Player.ServerPosition).LSTo2D()
                                                          .LSAngleBetween(
                                                              (Game.CursorPos - ObjectManager.Player.ServerPosition).LSTo2D())))
                              .To3D() * 300f));
            }
            if (Program.sacMode == 1)
            {
                return(Game.CursorPos);
            }

            return(Game.CursorPos);
        }
Beispiel #15
0
 public QPosition(Vector3 position,
     FioraPassive.PassiveType type = FioraPassive.PassiveType.None,
     Geometry.Polygon polygon = null)
 {
     Position = position;
     Type = type;
     Polygon = polygon;
 }
Beispiel #16
0
 private static Tuple<Vector3, Vector3> SGeneratePosition(Geometry.Polygon.Rectangle polygon, Vector3 fatherst, Vector3 closest)
 {
     Vector3 v0 = MoveVector(fatherst, closest, -187.5F);
     Vector3 v1 = MoveVector(closest, fatherst, -187.5F);
     return new Tuple<Vector3, Vector3>(v0, v1);
 }