/// <summary>
        /// returns current insec positions
        /// </summary>
        /// <param name="enemy">insec enemy</param>
        public static void InsecTo(Obj_AI_Hero enemy)
        {
            switch (Program.Config.Item("insec.to").GetValue <StringList>().SelectedIndex)
            {
            case 0:

                if (ObjectManager.Player.Distance(AllyInsec(SliderCheck("insec.distance"), enemy)) < Spells.W.Range && AllyInsec(SliderCheck("insec.distance"), enemy) != new Vector3(0, 0, 0))
                {
                    WardJump.HikiJump(AllyInsec(SliderCheck("insec.distance"), enemy));
                }
                break;

            case 1:
                if (ObjectManager.Player.Distance(TowerInsec(SliderCheck("insec.distance"), enemy)) < Spells.W.Range && TowerInsec(SliderCheck("insec.distance"), enemy) != new Vector3(0, 0, 0))
                {
                    WardJump.HikiJump(TowerInsec(SliderCheck("insec.distance"), enemy));
                }
                break;

            case 2:
                if (ObjectManager.Player.Distance(CursorInsec(SliderCheck("insec.distance"), enemy)) < Spells.W.Range && CursorInsec(SliderCheck("insec.distance"), enemy) != new Vector3(0, 0, 0))
                {
                    WardJump.HikiJump(CursorInsec(SliderCheck("insec.distance"), enemy));
                }
                break;
            }
        }
        /// <summary>
        /// ward jump flash insec
        /// </summary>
        public static void WardJumpFlashInsec()
        {
            Obj_AI_Hero selectedTarget     = TargetSelector.GetSelectedTarget();
            var         wardjumpflashrange = Spells.W.Range + 424;

            var insecpos = InsecPositions(TargetSelector.GetSelectedTarget());

            var insecposex = InsecPositions(TargetSelector.GetSelectedTarget())
                             .Extend(ObjectManager.Player.Position, wardjumpflashrange);


            var obj = ObjectManager.Get <Obj_AI_Base>().Where(x => x.IsEnemy && x.IsValidTarget(Spells.Q.Range) && x.Distance(insecpos) < wardjumpflashrange && x.Distance(insecpos) > 20 && Spells.Q.GetPrediction(x).Hitchance >=
                                                              HitChance.High && x.Name != TargetSelector.GetSelectedTarget().Name)
                      .OrderBy(o => o.Distance(insecposex)).FirstOrDefault(x => x.Health > Spells.Q.GetDamage(x));

            if (obj != null)
            {
                if (Spells.Q.CanCast(obj))
                {
                    Spells.Q.Cast(obj);
                }
                if (Spells.Q.Instance.Name != "BlindMonkQOne" && Spells.Q2.IsReady())
                {
                    Spells.Q2.Cast();
                }
                if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.IsReady() && Spells.W.Instance.Name == "BlindMonkWOne")
                {
                    WardJump.HikiJump(obj.Position.Extend(selectedTarget.Position, 424));
                }
                if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.Instance.Name != "BlindMonkWOne" && Spells.R.CanCast(selectedTarget))
                {
                    Utility.DelayAction.Add(30, () => ObjectManager.Player.Spellbook.CastSpell(ObjectManager.Player.GetSpellSlot("SummonerFlash"), insecpos));
                }
                if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.Instance.Name != "BlindMonkWOne" && Spells.R.CanCast(selectedTarget))
                {
                    Spells.R.CastOnUnit(selectedTarget);
                }
            }
        }
