示例#1
0
 public static void On_Unkillable_Minion(Obj_AI_Base unit, Orbwalker.UnkillableMinionArgs args)
 {
     if (Config.LasthitMenu.GetValue("lh") > Player.Instance.ManaPercent || unit == null ||
         Orbwalker.ActiveModes.Combo.IsActive())
     {
         return;
     }
     if (args.RemainingHealth <= Damages.QDamage(unit) && Spells.Q.IsReady() && Config.LasthitMenu.Checked("Q"))
     {
         if (Spells.Q.IsInRange(unit))
         {
             Spells.Q.Cast(unit);
         }
         else if (Spells.Q2.IsInRange(unit))
         {
             var pred = Spells.Q2.GetPrediction(unit);
             pred.QExtend();
         }
     }
     if (args.RemainingHealth <= Damages.WDamage(unit) && Spells.W.IsReady() && Config.LasthitMenu.Checked("W"))
     {
         Spells.W.Cast(unit);
     }
     if (args.RemainingHealth <= Damages.EDamage(unit) && Spells.E.IsReady() && Config.LasthitMenu.Checked("E"))
     {
         var Position = _E_.Intersection_Of_2Circle(Player.Instance.Position.To2D(), Spells.E.Range, unit.Position.To2D(), Player.Instance.GetAutoAttackRange(unit));
         if (Position.Count() > 0)
         {
             Spells.E.Cast(Position.OrderBy(x => x.Distance(Game.CursorPos)).FirstOrDefault().To3DWorld());
         }
     }
 }
示例#2
0
        public static void Killsteal(EventArgs args)
        {
            if (Spells.Q.IsReady() && Config.MiscMenu.Checked("Qks"))
            {
                var target = TargetSelector.GetTarget(EntityManager.Heroes.Enemies.Where(t => t != null &&
                                                                                         t.IsValidTarget() &&
                                                                                         Spells.Q2.IsInRange(t) &&
                                                                                         t.Health <= Damages.QDamage(t)), DamageType.Physical);

                if (target != null && !target.Unkillable())
                {
                    if (Spells.Q.IsInRange(target))
                    {
                        Spells.Q.Cast(target);
                    }
                    else if (Spells.Q2.IsInRange(target))
                    {
                        var pred = Spells.Q2.GetPrediction(target);
                        pred.QExtend();
                    }
                }
            }
            if (Spells.W.IsReady() && Config.MiscMenu.Checked("Wks"))
            {
                var target = TargetSelector.GetTarget(EntityManager.Heroes.Enemies.Where(t => t != null &&
                                                                                         t.IsValidTarget() &&
                                                                                         Spells.W.IsInRange(t) &&
                                                                                         t.Health <= Damages.WDamage(t) &&
                                                                                         !t.Unkillable()), DamageType.Magical);

                if (target != null && !target.Unkillable())
                {
                    var pred = Spells.W.GetPrediction(target);
                    Spells.W.Cast(pred.CastPosition);
                }
            }
            if (Spells.E.IsReady() && Config.MiscMenu.Checked("Eks"))
            {
                var target = TargetSelector.GetTarget(EntityManager.Heroes.Enemies.Where(t => t != null &&
                                                                                         t.IsValidTarget() &&
                                                                                         Spells.E.IsInRange(t) &&
                                                                                         t.Health <= Damages.EDamage(t) &&
                                                                                         !t.Unkillable()), DamageType.Physical);

                if (target != null)
                {
                    if (_E_.GetPos() != new Vector3() || _E_.GetPos() != Vector3.Zero)
                    {
                        Spells.E.Cast(_E_.GetPos());
                    }
                }
            }
            if (Spells.R.IsReady() && Config.MiscMenu.GetValue("Rks", false) > 0)
            {
                var target = TargetSelector.GetTarget(EntityManager.Heroes.Enemies.Where(t => t != null &&
                                                                                         t.IsValidTarget() &&
                                                                                         Spells.R.IsInRange(t) &&
                                                                                         t.Health <= Damages.RDamage(t, Config.MiscMenu.GetValue("Rkstick")) &&
                                                                                         !t.Unkillable()), DamageType.Physical);
                if (target != null)
                {
                    var CanRKS = Config.MiscMenu.GetValue("Rks", false) == 1 ? true :
                                 (Spells.Q2.IsInRange(target) && Spells.Q.IsReady()) ||
                                 (Spells.W.IsInRange(target) && Spells.W.IsReady()) ||
                                 Spells.E.IsReady() ||
                                 Player.Instance.IsInAutoAttackRange(target) ? false : true;

                    if (CanRKS)
                    {
                        var pred = Spells.R.GetPrediction(target);
                        Spells.R.Cast(pred.CastPosition);
                    }
                }
            }
        }
