コード例 #1
0
        private static void CastQ(Obj_AI_Base target)
        {
            if (Q.IsReady() && TickManager.NoLag(1) && target != null)
            {
                PredictionResult prediction;

                if (Q.IsInRange(target))
                {
                    prediction = Q.GetPrediction(target);
                    Q.Cast(prediction.CastPosition);
                }
                else if (Q2.IsInRange(target))
                {
                    prediction = Q2.GetPrediction(target);
                    Q2.Cast(prediction.CastPosition);
                }
                else if (Q3.IsInRange(target))
                {
                    prediction = Q3.GetPrediction(target);
                    Q3.Cast(prediction.CastPosition);
                }
                else
                {
                    return;
                }
                if (prediction.HitChance < HitChance.High)
                {
                    return;
                }
                if (Player.ServerPosition.Distance(prediction.CastPosition) <= Q.Range + Q.Width)
                {
                    Vector3 p;
                    if (Player.ServerPosition.Distance(prediction.CastPosition) > 300)
                    {
                        p = prediction.CastPosition -
                            100 *
                            (prediction.CastPosition.To2D() - Player.ServerPosition.To2D()).Normalized()
                            .To3D();
                    }
                    else
                    {
                        p = prediction.CastPosition;
                    }

                    Q.Cast(p);
                }
                else if (Player.ServerPosition.Distance(prediction.CastPosition) <=
                         (Q.Range + Q2.Range) / 2.0)
                {
                    var p = Player.ServerPosition.To2D()
                            .Extend(prediction.CastPosition.To2D(), Q.Range - 100);

                    if (!CheckQCollision(target, prediction.UnitPosition, p.To3D()))
                    {
                        Q.Cast(p.To3D());
                    }
                }
                else
                {
                    var p = Player.ServerPosition.To2D() +
                            Q.Range *
                            (prediction.CastPosition.To2D() - Player.ServerPosition.To2D()).Normalized
                                ();

                    if (!CheckQCollision(target, prediction.UnitPosition, p.To3D()))
                    {
                        Q.Cast(p.To3D());
                    }
                }
            }
        }
コード例 #2
0
ファイル: Yasuo.cs プロジェクト: geramz/PortAIO
        private static void LastHit()
        {
            foreach (Obj_AI_Base minion in LeagueSharp.Common.MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q3.Range, LeagueSharp.Common.MinionTypes.All, LeagueSharp.Common.MinionTeam.Enemy).OrderByDescending(m => m.Health))
            {
                if (minion != null)
                {
                    if (!minion.IsDead && minion != null && getCheckBoxItem(lhMenu, "Q") && Q.IsReady() && minion.LSIsValidTarget(500) && !haveQ3 && Q.IsInRange(minion) && !IsDashing)
                    {
                        if (minion.Health <= GetQDmg(minion))
                        {
                            Q.Cast(minion);
                        }
                    }
                    if (!minion.IsDead && minion != null && getCheckBoxItem(lhMenu, "Q3") && Q.IsReady() && minion.LSIsValidTarget(1100) && haveQ3 && Q3.IsInRange(minion) && !IsDashing)
                    {
                        if (minion.Health <= GetQDmg(minion))
                        {
                            Q2.Cast(minion);
                        }
                    }

                    if (getCheckBoxItem(lhMenu, "E") && E.IsReady() && minion.LSIsValidTarget(475))
                    {
                        if (!UnderTower(PosAfterE(minion)) && CanCastE(minion))
                        {
                            if (minion.Health <= GetEDmg(minion) && !isDangerous(minion, 600))
                            {
                                E.CastOnUnit(minion);
                            }
                        }
                    }
                }
            }
        }