コード例 #1
0
        private static void CastR(AIHeroClient target)
        {
            if (LeeSin.R.IsReady())
            {
                if (MenuManager.myMenu.Item("combo.rLogic").GetValue <Boolean>())
                {
                    // Find best pos to kick
                    Spell    wardSpell = LeeSin.FindWard();
                    rUtility value     = Find_R_BestPos(target);
                    if (value.hit > 1 && value.pos.Distance(LeeSin.myHero.Position) < 600)
                    {
                        if (target.Position.Distance(LeeSin.myHero.Position) < LeeSin.R.Range && Environment.TickCount - jumpToPos < 2000)
                        {
                            LeeSin.R.Cast(target);
                        }
                        else if (LeeSin.W.IsReady() && !LeeSin.IsSecondCast(LeeSin.W) && wardSpell != null)
                        {
                            jumpToPos = Environment.TickCount;
                            LeeSin.WardJump_Position(value.pos);
                        }
                    }
                }
                // Kill
                if (LeeSin.myHero.Position.Distance(target.Position) < LeeSin.R.Range)
                {
                    var r_dmg = LeeSin.GetDamage_R(target);
                    if (target.Health < r_dmg)
                    {
                        LeeSin.R.Cast(target);
                    }

                    if (LeeSin.Q.IsReady() && !LeeSin.IsSecondCast(LeeSin.Q))
                    {
                        if (LeeSin.GetDamage_Q(target, r_dmg) + r_dmg > target.Health)
                        {
                            LeeSin.R.Cast(target);
                        }
                    }

                    if (LeeSin.Q.IsReady() && LeeSin.IsSecondCast(LeeSin.Q) && target.HasBuff("BlindMonkQOne"))
                    {
                        if (LeeSin.GetDamage_Q2(target, r_dmg) + r_dmg > target.Health)
                        {
                            LeeSin.R.Cast(target);
                        }
                    }
                }
            }
        }
コード例 #2
0
        private static void startInsec()
        {
            LeeSin.myHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);

            if (insecTarget == null || !insecTarget.IsValidTarget() || !LeeSin.R.IsReady())
            {
                return;
            }

            Vector3 endPos = new Vector3();

            if (insecAlly != default(Obj_AI_Hero))
            {
                endPos = insecAlly.Position;
            }
            else if (insecTurret != default(Obj_AI_Turret))
            {
                endPos = insecTurret.Position;
            }
            else
            {
                endPos = insecPos;
            }

            if (endPos == default(Vector3))
            {
                return;
            }

            Vector3 WardPos = insecTarget.Position + (insecTarget.Position - endPos).Normalized() * 300;

            if (LeeSin.myHero.Distance(WardPos) < 100)
            {
                LeeSin.R.Cast(insecTarget);
                return;
            }

            Spell wardSpell = LeeSin.FindWard();

            if (LeeSin.Q.IsReady() && !LeeSin.IsSecondCast(LeeSin.Q) && LeeSin.W.IsReady() && !LeeSin.IsSecondCast(LeeSin.W) && wardSpell != null)
            {
                int     HitChance = 0;
                Vector3 pos       = new Vector3();

                if (MenuManager.myMenu.Item("pred.list2").GetValue <StringList>().SelectedIndex == 0)
                {
                    PredictionOutput pred = LeeSin.Q.GetPrediction(insecTarget);
                    HitChance = (int)pred.Hitchance;
                    pos       = pred.CastPosition;
                }
                else
                {
                    resultPred pred = myPred.GetPrediction(insecTarget, LeeSin.Q);
                    HitChance = pred.Hitchance;
                    pos       = pred.predPos;
                }

                if (HitChance >= MenuManager.myMenu.Item("insec.qHitChance").GetValue <Slider>().Value)
                {
                    LeeSin.Q.Cast(pos);
                    return;
                }
                else
                {
                    var enemyMinion = MinionManager.GetMinions(LeeSin.Q.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.None);
                    var isMinion    = enemyMinion.Where(unit => unit.Position.Distance(WardPos) < 500 && unit.Health > LeeSin.GetDamage_Q1(unit));
                    if (isMinion.Count() > 0)
                    {
                        PredictionOutput qPred = LeeSin.Q.GetPrediction(isMinion.First());
                        if ((int)qPred.Hitchance >= MenuManager.myMenu.Item("combo.qHitChance").GetValue <Slider>().Value)
                        {
                            LeeSin.Q.Cast(qPred.CastPosition);
                        }
                    }

                    var secondUnit = HeroManager.Enemies.Where(unit => unit.Position.Distance(WardPos) < 500);
                    if (secondUnit.Count() > 0)
                    {
                        if (MenuManager.myMenu.Item("pred.list2").GetValue <StringList>().SelectedIndex == 0)
                        {
                            PredictionOutput qPred = LeeSin.Q.GetPrediction(secondUnit.First());
                            if ((int)qPred.Hitchance >= MenuManager.myMenu.Item("combo.qHitChance").GetValue <Slider>().Value)
                            {
                                LeeSin.Q.Cast(qPred.CastPosition);
                            }
                        }
                        else
                        {
                            resultPred qPred = myPred.GetPrediction(secondUnit.First(), LeeSin.Q);
                            if (qPred.Hitchance >= MenuManager.myMenu.Item("combo.qHitChance").GetValue <Slider>().Value)
                            {
                                LeeSin.Q.Cast(qPred.predPos);
                            }
                        }
                    }
                }
            }

            if (LeeSin.Q.IsReady() && LeeSin.IsSecondCast(LeeSin.Q) && qHit != null && qHit.Position.Distance(WardPos) < 600)
            {
                LeeSin.Q.Cast();
                return;
            }

            if (LeeSin.myHero.Distance(WardPos) < 600 && LeeSin.W.IsReady() && !LeeSin.IsSecondCast(LeeSin.W))
            {
                LeeSin.WardJump_Position(WardPos);
                return;
            }
        }
