コード例 #1
0
 void Harass()
 {
     if (getCheckBoxItem(harass, "UseQHarass") && Q.IsReady())
     {
         var enemy = TargetSelector.GetTarget(Q.Range, DamageType.Physical);
         if (enemy.IsValidEnemy())
         {
             Q.Cast(enemy);
         }
     }
     if (getCheckBoxItem(harass, "UseWHarass") && W.IsReady())
     {
         AIHeroClient target    = TargetSelector.GetTarget(950, DamageType.Physical);
         var          autoWI    = getCheckBoxItem(harass, "Harass.AutoWI");
         var          autoWD    = getCheckBoxItem(harass, "Harass.AutoWD");
         var          hitchance = HarassHitChance(Config);
         if (target != null && W.IsReady())
         {
             if (!EvolvedW && Khazix.LSDistance(target) <= W.Range)
             {
                 PredictionOutput predw = W.GetPrediction(target);
                 if (predw.Hitchance == hitchance)
                 {
                     W.Cast(predw.CastPosition);
                 }
             }
             else if (EvolvedW && target.LSIsValidTarget(W.Range))
             {
                 PredictionOutput pred = WE.GetPrediction(target);
                 if ((pred.Hitchance == HitChance.Immobile && autoWI) || (pred.Hitchance == HitChance.Dashing && autoWD) || pred.Hitchance >= hitchance)
                 {
                     CastWE(target, pred.UnitPosition.LSTo2D(), 0, hitchance);
                 }
             }
         }
     }
 }
コード例 #2
0
        void Combo()
        {
            AIHeroClient target = null;

            if (SpellSlot.E.IsReady() && SpellSlot.Q.IsReady())
            {
                target = TargetSelector.GetTarget((E.Range + Q.Range) * 0.95f, DamageType.Physical);
            }

            if (target == null)
            {
                target = TargetSelector.GetTarget(W.Range, DamageType.Physical);
            }

            if ((target != null) && target.IsVisible && target.IsHPBarRendered)
            {
                var dist = Khazix.LSDistance(target);

                // Normal abilities

                if (Q.IsReady() && !Jumping && getCheckBoxItem(combo, "UseQCombo"))
                {
                    if (dist <= Q.Range)
                    {
                        Q.Cast(target);
                    }
                }

                if (W.IsReady() && !EvolvedW && dist <= W.Range && getCheckBoxItem(combo, "UseWCombo"))
                {
                    var pred = W.GetPrediction(target);
                    if (pred.Hitchance >= Config.GetHitChance("WHitchance"))
                    {
                        W.Cast(pred.CastPosition);
                    }
                }

                if (E.IsReady() && !Jumping && dist <= E.Range && getCheckBoxItem(combo, "UseECombo") && dist > Q.Range + (0.7 * Khazix.MoveSpeed))
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && target.IsVisible && target.IsHPBarRendered && !target.IsDead && ShouldJump(pred.CastPosition))
                    {
                        E.Cast(pred.CastPosition);
                    }
                }

                // Use EQ AND EW Synergy
                if ((dist <= E.Range + Q.Range + (0.7 * Khazix.MoveSpeed) && dist > Q.Range && E.IsReady() &&
                     getCheckBoxItem(combo, "UseEGapclose")) || (dist <= E.Range + W.Range && dist > Q.Range && E.IsReady() && W.IsReady() &&
                                                                 getCheckBoxItem(combo, "UseEGapcloseW")))
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && target.IsVisible && target.IsHPBarRendered && !target.IsDead && ShouldJump(pred.CastPosition))
                    {
                        E.Cast(pred.CastPosition);
                    }
                    if (getCheckBoxItem(combo, "UseRGapcloseW") && R.IsReady())
                    {
                        R.CastOnUnit(Khazix);
                    }
                }


                // Ult Usage
                if (R.IsReady() && !Q.IsReady() && !W.IsReady() && !E.IsReady() &&
                    getCheckBoxItem(combo, "UseRCombo"))
                {
                    R.Cast();
                }
                // Evolved

                if (W.IsReady() && EvolvedW && dist <= WE.Range && getCheckBoxItem(combo, "UseWCombo"))
                {
                    PredictionOutput pred = WE.GetPrediction(target);
                    if (pred.Hitchance >= Config.GetHitChance("WHitchance"))
                    {
                        CastWE(target, pred.UnitPosition.LSTo2D(), 0, Config.GetHitChance("WHitchance"));
                    }
                    if (pred.Hitchance >= HitChance.Collision)
                    {
                        List <Obj_AI_Base> PCollision = pred.CollisionObjects;
                        var x = PCollision.Where(PredCollisionChar => PredCollisionChar.LSDistance(target) <= 30).FirstOrDefault();
                        if (x != null)
                        {
                            W.Cast(x.Position);
                        }
                    }
                }

                if (dist <= E.Range + (0.7 * Khazix.MoveSpeed) && dist > Q.Range &&
                    getCheckBoxItem(combo, "UseECombo") && E.IsReady())
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && target.IsVisible && target.IsHPBarRendered && !target.IsDead && ShouldJump(pred.CastPosition))
                    {
                        E.Cast(pred.CastPosition);
                    }
                }

                if (getCheckBoxItem(combo, "UseItems"))
                {
                    UseItems(target);
                }
            }
        }
