Пример #1
0
        public static bool CastOKTW(this Spell spell, Obj_AI_Hero target, SebbyLib.Prediction.HitChance hitChance)
        {
            SebbyLib.Prediction.SkillshotType CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotLine;
            bool aoe2 = false;

            if (spell.Type == SkillshotType.SkillshotCircle)
            {
                CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotCircle;
                aoe2      = true;
            }

            if (spell.Width > 80 && !spell.Collision)
            {
                aoe2 = true;
            }

            var predInput2 = new SebbyLib.Prediction.PredictionInput
            {
                Aoe       = aoe2,
                Collision = spell.Collision,
                Speed     = spell.Speed,
                Delay     = spell.Delay,
                Range     = spell.Range,
                From      = HeroManager.Player.ServerPosition,
                Radius    = spell.Width,
                Unit      = target,
                Type      = CoreType2
            };
            var poutput2 = SebbyLib.Prediction.Prediction.GetPrediction(predInput2);

            if (spell.Speed != float.MaxValue && SebbyLib.OktwCommon.CollisionYasuo(HeroManager.Player.ServerPosition, poutput2.CastPosition))
            {
                return(false);
            }

            if (poutput2.Hitchance >= SebbyLib.Prediction.HitChance.VeryHigh)
            {
                return(spell.Cast(poutput2.CastPosition));
            }
            else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 && poutput2.Hitchance >= SebbyLib.Prediction.HitChance.High)
            {
                return(spell.Cast(poutput2.CastPosition));
            }

            return(false);
        }
Пример #2
0
        private static void CastQ(Obj_AI_Base target)
        {
            SebbyLib.Prediction.PredictionOutput prediction = GetPred(Q1, target);

            Vector3 pos1 = Vector3.Zero, pos2 = Vector3.Zero, pos3 = Vector3.Zero;

            SebbyLib.Prediction.HitChance hitchance = SebbyLib.Prediction.HitChance.Low;

            if (Config.Item("QHitChance", true).GetValue <StringList>().SelectedIndex == 0)
            {
                hitchance = SebbyLib.Prediction.HitChance.VeryHigh;
            }
            else if (Config.Item("QHitChance", true).GetValue <StringList>().SelectedIndex == 1)
            {
                hitchance = SebbyLib.Prediction.HitChance.High;
            }
            else if (Config.Item("QHitChance", true).GetValue <StringList>().SelectedIndex == 2)
            {
                hitchance = SebbyLib.Prediction.HitChance.Medium;
            }

            if (prediction.Hitchance == SebbyLib.Prediction.HitChance.OutOfRange)
            {
                prediction = GetPred(Q2, target);
                pos1       = Player.Position.Extend(prediction.CastPosition, Q1.Range);
                if (Cache.GetMinions(pos1, 280).Any())
                {
                    return;
                }
                if (OktwCommon.CirclePoints(10, 150, pos1).Any(x => x.IsWall()))
                {
                    return;
                }
                if (prediction.Hitchance == SebbyLib.Prediction.HitChance.OutOfRange)
                {
                    prediction = GetPred(Q3, target);
                    pos2       = Player.Position.Extend(prediction.CastPosition, Q2.Range);
                    if (Cache.GetMinions(pos2, 280).Any())
                    {
                        return;
                    }
                    if (OktwCommon.CirclePoints(10, 150, pos2).Any(x => x.IsWall()))
                    {
                        return;
                    }
                    if (prediction.Hitchance == SebbyLib.Prediction.HitChance.OutOfRange)
                    {
                        return;
                    }
                    else if (prediction.Hitchance >= hitchance)
                    {
                        Q3.Cast(prediction.CastPosition);
                    }
                }
                else if (prediction.Hitchance >= hitchance)
                {
                    Q2.Cast(prediction.CastPosition);
                }
            }
            else if (prediction.Hitchance >= hitchance)
            {
                Q1.Cast(prediction.CastPosition);
            }
        }