Exemplo n.º 1
0
        public static void OktwCast(this Spell Spells, Obj_AI_Base target, bool AOE = false)
        {
            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);
            }
        }
Exemplo n.º 2
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:
            {
                SebbyLib.Prediction.SkillshotType CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotLine;

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

                var predInput2 = new SebbyLib.Prediction.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 = SebbyLib.Prediction.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;
            }
        }