Beispiel #1
0
        private static Vector3 GetRCastPosition(AIHeroClient target)
        {
            if (target == null || !target.IsValidTarget(R.Range) || target.IsUnKillable())
            {
                return(Vector3.Zero);
            }

            var rPredInput = new SpellPrediction.PredictionInput
            {
                Unit             = target,
                Radius           = R.Width,
                Speed            = R.Speed,
                Range            = R.Range,
                Delay            = R.Delay,
                Aoe              = false,
                AddHitBox        = true,
                From             = Me.PreviousPosition,
                RangeCheckFrom   = Me.PreviousPosition,
                Type             = SkillshotType.Line,
                CollisionObjects = CollisionObjects.Heroes | CollisionObjects.YasuoWall
            };

            var rPredOutput = SpellPrediction.GetPrediction(rPredInput);

            if (rPredOutput.Hitchance < HitChance.High /* ||
                                                        * SpellPrediction.GetCollision(new List<Vector3> { target.PreviousPosition }, rPredInput)
                                                        * .Any(x => x.NetworkId != target.NetworkId)*/)
            {
                return(Vector3.Zero);
            }

            return(rPredOutput.CastPosition);
        }
Beispiel #2
0
        void AutoUlt()
        {
            var comboR = _menu["Combo"]["comboR"].GetValue <MenuSlider>().Value;

            if (comboR > 0 && _spellR.IsReady())
            {
                int enemiesHit   = 0;
                int killableHits = 0;
                foreach (AIHeroClient enemy in Program.Helper.EnemyTeam.Where(x => x.IsValidTarget(_spellR.Range)))
                {
                    var prediction = SpellPrediction.GetPrediction(enemy, _spellR.Delay);
                    if (prediction != null && prediction.UnitPosition.Distance(Player.Position) <= _spellR.Range)
                    {
                        enemiesHit++;

                        if (Player.GetSpellDamage(enemy, SpellSlot.W) >= enemy.Health)
                        {
                            killableHits++;
                        }
                    }
                }
                if (enemiesHit >= comboR || (killableHits >= 1 && Player.Health / Player.MaxHealth <= 0.1))
                {
                    CastR();
                }
            }
        }
Beispiel #3
0
        private void CastR(Spell R, AIHeroClient t)
        {
            Program.CastSpell(R, t);
            if (Config[Player.CharacterName]["RConfig"].GetValue <MenuBool>("minionR").Enabled)
            {
                // collision + predictio R
                var poutput = R.GetPrediction(t);
                var col     = poutput.CollisionObjects.Count(ColObj => ColObj.IsEnemy && ColObj.IsMinion && !ColObj.IsDead);

                //hitchance
                var prepos = SpellPrediction.GetPrediction(t, 0.4f);

                if (col == 0 && (int)prepos.Hitchance < 5)
                {
                    return;
                }

                float rSplash = 140;
                if (bonusR)
                {
                    rSplash = 290f;
                }

                var minions = Cache.GetMinions(Player.PreviousPosition, R.Range - rSplash);
                foreach (var minion in minions.Where(minion => minion.Distance(poutput.CastPosition) < rSplash))
                {
                    R.Cast(minion);
                    return;
                }
            }
        }
