Пример #1
0
        private static List <Obj_AI_Base> GetCollisionMinions(this Spell spell, Obj_AI_Hero source, Vector3 targetposition)
        {
            var input = new PredictionInput {
                Unit = source, Radius = spell.Width, Delay = spell.Delay, Speed = spell.Speed,
            };

            input.CollisionObjects[0] = CollisionableObjects.Minions;

            return
                (Collision.GetCollision(new List <Vector3> {
                targetposition
            }, input)
                 .OrderBy(obj => obj.Distance(source, false))
                 .ToList());
        }
Пример #2
0
        static bool IsCollidingWithChamps(Obj_AI_Hero source, Vector3 targetpos, float width)
        {
            var input = new PredictionInput
            {
                Radius = width,
                Unit   = source,
            };

            input.CollisionObjects[0] = CollisionableObjects.Heroes;

            return(Collision.GetCollision(new List <Vector3> {
                targetpos
            }, input).Any());
            //x => x.NetworkId != targetnetid, hard to realize with teamult
        }
Пример #3
0
        static bool CollisionCheck(Obj_AI_Hero source, Vector3 targetpos, float width)
        {
            var input = new PredictionInput
            {
                Radius = width,
                Unit   = source,
            };

            input.CollisionObjects[0] = CollisionableObjects.Heroes;
            input.CollisionObjects[1] = CollisionableObjects.YasuoWall;

            return(Collision.GetCollision(new List <Vector3> {
                targetpos
            }, input).Count() >= 1);
        }
Пример #4
0
        static bool CollisionCheck(Obj_AI_Hero source, Obj_AI_Hero target, float width)
        {
            var input = new PredictionInput
            {
                Radius = width,
                Unit   = source,
            };

            input.CollisionObjects[0] = CollisionableObjects.Heroes;
            input.CollisionObjects[1] = CollisionableObjects.YasuoWall;

            return(!Collision.GetCollision(new List <Vector3> {
                target.ServerPosition
            }, input).Where(x => x.NetworkId != x.NetworkId).Any());
        }
Пример #5
0
        private bool isColliding(Vector3 pos)
        {
            if (player.ChampionName == "Draven" && player.ChampionName == "Ashe" && player.ChampionName == "Jinx")
            {
                var input = new PredictionInput {
                    Radius = R.Width, Unit = player
                };

                input.CollisionObjects[0] = CollisionableObjects.Heroes;

                return(Collision.GetCollision(new List <Vector3> {
                    pos
                }, input).Any());
            }
            return(false);
        }
Пример #6
0
        public static int GetCollisionCount(Obj_AI_Base from,
                                            Vector3 toPos,
                                            float spellWidth,
                                            CollisionableObjects[] colloObjects)
        {
            var input = new PredictionInput
            {
                Radius           = spellWidth,
                Unit             = from,
                CollisionObjects = colloObjects
            };

            return(Collision.GetCollision(new List <Vector3> {
                toPos
            }, input).Count());
        }
Пример #7
0
        static List <Obj_AI_Base> Q_GetCollisionMinions(AIHeroClient source, Vector3 targetposition)
        {
            var input = new PredictionInput
            {
                Unit   = source,
                Radius = Q.Width,
                Delay  = Q.Delay,
                Speed  = Q.Speed,
            };

            input.CollisionObjects[0] = CollisionableObjects.Minions;

            return(Collision.GetCollision(new List <Vector3> {
                targetposition
            }, input).OrderBy(obj => obj.Distance(source, false)).ToList());
        }
Пример #8
0
        /// <summary>
        ///     Gets the Q Collision count.
        /// </summary>
        /// <param name="target"></param>
        /// <param name="castPos"></param>
        /// <returns></returns>
        internal static int GetQCollisionsCount(Obj_AI_Hero target, Vector3 castPos)
        {
            var input = new PredictionInput
            {
                Unit             = target,
                Radius           = SpellQ.SpellObject.Width,
                Delay            = SpellQ.SpellObject.Delay,
                Speed            = SpellQ.SpellObject.Speed,
                CollisionObjects = new[] { CollisionableObjects.Heroes, CollisionableObjects.Minions }
            };

            return
                (Collision.GetCollision(
                     new List <Vector3> {
                ObjectManager.Player.Position.Extend(castPos, SpellQ.Range + SpellQ.Width)
            }, input).Count);
        }
Пример #9
0
        /// <summary>
        ///     Gets the list of minions currently between the source and target
        /// </summary>
        /// <param name="source">
        ///     The Source
        /// </param>
        /// <param name="targetPosition">
        ///     The Target Position
        /// </param>
        /// <returns>
        ///     The <see cref="List" />.
        /// </returns>
        public static List <Obj_AI_Base> GetCollisionMinions(Obj_AI_Hero source, Vector3 targetPosition)
        {
            var input = new PredictionInput
            {
                Unit             = source, Radius = SpellManager.Spell[SpellSlot.Q].Width,
                Delay            = SpellManager.Spell[SpellSlot.Q].Delay,
                Speed            = SpellManager.Spell[SpellSlot.Q].Speed,
                CollisionObjects = new[] { CollisionableObjects.Minions }
            };

            return
                (Collision.GetCollision(new List <Vector3> {
                targetPosition
            }, input)
                 .OrderBy(x => x.Distance(source))
                 .ToList());
        }
Пример #10
0
        /// <summary>
        ///     Gets the minions in the Collision path from the source target to the given Position then creates a new prediction
        ///     input based on those details and compiles to list. thanks bye
        /// </summary>
        /// <param name="source"> the source mate </param>
        /// <param name="target"> the target mate </param>
        /// <returns> A Nice List of minions currently blocking your Q HIT M8 </returns>
        public static Obj_AI_Base GetFirstCollisionMinion(Obj_AI_Hero source, Obj_AI_Base target)
        {
            // ReSharper disable once UseObjectOrCollectionInitializer
            PredictionInput input = new PredictionInput
            {
                Unit   = source,
                Radius = CheckHandler._spells[SpellSlot.Q].Width,
                Delay  = CheckHandler._spells[SpellSlot.Q].Delay,
                Speed  = CheckHandler._spells[SpellSlot.Q].Speed,
                Range  = CheckHandler._spells[SpellSlot.Q].Range
            };

            input.CollisionObjects[0] = CollisionableObjects.Minions;

            return(Collision.GetCollision(new List <Vector3> {
                target.Position
            }, input).FirstOrDefault());
        }
Пример #11
0
        public override void OnBeforeEnemyAttack(BeforeEnemyAttackEventArgs args)
        {
            if (Q.CastCheck(args.Caster, "Misc.Q.OnAttack") && (ComboMode || HarassMode) && !BlockQ &&
                args.Caster == Target && args.Type == Packet.AttackTypePacket.TargetedAA)
            {
                var collision = Collision.GetCollision(new List <Vector3> {
                    args.Caster.Position
                },
                                                       new PredictionInput {
                    Delay = 0.25f, Radius = 70, Speed = 1800
                });

                if (collision.Count == 0)
                {
                    Q.Cast(args.Caster.Position, UsePackets);
                }
            }
        }
Пример #12
0
        private static List <Obj_AI_Base> CollisionObjects(Spell spell, AIHeroClient source, AIHeroClient target, CollisionableObjects[] collisionableObjects)
        {
            var input = new PredictionInput
            {
                Unit             = source,
                Radius           = spell.Width,
                Delay            = spell.Delay,
                Speed            = spell.Speed,
                CollisionObjects = collisionableObjects,//{[0] = CollisionableObjects.Heroes, [1] = CollisionableObjects.YasuoWall},
            };

            return
                (Collision.GetCollision(new List <Vector3> {
                target.Position
            }, input).Where(obj => obj.NetworkId != target.NetworkId)
                 .OrderBy(obj => obj.Distance(source, false))
                 .ToList());
        }
