예제 #1
0
파일: Combo.cs 프로젝트: volder1/PortAIO
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                return;
            }

            var target  = TargetSelector.GetTarget(600, DamageType.Magical);
            var target1 = TargetSelector.GetTarget(Program._q.Range, DamageType.Magical);

            if (Program.mode == 1 && Player.Level > 2)
            {
                var tarqs1 = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.LSIsValidTarget() && x.IsMinion && x.LSDistance(Player.Position) <= Program._q.Range);
                var tars1  = tarqs1.Where(x => x.LSDistance(Player.Position) <= Program._e.Range);
                var heroes = HeroManager.Enemies.Where(x => x.LSIsValidTarget());
                var tarqs  = new List <Obj_AI_Base>();
                tarqs.AddRange(tarqs1);
                tarqs.AddRange(heroes.Where(x => x.LSIsValidTarget(Program._q.Range)));
                var tars = new List <Obj_AI_Base>();
                tars.AddRange(tars1);
                tars.AddRange(heroes.Where(x => x.LSIsValidTarget(Program._e.Range)));

                Obj_AI_Base MainTarget = null;

                // in investigation
                MainTarget = tarqs.Where(x => Helper.HasEBuff(x) && Program._q.GetPrediction(x).HitChance >= EloBuddy.SDK.Enumerations.HitChance.Low && Program._q.IsReady() &&
                                         Helper.GetchainedTarget(x).Count() >= 2 && Helper.GetchainedTarget(x).Count(y => y is AIHeroClient) >= 1)
                             .MaxOrDefault(x => Helper.GetchainedTarget(x).Count(y => y is AIHeroClient));
                if (MainTarget != null)
                {
                    Program._q.Cast(Program._q.GetPrediction(MainTarget).UnitPosition);
                }

                MainTarget = tars.Where(x => Helper.HasEBuff(x) && Program._e.IsReady() &&
                                        Helper.GetchainedTarget(x).Count(y => y is AIHeroClient) >= 1)
                             .MaxOrDefault(x => Helper.GetchainedTarget(x).Count(y => y is AIHeroClient));
                if (MainTarget != null)
                {
                    Program._e.Cast(MainTarget);
                }

                MainTarget = tars.Where(x => x.Health <= Helper.Edamge(x) && Program._e.IsReady() &&
                                        Helper.GetchainedTarget(x).Count(y => y is AIHeroClient) >= 1)
                             .MaxOrDefault(x => Helper.GetchainedTarget(x).Count(y => y is AIHeroClient));
                if (MainTarget != null)
                {
                    Program._e.Cast(MainTarget);
                }

                if (Helper.Qstack() == 2 && target1.LSIsValidTarget() && !target1.IsZombie)
                {
                    Program._q2.Cast(target1);
                }

                if (Helper.Qstack() != 2 && target.LSIsValidTarget() && !target.IsZombie)
                {
                    if (Program._e.IsReady())
                    {
                        Program._e.Cast(target);
                    }
                    if (Program._w.IsReady())
                    {
                        Program._w.Cast(target);
                    }
                }
            }
            if (Program.mode == 0 || Player.Level <= 2)
            {
                if (target.IsValidTarget() && !target.IsZombie)
                {
                    if (Program._q.IsReady())
                    {
                        Helper.CastQTarget(target, true);
                        return;
                    }
                    if (Program._w.IsReady())
                    {
                        Program._w.Cast(target);
                        return;
                    }
                    if (Program._e.IsReady())
                    {
                        Program._e.Cast(target);
                        return;
                    }
                }
                else
                {
                    if (target1.IsValidTarget() && !target1.IsZombie)
                    {
                        Helper.CastQTarget(target1);
                    }
                }
            }
        }
