示例#1
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;
            }
        }
示例#2
0
        public static void CastSdk(this Spell spell, Obj_AI_Base unit, HitChance hit, bool aoe = false)
        {
            SDKPrediction.SkillshotType CoreType2 = SDKPrediction.SkillshotType.SkillshotLine;

            if (spell.Type == SkillshotType.SkillshotCircle)
            {
                CoreType2 = SDKPrediction.SkillshotType.SkillshotCircle;
                aoe       = true;
            }

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

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

            var poutput2 = SDKPrediction.GetPrediction(predInput2);

            if (spell.Speed != Single.MaxValue &&
                OktwCommon.CollisionYasuo(ObjectManager.Player.ServerPosition, poutput2.CastPosition))
            {
                return;
            }

            switch (hit)
            {
            case HitChance.Low:
                if (poutput2.Hitchance >= SDKPrediction.HitChance.Low)
                {
                    spell.Cast(poutput2.CastPosition);
                }
                break;

            case HitChance.Medium:
                if (poutput2.Hitchance >= SDKPrediction.HitChance.Medium)
                {
                    spell.Cast(poutput2.CastPosition);
                }
                break;

            case HitChance.High:
                if (poutput2.Hitchance >= SDKPrediction.HitChance.High)
                {
                    spell.Cast(poutput2.CastPosition);
                }
                break;

            case HitChance.VeryHigh:
                if (poutput2.Hitchance >= SDKPrediction.HitChance.VeryHigh)
                {
                    spell.Cast(poutput2.CastPosition);
                }
                break;

            case HitChance.Immobile:
                if (poutput2.Hitchance >= SDKPrediction.HitChance.Immobile)
                {
                    spell.Cast(poutput2.CastPosition);
                }
                break;
            }

            if (predInput2.AoE && poutput2.AoeTargetsHitCount > 1 &&
                poutput2.Hitchance >= SDKPrediction.HitChance.High)
            {
                spell.Cast(poutput2.CastPosition, true);
            }
        }