Example #1
0
        public override void AIHeroClient_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (Player.IsDead || !sender.IsEnemy || !(sender is AIHeroClient)) return;

            if (Q.IsReady() && args.SData.Name.ToLower() == "summonerflash" && args.End.Distance(Player) <= Q.Range && MenuManager.Menus[HERO_MENU]["Misc"].Keys.Last().IsActive("autoqonflash"))
            {
                //Chat.Print("{0} detected, Q on args.End", args.SData.Name);
                var rectangle = new Geometry.Polygon.Rectangle(Player.Position, args.End, Q.Width + 10);

                if (!EntityManager.MinionsAndMonsters.EnemyMinions.Any(it => rectangle.IsInside(it))) Q.Cast(args.End);
                return;
            }

            if (E.IsReady() && EMenu["UseShield?"].Cast<CheckBox>().CurrentValue && MenuSpells.Any(it => it == args.SData.Name))
            {
                if (EMenu[args.SData.Name].Cast<CheckBox>().CurrentValue)
                {
                    List<AIHeroClient> Allies = new List<AIHeroClient>();

                    //Division
                    if (args.Target != null)
                    {
                        if (args.Target.IsAlly || args.Target.IsMe)
                        {
                            var target = EntityManager.Heroes.Allies.FirstOrDefault(it => it.NetworkId == args.Target.NetworkId);

                            //Chat.Print(args.Target.Name);

                            if (target != null) E.Cast(target);

                            return;
                        }
                    }

                    //Division

                    var rectangle = new Geometry.Polygon.Rectangle(args.Start, args.End, args.SData.LineWidth);

                    foreach (var ally in EntityManager.Heroes.Allies)
                    {
                        if (rectangle.IsInside(ally)) { Allies.Add(ally); continue; }

                        foreach (var point in rectangle.Points)
                        {
                            if (ally.Distance(point) <= 90)
                            {
                                Allies.Add(ally);
                            }
                        }
                    }

                    if (Allies.Any())
                    {
                        //Chat.Print("Rectangle Detection");

                        PriorityCast(sender, args, Allies, rectangle);
                        return;
                    }

                    //Division

                    var circle = new Geometry.Polygon.Circle(args.End, args.SData.CastRadius);

                    foreach (var ally in EntityManager.Heroes.Allies)
                    {
                        if (circle.IsInside(ally)) { Allies.Add(ally); continue; }

                        foreach (var point in circle.Points)
                        {
                            if (ally.Distance(point) <= 90)
                            {
                                Allies.Add(ally);
                            }
                        }
                    }

                    if (Allies.Any())
                    {
                        //Chat.Print("Circle Detection");

                        PriorityCast(sender, args, Allies, circle);
                        return;
                    }
                }
            }

            return;
        }
Example #2
0
        public override void AIHeroClient_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (Player.IsDead || !sender.IsEnemy || !(sender is AIHeroClient))
            {
                return;
            }

            if (Q.IsReady() && args.SData.Name.ToLower() == "summonerflash" && args.End.Distance(Player) <= Q.Range && MenuManager.Menus[HERO_MENU]["Misc"].Keys.Last().IsActive("autoqonflash"))
            {
                //Chat.Print("{0} detected, Q on args.End", args.SData.Name);
                var rectangle = new Geometry.Polygon.Rectangle(Player.Position, args.End, Q.Width + 10);

                if (!EntityManager.MinionsAndMonsters.EnemyMinions.Any(it => rectangle.IsInside(it)))
                {
                    Q.Cast(args.End);
                }
                return;
            }

            if (E.IsReady() && EMenu["UseShield?"].Cast <CheckBox>().CurrentValue&& MenuSpells.Any(it => it == args.SData.Name))
            {
                if (EMenu[args.SData.Name].Cast <CheckBox>().CurrentValue)
                {
                    List <AIHeroClient> Allies = new List <AIHeroClient>();

                    //Division
                    if (args.Target != null)
                    {
                        if (args.Target.IsAlly || args.Target.IsMe)
                        {
                            var target = EntityManager.Heroes.Allies.FirstOrDefault(it => it.NetworkId == args.Target.NetworkId);

                            //Chat.Print(args.Target.Name);

                            if (target != null)
                            {
                                E.Cast(target);
                            }

                            return;
                        }
                    }

                    //Division

                    var rectangle = new Geometry.Polygon.Rectangle(args.Start, args.End, args.SData.LineWidth);

                    foreach (var ally in EntityManager.Heroes.Allies)
                    {
                        if (rectangle.IsInside(ally))
                        {
                            Allies.Add(ally); continue;
                        }

                        foreach (var point in rectangle.Points)
                        {
                            if (ally.Distance(point) <= 90)
                            {
                                Allies.Add(ally);
                            }
                        }
                    }

                    if (Allies.Any())
                    {
                        //Chat.Print("Rectangle Detection");

                        PriorityCast(sender, args, Allies, rectangle);
                        return;
                    }

                    //Division

                    var circle = new Geometry.Polygon.Circle(args.End, args.SData.CastRadius);

                    foreach (var ally in EntityManager.Heroes.Allies)
                    {
                        if (circle.IsInside(ally))
                        {
                            Allies.Add(ally); continue;
                        }

                        foreach (var point in circle.Points)
                        {
                            if (ally.Distance(point) <= 90)
                            {
                                Allies.Add(ally);
                            }
                        }
                    }

                    if (Allies.Any())
                    {
                        //Chat.Print("Circle Detection");

                        PriorityCast(sender, args, Allies, circle);
                        return;
                    }
                }
            }

            return;
        }