Exemple #3
0
        public static void ClickInsec()
        {
            if (Program.Config.Item("obj.usage").GetValue <bool>())
            {
                if (Program.Config.Item("flash.usage").GetValue <bool>())
                {
                    AIHeroClient selectedTarget     = TargetSelector.GetSelectedTarget();
                    var          wardjumpflashrange = Spells.W.Range + 424;

                    var insecpos = InsecPositions(TargetSelector.GetSelectedTarget());

                    var insecposex = InsecPositions(TargetSelector.GetSelectedTarget())
                                     .Extend(ObjectManager.Player.Position, wardjumpflashrange);


                    var obj = ObjectManager.Get <Obj_AI_Base>().Where(x => x.IsEnemy && x.IsValidTarget(Spells.Q.Range) && x.Distance(insecpos) < wardjumpflashrange && x.Distance(insecpos) > 20 && Spells.Q.GetPrediction(x).Hitchance >=
                                                                      HitChance.High && !x.Name.ToLower().Contains("turret") && x.Name != TargetSelector.GetSelectedTarget().Name)
                              .OrderBy(o => o.Distance(insecposex)).FirstOrDefault(x => x.Health > Spells.Q.GetDamage(x));

                    if (obj != null)
                    {
                        if (Spells.Q.CanCast(obj))
                        {
                            Spells.Q.Cast(obj);
                        }
                        if (Spells.Q.Instance.Name != "BlindMonkQOne" && Spells.Q2.IsReady())
                        {
                            Spells.Q2.Cast();
                        }
                        if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.IsReady() && Spells.W.Instance.Name == "BlindMonkWOne")
                        {
                            WardJump.HikiJump(obj.Position.Extend(selectedTarget.Position, 424));
                        }
                        if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.Instance.Name != "BlindMonkWOne" && Spells.R.CanCast(selectedTarget))
                        {
                            LeagueSharp.Common.Utility.DelayAction.Add(30, () => ObjectManager.Player.Spellbook.CastSpell(ObjectManager.Player.GetSpellSlot("SummonerFlash"), insecpos));
                        }
                        if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.Instance.Name != "BlindMonkWOne" && Spells.R.CanCast(selectedTarget))
                        {
                            Spells.R.CastOnUnit(selectedTarget);
                        }
                    }
                    else
                    {
                        AIHeroClient selectedTargetx = TargetSelector.GetSelectedTarget();

                        if (selectedTargetx != null && Spells.Q.GetPrediction(selectedTargetx).Hitchance >= HitChance.High)
                        {
                            if (Spells.Q.CanCast(selectedTargetx) && Spells.Q.GetPrediction(selectedTargetx).Hitchance > HitChance.High)
                            {
                                Spells.Q.Cast(selectedTargetx);
                            }
                            if (Spells.Q.Instance.Name != "BlindMonkQOne" && Spells.Q2.IsReady())
                            {
                                Spells.Q2.Cast();
                            }
                            if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.IsReady() && Spells.W.Instance.Name == "BlindMonkWOne")
                            {
                                InsecTo(selectedTargetx);
                            }
                            if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.Instance.Name != "BlindMonkWOne" && Spells.R.CanCast(selectedTargetx))
                            {
                                Spells.R.CastOnUnit(selectedTargetx);
                            }
                        }
                    }
                }
                else
                {
                    AIHeroClient selectedTarget = TargetSelector.GetSelectedTarget();

                    var insecpos = InsecPositions(TargetSelector.GetSelectedTarget());


                    var obj = ObjectManager.Get <Obj_AI_Base>().Where(x => x.IsEnemy && x.IsValidTarget(Spells.Q.Range) && x.Distance(insecpos) < Spells.W.Range && x.Distance(insecpos) > 20 && Spells.Q.GetPrediction(x).Hitchance >=
                                                                      HitChance.High && x.Name != TargetSelector.GetSelectedTarget().Name)
                              .OrderBy(o => o.Distance(insecpos)).FirstOrDefault(x => x.Health > Spells.Q.GetDamage(x));

                    if (obj != null)
                    {
                        if (Spells.Q.CanCast(obj))
                        {
                            Spells.Q.Cast(obj);
                        }
                        if (Spells.Q.Instance.Name != "BlindMonkQOne" && Spells.Q2.IsReady())
                        {
                            Spells.Q2.Cast();
                        }
                        if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.IsReady() && Spells.W.Instance.Name == "BlindMonkWOne")
                        {
                            WardJump.HikiJump(insecpos);
                        }
                        if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.Instance.Name != "BlindMonkWOne" && Spells.R.CanCast(selectedTarget))
                        {
                            Spells.R.CastOnUnit(selectedTarget);
                        }
                    }
                    else
                    {
                        AIHeroClient selectedTargetx = TargetSelector.GetSelectedTarget();

                        if (selectedTargetx != null && Spells.Q.GetPrediction(selectedTargetx).Hitchance >= HitChance.High)
                        {
                            if (Spells.Q.CanCast(selectedTargetx) && Spells.Q.GetPrediction(selectedTargetx).Hitchance > HitChance.High)
                            {
                                Spells.Q.Cast(selectedTargetx);
                            }
                            if (Spells.Q.Instance.Name != "BlindMonkQOne" && Spells.Q2.IsReady())
                            {
                                Spells.Q2.Cast();
                            }
                            if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.IsReady() && Spells.W.Instance.Name == "BlindMonkWOne")
                            {
                                InsecTo(selectedTargetx);
                            }
                            if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.Instance.Name != "BlindMonkWOne" && Spells.R.CanCast(selectedTargetx))
                            {
                                Spells.R.CastOnUnit(selectedTargetx);
                            }
                        }
                    }
                }
            }
            else
            {
                AIHeroClient selectedTarget = TargetSelector.GetSelectedTarget();
                var          insecpos       = InsecPositions(TargetSelector.GetSelectedTarget());

                var obj = ObjectManager.Get <Obj_AI_Base>().Where(x => x.IsEnemy && x.IsValidTarget(Spells.Q.Range) && x.Distance(insecpos) < 400 && x.Distance(insecpos) > 20 && Spells.Q.GetPrediction(x).Hitchance >=
                                                                  HitChance.High && x.Name != TargetSelector.GetSelectedTarget().Name)
                          .OrderBy(o => o.Distance(insecpos)).FirstOrDefault();

                if (selectedTarget != null && Spells.Q.GetPrediction(selectedTarget).Hitchance >= HitChance.High)
                {
                    if (Spells.Q.CanCast(selectedTarget) && Spells.Q.GetPrediction(selectedTarget).Hitchance > HitChance.High)
                    {
                        Spells.Q.Cast(selectedTarget);
                    }
                    if (Spells.Q.Instance.Name != "BlindMonkQOne" && Spells.Q2.IsReady())
                    {
                        Spells.Q2.Cast();
                    }
                    if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.IsReady() && Spells.W.Instance.Name == "BlindMonkWOne")
                    {
                        InsecTo(selectedTarget);
                    }
                    if (!Spells.Q.IsReady() && !Spells.Q2.IsReady() && Spells.W.Instance.Name != "BlindMonkWOne" && Spells.R.CanCast(selectedTarget))
                    {
                        Spells.R.CastOnUnit(selectedTarget);
                    }
                }
            }
        }