示例#3
0
文件: _E_.cs 项目: tekintr/Elobuddy
        public static Vector3 GetPos()
        {
            var AARange        = Player.Instance.GetAutoAttackRange(Nearest);
            var TargetPosition = new Vector2();

            if (Nearest != null)
            {
                TargetPosition = Config.EPath.CurrentValue ? Prediction.Position.PredictUnitPosition(Nearest, 200) : Nearest.Position.To2D();
            }
            var Location = new Vector3();

            if (Config.EQ.CurrentValue && Player.Instance.CountEnemiesInRange(Spells.Q2.Range + Spells.E.Range) > Config.EQHit.CurrentValue)
            {
                var Champs = EntityManager.Heroes.Enemies.Where(x => !x.IsDead && x.IsValid && x.Distance(Player.Instance) <= Spells.E.Range + Spells.Q2.Range).ToArray();
                if (Champs != null)
                {
                    Prediction.Position.PredictionData data = new Prediction.Position.PredictionData(Prediction.Position.PredictionData.PredictionType.Linear, (int)Spells.Q2.Range, Spells.Q2.Width, 0, 450, int.MaxValue, int.MaxValue, Player.Instance.Position);
                    var preds = Prediction.Position.GetPredictionAoe(Champs, data).OrderByDescending(x => x.CastPosition.Distance(Player.Instance)).ToArray();
                    if (preds.Count() >= Config.EQHit.CurrentValue)
                    {
                        for (var i = 1; i <= preds.Count(); i++)
                        {
                            var Rectangle = new Geometry.Polygon.Rectangle(preds[0].CastPosition, preds[i].CastPosition, 75f);
                            var count     = preds.Count(x => Rectangle.IsInside(x.CastPosition));
                            if (count >= Config.EQHit.CurrentValue)
                            {
                                var Position = preds[0].CastPosition.Extend(preds[i].CastPosition, Spells.Q.Range).To3DWorld();
                                if (Spells.E.IsInRange(Position))
                                {
                                    Location = Position;
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                switch (Get_Style_Of_E)
                {
                case 1:
                {
                    var Range = Config.ERange.CurrentValue;
                    var Path  = Intersection_Of_2Circle(Player.Instance.Position.To2D(), Spells.E.Range, TargetPosition, AARange - Range);
                    if (Path.Count() > 0)
                    {
                        if (Path.Count(x => IsNotDangerPosition(x)) == 2)
                        {
                            Location = Path.OrderByDescending(x => Get_Rate_Position(x)).OrderBy(x => x.Distance(Game.CursorPos)).FirstOrDefault().To3DWorld();
                        }
                        else if (Path.Count(x => IsNotDangerPosition(x)) == 0)
                        {
                            var Position = Path.OrderByDescending(x => Get_Rate_Position(x)).OrderBy(x => x.Distance(Game.CursorPos)).FirstOrDefault().To3DWorld();
                            var target   = TargetSelector.GetTarget(EntityManager.Heroes.Enemies.Where(t => t != null &&
                                                                                                       !t.IsDead &&
                                                                                                       t.IsValidTarget() &&
                                                                                                       Position.IsInRange(t, Player.Instance.GetAutoAttackRange(t)) &&
                                                                                                       t.Health <= Damages.EDamage(t) &&
                                                                                                       !t.Unkillable()), DamageType.Physical);
                            if (target != null)
                            {
                                Location = Position;
                            }
                            else if (Config.ECorrect.CurrentValue)
                            {
                                var Loc = Path.OrderBy(x => x.Distance(Game.CursorPos)).FirstOrDefault().To3DWorld();
                                Location = CorrectToBetter(Loc);
                            }
                            else
                            {
                                Location = Vector3.Zero;
                            }
                        }
                        else
                        {
                            Location = Path.OrderBy(x => Get_Rate_Position(x)).FirstOrDefault(x => IsNotDangerPosition(x)).To3DWorld();
                        }
                    }
                    else
                    {
                        if (Player.Instance.Distance(TargetPosition) >= AARange + Spells.E.Range)
                        {
                            Location = Vector3.Zero;
                        }
                        if (Player.Instance.Distance(TargetPosition) <= AARange - Spells.E.Range && Config.EKite.CurrentValue)
                        {
                            Location = Nearest.Position.Extend(Player.Instance, Nearest.Distance(Player.Instance) + Spells.E.Range).To3DWorld();
                        }
                    }
                }
                break;

                case 2:
                {
                    if (Nearest.Distance(Player.Instance) <= AARange + Spells.E.Range)
                    {
                        Location = Player.Instance.ServerPosition.Extend(Game.CursorPos, Spells.E.Range).To3DWorld();
                    }
                }
                break;

                case 3:
                {
                    if (Nearest.Distance(Player.Instance) <= AARange + Spells.E.Range)
                    {
                        if (Nearest.Distance(Player.Instance) <= AARange - Spells.E.Range && Config.EKite.CurrentValue)
                        {
                            Location = Nearest.Position.Extend(Player.Instance, Nearest.Distance(Player.Instance) + Spells.E.Range).To3DWorld();
                        }
                        else
                        {
                            var Pos         = Player.Instance.ServerPosition.Extend(Game.CursorPos, Spells.E.Range).To3DWorld();
                            var GrassObject = ObjectManager.Get <GameObject>().Where(x => Spells.E.IsInRange(x.Position) && x.Type.ToString() == "GrassObject").OrderBy(x => x.Distance(Nearest)).FirstOrDefault();
                            var target      = TargetSelector.GetTarget(EntityManager.Heroes.Enemies.Where(t => t != null &&
                                                                                                          !t.IsDead &&
                                                                                                          t.IsValidTarget() &&
                                                                                                          Pos.IsInRange(t, Player.Instance.GetAutoAttackRange(t)) &&
                                                                                                          t.Health <= Damages.EDamage(t) &&
                                                                                                          !t.Unkillable()), DamageType.Physical);
                            if (IsNotDangerPosition(Pos) || target != null)
                            {
                                Location = Pos;
                            }
                            else if (Config.ECorrect.CurrentValue)
                            {
                                if (GrassObject != null && Config.EGrass.CurrentValue)
                                {
                                    Location = GrassObject.Position;
                                }
                                else
                                {
                                    Location = CorrectToBetter(Pos);
                                }
                            }
                        }
                    }
                }
                break;

                case 4:
                {
                    Location = Player.Instance.ServerPosition.Extend(Game.CursorPos, Spells.E.Range).To3DWorld();
                }
                break;
                }
            }
            return(Location);
        }