Example #3
0
        //---------------------------------------WhyInsec()----------------------------------------------------

        void WhyInsec(Obj_AI_Base target)
        {
            //Back distance = 300

            //Why I did that

            EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, target);

            var targetpos = Prediction.Position.PredictUnitPosition(target, 500).To3D();

            if (!WhyIDidThatAddonInsec && Orbwalker.ValidAzirSoldiers.Any(it => it.Distance(target) >= E.Width + target.BoundingRadius && it.Distance(target) <= (R.Width / 2) - 20))
            {
                WhyIDidThatAddonInsec = true;

                Core.DelayAction(() => WhyIDidThatAddonInsec = false, 3000);

                if (E.IsReady())
                {
                    InsecSoldier = Orbwalker.ValidAzirSoldiers.Where(it => it.Distance(target) <= (R.Width / 2) - 20).OrderByDescending(it => it.Distance(target)).First();

                    var rectangle = new Geometry.Polygon.Rectangle(Player.Position, InsecSoldier.Position, E.Width + target.BoundingRadius);

                    if (!rectangle.IsInside(targetpos) && InsecSoldier.Distance(target) <= (R.Width / 2) - 50)
                    {
                        var EDelay = (int)((((Player.Distance(InsecSoldier) - 100) / 8) * 5));

                        if (E.Cast(Vectors.CorrectSpellRange(InsecSoldier.Position, E.Range)))
                        {
                            //Delayed insec

                            Core.DelayAction(delegate
                            {
                                if (Player.Spellbook.CastSpell(SpellSlot.Q, Vectors.CorrectSpellRange(Game.CursorPos, Q.Range)))
                                {
                                    LastQTime = Game.Time;
                                }

                                else
                                {
                                    WhyIDidThatAddonInsec = false;
                                }
                            }, EDelay);
                        }
                        else
                        {
                            WhyIDidThatAddonInsec = false;
                        }
                    }
                    else
                    {
                        WhyIDidThatAddonInsec = false;
                    }
                }
                else
                {
                    WhyIDidThatAddonInsec = false;
                }
            }

            else if (!WhyIDidThatAddonInsec && W.IsReady() && E.IsReady() && Q.IsReady() && W.IsInRange(target))
            {
                var rectangle = new Geometry.Polygon.Rectangle(Player.Position, targetpos, 2 * (target.BoundingRadius + E.Width + 20));
                //rectangle.Draw(System.Drawing.Color.Yellow);

                var circle = new Geometry.Polygon.Circle(targetpos, (R.Width - 20) / 2);
                //circle.Draw(System.Drawing.Color.Red);

                var point = circle.Points.Where(it => !NavMesh.GetCollisionFlags(it).HasFlag(CollisionFlags.Wall) && W.IsInRange(it.To3D()) && !rectangle.IsInside(it)).OrderByDescending(it => it.Distance(Player)).FirstOrDefault();

                if (point != null && W.Cast(point.To3D()))
                {
                    WhyIDidThatAddonInsec = true;

                    Core.DelayAction(() => WhyIDidThatAddonInsec = false, 3000);

                    Core.DelayAction(delegate
                    {
                        InsecSoldier = Orbwalker.ValidAzirSoldiers.Where(it => it.Distance(target) <= (R.Width / 2) - 20).OrderByDescending(it => it.Distance(target)).First();

                        var EDelay = (int)((((Player.Distance(InsecSoldier) - 100) / 8) * 5));

                        if (E.Cast(Vectors.CorrectSpellRange(InsecSoldier.Position, E.Range)))
                        {
                            //Delayed insec

                            Core.DelayAction(delegate
                            {
                                if (Player.Spellbook.CastSpell(SpellSlot.Q, Vectors.CorrectSpellRange(Game.CursorPos, Q.Range)))
                                {
                                    LastQTime = Game.Time;
                                }

                                else
                                {
                                    WhyIDidThatAddonInsec = false;
                                }
                            }, EDelay);
                        }
                        else
                        {
                            WhyIDidThatAddonInsec = false;
                        }
                    }, 350);
                }
            }

            return;
        }