Пример #13
0
        private static bool HitsEnemyInTravel(Obj_AI_Base source)
        {
            var pred      = R.GetPrediction(source);
            var collision =
                Collision.GetCollision(new List <Vector3> {
                pred.UnitPosition
            },
                                       new PredictionInput
            {
                Unit             = ObjectManager.Player,
                Delay            = R.Delay,
                Speed            = R.Speed,
                Radius           = R.Width,
                CollisionObjects = new[] { CollisionableObjects.Heroes }
            })
                .Any(x => x.NetworkId != source.NetworkId);

            return(collision);
        }
Пример #14
0
 void Orbwalking_AfterAttack(AttackableUnit unit, AttackableUnit target)
 {
     if (unit.IsMe && config.Item("useqH", true).GetValue <bool>() && Q.IsReady() && orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo && !player.UnderTurret(true))
     {
         var collision = Collision.GetCollision(
             new List <Vector3>()
         {
             player.Position, player.Position.Extend(target.Position, Q.Range)
         },
             new PredictionInput()
         {
             Aoe              = true,
             Collision        = false,
             CollisionObjects = new CollisionableObjects[] { CollisionableObjects.Heroes },
         });
         if (collision.Any())
         {
             Q.Cast();
         }
     }
 }
Пример #15
0
 private List <Obj_AI_Base> QGetCollisions(Obj_AI_Hero source, Vector3 targetposition)
 {
     try
     {
         var input = new PredictionInput {
             Unit = source, Radius = Q.Width, Delay = Q.Delay, Speed = Q.Speed
         };
         input.CollisionObjects[0] = CollisionableObjects.Minions;
         return
             (Collision.GetCollision(new List <Vector3> {
             targetposition
         }, input)
              .OrderBy(obj => obj.Distance(source))
              .ToList());
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(new List <Obj_AI_Base>());
 }
Пример #16
0
        public static IEnumerable <Obj_AI_Base> QGetCollisionMinions(Vector3 source, Vector3 targetposition, float width, float range, CollisionableObjects[] collisionObjects)
        {
            PredictionInput input = new PredictionInput {
                From = source, Radius = width, Range = range
            };

            if (collisionObjects.Length > 0)
            {
                for (int i = 0; collisionObjects.Length != 0; i++)
                {
                    input.CollisionObjects[i] = collisionObjects[i];
                }
            }
            else
            {
                input.CollisionObjects[0] = CollisionableObjects.Minions;
            }

            return
                (Collision.GetCollision(new List <Vector3> {
                targetposition
            }, input).OrderBy(obj => obj.Distance(source)).ToList());
        }
Пример #17
0
 private int GetQCollisionsCount(Obj_AI_Hero target, Vector3 castPos)
 {
     try
     {
         var input = new PredictionInput
         {
             Unit             = target,
             Radius           = Q.Width,
             Delay            = Q.Delay,
             Speed            = Q.Speed,
             CollisionObjects = new[] { CollisionableObjects.Heroes, CollisionableObjects.Minions }
         };
         return
             (Collision.GetCollision(
                  new List <Vector3> {
             Player.Position.Extend(castPos, Q.Range + Q.Width)
         }, input).Count);
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(0);
 }
Пример #18
0
        private void Game_OnUpdate(EventArgs args)
        {
            _r.Range = 1500 + 500 * _r.Level;

            if (!ObjectManager.Player.IsDead)
            {
                if (Orbwalking.CanMove(100))
                {
                    switch (MenuProvider.Orbwalker.ActiveMode)
                    {
                    case Orbwalking.OrbwalkingMode.Combo:
                    {
                        if (MenuProvider.Champion.Combo.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (
                                    HeroManager.Enemies.Count(
                                        x => x.IsValidTarget() && Orbwalking.InAutoAttackRange(x)) == 0)
                                {
                                    var target = TargetSelector.GetTarget(_q.Range, _q.DamageType);
                                    if (target != null)
                                    {
                                        _q.Cast(target, false, true);
                                    }
                                }
                                else
                                {
                                    var immobileTarget =
                                        HeroManager.Enemies.Where(
                                            x =>
                                            x.IsValidTarget(_q.Range) &&
                                            _q.GetPrediction(x).Hitchance >= HitChance.Immobile)
                                        .OrderByDescending(x => TargetSelector.GetPriority(x))
                                        .FirstOrDefault();
                                    if (immobileTarget != null)
                                    {
                                        _q.Cast(immobileTarget, false, true);
                                    }
                                    else
                                    {
                                        var killableTarget =
                                            HeroManager.Enemies.FirstOrDefault(
                                                x =>
                                                x.IsKillableAndValidTarget(_q.GetDamage(x),
                                                                           TargetSelector.DamageType.Physical, _q.Range));
                                        if (killableTarget != null)
                                        {
                                            _q.Cast(killableTarget, false, true);
                                        }
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseR)
                        {
                            if (_r.IsReadyPerfectly())
                            {
                                var target =
                                    HeroManager.Enemies.FirstOrDefault(
                                        x =>
                                        !Orbwalking.InAutoAttackRange(x) &&
                                        x.IsKillableAndValidTarget(_r.GetDamage(x),
                                                                   TargetSelector.DamageType.Physical, _r.Range));
                                if (target != null)
                                {
                                    if (
                                        ObjectManager.Player.GetEnemiesInRange(1500f)
                                        .Count(x => target.NetworkId != x.NetworkId) <= 0)
                                    {
                                        if (
                                            target.GetEnemiesInRange(500f)
                                            .Count(x => target.NetworkId != x.NetworkId) <= 0)
                                        {
                                            var collision =
                                                Collision.GetCollision(new List <Vector3> {
                                                    target.ServerPosition
                                                },
                                                                       new PredictionInput
                                                {
                                                    UseBoundingRadius = true,
                                                    Unit             = ObjectManager.Player,
                                                    Delay            = 0.5f,
                                                    Speed            = 1500f,
                                                    Radius           = 500f,
                                                    CollisionObjects = new[] { CollisionableObjects.Heroes }
                                                })
                                                .Any(x => x.NetworkId != target.NetworkId);
                                            if (!collision)
                                            {
                                                _r.CastOnUnit(target);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        break;
                    }

                    case Orbwalking.OrbwalkingMode.Mixed:
                    {
                        if (MenuProvider.Champion.Harass.UseQ)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (_q.IsReadyPerfectly())
                                {
                                    var target = TargetSelector.GetTarget(_q.Range, _q.DamageType);
                                    if (target != null)
                                    {
                                        _q.Cast(target, false, true);
                                    }
                                }
                            }
                        }
                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LaneClear:
                    {
                        //Laneclear
                        if (MenuProvider.Champion.Laneclear.UseQ)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                            {
                                if (_q.IsReadyPerfectly())
                                {
                                    var farmLocation = _q.GetLineFarmLocation(MinionManager.GetMinions(_q.Range));
                                    if (farmLocation.MinionsHit >= 4)
                                    {
                                        _q.Cast(farmLocation.Position);
                                    }
                                }
                            }
                        }

                        //Jungleclear
                        if (MenuProvider.Champion.Jungleclear.UseQ)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                            {
                                if (_q.IsReadyPerfectly())
                                {
                                    var target =
                                        MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral,
                                                                 MinionOrderTypes.MaxHealth).FirstOrDefault(x => x.IsValidTarget(600));
                                    if (target != null)
                                    {
                                        _q.Cast(target);
                                    }
                                }
                            }
                        }
                        break;
                    }
                    }

                    if (MenuProvider.Champion.Misc.GetBoolValue("Auto R on Killable Target"))
                    {
                        if (_r.IsReadyPerfectly())
                        {
                            var target =
                                HeroManager.Enemies.FirstOrDefault(
                                    x =>
                                    !Orbwalking.InAutoAttackRange(x) &&
                                    x.IsKillableAndValidTarget(_r.GetDamage(x), TargetSelector.DamageType.Physical,
                                                               _r.Range));
                            if (target != null)
                            {
                                if (
                                    ObjectManager.Player.GetEnemiesInRange(1500f)
                                    .Count(x => target.NetworkId != x.NetworkId) <= 0)
                                {
                                    if (target.GetEnemiesInRange(500f).Count(x => target.NetworkId != x.NetworkId) <= 0)
                                    {
                                        var collision =
                                            Collision.GetCollision(new List <Vector3> {
                                            target.ServerPosition
                                        },
                                                                   new PredictionInput
                                        {
                                            Unit             = ObjectManager.Player,
                                            Delay            = 0.5f,
                                            Speed            = 1500f,
                                            Radius           = 500f,
                                            CollisionObjects = new[] { CollisionableObjects.Heroes }
                                        })
                                            .Any(x => x.NetworkId != target.NetworkId);
                                        if (!collision)
                                        {
                                            _r.CastOnUnit(target);
                                        }
                                    }
                                }
                            }
                        }
                    }

                    if (MenuProvider.Champion.Misc.GetBoolValue("Auto W on Immobile Target"))
                    {
                        if (_w.IsReadyPerfectly())
                        {
                            var target =
                                HeroManager.Enemies.FirstOrDefault(
                                    x => x.IsValidTarget(_w.Range) && x.IsImmobileUntil() > 0.5f);
                            if (target != null)
                            {
                                if (!_myTrapList.Any(x => x.IsValid && target.Position.Distance(x.Position) <= 100))
                                {
                                    _w.Cast(target.Position);
                                }
                            }
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetKeyBindValue("Dash to Cursor Position (With E)").Active)
                {
                    if (_e.IsReadyPerfectly())
                    {
                        _e.Cast(ObjectManager.Player.Position.Extend(Game.CursorPos, -(_e.Range / 2)));
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto Attack Trapped Target"))
                {
                    foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(1300)))
                    {
                        if (!Orbwalking.CanAttack())
                        {
                            continue;
                        }
                        var trapbuff = enemy.GetBuff("caitlynyordletrapinternal");
                        if (trapbuff != null && trapbuff.IsValid)
                        {
                            ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, enemy);
                        }
                    }
                }
            }
        }
Пример #19
0
        internal static resultPred GetPrediction(Obj_AI_Hero target, Spell isSpell)
        {
            resultPred result = new resultPred(new Vector3(), 0);

            if (target != null & target.IsValidTarget(LeeSin.Q.Range + LeeSin.W.Range))
            {
                Vector3[] path = target.Path;
                if (path.Count() == 1)
                {
                    if (path[0].Distance(LeeSin.myHero.ServerPosition) < isSpell.Range)
                    {
                        result.Hitchance = 8;
                    }

                    result.predPos = path[0];
                }
                else if (path.Count() >= 2)
                {
                    if (GetNow() - newPath[target.NetworkId] < 100 || GetNow() > 3000)
                    {
                        float timeToHit   = (LeeSin.myHero.ServerPosition.Distance(target.ServerPosition) / isSpell.Speed) + (isSpell.Delay / 1000);
                        float DistanceRun = target.MoveSpeed * timeToHit;

                        Vector3 pos = path[1];
                        pos = target.ServerPosition.Extend(path[1], (DistanceRun - (isSpell.Width / 2) - target.BoundingRadius));

                        if (pos.Distance(LeeSin.myHero.ServerPosition) < isSpell.Range)
                        {
                            if (DistanceRun > 500)
                            {
                                result.Hitchance = 3;
                            }
                            else if (DistanceRun > 400)
                            {
                                result.Hitchance = 4;
                            }
                            else if (DistanceRun > 300)
                            {
                                result.Hitchance = 5;
                            }
                            else if (DistanceRun > 200)
                            {
                                result.Hitchance = 6;
                            }
                            else if (DistanceRun < 200)
                            {
                                result.Hitchance = 7;
                            }

                            result.predPos = pos;
                        }
                    }
                }

                PredictionInput predInput = new PredictionInput {
                    From = LeeSin.myHero.ServerPosition, Radius = isSpell.Width, Range = isSpell.Range
                };
                predInput.CollisionObjects[0] = CollisionableObjects.Heroes;
                predInput.CollisionObjects[1] = CollisionableObjects.Minions;

                IEnumerable <Obj_AI_Base> rCol = Collision.GetCollision(new List <Vector3> {
                    result.predPos
                }, predInput).ToArray();
                IEnumerable <Obj_AI_Base> rObjCol = rCol as Obj_AI_Base[] ?? rCol.ToArray();

                if (rObjCol.Count() > 0)
                {
                    result.Hitchance = 0;
                }
            }
            return(result);
        }
Пример #20
0
        private void Game_OnUpdate(EventArgs args)
        {
            _w.MinHitChance = MenuProvider.Champion.Misc.WSelectedHitchance;

            if (!ObjectManager.Player.IsDead)
            {
                if (Orbwalking.CanMove(100))
                {
                    switch (MenuProvider.Orbwalker.ActiveMode)
                    {
                    case Orbwalking.OrbwalkingMode.Combo:
                    {
                        if (MenuProvider.Champion.Combo.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.CountEnemiesInRange(2000f) > 0)
                                {
                                    var target =
                                        HeroManager.Enemies.Where(
                                            x =>
                                            x.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(x,
                                                                                                        GetQRange)))
                                        .OrderByDescending(a => TargetSelector.GetPriority(a))
                                        .FirstOrDefault();
                                    if (target != null)
                                    {
                                        if (target.CountEnemiesInRange(200) >=
                                            MenuProvider.Champion.Combo.GetSliderValue(
                                                "Switch to Rocket If will hit enemy Number >=").Value)
                                        {
                                            QSwitch(true);
                                        }
                                        else
                                        {
                                            QSwitch(
                                                !target.IsValidTarget(
                                                    ObjectManager.Player.GetRealAutoAttackRange(target, DefaultRange)));
                                        }
                                    }
                                    else
                                    {
                                        QSwitch(true);
                                    }
                                }
                                else
                                {
                                    QSwitch(false);
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseW)
                        {
                            if (ObjectManager.Player.CountEnemiesInRange(400f) == 0)
                            {
                                if (_w.IsReadyPerfectly())
                                {
                                    var target = TargetSelector.GetTargetNoCollision(_w);
                                    if (target.IsValidTarget(_w.Range))
                                    {
                                        _w.SPredictionCast(target, _w.MinHitChance);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseE)
                        {
                            if (_e.IsReadyPerfectly())
                            {
                                var target =
                                    HeroManager.Enemies.Where(
                                        x =>
                                        x.IsValidTarget(600) && _e.GetPrediction(x).Hitchance >= _e.MinHitChance &&
                                        x.IsMoving)
                                    .OrderBy(x => x.Distance(ObjectManager.Player))
                                    .FirstOrDefault();
                                if (target != null)
                                {
                                    _e.Cast(target, false, true);
                                }
                                else
                                {
                                    _e.CastWithExtraTrapLogic();
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseR)
                        {
                            if (_r.IsReadyPerfectly())
                            {
                                if (_wCastTime + 1060 <= Environment.TickCount)
                                {
                                    var target =
                                        HeroManager.Enemies.FirstOrDefault(
                                            x =>
                                            !x.IsZombie && x.CountAlliesInRange(500) < 2 &&
                                            HealthPrediction.GetHealthPrediction(x, 5000) > 0 &&
                                            ObjectManager.Player.Distance(x) >= GetQRange &&
                                            x.IsKillableAndValidTarget(GetRDamage(x),
                                                                       TargetSelector.DamageType.Physical, _r.Range) &&
                                            _r.GetPrediction(x).Hitchance >= HitChance.High);
                                    if (target != null)
                                    {
                                        var prediction = _r.GetPrediction(target);
                                        var collision  =
                                            Collision.GetCollision(new List <Vector3> {
                                                prediction.UnitPosition
                                            },
                                                                   new PredictionInput
                                            {
                                                UseBoundingRadius = true,
                                                Unit             = ObjectManager.Player,
                                                Delay            = _r.Delay,
                                                Speed            = _r.Speed,
                                                Radius           = 200,
                                                CollisionObjects = new[] { CollisionableObjects.Heroes }
                                            })
                                            .Any(x => x.NetworkId != target.NetworkId);
                                        if (!collision)
                                        {
                                            _r.Cast(target);
                                        }
                                    }
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.Mixed:
                    {
                        if (MenuProvider.Champion.Harass.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                                {
                                    if (ObjectManager.Player.CountEnemiesInRange(2000f) > 0)
                                    {
                                        var target =
                                            HeroManager.Enemies.Where(
                                                x =>
                                                x.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(x,
                                                                                                            GetQRange)))
                                            .OrderByDescending(a => TargetSelector.GetPriority(a))
                                            .FirstOrDefault();
                                        QSwitch(
                                            !target.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(
                                                                      target, DefaultRange)));
                                    }
                                    else
                                    {
                                        QSwitch(false);
                                    }
                                }
                                else
                                {
                                    QSwitch(false);
                                }
                            }
                        }
                        else
                        {
                            QSwitch(false);
                        }

                        if (MenuProvider.Champion.Harass.UseW)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (ObjectManager.Player.CountEnemiesInRange(400f) == 0)
                                {
                                    if (_w.IsReadyPerfectly())
                                    {
                                        var target = TargetSelector.GetTargetNoCollision(_w);
                                        if (target.IsValidTarget(_w.Range))
                                        {
                                            _w.SPredictionCast(target, _w.MinHitChance);
                                        }
                                    }
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LaneClear:
                    {
                        if (MenuProvider.Champion.Laneclear.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                                {
                                }
                                else
                                {
                                    QSwitch(false);
                                }
                            }
                        }
                        else
                        {
                            QSwitch(false);
                        }

                        //Jungleclear
                        if (MenuProvider.Champion.Jungleclear.UseW)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                            {
                                if (_w.IsReadyPerfectly())
                                {
                                    var target =
                                        MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral,
                                                                 MinionOrderTypes.MaxHealth)
                                        .FirstOrDefault(
                                            x =>
                                            x.IsValidTarget(600) &&
                                            _w.GetPrediction(x).Hitchance >= _w.MinHitChance);
                                    if (target != null)
                                    {
                                        _w.Cast(target);
                                    }
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LastHit:
                    {
                        if (MenuProvider.Champion.Lasthit.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Lasthit.IfMana))
                                {
                                    var target =
                                        MinionManager.GetMinions(float.MaxValue)
                                        .FirstOrDefault(
                                            x =>
                                            x.IsKillableAndValidTarget(
                                                ObjectManager.Player.GetAutoAttackDamage(x, false) +
                                                _q.GetDamage(x), TargetSelector.DamageType.Physical) &&
                                            x.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(x,
                                                                                                        GetQRange)) &&
                                            !x.IsValidTarget(ObjectManager.Player.GetRealAutoAttackRange(x,
                                                                                                         DefaultRange)));
                                    if (target != null)
                                    {
                                        QSwitch(true);

                                        if (Orbwalking.InAutoAttackRange(target))
                                        {
                                            MenuProvider.Orbwalker.ForceTarget(target);
                                        }
                                    }
                                    else
                                    {
                                        QSwitch(false);
                                    }
                                }
                                else
                                {
                                    QSwitch(false);
                                }
                            }
                        }
                        else
                        {
                            QSwitch(false);
                        }

                        break;
                    }
                    }

                    if (MenuProvider.Champion.Misc.GetBoolValue("Auto R on Killable Target"))
                    {
                        if (_r.IsReadyPerfectly())
                        {
                            if (_wCastTime + 1060 <= Environment.TickCount)
                            {
                                var target =
                                    HeroManager.Enemies.FirstOrDefault(
                                        x =>
                                        !x.IsZombie && x.CountAlliesInRange(500) < 2 &&
                                        HealthPrediction.GetHealthPrediction(x, 5000) > 0 &&
                                        ObjectManager.Player.Distance(x) >= GetQRange &&
                                        x.IsKillableAndValidTarget(GetRDamage(x), TargetSelector.DamageType.Physical,
                                                                   _r.Range) && _r.GetPrediction(x).Hitchance >= HitChance.High);
                                if (target != null)
                                {
                                    var prediction = _r.GetPrediction(target);
                                    var collision  =
                                        Collision.GetCollision(new List <Vector3> {
                                        prediction.UnitPosition
                                    },
                                                               new PredictionInput
                                    {
                                        Unit             = ObjectManager.Player,
                                        Delay            = _r.Delay,
                                        Speed            = _r.Speed,
                                        Radius           = _r.Width,
                                        CollisionObjects = new[] { CollisionableObjects.Heroes }
                                    })
                                        .Any(x => x.NetworkId != target.NetworkId);
                                    if (!collision)
                                    {
                                        _r.Cast(target);
                                    }
                                }
                            }
                        }
                    }

                    if (MenuProvider.Champion.Misc.GetBoolValue("Auto E on Immobile Target"))
                    {
                        if (_e.IsReadyPerfectly())
                        {
                            var target =
                                HeroManager.Enemies.FirstOrDefault(
                                    x => x.IsValidTarget(_e.Range) && x.IsImmobileUntil() > 0.5f);
                            if (target != null)
                            {
                                _e.Cast(target, false, true);
                            }
                        }
                    }

                    if (MenuProvider.Champion.Harass.AutoHarass)
                    {
                        if (MenuProvider.Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo)
                        {
                            if (!ObjectManager.Player.IsRecalling())
                            {
                                if (MenuProvider.Champion.Harass.UseW)
                                {
                                    if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                                    {
                                        var target = TargetSelector.GetTargetNoCollision(_w);
                                        if (target != null)
                                        {
                                            if (ObjectManager.Player.UnderTurret(true)
                                                ? !target.UnderTurret(true)
                                                : true)
                                            {
                                                _w.Cast(target);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #21
0
        private void Game_OnUpdate(EventArgs args)
        {
            if (!ObjectManager.Player.IsDead)
            {
                if (Orbwalking.CanMove(100))
                {
                    switch (MenuProvider.Orbwalker.ActiveMode)
                    {
                    case Orbwalking.OrbwalkingMode.Combo:
                    {
                        if (MenuProvider.Champion.Combo.GetBoolValue("Attack Minion For Chasing"))
                        {
                            if (MenuProvider.Orbwalker.GetTarget() == null)
                            {
                                if (
                                    !HeroManager.Enemies.Any(
                                        x => x.IsValidTarget() && Orbwalking.InAutoAttackRange(x)))
                                {
                                    var minion =
                                        MinionManager.GetMinions(Orbwalking.GetRealAutoAttackRange(null) + 65,
                                                                 MinionTypes.All, MinionTeam.NotAlly)
                                        .Where(x => x.IsValidTarget())
                                        .OrderBy(x => x.Distance(ObjectManager.Player))
                                        .FirstOrDefault();
                                    if (minion != null)
                                    {
                                        Orbwalking.Orbwalk(minion, Game.CursorPos, 0f);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (!ObjectManager.Player.IsDashing())
                                {
                                    if (!ObjectManager.Player.IsWindingUp)
                                    {
                                        var target = TargetSelector.GetTargetNoCollision(_q);
                                        if (target != null)
                                        {
                                            if (ObjectManager.Player.Mana - _qManaCost[_q.Level] >= 40)
                                            {
                                                _q.SPredictionCast(target, _q.MinHitChance);
                                            }
                                            else
                                            {
                                                var killableTarget =
                                                    HeroManager.Enemies.FirstOrDefault(
                                                        x =>
                                                        !Orbwalking.InAutoAttackRange(x) &&
                                                        x.IsKillableAndValidTarget(_q.GetDamage(x),
                                                                                   TargetSelector.DamageType.Physical, _q.Range) &&
                                                        _q.GetPrediction(x).Hitchance >= _q.MinHitChance);
                                                if (killableTarget != null)
                                                {
                                                    _q.Cast(killableTarget);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseE)
                        {
                            if (_e.IsReadyPerfectly())
                            {
                                if (
                                    HeroManager.Enemies.Any(
                                        x =>
                                        HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                        x.IsKillableAndValidTarget(_e.GetDamage(x),
                                                                   TargetSelector.DamageType.Physical, _e.Range)))
                                {
                                    _e.Cast();
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.Mixed:
                    {
                        if (MenuProvider.Champion.Harass.UseQ)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (!ObjectManager.Player.IsDashing())
                                {
                                    if (!ObjectManager.Player.IsWindingUp)
                                    {
                                        if (_q.IsReadyPerfectly())
                                        {
                                            var target = TargetSelector.GetTargetNoCollision(_q);
                                            if (target != null)
                                            {
                                                _q.SPredictionCast(target, _q.MinHitChance);
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LaneClear:
                    {
                        //Lane
                        if (MenuProvider.Champion.Laneclear.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (!ObjectManager.Player.IsDashing())
                                {
                                    if (!ObjectManager.Player.IsWindingUp)
                                    {
                                        if (
                                            ObjectManager.Player.IsManaPercentOkay(
                                                MenuProvider.Champion.Laneclear.IfMana))
                                        {
                                            foreach (
                                                var killableMinion in
                                                MinionManager.GetMinions(_q.Range)
                                                .Where(
                                                    x =>
                                                    _q.GetPrediction(x).Hitchance >= _q.MinHitChance &&
                                                    x.IsKillableAndValidTarget(_q.GetDamage(x),
                                                                               TargetSelector.DamageType.Physical, _q.Range)))
                                            {
                                                var killableNumber = 0;

                                                var collisionMinions =
                                                    Collision.GetCollision(
                                                        new List <Vector3>
                                                    {
                                                        ObjectManager.Player.ServerPosition.Extend(
                                                            killableMinion.ServerPosition, _q.Range)
                                                    },
                                                        new PredictionInput
                                                    {
                                                        Unit              = ObjectManager.Player,
                                                        Delay             = _q.Delay,
                                                        Speed             = _q.Speed,
                                                        Radius            = _q.Width,
                                                        Range             = _q.Range,
                                                        CollisionObjects  = new[] { CollisionableObjects.Minions },
                                                        UseBoundingRadius = false
                                                    }
                                                        ).OrderBy(x => x.Distance(ObjectManager.Player));

                                                foreach (Obj_AI_Minion collisionMinion in collisionMinions)
                                                {
                                                    if (
                                                        collisionMinion.IsKillableAndValidTarget(
                                                            ObjectManager.Player.GetSpellDamage(collisionMinion,
                                                                                                SpellSlot.Q), TargetSelector.DamageType.Physical,
                                                            _q.Range))
                                                    {
                                                        killableNumber++;
                                                    }
                                                    else
                                                    {
                                                        break;
                                                    }
                                                }

                                                if (killableNumber >=
                                                    MenuProvider.Champion.Laneclear.GetSliderValue(
                                                        "Cast Q if Killable Minion Number >=").Value)
                                                {
                                                    if (!ObjectManager.Player.IsWindingUp)
                                                    {
                                                        _q.Cast(killableMinion.ServerPosition);
                                                        break;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Laneclear.UseE)
                        {
                            if (_e.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                                {
                                    if (
                                        MinionManager.GetMinions(_e.Range)
                                        .Count(
                                            x =>
                                            HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                            x.IsKillableAndValidTarget(_e.GetDamage(x),
                                                                       TargetSelector.DamageType.Physical)) >=
                                        MenuProvider.Champion.Laneclear.GetSliderValue(
                                            "Cast E if Killable Minion Number >=").Value)
                                    {
                                        _e.Cast();
                                    }
                                }
                            }
                        }

                        //Jugnle
                        if (MenuProvider.Champion.Jungleclear.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                                {
                                    var qTarget =
                                        MinionManager.GetMinions(_q.Range, MinionTypes.All, MinionTeam.Neutral,
                                                                 MinionOrderTypes.MaxHealth)
                                        .FirstOrDefault(
                                            x =>
                                            x.IsValidTarget(_q.Range) &&
                                            _q.GetPrediction(x).Hitchance >= HitChance.High);

                                    if (qTarget != null)
                                    {
                                        _q.Cast(qTarget);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Jungleclear.UseE)
                        {
                            if (_e.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                                {
                                    if (
                                        MinionManager.GetMinions(_e.Range, MinionTypes.All, MinionTeam.Neutral,
                                                                 MinionOrderTypes.MaxHealth)
                                        .Any(
                                            x =>
                                            HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                            x.IsKillableAndValidTarget(_e.GetDamage(x),
                                                                       TargetSelector.DamageType.Physical)))
                                    {
                                        _e.Cast();
                                    }
                                }
                            }
                        }

                        break;
                    }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Use Killsteal (With E)"))
                {
                    if (_e.IsReadyPerfectly())
                    {
                        if (
                            HeroManager.Enemies.Any(
                                x =>
                                HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                x.IsKillableAndValidTarget(_e.GetDamage(x), TargetSelector.DamageType.Physical,
                                                           _e.Range)))
                        {
                            _e.Cast();
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Use Mobsteal (With E)"))
                {
                    if (_e.IsReadyPerfectly())
                    {
                        if (
                            MinionManager.GetMinions(_e.Range, MinionTypes.All, MinionTeam.Neutral,
                                                     MinionOrderTypes.MaxHealth)
                            .Any(
                                x =>
                                HealthPrediction.GetHealthPrediction(x, 500) > 0 &&
                                x.IsKillableAndValidTarget(_e.GetDamage(x), TargetSelector.DamageType.Physical)))
                        {
                            _e.Cast();
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto Steal Siege minion & Super minion (With E)"))
                {
                    if (_e.IsReadyPerfectly())
                    {
                        if (
                            MinionManager.GetMinions(_e.Range)
                            .Any(
                                x =>
                                HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                x.IsKillableAndValidTarget(_e.GetDamage(x), TargetSelector.DamageType.Physical) &&
                                (x.CharData.BaseSkinName.ToLower().Contains("siege") ||
                                 x.CharData.BaseSkinName.ToLower().Contains("super"))))
                        {
                            _e.Cast();
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto Balista Combo (With R)"))
                {
                    if (_r.IsReadyPerfectly())
                    {
                        var myBlitzcrank =
                            HeroManager.Allies.FirstOrDefault(
                                x => !x.IsDead && x.HasBuff("kalistacoopstrikeally") && x.ChampionName == "Blitzcrank");
                        if (myBlitzcrank != null)
                        {
                            var grabTarget =
                                HeroManager.Enemies.FirstOrDefault(x => !x.IsDead && x.HasBuff("rocketgrab2"));
                            if (grabTarget != null)
                            {
                                if (ObjectManager.Player.Distance(grabTarget) > myBlitzcrank.Distance(grabTarget))
                                {
                                    _r.Cast();
                                }
                            }
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto E Harass (With E)"))
                {
                    if (_e.IsReadyPerfectly())
                    {
                        if (
                            !(MenuProvider.Champion.Misc.GetBoolValue("^ Don't do this in ComboMode") &&
                              MenuProvider.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo))
                        {
                            if (ObjectManager.Player.Mana - _e.ManaCost >= _e.ManaCost)
                            {
                                if (HeroManager.Enemies.Any(x => x.IsValidTarget(_e.Range) && _e.GetDamage(x) > 10))
                                {
                                    if (
                                        MinionManager.GetMinions(_e.Range, MinionTypes.All, MinionTeam.NotAlly)
                                        .Any(
                                            x =>
                                            HealthPrediction.GetHealthPrediction(x, 250) > 0 &&
                                            x.IsKillableAndValidTarget(_e.GetDamage(x),
                                                                       TargetSelector.DamageType.Physical, _e.Range)))
                                    {
                                        _e.Cast();
                                    }
                                }
                            }
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetBoolValue("Auto W on Dragon or Baron (With W)"))
                {
                    if (ObjectManager.Player.IsManaPercentOkay(50))
                    {
                        if (!ObjectManager.Player.IsRecalling())
                        {
                            if (ObjectManager.Player.Position.CountEnemiesInRange(1500f) <= 0)
                            {
                                if (MenuProvider.Orbwalker.GetTarget() == null)
                                {
                                    if (_w.IsReadyPerfectly())
                                    {
                                        if (ObjectManager.Player.Distance(_baronLocation) <= _w.Range)
                                        {
                                            _w.Cast(_baronLocation);
                                        }
                                    }

                                    if (_w.IsReadyPerfectly())
                                    {
                                        if (ObjectManager.Player.Distance(_dragonLocation) <= _w.Range)
                                        {
                                            _w.Cast(_dragonLocation);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetKeyBindValue("Cast W on Dragon").Active)
                {
                    if (_w.IsReadyPerfectly())
                    {
                        if (ObjectManager.Player.Distance(_dragonLocation) <= _w.Range)
                        {
                            _w.Cast(_dragonLocation);
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.GetKeyBindValue("Cast W on Baron").Active)
                {
                    if (_w.IsReadyPerfectly())
                    {
                        if (ObjectManager.Player.Distance(_baronLocation) <= _w.Range)
                        {
                            _w.Cast(_baronLocation);
                        }
                    }
                }
            }
        }
Пример #22
0
        public override void ExecuteLaneClear()
        {
            var prepareMinions = GetValue <StringList>("UseE.Prepare.Lane").SelectedIndex;

            if (prepareMinions != 0)
            {
                List <Obj_AI_Minion>        list    = new List <Obj_AI_Minion>();
                IEnumerable <Obj_AI_Minion> minions =
                    from m in
                    ObjectManager.Get <Obj_AI_Minion>()
                    .Where(
                        m =>
                        m.Health > ObjectManager.Player.TotalAttackDamage &&
                        m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65))
                    select m;
                if (prepareMinions == 2)
                {
                    minions = minions.Where(m => m.IsUnderAllyTurret());
                }

                var objAiMinions = minions as Obj_AI_Minion[] ?? minions.ToArray();
                foreach (var m in objAiMinions)
                {
                    if (m.GetBuffCount(kalistaEBuffName) >= 0)
                    {
                        Render.Circle.DrawCircle(m.Position, 105f, Color.Blue);
                        list.Add(m);
                    }
                    else
                    {
                        list.Remove(m);
                    }
                }
                var enemy = HeroManager.Enemies.Find(e => e.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65));
                if (enemy == null)
                {
                    foreach (var l in objAiMinions.Except(list).ToList())
                    {
                        Program.ChampionClass.Orbwalker.ForceTarget(l);
                    }
                }
                else
                {
                    Program.ChampionClass.Orbwalker.ForceTarget(enemy);
                }
            }

            if (Q.IsReady())
            {
                var qCount = GetValue <StringList>("UseQ.Lane").SelectedIndex;
                if (qCount != 0)
                {
                    var minions = MinionManager.GetMinions(
                        ObjectManager.Player.ServerPosition,
                        Q.Range,
                        MinionTypes.All,
                        MinionTeam.Enemy);

                    foreach (var minion in minions.Where(x => x.Health <= Q.GetDamage(x)))
                    {
                        var killableMinionCount = 0;
                        foreach (
                            var colminion in
                            qGetCollisionMinions(
                                ObjectManager.Player,
                                ObjectManager.Player.ServerPosition.Extend(minion.ServerPosition, Q.Range)))
                        {
                            if (colminion.Health <= Q.GetDamage(colminion))
                            {
                                if (GetValue <StringList>("UseQ.Mode.Lane").SelectedIndex == 1 &&
                                    colminion.Distance(ObjectManager.Player)
                                    > Orbwalking.GetRealAutoAttackRange(null) + 65)
                                {
                                    killableMinionCount++;
                                }
                                else
                                {
                                    killableMinionCount++;
                                }
                            }
                            else
                            {
                                break;
                            }
                        }

                        if (killableMinionCount >= qCount)
                        {
                            if (!ObjectManager.Player.IsWindingUp && !ObjectManager.Player.IsDashing())
                            {
                                Q.Cast(minion.ServerPosition);
                                break;
                            }
                        }
                    }
                }
            }

            if (E.IsReady())
            {
                var minECount = GetValue <StringList>("UseE.Lane").SelectedIndex;
                if (minECount != 0)
                {
                    var killableMinionCount = 0;
                    foreach (var m in
                             MinionManager.GetMinions(ObjectManager.Player.ServerPosition, E.Range)
                             .Where(x => E.CanCast(x) && x.Health < E.GetDamage(x)))
                    {
                        if (m.SkinName.ToLower().Contains("siege") || m.SkinName.ToLower().Contains("super"))
                        {
                            killableMinionCount += 2;
                        }
                        else
                        {
                            killableMinionCount++;
                        }
                    }

                    if (killableMinionCount >= minECount && E.IsReady() &&
                        ObjectManager.Player.ManaPercent > E.ManaCost * 2)
                    {
                        E.Cast();
                    }
                }
            }

            // Don't miss minion
            if (GetValue <bool>("UseE.LaneNon"))
            {
                var minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, E.Range * 1);

                foreach (var n in minions)
                {
                    var xH = HealthPrediction.GetHealthPrediction(n, (int)(ObjectManager.Player.AttackCastDelay * 1000),
                                                                  Game.Ping / 2 + 100);
                    if (xH < 0)
                    {
                        if (n.Health < E.GetDamage(n) && E.CanCast(n))
                        {
                            E.Cast(n);
                        }
                        else if (Q.IsReady() && Q.CanCast(n) &&
                                 n.Distance(ObjectManager.Player.Position) < Orbwalking.GetRealAutoAttackRange(null) + 75)
                        {
                            xH = HealthPrediction.GetHealthPrediction(n,
                                                                      (int)(ObjectManager.Player.AttackCastDelay * 1000), (int)Q.Speed);
                            if (xH < 0)
                            {
                                var input = new PredictionInput
                                {
                                    Unit   = ObjectManager.Player,
                                    Radius = Q.Width,
                                    Delay  = Q.Delay,
                                    Speed  = Q.Speed,
                                };

                                input.CollisionObjects[0] = CollisionableObjects.Minions;

                                int count =
                                    Collision.GetCollision(new List <Vector3> {
                                    n.Position
                                }, input)
                                    .OrderBy(obj => obj.Distance(ObjectManager.Player))
                                    .Count(obj => obj.NetworkId != n.NetworkId);
                                if (count == 0)
                                {
                                    Q.Cast(n);
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #23
0
        public override void ExecuteLane()
        {
            if (Q.IsReady())
            {
                var qCount = GetValue <StringList>("UseQ.Lane").SelectedIndex;
                if (qCount != 0)
                {
                    var minions = MinionManager.GetMinions(
                        ObjectManager.Player.ServerPosition,
                        Q.Range,
                        MinionTypes.All,
                        MinionTeam.Enemy);

                    foreach (var minion in minions.Where(x => x.Health <= Q.GetDamage(x)))
                    {
                        var killableMinionCount = 0;
                        foreach (
                            var colminion in
                            qGetCollisionMinions(
                                ObjectManager.Player,
                                ObjectManager.Player.ServerPosition.Extend(minion.ServerPosition, Q.Range)))
                        {
                            if (colminion.Health <= Q.GetDamage(colminion))
                            {
                                if (GetValue <StringList>("UseQ.Mode.Lane").SelectedIndex == 1 &&
                                    colminion.Distance(ObjectManager.Player)
                                    > Orbwalking.GetRealAutoAttackRange(null) + 65)
                                {
                                    killableMinionCount++;
                                }
                                else
                                {
                                    killableMinionCount++;
                                }
                            }
                            else
                            {
                                break;
                            }
                        }

                        if (killableMinionCount >= qCount)
                        {
                            if (!ObjectManager.Player.IsWindingUp && !ObjectManager.Player.IsDashing())
                            {
                                Q.Cast(minion.ServerPosition);
                                break;
                            }
                        }
                    }
                }
            }

            if (E.IsReady())
            {
                var minECount = GetValue <StringList>("UseE.Lane").SelectedIndex;
                if (minECount != 0)
                {
                    var killableMinionCount = 0;
                    foreach (var m in
                             MinionManager.GetMinions(ObjectManager.Player.ServerPosition, E.Range)
                             .Where(x => E.CanCast(x) && x.Health < E.GetDamage(x)))
                    {
                        if (m.SkinName.ToLower().Contains("siege") || m.SkinName.ToLower().Contains("super"))
                        {
                            killableMinionCount += 2;
                        }
                        else
                        {
                            killableMinionCount++;
                        }
                    }

                    if (killableMinionCount >= minECount && E.IsReady() &&
                        ObjectManager.Player.ManaPercent > E.ManaCost * 2)
                    {
                        E.Cast();
                    }
                }
            }

            // Don't miss minion
            if (GetValue <bool>("UseE.LaneNon"))
            {
                var minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, E.Range * 1);

                foreach (var n in minions)
                {
                    var xH = HealthPrediction.GetHealthPrediction(n, (int)(ObjectManager.Player.AttackCastDelay * 1000),
                                                                  Game.Ping / 2 + 100);
                    if (xH < 0)
                    {
                        if (n.Health < E.GetDamage(n) && E.CanCast(n))
                        {
                            E.Cast(n);
                        }
                        else if (Q.IsReady() && Q.CanCast(n) &&
                                 n.Distance(ObjectManager.Player.Position) < Orbwalking.GetRealAutoAttackRange(null) + 75)
                        {
                            xH = HealthPrediction.GetHealthPrediction(n,
                                                                      (int)(ObjectManager.Player.AttackCastDelay * 1000), (int)Q.Speed);
                            if (xH < 0)
                            {
                                var input = new PredictionInput
                                {
                                    Unit   = ObjectManager.Player,
                                    Radius = Q.Width,
                                    Delay  = Q.Delay,
                                    Speed  = Q.Speed,
                                };

                                input.CollisionObjects[0] = CollisionableObjects.Minions;

                                int count =
                                    Collision.GetCollision(new List <Vector3> {
                                    n.Position
                                }, input)
                                    .OrderBy(obj => obj.Distance(ObjectManager.Player))
                                    .Count(obj => obj.NetworkId != n.NetworkId);
                                if (count == 0)
                                {
                                    Q.Cast(n);
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #24
0
        public static PredictionOutput GetPrediction(PredictionInput input)
        {
            MinMaxValues values;

            if (!MIN_MAX.TryGetValue(input.Slot, out values))
            {
                values = new MinMaxValues();
                MIN_MAX[input.Slot] = values;
            }

            var positionOnPath =
                GetPositionOnPath(input, input.Unit.GetWaypoints(), Prediction.SpeedFromVelocity(input.Unit));

            var pathInput = new AIPredictionInput
            {
                input        = input,
                CastPosition = positionOnPath
            };

            // var pathValues = pathInput.GetValues();
            // Console.WriteLine("Inputs: " + pathValues.Length);
            //
            // for (var i = 0; i < pathValues.Length; i++)
            // {
            //     Console.Write(pathValues[i] + ", ");
            // }
            //
            // Console.WriteLine();


            var positionInput = new AIPredictionInput
            {
                input        = input,
                CastPosition = input.Unit.ServerPosition
            };

            var outputPath =
                (input.Type == SkillshotType.SkillshotLine ? LinePathModel : CirclePathModel).Predict(
                    pathInput.GetValues());
            // var outputPosition =
            //     (input.Type == SkillshotType.SkillshotLine ? LinePositionModel : CirclePositionModel).Predict(
            //         positionInput.GetValues());

            float   hitchance;
            Vector3 castPosition;

            // if (outputPosition[0] > outputPath[0])
            // {
            //     castPosition = input.Unit.ServerPosition;
            //     hitchance = outputPosition[0];
            // }
            // else
            // {
            castPosition = positionOnPath;
            hitchance    = outputPath[0];
            // }

            var normalized = values.Normalized(hitchance);

            var output = new PredictionOutput
            {
                HitchanceFloat = normalized,
                CastPosition   = castPosition
            };

            Console.WriteLine(input.Slot + " == " + normalized + " ! " + outputPath[0] + " || " + pathInput.GetDelay());

            if (input.Collision)
            {
                var maxCollisions = 0;
                if (HeroManager.Player.ChampionName == "Lux")
                {
                    maxCollisions = 1;
                }

                var positions = new List <Vector3> {
                    output.CastPosition
                };
                output.CollisionObjects = Collision.GetCollision(positions, input);
                output.CollisionObjects.RemoveAll(x => x.NetworkId == input.Unit.NetworkId);
                if (output.CollisionObjects.Count > maxCollisions)
                {
                    output.HitchanceFloat = 0.0f;
                    output.Hitchance      = HitChance.Collision;
                }
            }

            return(output);
        }
Пример #25
0
        private static void Harass()
        {
            if (Human() && Player.ManaPercent <= getSliderItem(harassMenu, "harassMana"))
            {
                return;
            }
            var target = TargetSelector.GetTarget(E.Range, DamageType.Magical);

            if (target == null)
            {
                return;
            }
            if (!target.LSIsValidTarget())
            {
                return;
            }

            if (Human())
            {
                if (W.IsReady() && getCheckBoxItem(harassMenu, "wHarassH") &&
                    target.LSDistance(Player.Position) <= W.Range)
                {
                    var wprediction = W.GetPrediction(target);

                    switch (wprediction.Hitchance)
                    {
                    case HitChance.Medium:
                    case HitChance.High:
                    case HitChance.VeryHigh:
                    case HitChance.Immobile:

                        W.Cast(wprediction.CastPosition);
                        break;

                    case HitChance.Collision:

                        var colliding = wprediction.CollisionObjects.OrderBy(o => o.LSDistance(Player, true)).ToList();
                        if (colliding.Count > 0)
                        {
                            if (colliding[0].LSDistance(target, true) <= 25000 ||
                                colliding[0].Type == GameObjectType.AIHeroClient)
                            {
                                W.Cast(wprediction.CastPosition);
                            }
                            else if (colliding[0].Type != GameObjectType.AIHeroClient &&
                                     colliding[0].LSDistance(target, true) > 25000 && R.IsReady() && realcdSQ <= 1 &&
                                     target.LSDistance(Player.Position) <= Q1.Range + 200 && getCheckBoxItem(harassMenu, "rComboHarass"))
                            {
                                var       playerPosition = ObjectManager.Player.Position.LSTo2D();
                                var       direction      = ObjectManager.Player.Direction.LSTo2D().LSPerpendicular();
                                const int distance       = 600;
                                const int stepSize       = 40;

                                for (var step = 0f; step < 360; step += stepSize)
                                {
                                    var currentAngel      = step * (float)Math.PI / 180;
                                    var currentCheckPoint = playerPosition +
                                                            distance * direction.LSRotated(currentAngel);

                                    var collision =
                                        Collision.GetCollision(new List <Vector3> {
                                        currentCheckPoint.To3D()
                                    },
                                                               new PredictionInput {
                                        Delay = 0.25f, Radius = 200, Speed = 1000
                                    });

                                    if (collision.Count == 0)
                                    {
                                        Q.CastOnUnit(target);
                                        W.Cast(currentCheckPoint);
                                        R.Cast();
                                        //if (Q.IsReady() && Config.Item("qHarassH").GetValue<bool>() &&
                                        //    target.LSDistance(Player.Position) <= Q.Range)
                                        //{
                                        //
                                        //}
                                    }
                                }
                            }
                        }
                        break;
                    }
                }


                if (E.IsReady() && getCheckBoxItem(harassMenu, "eHarassH") &&
                    target.LSDistance(Player.Position) <= E.Range)
                {
                    var eprediction = E.GetPrediction(target);
                    switch (eprediction.Hitchance)
                    {
                    case HitChance.VeryHigh:
                    case HitChance.Immobile:

                        E.Cast(eprediction.CastPosition);
                        break;

                    case HitChance.Collision:
                        var colliding = eprediction.CollisionObjects.OrderBy(o => o.LSDistance(Player, true)).ToList();
                        if (colliding.Count >= 1 && colliding[0].Type == GameObjectType.AIHeroClient)
                        {
                            E.Cast(eprediction.CastPosition);
                        }
                        break;
                    }
                }

                if (Q.IsReady() && getCheckBoxItem(harassMenu, "qHarassH") &&
                    target.LSDistance(Player.Position) <= Q.Range)
                {
                    Q.CastOnUnit(target);
                }

                if (getCheckBoxItem(harassMenu, "rHarass") && !Q.IsReady() && !W.IsReady() && !E.IsReady() &&
                    R.IsReady() && target.LSDistance(Player.Position) <= Q1.Range)
                {
                    if (realcdSQ == 0 || realcdSW == 0 || realcdSE == 0)
                    {
                        R.Cast();
                    }
                }
            }
            else
            {
                if (Q1.IsReady() && getCheckBoxItem(harassMenu, "qHarass") &&
                    target.LSDistance(Player.Position) <= Q1.Range)
                {
                    Q1.CastOnUnit(target);
                }

                if (E1.IsReady() && getCheckBoxItem(harassMenu, "eHarass") &&
                    target.LSDistance(Player.Position) <= E1.Range &&
                    target.LSDistance(Player.Position) >= getSliderItem(harassMenu, "eMinHarass"))
                {
                    E1.CastOnUnit(target);
                }

                if (getCheckBoxItem(harassMenu, "rHarass") && !Q.IsReady() && !W.IsReady() && !E.IsReady() && R.IsReady())
                {
                    if (!Player.HasBuff("EliseSpiderW") || target.LSDistance(Player.Position) >= Player.AttackRange + 100)
                    {
                        if (realcdQ == 0 || realcdW == 0 || realcdE == 0)
                        {
                            R.Cast();
                        }
                    }
                }
            }
        }
Пример #26
0
        public override void ExecuteCombo()
        {
            var useE = GetValue <bool>("UseE" + (ComboActive ? "C" : "H"));

            if (E.IsReady() && useE) // Credits DZ191
            {
                var target = HeroManager.Enemies.Find(x => x.IsValidTarget(E.Range));
                if (target != null)
                {
                    if (target.HasBuffOfType(BuffType.Slow))
                    {
                        if (target.Path.Count() > 1)
                        {
                            var slowEndTime = target.GetSlowEndTime();
                            if (slowEndTime >= E.Delay + 0.5f + Game.Ping / 2f)
                            {
                                E.CastIfHitchanceGreaterOrEqual(target);
                            }
                        }
                    }

                    if (target.IsHeavilyImpaired())
                    {
                        var immobileEndTime = target.GetImpairedEndTime();
                        if (immobileEndTime >= E.Delay + 0.5f + Game.Ping / 2f)
                        {
                            E.CastIfHitchanceGreaterOrEqual(target);
                        }
                    }
                }
            }

            var useW = GetValue <bool>("UseW" + (ComboActive ? "C" : "H"));

            if (W.IsReady() && useW)
            {
                var target = TargetSelector.GetTargetNoCollision(W);
                if (target == null)
                {
                    return;
                }
                if (!ObjectManager.Player.UnderTurret(true) || !target.UnderTurret(true))
                {
                    W.CastIfHitchanceGreaterOrEqual(target);
                }
            }

            if ((GetValue <KeyBind>("CastR").Active || GetValue <bool>("UseRC")) && R.IsReady())
            {
                if (wCastTime + 1060 <= Environment.TickCount)
                {
                    var target =
                        HeroManager.Enemies.FirstOrDefault(
                            x =>
                            !x.IsZombie && x.CountAlliesInRange(500) < 2 &&
                            HealthPrediction.GetHealthPrediction(x, 5000) > 0 &&
                            ObjectManager.Player.Distance(x) >= Orbwalking.GetRealAutoAttackRange(null) + 65 + QExtraRange &&
                            x.IsKillableAndValidTarget(GetRDamage(x), TargetSelector.DamageType.Physical, R.Range) &&
                            R.GetPrediction(x).Hitchance >= HitChance.High);
                    if (target != null)
                    {
                        var prediction = R.GetPrediction(target);
                        var collision  =
                            Collision.GetCollision(new List <Vector3> {
                            prediction.UnitPosition
                        },
                                                   new PredictionInput
                        {
                            UseBoundingRadius = true,
                            Unit             = ObjectManager.Player,
                            Delay            = R.Delay,
                            Speed            = R.Speed,
                            Radius           = 200,
                            CollisionObjects = new[] { CollisionableObjects.Heroes }
                        })
                            .Any(x => x.NetworkId != target.NetworkId);
                        if (!collision)
                        {
                            R.Cast(target);
                        }
                    }
                }
            }
            base.ExecuteCombo();
        }