Exemplo n.º 1
0
        public static bool CastOKTW(Obj_AI_Hero target, OKTWPrediction.HitChance hitChance)
        {
            var spell  = Thresh.Q;
            var Player = Thresh.Player;

            OKTWPrediction.SkillshotType CoreType2 = OKTWPrediction.SkillshotType.SkillshotLine;
            bool aoe2 = false;

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

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

            if (poutput2.Hitchance >= hitChance)
            {
                return(spell.Cast(poutput2.CastPosition));
            }
            return(false);
        }
Exemplo n.º 2
0
        public static void ExecuteE(Gapcloser.GapcloserArgs args)
        {
            if (!GapCloserMenu.EGapcloser.IsEnabled(args.SpellName))
            {
                return;
            }

            if (args.EndPosition.DistanceToPlayer() > args.StartPosition.DistanceToPlayer())
            {
                return;
            }

            var Input = new OKTWPrediction.PredictionInput
            {
                Aoe       = false,
                Collision = E.Collision,
                Speed     = E.Speed,
                Delay     = E.Delay,
                Range     = E.Range,
                From      = LocalPlayer.Instance.Position,
                Radius    = E.Width,
                Unit      = args.Sender,
                Type      = OKTWPrediction.SkillshotType.SkillshotLine
            };

            var list = new List <Vector3>();

            list.Add(LocalPlayer.Instance.Position);
            list.Add(args.EndPosition);
            switch (args.Type)
            {
            case SpellType.Targeted when args.Target.IsMe():
            case SpellType.Dash when args.EndPosition.DistanceToPlayer() <= LocalPlayer.Instance.GetAutoAttackRange():
                if (!OKTWPrediction.Collision.GetCollision(list, Input).Any())
                {
                    return;
                }

                E.Cast(args.EndPosition);
                break;
            }
        }
Exemplo n.º 3
0
        public static void CastTo(this Spell Spells, Obj_AI_Base target, bool AOE = false)
        {
            switch (Program.Menu.Item("SelectPred", true).GetValue <StringList>().SelectedIndex)
            {
            case 0:
            {
                var SpellPred = Spells.GetPrediction(target, AOE);

                if (SpellPred.Hitchance >= MinCommonHitChance)
                {
                    Spells.Cast(SpellPred.CastPosition, true);
                }
            }
            break;

            case 1:
            {
                OKTWPrediction.SkillshotType CoreType2 = OKTWPrediction.SkillshotType.SkillshotLine;

                if (Spells.Type == SkillshotType.SkillshotCircle)
                {
                    CoreType2 = OKTWPrediction.SkillshotType.SkillshotCircle;
                }

                var predInput2 = new OKTWPrediction.PredictionInput
                {
                    Aoe       = AOE,
                    Collision = Spells.Collision,
                    Speed     = Spells.Speed,
                    Delay     = Spells.Delay,
                    Range     = Spells.Range,
                    From      = ObjectManager.Player.ServerPosition,
                    Radius    = Spells.Width,
                    Unit      = target,
                    Type      = CoreType2
                };

                var poutput2 = OKTWPrediction.Prediction.GetPrediction(predInput2);

                if (Spells.Speed != float.MaxValue && YasuoWindWall.CollisionYasuo(ObjectManager.Player.ServerPosition, poutput2.CastPosition))
                {
                    return;
                }

                if (poutput2.Hitchance >= MinOKTWHitChance)
                {
                    Spells.Cast(poutput2.CastPosition, true);
                }
                else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 && poutput2.Hitchance >= MinOKTWHitChance - 1)
                {
                    Spells.Cast(poutput2.CastPosition, true);
                }
            }
            break;

            case 2:
            {
                SDKPrediction.SkillshotType CoreType2 = SDKPrediction.SkillshotType.SkillshotLine;

                var predInput2 = new SDKPrediction.PredictionInput
                {
                    AoE       = AOE,
                    Collision = Spells.Collision,
                    Speed     = Spells.Speed,
                    Delay     = Spells.Delay,
                    Range     = Spells.Range,
                    From      = ObjectManager.Player.ServerPosition,
                    Radius    = Spells.Width,
                    Unit      = target,
                    Type      = CoreType2
                };

                var poutput2 = SDKPrediction.GetPrediction(predInput2);

                if (Spells.Speed != float.MaxValue && YasuoWindWall.CollisionYasuo(ObjectManager.Player.ServerPosition, poutput2.CastPosition))
                {
                    return;
                }

                if (poutput2.Hitchance >= MinSDKHitChance)
                {
                    Spells.Cast(poutput2.CastPosition, true);
                }
                else if (predInput2.AoE && poutput2.AoeTargetsHitCount > 1 && poutput2.Hitchance >= MinSDKHitChance - 1)
                {
                    Spells.Cast(poutput2.CastPosition, true);
                }
            }
            break;

            case 3:
            {
                var hero = target as Obj_AI_Hero;

                if (hero != null && hero.IsValid)
                {
                    var t = hero;

                    if (t.IsValidTarget())
                    {
                        Spells.SPredictionCast(t, MinCommonHitChance);
                    }
                }
                else
                {
                    Spells.CastIfHitchanceEquals(target, MinCommonHitChance);
                }
            }
            break;

            case 4:
            {
                if (Spells.Type == SkillshotType.SkillshotCircle)
                {
                    Spells.CastCircle(target);
                }
                else if (Spells.Type == SkillshotType.SkillshotLine)
                {
                    Spells.CastLine(target);
                }
                else if (Spells.Type == SkillshotType.SkillshotCone)
                {
                    Spells.CastCone(target);
                }
            }
            break;
            }
        }