Beispiel #4
0
        internal static void CCast(this Spell spell, AIBaseClient target, HitChance SelectedHitchance) //for Circular spells
        {
            if (spell.Type == SkillshotType.Circle || spell.Type == SkillshotType.Cone)                // Cone 스킬은 임시로
            {
                if (spell != null && target != null)
                {
                    var             pred     = SpellPrediction.GetPrediction(target, spell.Delay, spell.Width / 2, spell.Speed);
                    SharpDX.Vector2 castVec  = (pred.UnitPosition.ToVector2() + target.PreviousPosition.ToVector2()) / 2;
                    SharpDX.Vector2 castVec2 = Player.PreviousPosition.ToVector2() +
                                               SharpDX.Vector2.Normalize(pred.UnitPosition.ToVector2() - Player.Position.ToVector2()) * (spell.Range);

                    if (target.IsValidTarget(spell.Range))
                    {
                        if (target.MoveSpeed * (Game.Ping / 2000 + spell.Delay + Player.PreviousPosition.Distance(target.PreviousPosition) / spell.Speed) <= spell.Width * 1 / 2)
                        {
                            spell.Cast(target.PreviousPosition); //Game.Ping/2000  추가함.
                        }
                        else if (pred.Hitchance >= SelectedHitchance && pred.UnitPosition.Distance(target.PreviousPosition) < Math.Max(spell.Width, 300f))
                        {
                            if (target.MoveSpeed * (Game.Ping / 2000 + spell.Delay + Player.PreviousPosition.Distance(target.PreviousPosition) / spell.Speed) <= spell.Width * 2 / 3 && castVec.Distance(pred.UnitPosition) <= spell.Width * 1 / 2 && castVec.Distance(Player.PreviousPosition) <= spell.Range)
                            {
                                spell.Cast(castVec);
                            }
                            else if (castVec.Distance(pred.UnitPosition) > spell.Width * 1 / 2 && Player.PreviousPosition.Distance(pred.UnitPosition) <= spell.Range)
                            {
                                spell.Cast(pred.UnitPosition);
                            }
                            else
                            {
                                spell.Cast(pred.CastPosition); // <- 별로 좋은 선택은 아니지만..
                            }
                        }
                    }
                    else if (target.IsValidTarget(spell.Range + spell.Width / 2)) //사거리 밖 대상에 대해서
                    {
                        if (pred.Hitchance >= SelectedHitchance && Player.PreviousPosition.Distance(pred.UnitPosition) <= spell.Range + spell.Width * 1 / 2 && pred.UnitPosition.Distance(target.PreviousPosition) < Math.Max(spell.Width, 400f))
                        {
                            if (Player.PreviousPosition.Distance(pred.UnitPosition) <= spell.Range)
                            {
                                if (Player.PreviousPosition.Distance(pred.CastPosition) <= spell.Range)
                                {
                                    spell.Cast(pred.CastPosition);
                                }
                            }
                            else if (Player.PreviousPosition.Distance(pred.UnitPosition) <= spell.Range + spell.Width * 1 / 2 && target.MoveSpeed * (Game.Ping / 2000 + spell.Delay + Player.PreviousPosition.Distance(target.PreviousPosition) / spell.Speed) <= spell.Width / 2)
                            {
                                if (Player.Distance(castVec2) <= spell.Range)
                                {
                                    spell.Cast(castVec2);
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #5
0
 internal static void AOECast(this Spell spell, AIBaseClient target)
 {
     if (spell != null && target != null)
     {
         var pred = SpellPrediction.GetPrediction(target, spell.Delay > 0 ? spell.Delay : 0.25f, spell.Range);
         if (pred.Hitchance >= HitChance.High && pred.UnitPosition.Distance(Player.PreviousPosition) <= spell.Range)
         {
             spell.Cast();
         }
     }
 }
Beispiel #6
0
        private void LogicQ()
        {
            var t  = TargetSelector.GetTarget(Q.Range);
            var t1 = TargetSelector.GetTarget(Q1.Range);

            if (t.IsValidTarget(Q.Range))
            {
                if (OktwCommon.GetKsDamage(t, Q) + AaDamage(t) > t.Health)
                {
                    Q.Cast(t);
                }
                else if (Combo && Player.Mana > RMANA + QMANA)
                {
                    Q.Cast(t);
                }
                else if (Harass && Config[Player.CharacterName]["Harras" + t.CharacterName].GetValue <MenuBool>().Enabled&& Player.Mana > RMANA + QMANA + EMANA + WMANA)
                {
                    Q.Cast(t);
                }
            }
            else if ((Harass || Combo) && Config[Player.CharacterName]["QConfig"].GetValue <MenuBool>("harassQ").Enabled&& t1.IsValidTarget(Q1.Range) && Config[Player.CharacterName]["Harras" + t.CharacterName].GetValue <MenuBool>().Enabled&& Player.Distance(t1.PreviousPosition) > Q.Range + 100)
            {
                if (Combo && Player.Mana < RMANA + QMANA)
                {
                    return;
                }
                if (Harass && Player.Mana < RMANA + QMANA + EMANA + WMANA)
                {
                    return;
                }
                if (!OktwCommon.CanHarass())
                {
                    return;
                }
                var prepos = SpellPrediction.GetPrediction(t1, Q1.Delay);
                if ((int)prepos.Hitchance < 5)
                {
                    return;
                }
                var distance = Player.Distance(prepos.CastPosition);
                var minions  = Cache.GetMinions(Player.PreviousPosition, Q.Range);

                foreach (var minion in minions.Where(minion => minion.IsValidTarget(Q.Range)))
                {
                    if (prepos.CastPosition.Distance(Player.Position.Extend(minion.Position, distance)) < 25)
                    {
                        Q.Cast(minion);
                        return;
                    }
                }
            }
        }
Beispiel #7
0
        internal static void LCast(this Spell spell, AIBaseClient target, HitChance SelectedHitchance, float alpha = 0f, float colmini = float.MaxValue, bool HeroOnly = false, float BombRadius = 0f) //for Linar spells  사용예시 AIO_Func.LCast(Q,Qtarget,50,0)
        {                                                                                                                                                                                              //        AIO_Func.LCast(E,Etarget,Menu.Item("Misc.Etg").GetValue<Slider>().Value,float.MaxValue); <- 이런식으로 사용.
            if (spell.Type == SkillshotType.Line)
            {
                if (spell != null && target != null)
                {
                    var pred      = SpellPrediction.GetPrediction(target, spell.Delay, spell.Width / 2, spell.Speed); //spell.Width/2
                    var collision = spell.GetCollision(Player.PreviousPosition.ToVector2(), new List <Vector2> {
                        pred.CastPosition.ToVector2()
                    });
                    //var minioncol = collision.Where(x => !(x is Obj_AI_Hero)).Count(x => x.IsMinion);
                    var             minioncol = collision.Count(x => (HeroOnly == false ? x.IsMinion : (x is AIHeroClient)));
                    SharpDX.Vector2 EditedVec = pred.UnitPosition.ToVector2() -
                                                SharpDX.Vector2.Normalize(pred.UnitPosition.ToVector2() - target.PreviousPosition.ToVector2()) * (spell.Width * 2 / 5);
                    SharpDX.Vector2 EditedVec2 = (pred.UnitPosition.ToVector2() + target.PreviousPosition.ToVector2()) / 2;

                    var collision2 = spell.GetCollision(Player.PreviousPosition.ToVector2(), new List <Vector2> {
                        EditedVec
                    });
                    var minioncol2 = collision2.Count(x => (HeroOnly == false ? x.IsMinion : (x is AIHeroClient)));
                    var collision3 = spell.GetCollision(Player.PreviousPosition.ToVector2(), new List <Vector2> {
                        EditedVec2
                    });
                    var minioncol3 = collision3.Count(x => (HeroOnly == false ? x.IsMinion : (x is AIHeroClient)));
                    if (pred.Hitchance >= SelectedHitchance)
                    {
                        if (target.IsValidTarget(spell.Range - target.MoveSpeed * (spell.Delay + Player.Distance(target.PreviousPosition) / spell.Speed) + alpha) && minioncol2 <= colmini && pred.UnitPosition.Distance(target.PreviousPosition) > spell.Width)
                        {
                            spell.Cast(EditedVec);
                        }
                        else if (target.IsValidTarget(spell.Range - target.MoveSpeed * (spell.Delay + Player.Distance(target.PreviousPosition) / spell.Speed) + alpha) && minioncol3 <= colmini && pred.UnitPosition.Distance(target.PreviousPosition) > spell.Width / 2)
                        {
                            spell.Cast(EditedVec2);
                        }
                        else if (target.IsValidTarget(spell.Range - target.MoveSpeed * (spell.Delay + Player.Distance(target.PreviousPosition) / spell.Speed) + alpha) && minioncol <= colmini)
                        {
                            spell.Cast(pred.CastPosition);
                        }
                        else if (false == spell.Collision && colmini < 1 && minioncol >= 1)
                        {
                            var FirstMinion = collision.OrderBy(o => o.Distance(Player.PreviousPosition)).FirstOrDefault();
                            if (FirstMinion.PreviousPosition.Distance(pred.UnitPosition) <= BombRadius / 4)
                            {
                                spell.Cast(pred.CastPosition);
                            }
                        }
                    }
                }
            }
        }
Beispiel #8
0
 public static PredictionOutput GetP(Vector3 pos, Spell spell, AIBaseClient target, float delay, bool aoe)
 {
     return(SpellPrediction.GetPrediction(new PredictionInput
     {
         Unit = target,
         Delay = spell.Delay + delay,
         Radius = spell.Width,
         Speed = spell.Speed,
         From = pos,
         Range = spell.Range,
         Collision = spell.Collision,
         Type = spell.Type,
         RangeCheckFrom = Player.Position,
         Aoe = aoe,
     }));
 }
Beispiel #9
0
 internal static void ConeCast(this Spell spell, AIBaseClient target, HitChance SelectedHitchance, float alpha = 0f, float colmini = float.MaxValue, bool HeroOnly = false)
 {
     if (spell.Type == SkillshotType.Cone)
     {
         if (spell != null && target != null)
         {
             var pred      = SpellPrediction.GetPrediction(target, spell.Delay, spell.Width / 2, spell.Speed); //spell.Width/2
             var collision = spell.GetCollision(Player.PreviousPosition.ToVector2(), new List <Vector2> {
                 pred.CastPosition.ToVector2()
             });
             var minioncol = collision.Count(x => (HeroOnly == false ? x.IsMinion : (x is AIHeroClient)));
             if (target.IsValidTarget(spell.Range - target.MoveSpeed * (spell.Delay + Player.Distance(target.PreviousPosition) / spell.Speed) + alpha) && minioncol <= colmini && pred.Hitchance >= SelectedHitchance)
             {
                 spell.Cast(pred.CastPosition);
             }
         }
     }
 }
Beispiel #10
0
 public static bool CanHitSkillShot(AIBaseClient target, AIBaseClientProcessSpellCastEventArgs args)
 {
     if (args.Target == null && target.IsValidTarget(float.MaxValue, false))
     {
         var pred = SpellPrediction.GetPrediction(target, 0.25f).CastPosition;
         if (args.SData.LineWidth > 0)
         {
             var powCalc = Math.Pow(args.SData.LineWidth + target.BoundingRadius, 2);
             if (pred.ToVector2().DistanceSquared(args.To.ToVector2(), args.Start.ToVector2(), true) <= powCalc ||
                 target.Position.ToVector2().DistanceSquared(args.To.ToVector2(), args.Start.ToVector2(), true) <= powCalc)
             {
                 return(true);
             }
         }
         else if (target.Distance(args.To) < 50 + target.BoundingRadius ||
                  pred.Distance(args.To) < 50 + target.BoundingRadius)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #11
0
        private static void Combo()
        {
            var newtarget = TargetSelector.GetTarget(1000);

            if (newtarget == null)
            {
                return;
            }
            var targPred = SpellPrediction.GetPrediction(newtarget, 0.5f);

            if (Q.CanCast(newtarget))
            {
                Q.Cast(targPred.CastPosition);
            }
            if (W.CanCast(newtarget))
            {
                W.Cast(targPred.CastPosition);
            }
            if (R.CanCast(newtarget) && Player.HealthPercent < 50)
            {
                R.CastOnUnit(newtarget);
            }
        }
Beispiel #12
0
        private static void OnProcessSpellCast(AIBaseClient sender, AIBaseClientProcessSpellCastEventArgs args)
        {
            if (myhero.IsDead || !sender.IsEnemy || sender.IsMinion)
            {
                return;
            }

            if (args.Slot == SpellSlot.R)
            {
                switch (args.SData.CastType)
                {
                case SpellDataCastType.CircleMissile:
                    if (args.End.DistanceToPlayer() < args.SData.CastRadius - 20)
                    {
                        E.Cast();
                    }
                    break;

                case SpellDataCastType.Missile:
                    var pred = new SpellPrediction.PredictionInput();
                    pred.Type   = SkillshotType.Line;
                    pred.Range  = args.SData.CastRange;
                    pred.Speed  = args.SData.MissileSpeed;
                    pred.Radius = args.SData.LineWidth;

                    if (SpellPrediction.GetPrediction(pred).CollisionObjects.Contains(myhero))
                    {
                        E.Cast();
                    }
                    break;
                }
            }
            else if (args.Target == myhero)
            {
                E.Cast();
            }
        }
Beispiel #13
0
        private void Orbwalker_OnAction(object sender, OrbwalkerActionArgs args)
        {
            if (args.Type == OrbwalkerType.BeforeAttack)
            {
                var q = Config[Player.CharacterName]["QConfig"];
                if (!Q.IsReady() || !q.GetValue <MenuBool>("autoQ").Enabled || !FishBoneActive)
                {
                    return;
                }

                var t = args.Target as AIHeroClient;

                if (t != null)
                {
                    var realDistance = GetRealDistance(t) - 50;
                    if (Combo && (realDistance < GetRealPowPowRange(t) || (Player.Mana < RMANA + QMANA + QMANA && Player.GetAutoAttackDamage(t) * 3 < t.Health)))
                    {
                        Q.Cast();
                    }
                    else if (Harass && q.GetValue <MenuBool>("Qharass").Enabled&& (realDistance > bonusRange() || realDistance < GetRealPowPowRange(t) || Player.Mana < RMANA + EMANA + WMANA + WMANA))
                    {
                        Q.Cast();
                    }
                }

                var minion = args.Target as AIMinionClient;

                if (LaneClear && minion != null)
                {
                    var realDistance = GetRealDistance(minion);
                    if (realDistance < GetRealPowPowRange(minion) || Player.ManaPercent < Config[Player.CharacterName]["farm"].GetValue <MenuSlider>("LCMana").Value)
                    {
                        Q.Cast();
                    }
                    else if (GameObjects.EnemyHeroes.Any(tar => tar.IsValidTarget(1000) && args.Target.Distance(SpellPrediction.GetPrediction(tar, 0.25f).CastPosition) < 200))
                    {
                        Q.Cast();
                    }
                }
            }
        }
Beispiel #14
0
 private float GetRealDistance(AIBaseClient target)
 {
     return(Player.PreviousPosition.Distance(SpellPrediction.GetPrediction(target, 0.05f).CastPosition) + Player.BoundingRadius + target.BoundingRadius);
 }
        public static void CastSpell(Spell QWER, AIBaseClient target)
        {
            var predIndex = 0;
            var hitchance = HitChance.Low;

            if (QWER.Slot == SpellSlot.Q)
            {
                predIndex = Config["predmode"].GetValue <MenuList <string> >("Qpred").Index;
                var QHitChance = Config["predmode"].GetValue <MenuList <string> >("QHitChance").Index;
                if (QHitChance == 0)
                {
                    hitchance = HitChance.VeryHigh;
                }
                else if (QHitChance == 1)
                {
                    hitchance = HitChance.High;
                }
                else if (QHitChance == 2)
                {
                    hitchance = HitChance.Medium;
                }
            }
            else if (QWER.Slot == SpellSlot.W)
            {
                predIndex = Config["predmode"].GetValue <MenuList <string> >("Wpred").Index;
                var WHitChance = Config["predmode"].GetValue <MenuList <string> >("WHitChance").Index;
                if (WHitChance == 0)
                {
                    hitchance = HitChance.VeryHigh;
                }
                else if (WHitChance == 1)
                {
                    hitchance = HitChance.High;
                }
                else if (WHitChance == 2)
                {
                    hitchance = HitChance.Medium;
                }
            }
            else if (QWER.Slot == SpellSlot.E)
            {
                predIndex = Config["predmode"].GetValue <MenuList <string> >("Epred").Index;
                var EHitChance = Config["predmode"].GetValue <MenuList <string> >("EHitChance").Index;
                if (EHitChance == 0)
                {
                    hitchance = HitChance.VeryHigh;
                }
                else if (EHitChance == 1)
                {
                    hitchance = HitChance.High;
                }
                else if (EHitChance == 2)
                {
                    hitchance = HitChance.Medium;
                }
            }
            else if (QWER.Slot == SpellSlot.R)
            {
                predIndex = Config["predmode"].GetValue <MenuList <string> >("Rpred").Index;
                var RHitChance = Config["predmode"].GetValue <MenuList <string> >("RHitChance").Index;
                if (RHitChance == 0)
                {
                    hitchance = HitChance.VeryHigh;
                }
                else if (RHitChance == 1)
                {
                    hitchance = HitChance.High;
                }
                else if (RHitChance == 2)
                {
                    hitchance = HitChance.Medium;
                }
            }

            if (predIndex == 3)
            {
                if (QWER.Type == SkillshotType.Circle)
                {
                    Core.PredictionAio.CCast(QWER, target, hitchance);
                }
                else if (QWER.Type == SkillshotType.Line)
                {
                    Core.PredictionAio.LCast(QWER, target, hitchance);
                }
                else if (QWER.Type == SkillshotType.Cone)
                {
                    Core.PredictionAio.ConeCast(QWER, target, hitchance);
                }
                else
                {
                    QWER.CastIfHitchanceMinimum(target, hitchance);
                }
            }
            else if (predIndex == 2)
            {
                if (target is AIHeroClient)
                {
                    QWER.SPredictionCast(target as AIHeroClient, hitchance);
                }
                else
                {
                    QWER.CastIfHitchanceMinimum(target, hitchance);
                }
            }
            else if (predIndex == 1)
            {
                var aoe = false;

                if (QWER.Type == SkillshotType.Circle)
                {
                    aoe = true;
                }

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

                var predInput = new SpellPrediction.PredictionInput
                {
                    Aoe            = aoe,
                    Collision      = QWER.Collision,
                    Speed          = QWER.Speed,
                    Delay          = QWER.Delay,
                    Range          = QWER.Range,
                    From           = Player.PreviousPosition,
                    RangeCheckFrom = Player.PreviousPosition,
                    Radius         = QWER.Width,
                    Unit           = target,
                    Type           = QWER.Type
                };

                var predOutput = SpellPrediction.GetPrediction(predInput);

                if (QWER.Speed != float.MaxValue && OktwCommon.CollisionYasuo(Player.PreviousPosition, predOutput.CastPosition))
                {
                    return;
                }

                if (predOutput.Hitchance >= hitchance)
                {
                    QWER.Cast(predOutput.CastPosition);
                }

                if (Game.Time - DrawSpellTime > 0.5)
                {
                    DrawSpell     = QWER;
                    DrawSpellTime = Game.Time;
                }

                DrawSpellPos = predOutput;
            }
            else if (predIndex == 0)
            {
                QWER.CastIfHitchanceMinimum(target, hitchance);
            }
        }
Beispiel #16
0
        private static void Harass()
        {
            if (HarassOption.HasEnouguMana())
            {
                if (HarassOption.UseQ && Q.IsReady())
                {
                    var target = HarassOption.GetTarget(Q.Range + 300);

                    if (target.IsValidTarget(Q.Range))
                    {
                        Q.Cast(target);
                    }
                    else if (target.IsValidTarget(Q.Range + 300) && HarassOption.GetBool("HarassQMinion").Enabled)
                    {
                        if (Me.HasBuff("JhinPassiveReload") || !Me.HasBuff("JhinPassiveReload") &&
                            Me.CountEnemyHeroesInRange(Me.AttackRange + Me.BoundingRadius) == 0)
                        {
                            var qPred =
                                SpellPrediction.GetPrediction(new SpellPrediction.PredictionInput {
                                Unit = target, Delay = 0.25f
                            });
                            var bestQMinion =
                                GameObjects.EnemyMinions.Where(x => x.IsValidTarget(300, true, qPred.CastPosition) && x.MaxHealth > 5)
                                .Where(x => x.IsValidTarget(Q.Range))
                                .OrderBy(x => x.Distance(target))
                                .ThenBy(x => x.Health)
                                .FirstOrDefault();

                            if (bestQMinion != null && bestQMinion.IsValidTarget(Q.Range))
                            {
                                Q.CastOnUnit(bestQMinion);
                            }
                        }
                    }
                }

                if (HarassOption.UseE && E.IsReady() && Variables.GameTimeTickCount - lastETime > 2500 && !isAttacking)
                {
                    var target = HarassOption.GetTarget(E.Range);

                    if (target.IsValidTarget(E.Range))
                    {
                        var ePred = E.GetPrediction(target);

                        if (ePred.Hitchance >= HitChance.High)
                        {
                            E.Cast(ePred.CastPosition);
                        }
                    }
                }

                if (HarassOption.UseW && W.IsReady())
                {
                    var target = HarassOption.GetTarget(1500);

                    if (target.IsValidTarget(W.Range))
                    {
                        if (HarassOption.GetBool("HarassWOnly").Enabled&& !HasPassive(target))
                        {
                            return;
                        }

                        var wPred = W.GetPrediction(target);

                        if (wPred.Hitchance >= HitChance.High)
                        {
                            W.Cast(wPred.UnitPosition);
                        }
                    }
                }
            }
        }
Beispiel #17
0
        private static void Combo()
        {
            if (R.Name == "JhinRShot")
            {
                return;
            }

            if (ComboOption.UseW && W.IsReady())
            {
                var target = MyTargetSelector.GetTarget(W.Range);

                if (target != null && target.IsValidTarget(W.Range))
                {
                    if (ComboOption.GetBool("ComboWOnly").Enabled)
                    {
                        if (HasPassive(target))
                        {
                            var wPred = W.GetPrediction(target);

                            if (wPred.Hitchance >= HitChance.High)
                            {
                                W.Cast(wPred.UnitPosition);
                            }
                        }
                    }
                    else
                    {
                        var wPred = W.GetPrediction(target);

                        if (wPred.Hitchance >= HitChance.High)
                        {
                            W.Cast(wPred.UnitPosition);
                        }
                    }
                }
            }

            if (ComboOption.UseQ && Q.IsReady())
            {
                var target  = MyTargetSelector.GetTarget(Q.Range + 300);
                var qTarget = MyTargetSelector.GetTarget(Q.Range);

                if (qTarget.IsValidTarget(Q.Range) && !Orbwalker.CanAttack())
                {
                    Q.Cast(qTarget);
                }
                else if (target.IsValidTarget(Q.Range + 300) && ComboOption.GetBool("ComboQMinion").Enabled)
                {
                    if (Me.HasBuff("JhinPassiveReload") || !Me.HasBuff("JhinPassiveReload") &&
                        Me.CountEnemyHeroesInRange(Me.AttackRange + Me.BoundingRadius) == 0)
                    {
                        var qPred =
                            SpellPrediction.GetPrediction(new SpellPrediction.PredictionInput {
                            Unit = target, Delay = 0.25f
                        });
                        var bestQMinion =
                            GameObjects.EnemyMinions.Where(x => x.IsValidTarget(300, true, qPred.CastPosition) && x.MaxHealth > 5)
                            .Where(x => x.IsValidTarget(Q.Range))
                            .OrderBy(x => x.Distance(target))
                            .ThenBy(x => x.Health)
                            .FirstOrDefault();

                        if (bestQMinion != null && bestQMinion.IsValidTarget(Q.Range))
                        {
                            Q.CastOnUnit(bestQMinion);
                        }
                    }
                }
            }

            if (ComboOption.UseE && E.IsReady() && Variables.GameTimeTickCount - lastETime > 2500 && !isAttacking)
            {
                var target = MyTargetSelector.GetTarget(E.Range);

                if (target != null && target.IsValidTarget(E.Range))
                {
                    if (!target.CanMoveMent())
                    {
                        E.Cast(target.PreviousPosition);
                    }
                    else
                    {
                        var ePred = E.GetPrediction(target);

                        if (ePred.Hitchance >= HitChance.High)
                        {
                            E.Cast(ePred.CastPosition);
                        }
                    }
                }
            }
        }