コード例 #3
0
        void Waveclear()
        {
            List <Obj_AI_Minion> allMinions = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.LSIsValidTarget(W.Range) && !MinionManager.IsWard(x)).ToList();

            if (getCheckBoxItem(farm, "UseQFarm") && Q.IsReady())
            {
                var minion = Orbwalker.LastTarget as Obj_AI_Minion;
                if (minion != null && HealthPrediction.GetHealthPrediction(
                        minion, (int)(Khazix.LSDistance(minion) * 1000 / 1400)) >
                    0.35f * Khazix.GetSpellDamage(minion, SpellSlot.Q) && Khazix.LSDistance(minion) <= Q.Range)
                {
                    Q.Cast(minion);
                }
                else if (minion == null || !minion.IsValid)
                {
                    foreach (var min in allMinions.Where(x => x.LSIsValidTarget(Q.Range)))
                    {
                        if (HealthPrediction.GetHealthPrediction(
                                min, (int)(Khazix.LSDistance(min) * 1000 / 1400)) >
                            3 * Khazix.GetSpellDamage(min, SpellSlot.Q) && Khazix.LSDistance(min) <= Q.Range)
                        {
                            Q.Cast(min);
                            break;
                        }
                    }
                }
            }

            if (getCheckBoxItem(farm, "UseWFarm") && W.IsReady() && Khazix.HealthPercent <= getSliderItem(farm, "Farm.WHealth"))
            {
                var wmins = EvolvedW ? allMinions.Where(x => x.LSIsValidTarget(WE.Range)) : allMinions.Where(x => x.LSIsValidTarget(W.Range));
                MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation(wmins
                                                                                                    .Select(minion => minion.ServerPosition.LSTo2D())
                                                                                                    .ToList(), EvolvedW ? WE.Width : W.Width, EvolvedW ? WE.Range : W.Range);
                var distcheck = EvolvedW ? Khazix.LSDistance(farmLocation.Position) <= WE.Range : Khazix.LSDistance(farmLocation.Position) <= W.Range;
                if (distcheck)
                {
                    W.Cast(farmLocation.Position);
                }
            }

            if (getCheckBoxItem(farm, "UseEFarm") && E.IsReady())
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, E.Range)
                        .Select(minion => minion.ServerPosition.LSTo2D())
                        .ToList(), E.Width, E.Range);
                if (Khazix.LSDistance(farmLocation.Position) <= E.Range)
                {
                    E.Cast(farmLocation.Position);
                }
            }


            if (getCheckBoxItem(farm, "UseItemsFarm"))
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, Hydra.Range)
                        .Select(minion => minion.ServerPosition.LSTo2D())
                        .ToList(), Hydra.Range, Hydra.Range);

                if (Hydra.IsReady() && Khazix.LSDistance(farmLocation.Position) <= Hydra.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3074, Khazix);
                }
                if (Tiamat.IsReady() && Khazix.LSDistance(farmLocation.Position) <= Tiamat.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3077, Khazix);
                }
                if (Titanic.IsReady() && Khazix.LSDistance(farmLocation.Position) <= Titanic.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3748, Khazix);
                }
            }
        }