コード例 #3
0
ファイル: Insec.cs プロジェクト: Rambe/LeagueSharp
        private static void startInsec()
        {
            LeeSin.myHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);

            if (insecTarget != null && insecTarget.IsValidTarget(50000) && LeeSin.R.IsReady())
            {
                return;
            }

            Vector3 endPos = new Vector3();

            if (insecAlly != default(Obj_AI_Hero))
            {
                endPos = insecAlly.Position;
            }
            else if (insecTurret != default(Obj_AI_Turret))
            {
                endPos = insecTurret.Position;
            }
            else
            {
                endPos = insecPos;
            }

            if (endPos == default(Vector3))
            {
                return;
            }


            Vector3 WardPos = insecTarget.Position + (insecTarget.Position - endPos).Normalized() * 250;

            if (LeeSin.myHero.Distance(WardPos) < 100 || (!LeeSin.W.IsReady() || LeeSin.IsSecondCast(LeeSin.W)))
            {
                LeeSin.R.Cast(insecTarget);
                return;
            }

            Spell wardSpell = LeeSin.FindWard();

            if (LeeSin.Q.IsReady() && !LeeSin.IsSecondCast(LeeSin.Q) && LeeSin.W.IsReady() && !LeeSin.IsSecondCast(LeeSin.W) && wardSpell != null)
            {
                PredictionOutput qPred = LeeSin.Q.GetPrediction(insecTarget);
                if (qPred.Hitchance >= HitChance.Medium)
                {
                    LeeSin.Q.Cast(qPred.CastPosition);
                    return;
                }
                else
                {
                    var enemyMinion = MinionManager.GetMinions(LeeSin.Q.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.None);
                    var isMinion    = enemyMinion.Where(unit => unit.Position.Distance(WardPos) < 500 && unit.Health > LeeSin.GetDamage_Q1(unit));
                    if (isMinion.Count() > 0)
                    {
                        qPred = LeeSin.Q.GetPrediction(isMinion.First());
                        if (qPred.Hitchance >= HitChance.Medium)
                        {
                            LeeSin.Q.Cast(qPred.CastPosition);
                            return;
                        }
                    }
                    var secondUnit = HeroManager.Enemies.Where(unit => unit.Position.Distance(WardPos) < 500);
                    if (secondUnit.Count() > 0)
                    {
                        qPred = LeeSin.Q.GetPrediction(secondUnit.First());
                        if (qPred.Hitchance >= HitChance.Medium)
                        {
                            LeeSin.Q.Cast(qPred.CastPosition);
                            return;
                        }
                    }
                }
            }

            if (LeeSin.Q.IsReady() && LeeSin.IsSecondCast(LeeSin.Q) && qHit != null && qHit.Position.Distance(WardPos) < 600)
            {
                LeeSin.Q.Cast();
                return;
            }

            if (LeeSin.myHero.Distance(WardPos) < 600 && LeeSin.W.IsReady() && !LeeSin.IsSecondCast(LeeSin.W))
            {
                LeeSin.WardJump_Position(WardPos);
                return;
            }
        }