예제 #2
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (Program._orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.LaneClear)
            {
                return;
            }

            if (Player.Mana * 100 / Player.MaxMana > Program.ManaLaneClear)
            {
                var tarqs = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsEnemy && x.IsValidTarget() && x.IsMinion && x.Distance(Player.Position) <= Program._q.Range);
                var tars  = tarqs.Where(x => x.Distance(Player.Position) <= Program._e.Range);
                if (tarqs.Count() <= 2 || Player.Mana <= Program._e.ManaCost * 2 + Program._q.ManaCost)
                {
                    //Chat.Print("case 1");
                    var targetq = MinionManager.GetMinions(Player.Position, Program._q.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health).FirstOrDefault();
                    var target  = MinionManager.GetMinions(Player.Position, 600, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health).FirstOrDefault();
                    if (Program._q2.IsReady() && Program.QlaneClear)
                    {
                        if (targetq != null)
                        {
                            Program._q2.Cast(targetq);
                        }
                    }
                    else if (Program._e.IsReady() && Program.ElaneClear)
                    {
                        if (target != null)
                        {
                            Program._e.Cast(target);
                        }
                    }
                    else if (Program._w.IsReady() && Program.WlaneClear)
                    {
                        if (target != null)
                        {
                            Program._w.Cast(targetq);
                        }
                    }
                }
                else
                {
                    //Chat.Print("case 2");
                    Obj_AI_Minion MainTarget = null;
                    int           AoEcount   = 0;

                    // in investigation
                    var tarqss  = tarqs;
                    var tarqsss = tarqs;
                    MainTarget = tarqss.Where(x => Helper.HasEBuff(x) && Program._q.GetPrediction(x).Hitchance >= HitChance.Low && Program._q.IsReady() &&
                                              Program.QlaneClear && Helper.GetchainedTarget(x).Count() >= 3).MaxOrDefault(x => Helper.GetchainedTarget(x).Count());
                    if (MainTarget != null)
                    {
                        Program._q.Cast(Program._q.GetPrediction(MainTarget).UnitPosition);
                    }

                    MainTarget = tars.Where(x => Helper.HasEBuff(x) && Program._e.IsReady() && Program.ElaneClear &&
                                            tarqs.Where(y => y.Distance(x.Position) <= 300).Count() >= 3).MaxOrDefault(x => tarqs.Where(y => y.Distance(x.Position) <= 300).Count());
                    if (MainTarget != null)
                    {
                        Program._e.Cast(MainTarget);
                    }

                    MainTarget = tars.Where(x => x.Health <= Helper.Edamge(x) && Program._e.IsReady() && Program.ElaneClear &&
                                            tarqs.Where(y => y.Distance(x.Position) <= 300).Count() >= 3).MaxOrDefault(x => tarqs.Where(y => y.Distance(x.Position) <= 300).Count());
                    if (MainTarget != null)
                    {
                        if (Program._e.IsReady() && Program.ElaneClear)
                        {
                            Program._e.Cast(MainTarget);
                        }
                    }

                    MainTarget = tars.Where(x => x.Health <= Helper.Wdamge(x) && Program._w.IsReady() && Program.WlaneClear &&
                                            Helper.HasEBuff(x) && tarqs.Where(y => y.Distance(x.Position) <= 300).Count() >= 3).MaxOrDefault(x => tarqs.Where(y => y.Distance(x.Position) <= 300).Count());
                    if (MainTarget != null)
                    {
                        //Chat.Print("2");
                        if (Program._w.IsReady() && Program.WlaneClear)
                        {
                            Program._w.Cast(MainTarget);
                        }
                    }

                    MainTarget = tars.Where(x => x.Health <= Helper.Qdamage(x) && Program._q.IsReady() && Program.QlaneClear &&
                                            Helper.HasEBuff(x) && Program._q.GetPrediction(x).Hitchance >= HitChance.Low &&
                                            tarqs.Where(y => y.Distance(x.Position) <= 300).Count() >= 3)
                                 .MaxOrDefault(x => tarqs.Where(y => y.Distance(x.Position) <= 300).Count());
                    if (MainTarget != null)
                    {
                        if (Program._q.IsReady() && Program.QlaneClear)
                        {
                            Program._q.Cast(Program._q.GetPrediction(MainTarget).UnitPosition);
                        }
                    }

                    MainTarget = tars.Where(x => x.Health <= Helper.Edamge(x) + Helper.Wdamge(x) && Program._e.IsReady() && Program.ElaneClear && Program._w.IsReady() && Program.WlaneClear &&
                                            tarqs.Where(y => y.Distance(x.Position) <= 300).Count() >= 3)
                                 .MaxOrDefault(x => tarqs.Where(y => y.Distance(x.Position) <= 300).Count());
                    if (MainTarget != null)
                    {
                        if (Program._e.IsReady() && Program.ElaneClear && Program._w.IsReady() && Program.WlaneClear)
                        {
                            Program._e.Cast(MainTarget);
                        }
                    }

                    MainTarget = tars.Where(x => x.Health <= Helper.Edamge(x) + Helper.Qdamage(x, true) && Program._e.IsReady() && Program.ElaneClear && Program._q.IsReady() && Program.QlaneClear &&
                                            Program._q.GetPrediction(x).Hitchance >= HitChance.Low &&
                                            tarqs.Where(y => y.Distance(x.Position) <= 300).Count() >= 3)
                                 .MaxOrDefault(x => tarqs.Where(y => y.Distance(x.Position) <= 300).Count());
                    if (MainTarget != null)
                    {
                        if (Program._e.IsReady() && Program.ElaneClear && Program._q.IsReady() && Program.QlaneClear)
                        {
                            Program._e.Cast(MainTarget);
                        }
                    }

                    foreach (var tar in tars)
                    {
                        int count = tarqs.Where(x => x.Distance(tar.Position) <= 300).Count();
                        if (count > AoEcount)
                        {
                            AoEcount   = count;
                            MainTarget = tar;
                        }
                    }
                    if (AoEcount < 3)
                    {
                        //Chat.Print("case 3");
                        var targetq = MinionManager.GetMinions(Player.Position, Program._q.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health).FirstOrDefault();
                        var target  = MinionManager.GetMinions(Player.Position, 600, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health).FirstOrDefault();
                        if (Program._q2.IsReady() && Program.QlaneClear)
                        {
                            if (targetq != null)
                            {
                                Program._q2.Cast(targetq);
                            }
                        }
                        else if (Program._e.IsReady() && Program.ElaneClear)
                        {
                            if (target != null)
                            {
                                Program._e.Cast(target);
                            }
                        }
                        else if (Program._w.IsReady() && Program.WlaneClear)
                        {
                            if (target != null)
                            {
                                Program._w.Cast(targetq);
                            }
                        }
                    }
                    if (MainTarget != null)
                    {
                        Program._e.Cast(MainTarget);
                    }
                }
            }
        }