コード例 #4
0
        void LH()
        {
            List <Obj_AI_Base> allMinions = MinionManager.GetMinions(Khazix.ServerPosition, Q.Range);

            if (getCheckBoxItem(farm, "UseQFarm") && Q.IsReady())
            {
                foreach (Obj_AI_Base minion in
                         allMinions.Where(
                             minion =>
                             minion.LSIsValidTarget() &&
                             HealthPrediction.GetHealthPrediction(
                                 minion, (int)(Khazix.LSDistance(minion) * 1000 / 1400)) <
                             0.75 * Khazix.GetSpellDamage(minion, SpellSlot.Q)))
                {
                    if (Vector3.Distance(minion.ServerPosition, Khazix.ServerPosition) >
                        Orbwalking.GetRealAutoAttackRange(Khazix) && Khazix.LSDistance(minion) <= Q.Range)
                    {
                        Q.CastOnUnit(minion);
                        return;
                    }
                }
            }
            if (getCheckBoxItem(farm, "UseWFarm") && W.IsReady())
            {
                MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation(
                    MinionManager.GetMinions(Khazix.ServerPosition, W.Range).Where(minion => HealthPrediction.GetHealthPrediction(
                                                                                       minion, (int)(Khazix.LSDistance(minion) * 1000 / 1400)) <
                                                                                   0.75 * Khazix.GetSpellDamage(minion, SpellSlot.W))
                    .Select(minion => minion.ServerPosition.LSTo2D())
                    .ToList(), W.Width, W.Range);
                if (farmLocation.MinionsHit >= 1)
                {
                    if (!EvolvedW)
                    {
                        if (Khazix.LSDistance(farmLocation.Position) <= W.Range)
                        {
                            W.Cast(farmLocation.Position);
                        }
                    }

                    if (EvolvedW)
                    {
                        if (Khazix.LSDistance(farmLocation.Position) <= W.Range)
                        {
                            W.Cast(farmLocation.Position);
                        }
                    }
                }
            }

            if (getCheckBoxItem(farm, "UseEFarm") && E.IsReady())
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, E.Range).Where(minion => HealthPrediction.GetHealthPrediction(
                                                                                           minion, (int)(Khazix.LSDistance(minion) * 1000 / 1400)) <
                                                                                       0.75 * Khazix.GetSpellDamage(minion, SpellSlot.W))
                        .Select(minion => minion.ServerPosition.LSTo2D())
                        .ToList(), E.Width, E.Range);

                if (farmLocation.MinionsHit >= 1)
                {
                    if (Khazix.LSDistance(farmLocation.Position) <= E.Range)
                    {
                        E.Cast(farmLocation.Position);
                    }
                }
            }


            if (getCheckBoxItem(farm, "UseItemsFarm"))
            {
                MinionManager.FarmLocation farmLocation =
                    MinionManager.GetBestCircularFarmLocation(
                        MinionManager.GetMinions(Khazix.ServerPosition, Hydra.Range)
                        .Select(minion => minion.ServerPosition.LSTo2D())
                        .ToList(), Hydra.Range, Hydra.Range);

                if (Hydra.IsReady() && Khazix.LSDistance(farmLocation.Position) <= Hydra.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3074, Khazix);
                }
                if (Tiamat.IsReady() && Khazix.LSDistance(farmLocation.Position) <= Tiamat.Range && farmLocation.MinionsHit >= 2)
                {
                    Items.UseItem(3077, Khazix);
                }
            }
        }