Example #4
0
        //---------------------------------------WhyInsec()----------------------------------------------------

        void WhyInsec(Obj_AI_Base target)
        {
            //Back distance = 300

            //Why I did that

            EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, target);

            var targetpos = Prediction.Position.PredictUnitPosition(target, 500).To3D();

            if (!WhyIDidThatAddonInsec && Orbwalker.ValidAzirSoldiers.Any(it => it.Distance(target) >= E.Width + target.BoundingRadius && it.Distance(target) <= (R.Width / 2) - 20))
            {
                WhyIDidThatAddonInsec = true;

                Core.DelayAction(() => WhyIDidThatAddonInsec = false, 3000);

                if (E.IsReady())
                {
                    InsecSoldier = Orbwalker.ValidAzirSoldiers.Where(it => it.Distance(target) <= (R.Width / 2) - 20).OrderByDescending(it => it.Distance(target)).First();

                    var rectangle = new Geometry.Polygon.Rectangle(Player.Position, InsecSoldier.Position, E.Width + target.BoundingRadius);

                    if (!rectangle.IsInside(targetpos) && InsecSoldier.Distance(target) <= (R.Width / 2) - 50)
                    {
                        var EDelay = (int)((((Player.Distance(InsecSoldier) - 100) / 8) * 5));

                        if (E.Cast(Vectors.CorrectSpellRange(InsecSoldier.Position, E.Range)))
                        {
                            //Delayed insec

                            Core.DelayAction(delegate
                            {
                                if (Player.Spellbook.CastSpell(SpellSlot.Q, Vectors.CorrectSpellRange(Game.CursorPos, Q.Range)))
                                {
                                    LastQTime = Game.Time;
                                }

                                else WhyIDidThatAddonInsec = false;
                            }, EDelay);
                        }
                        else WhyIDidThatAddonInsec = false;
                    }
                    else { WhyIDidThatAddonInsec = false; }
                }
                else WhyIDidThatAddonInsec = false;
            }

            else if (!WhyIDidThatAddonInsec && W.IsReady() && E.IsReady() && Q.IsReady() && W.IsInRange(target))
            {
                var rectangle = new Geometry.Polygon.Rectangle(Player.Position, targetpos, 2 * (target.BoundingRadius + E.Width + 20));
                //rectangle.Draw(System.Drawing.Color.Yellow);

                var circle = new Geometry.Polygon.Circle(targetpos, (R.Width - 20)/2);
                //circle.Draw(System.Drawing.Color.Red);

                var point = circle.Points.Where(it => !NavMesh.GetCollisionFlags(it).HasFlag(CollisionFlags.Wall) && W.IsInRange(it.To3D()) && !rectangle.IsInside(it)).OrderByDescending(it => it.Distance(Player)).FirstOrDefault();

                if (point != null && W.Cast(point.To3D()))
                {
                    WhyIDidThatAddonInsec = true;

                    Core.DelayAction(() => WhyIDidThatAddonInsec = false, 3000);

                    Core.DelayAction(delegate
                    {
                        InsecSoldier = Orbwalker.ValidAzirSoldiers.Where(it => it.Distance(target) <= (R.Width / 2) - 20).OrderByDescending(it => it.Distance(target)).First();

                        var EDelay = (int)((((Player.Distance(InsecSoldier) - 100) / 8) * 5));

                        if (E.Cast(Vectors.CorrectSpellRange(InsecSoldier.Position, E.Range)))
                        {
                            //Delayed insec

                            Core.DelayAction(delegate
                            {
                                if (Player.Spellbook.CastSpell(SpellSlot.Q, Vectors.CorrectSpellRange(Game.CursorPos, Q.Range)))
                                {
                                    LastQTime = Game.Time;
                                }

                                else WhyIDidThatAddonInsec = false;
                            }, EDelay);
                        }
                        else WhyIDidThatAddonInsec = false;

                    }, 350);
                }

            }

            return;
        }