Exemplo n.º 1
0
        internal void AssasinationCombo(Obj_AI_Hero target)
        {
            if ((target != null))
            {
                var dist = Khazix.Distance(target);

                // Normal abilities

                if (Q.IsReady() && dist <= Q.Range)
                {
                    Q.Cast(target);
                }

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

                else if (W.IsReady() && EvolvedW && dist <= WE.Range)
                {
                    PredictionOutput pred = WE.GetPrediction(target);
                    CastWE(target, pred.UnitPosition.To2D(), 0);
                }

                if (Config.GetBool("UseItems"))
                {
                    UseItems(target);
                }
            }
        }
Exemplo n.º 2
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.Distance(target) <= W.Range)
             {
                 PredictionOutput predw = W.GetPrediction(target);
                 if (predw.Hitchance == hitchance)
                 {
                     W.Cast(predw.CastPosition);
                 }
             }
             else if (EvolvedW && target.IsValidTarget(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.To2D(), 0, hitchance);
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
        internal void CastWE(Obj_AI_Base unit, Vector2 unitPosition, int minTargets = 0, HitChance hc = HitChance.Medium)
        {
            var points   = new List <Vector2>();
            var hitBoxes = new List <int>();

            Vector2 startPoint        = Khazix.ServerPosition.To2D();
            Vector2 originalDirection = W.Range * (unitPosition - startPoint).Normalized();

            foreach (AIHeroClient enemy in HeroManager.Enemies)
            {
                if (enemy.IsValidTarget() && enemy.NetworkId != unit.NetworkId)
                {
                    PredictionOutput pos = WE.GetPrediction(enemy);
                    if (pos.Hitchance >= hc)
                    {
                        points.Add(pos.UnitPosition.To2D());
                        hitBoxes.Add((int)enemy.BoundingRadius + 275);
                    }
                }
            }

            var posiblePositions = new List <Vector2>();

            for (int i = 0; i < 3; i++)
            {
                if (i == 0)
                {
                    posiblePositions.Add(unitPosition + originalDirection.Rotated(0));
                }
                if (i == 1)
                {
                    posiblePositions.Add(startPoint + originalDirection.Rotated(Wangle));
                }
                if (i == 2)
                {
                    posiblePositions.Add(startPoint + originalDirection.Rotated(-Wangle));
                }
            }


            if (startPoint.Distance(unitPosition) < 900)
            {
                for (int i = 0; i < 3; i++)
                {
                    Vector2 pos       = posiblePositions[i];
                    Vector2 direction = (pos - startPoint).Normalized().Perpendicular();
                    float   k         = (2 / 3 * (unit.BoundingRadius + W.Width));
                    posiblePositions.Add(startPoint - k * direction);
                    posiblePositions.Add(startPoint + k * direction);
                }
            }

            var bestPosition = new Vector2();
            int bestHit      = -1;

            foreach (Vector2 position in posiblePositions)
            {
                int hits = CountHits(position, points, hitBoxes);
                if (hits > bestHit)
                {
                    bestPosition = position;
                    bestHit      = hits;
                }
            }

            if (bestHit + 1 <= minTargets)
            {
                return;
            }

            W.Cast(bestPosition.To3D(), false);
        }
Exemplo n.º 4
0
        void KillSteal()
        {
            AIHeroClient target = HeroList
                                  .Where(x => x.IsValidTarget() && x.Distance(Khazix.Position) < 1375f && !x.IsZombie)
                                  .MinOrDefault(x => x.Health);

            if (target != null && target.IsInRange(600))
            {
                if (getCheckBoxItem(safety, "Safety.autoescape") && !IsHealthy)
                {
                    var ally =
                        HeroList.FirstOrDefault(h => h.HealthPercent > 40 && h.CountEnemiesInRange(400) == 0 && !h.ServerPosition.PointUnderEnemyTurret());
                    if (ally != null && ally.IsValid)
                    {
                        E.Cast(ally.ServerPosition);
                        return;
                    }
                    var objAiturret = EnemyTurretPositions.Where(x => Vector3.Distance(Khazix.ServerPosition, x) <= 900f);
                    if (objAiturret.Any() || Khazix.CountEnemiesInRange(500) >= 1)
                    {
                        var bestposition = Khazix.ServerPosition.LSExtend(NexusPosition, E.Range);
                        E.Cast(bestposition);
                        return;
                    }
                }

                if (getCheckBoxItem(ks, "UseQKs") && Q.IsReady() &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= Q.Range)
                {
                    double QDmg = GetQDamage(target);
                    if (!Jumping && target.Health <= QDmg)
                    {
                        Q.Cast(target);
                        return;
                    }
                }

                if (getCheckBoxItem(ks, "UseEKs") && E.IsReady() && !Jumping &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= E.Range && Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) > Q.Range)
                {
                    double EDmg = Khazix.GetSpellDamage(target, SpellSlot.E);
                    if (!Jumping && target.Health < EDmg)
                    {
                        LeagueSharp.Common.Utility.DelayAction.Add(
                            Game.Ping + getSliderItem(ks, "Edelay"), delegate
                        {
                            PredictionOutput pred = E.GetPrediction(target);
                            if (target.IsValid && !target.IsDead)
                            {
                                if (getCheckBoxItem(ks, "Ksbypass") || ShouldJump(pred.CastPosition))
                                {
                                    E.Cast(pred.CastPosition);
                                }
                            }
                        });
                    }
                }

                if (W.IsReady() && !EvolvedW && Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= W.Range &&
                    getCheckBoxItem(ks, "UseWKs"))
                {
                    double WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    if (target.Health <= WDmg)
                    {
                        var pred = W.GetPrediction(target);
                        if (pred.Hitchance >= HitChance.Medium)
                        {
                            W.Cast(pred.CastPosition);
                            return;
                        }
                    }
                }

                if (W.IsReady() && EvolvedW &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= W.Range &&
                    getCheckBoxItem(ks, "UseWKs"))
                {
                    double           WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    PredictionOutput pred = WE.GetPrediction(target);
                    if (target.Health <= WDmg && pred.Hitchance >= HitChance.Medium)
                    {
                        CastWE(target, pred.UnitPosition.To2D(), 0, Config.GetHitChance("WHitchance"));
                        return;
                    }

                    if (pred.Hitchance >= HitChance.Collision)
                    {
                        List <Obj_AI_Base> PCollision = pred.CollisionObjects;
                        var x =
                            PCollision
                            .FirstOrDefault(PredCollisionChar => Vector3.Distance(PredCollisionChar.ServerPosition, target.ServerPosition) <= 30);
                        if (x != null)
                        {
                            W.Cast(x.Position);
                            return;
                        }
                    }
                }


                // Mixed's EQ KS
                if (Q.IsReady() && E.IsReady() &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= E.Range + Q.Range &&
                    getCheckBoxItem(ks, "UseEQKs"))
                {
                    double QDmg = GetQDamage(target);
                    double EDmg = Khazix.GetSpellDamage(target, SpellSlot.E);
                    if ((target.Health <= QDmg + EDmg))
                    {
                        LeagueSharp.Common.Utility.DelayAction.Add(getSliderItem(ks, "Edelay"), delegate
                        {
                            PredictionOutput pred = E.GetPrediction(target);
                            if (target.IsValidTarget() && !target.IsZombie && ShouldJump(pred.CastPosition))
                            {
                                if (getCheckBoxItem(ks, "Ksbypass") || ShouldJump(pred.CastPosition))
                                {
                                    E.Cast(pred.CastPosition);
                                }
                            }
                        });
                    }
                }

                // MIXED EW KS
                if (W.IsReady() && E.IsReady() && !EvolvedW &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= W.Range + E.Range &&
                    getCheckBoxItem(ks, "UseEWKs"))
                {
                    double WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    if (target.Health <= WDmg)
                    {
                        LeagueSharp.Common.Utility.DelayAction.Add(getSliderItem(ks, "Edelay"), delegate
                        {
                            PredictionOutput pred = E.GetPrediction(target);
                            if (target.IsValid && !target.IsDead && ShouldJump(pred.CastPosition))
                            {
                                if (getCheckBoxItem(ks, "Ksbypass") || ShouldJump(pred.CastPosition))
                                {
                                    E.Cast(pred.CastPosition);
                                }
                            }
                        });
                    }
                }

                if (Tiamat.IsReady() &&
                    Vector2.Distance(Khazix.ServerPosition.To2D(), target.ServerPosition.To2D()) <= Tiamat.Range &&
                    getCheckBoxItem(ks, "UseTiamatKs"))
                {
                    double Tiamatdmg = Khazix.GetItemDamage(target, LeagueSharp.Common.Damage.DamageItems.Tiamat);
                    if (target.Health <= Tiamatdmg)
                    {
                        Tiamat.Cast();
                        return;
                    }
                }
                if (Hydra.IsReady() &&
                    Vector2.Distance(Khazix.ServerPosition.To2D(), target.ServerPosition.To2D()) <= Hydra.Range &&
                    getCheckBoxItem(ks, "UseTiamatKs"))
                {
                    double hydradmg = Khazix.GetItemDamage(target, LeagueSharp.Common.Damage.DamageItems.Hydra);
                    if (target.Health <= hydradmg)
                    {
                        Hydra.Cast();
                    }
                }
            }
        }
Exemplo n.º 5
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))
            {
                var dist = Khazix.Distance(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.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.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.To2D(), 0, Config.GetHitChance("WHitchance"));
                    }
                    if (pred.Hitchance >= HitChance.Collision)
                    {
                        List <Obj_AI_Base> PCollision = pred.CollisionObjects;
                        var x = PCollision.Where(PredCollisionChar => PredCollisionChar.Distance(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.IsDead && ShouldJump(pred.CastPosition))
                    {
                        E.Cast(pred.CastPosition);
                    }
                }

                if (getCheckBoxItem(combo, "UseItems"))
                {
                    UseItems(target);
                }
            }
        }
Exemplo n.º 6
0
        void KillSteal()
        {
            //Avoid interrupting our assasination attempt
            if (jumpManager.MidAssasination)
            {
                return;
            }

            Obj_AI_Hero target = HeroList
                                 .Where(x => x.IsValidTarget() && x.Distance(Khazix.Position) < 1375f && !x.IsZombie)
                                 .MinOrDefault(x => x.Health);

            if (target != null)
            {
                if (Config.GetBool("UseIgnite") && Ignite.IsReady() && target.IsInRange(Ignite.Range))
                {
                    double igniteDmg = Khazix.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
                    if (igniteDmg > target.Health)
                    {
                        Ignite.Cast(target);
                        return;
                    }
                }

                if (Config.GetBool("UseQKs") && Q.IsReady() &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= Q.Range)
                {
                    double QDmg = GetQDamage(target);
                    if (!Jumping && target.Health <= QDmg)
                    {
                        Q.Cast(target);
                        return;
                    }
                }

                if (Config.GetBool("UseEKs") && E.IsReady() && !Jumping &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= E.Range && Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) > Q.Range)
                {
                    double EDmg = Khazix.GetSpellDamage(target, SpellSlot.E);
                    if (!Jumping && target.Health < EDmg)
                    {
                        Utility.DelayAction.Add(
                            Game.Ping + Config.GetSlider("EDelay"), delegate
                        {
                            var jump = GetJumpPosition(target);
                            if (jump.shouldJump)
                            {
                                if (target.IsValid && !target.IsDead)
                                {
                                    E.Cast(jump.position);
                                }
                            }
                        });
                    }
                }

                if (W.IsReady() && !EvolvedW && Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= W.Range &&
                    Config.GetBool("UseWKs"))
                {
                    double WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    if (target.Health <= WDmg)
                    {
                        var pred = W.GetPrediction(target);
                        if (pred.Hitchance >= HitChance.Medium)
                        {
                            W.Cast(pred.CastPosition);
                            return;
                        }
                    }
                }

                if (W.IsReady() && EvolvedW &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= W.Range &&
                    Config.GetBool("UseWKs"))
                {
                    double           WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    PredictionOutput pred = WE.GetPrediction(target);
                    if (target.Health <= WDmg && pred.Hitchance >= HitChance.Medium)
                    {
                        CastWE(target, pred.UnitPosition.To2D(), 0, Config.GetHitChance("WHitchance"));
                        return;
                    }

                    if (pred.Hitchance >= HitChance.Collision)
                    {
                        List <Obj_AI_Base> PCollision = pred.CollisionObjects;
                        var x =
                            PCollision
                            .FirstOrDefault(PredCollisionChar => Vector3.Distance(PredCollisionChar.ServerPosition, target.ServerPosition) <= 30);
                        if (x != null)
                        {
                            W.Cast(x.Position);
                            return;
                        }
                    }
                }


                // Mixed's EQ KS
                if (Q.IsReady() && E.IsReady() &&
                    target.IsValidEnemy(0.90f * (E.Range + Q.Range)) &&
                    Config.GetBool("UseEQKs"))
                {
                    double QDmg = GetQDamage(target);
                    double EDmg = Khazix.GetSpellDamage(target, SpellSlot.E);
                    if ((target.Health <= QDmg + EDmg))
                    {
                        Utility.DelayAction.Add(Config.GetSlider("EDelay"), delegate
                        {
                            var jump = GetJumpPosition(target);
                            if (jump.shouldJump)
                            {
                                E.Cast(jump.position);
                            }
                        });
                    }
                }

                // MIXED EW KS
                if (W.IsReady() && E.IsReady() && !EvolvedW &&
                    target.IsValidEnemy(W.Range + E.Range) &&
                    Config.GetBool("UseEWKs"))
                {
                    double WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    if (target.Health <= WDmg)
                    {
                        Utility.DelayAction.Add(Config.GetSlider("EDelay"), delegate
                        {
                            var jump = GetJumpPosition(target);
                            if (jump.shouldJump)
                            {
                                E.Cast(jump.position);
                            }
                        });
                    }
                }

                if (Tiamat.IsReady() &&
                    Vector2.Distance(Khazix.ServerPosition.To2D(), target.ServerPosition.To2D()) <= Tiamat.Range &&
                    Config.GetBool("UseTiamatKs"))
                {
                    double Tiamatdmg = Khazix.GetItemDamage(target, Damage.DamageItems.Tiamat);
                    if (target.Health <= Tiamatdmg)
                    {
                        Tiamat.Cast();
                        return;
                    }
                }

                if (Config.GetBool("UseSmiteKs"))
                {
                    if (SmiteManager.CanCast(target))
                    {
                        var dmg = SmiteManager.GetSmiteDamage(target);
                        if (dmg >= target.Health)
                        {
                            SmiteManager.Cast(target);
                        }
                    }
                }

                if (Hydra.IsReady() &&
                    Vector2.Distance(Khazix.ServerPosition.To2D(), target.ServerPosition.To2D()) <= Hydra.Range &&
                    Config.GetBool("UseTiamatKs"))
                {
                    double hydradmg = Khazix.GetItemDamage(target, Damage.DamageItems.Hydra);
                    if (target.Health <= hydradmg)
                    {
                        Hydra.Cast();
                    }
                }
            }
        }
Exemplo n.º 7
0
        void Combo()
        {
            Obj_AI_Hero target = null;

            TargetSelector.TargetSelectionConditionDelegate conditions = targ => targ.IsIsolated() || targ.Health <= GetBurstDamage(targ);

            float targetSelectionRange = Khazix.AttackRange;

            if (SpellSlot.Q.IsReady())
            {
                targetSelectionRange += Q.Range;
            }

            if (SpellSlot.E.IsReady())
            {
                targetSelectionRange += E.Range;
            }

            else if (SpellSlot.W.IsReady())
            {
                targetSelectionRange += W.Range;
            }

            //Get Optimal target if available
            target = TargetSelector.GetTarget(targetSelectionRange, TargetSelector.DamageType.Physical, true, null, null, conditions);

            //If could not find then settle for anything
            if (target == null)
            {
                target = TargetSelector.GetTarget(targetSelectionRange, TargetSelector.DamageType.Physical, true, null, null);
            }

            //If a target has been found
            if ((target != null && target.IsValidEnemy()))
            {
                var dist = Khazix.Distance(target.ServerPosition);

                // Normal abilities

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

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

                if (Config.GetBool("UseECombo") && E.IsReady() && !Jumping && dist <= E.Range && dist > Q.Range + (0.4 * Khazix.MoveSpeed))
                {
                    var jump = GetJumpPosition(target);
                    if (jump.shouldJump)
                    {
                        E.Cast(jump.position);
                    }
                }

                // Use EQ
                if ((Config.GetBool("UseEGapcloseQ") && Q.IsReady() && E.IsReady() && dist > Q.Range + (0.4 * Khazix.MoveSpeed) && dist <= E.Range + Q.Range))
                {
                    var jump = GetJumpPosition(target);
                    if (jump.shouldJump)
                    {
                        E.Cast(jump.position);
                    }
                    if (Config.GetBool("UseRGapcloseL") && R.IsReady())
                    {
                        R.CastOnUnit(Khazix);
                    }
                }


                // Ult Usage
                if (R.IsReady() && !Q.IsReady() && !W.IsReady() && !E.IsReady() &&
                    Config.GetBool("UseRCombo") && Khazix.CountEnemiesInRange(500) > 0)
                {
                    R.Cast();
                }

                // Evolved

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


                if (Config.GetBool("Combo.Smite"))
                {
                    if (SmiteManager.CanCast(target))
                    {
                        SmiteManager.Cast(target);
                    }
                }

                if (Config.GetBool("UseItems"))
                {
                    UseItems(target);
                }
            }
        }
Exemplo n.º 8
0
        void KillSteal()
        {
            Obj_AI_Hero target = HeroList
                                 .Where(x => x.IsValidTarget() && x.Distance(Khazix.Position) < 1375f && !x.IsZombie)
                                 .MinOrDefault(x => x.Health);

            if (target != null && target.IsInRange(Ignite.Range))
            {
                if (Config.GetBool("UseIgnite") && IgniteSlot != SpellSlot.Unknown &&
                    Khazix.Spellbook.CanUseSpell(IgniteSlot) == SpellState.Ready)
                {
                    double igniteDmg = Khazix.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
                    if (igniteDmg > target.Health)
                    {
                        Khazix.Spellbook.CastSpell(IgniteSlot, target);
                        return;
                    }
                }

                if (Config.GetBool("Safety.autoescape") && !IsHealthy)
                {
                    var ally =
                        HeroList.FirstOrDefault(h => h.HealthPercent > 40 && h.CountEnemiesInRange(400) == 0 && !h.ServerPosition.PointUnderEnemyTurret());
                    if (ally != null && ally.IsValid)
                    {
                        E.Cast(ally.ServerPosition);
                        return;
                    }
                    var underTurret = EnemyTurrets.Any(x => x.Distance(Khazix.ServerPosition) <= 900f && !x.IsDead && x.IsValid);
                    if (underTurret || Khazix.CountEnemiesInRange(500) >= 1)
                    {
                        var bestposition = Khazix.ServerPosition.Extend(NexusPosition, E.Range);
                        E.Cast(bestposition);
                        return;
                    }
                }

                if (Config.GetBool("UseQKs") && Q.IsReady() &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= Q.Range)
                {
                    double QDmg = GetQDamage(target);
                    if (!Jumping && target.Health <= QDmg)
                    {
                        Q.Cast(target);
                        return;
                    }
                }

                if (Config.GetBool("UseEKs") && E.IsReady() && !Jumping &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= E.Range && Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) > Q.Range)
                {
                    double EDmg = Khazix.GetSpellDamage(target, SpellSlot.E);
                    if (!Jumping && target.Health < EDmg)
                    {
                        Utility.DelayAction.Add(
                            Game.Ping + Config.GetSlider("EDelay"), delegate
                        {
                            PredictionOutput pred = E.GetPrediction(target);
                            if (target.IsValid && !target.IsDead)
                            {
                                if (Config.GetBool("Ksbypass") || ShouldJump(pred.CastPosition))
                                {
                                    E.Cast(pred.CastPosition);
                                }
                            }
                        });
                    }
                }

                if (W.IsReady() && !EvolvedW && Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= W.Range &&
                    Config.GetBool("UseWKs"))
                {
                    double WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    if (target.Health <= WDmg)
                    {
                        var pred = W.GetPrediction(target);
                        if (pred.Hitchance >= HitChance.Medium)
                        {
                            W.Cast(pred.CastPosition);
                            return;
                        }
                    }
                }

                if (W.IsReady() && EvolvedW &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= W.Range &&
                    Config.GetBool("UseWKs"))
                {
                    double           WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    PredictionOutput pred = WE.GetPrediction(target);
                    if (target.Health <= WDmg && pred.Hitchance >= HitChance.Medium)
                    {
                        CastWE(target, pred.UnitPosition.To2D(), 0, Config.GetHitChance("WHitchance"));
                        return;
                    }

                    if (pred.Hitchance >= HitChance.Collision)
                    {
                        List <Obj_AI_Base> PCollision = pred.CollisionObjects;
                        var x =
                            PCollision
                            .FirstOrDefault(PredCollisionChar => Vector3.Distance(PredCollisionChar.ServerPosition, target.ServerPosition) <= 30);
                        if (x != null)
                        {
                            W.Cast(x.Position);
                            return;
                        }
                    }
                }


                // Mixed's EQ KS
                if (Q.IsReady() && E.IsReady() &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= E.Range + Q.Range &&
                    Config.GetBool("UseEQKs"))
                {
                    double QDmg = GetQDamage(target);
                    double EDmg = Khazix.GetSpellDamage(target, SpellSlot.E);
                    if ((target.Health <= QDmg + EDmg))
                    {
                        Utility.DelayAction.Add(Config.GetSlider("EDelay"), delegate
                        {
                            PredictionOutput pred = E.GetPrediction(target);
                            if (target.IsValidTarget() && !target.IsZombie && ShouldJump(pred.CastPosition))
                            {
                                if (Config.GetBool("Ksbypass") || ShouldJump(pred.CastPosition))
                                {
                                    E.Cast(pred.CastPosition);
                                }
                            }
                        });
                    }
                }

                // MIXED EW KS
                if (W.IsReady() && E.IsReady() && !EvolvedW &&
                    Vector3.Distance(Khazix.ServerPosition, target.ServerPosition) <= W.Range + E.Range &&
                    Config.GetBool("UseEWKs"))
                {
                    double WDmg = Khazix.GetSpellDamage(target, SpellSlot.W);
                    if (target.Health <= WDmg)
                    {
                        Utility.DelayAction.Add(Config.GetSlider("EDelay"), delegate
                        {
                            PredictionOutput pred = E.GetPrediction(target);
                            if (target.IsValid && !target.IsDead && ShouldJump(pred.CastPosition))
                            {
                                if (Config.GetBool("Ksbypass") || ShouldJump(pred.CastPosition))
                                {
                                    E.Cast(pred.CastPosition);
                                }
                            }
                        });
                    }
                }

                if (Tiamat.IsReady() &&
                    Vector2.Distance(Khazix.ServerPosition.To2D(), target.ServerPosition.To2D()) <= Tiamat.Range &&
                    Config.GetBool("UseTiamatKs"))
                {
                    double Tiamatdmg = Khazix.GetItemDamage(target, Damage.DamageItems.Tiamat);
                    if (target.Health <= Tiamatdmg)
                    {
                        Tiamat.Cast();
                        return;
                    }
                }
                if (Hydra.IsReady() &&
                    Vector2.Distance(Khazix.ServerPosition.To2D(), target.ServerPosition.To2D()) <= Hydra.Range &&
                    Config.GetBool("UseTiamatKs"))
                {
                    double hydradmg = Khazix.GetItemDamage(target, Damage.DamageItems.Hydra);
                    if (target.Health <= hydradmg)
                    {
                        Hydra.Cast();
                    }
                }
            }
        }
Exemplo n.º 9
0
        private static void Combo()
        {
            if (Player.IsDead)
            {
                return;
            }
            var         usePacket    = Config.Item("usePackets").GetValue <bool>();
            var         isolatedlist = GetIsolatedTargets();
            HitChance   hitchance    = HarassHitChance();
            Obj_AI_Hero target       = new Obj_AI_Hero();

            if (isolatedlist != null && isolatedlist.Any())
            {
                var isolated = isolatedlist.OrderByDescending(
                    hero =>
                    Player.CalcDamage(hero, Damage.DamageType.Physical, 100) / (1 + hero.Health) *
                    TargetSelector.GetPriority(hero)).FirstOrDefault();

                target = isolated;
                isolatedlist.Clear();
            }
            else
            {
                target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
            }

            if (target == null || !target.IsValid || !target.IsEnemy || target.IsDead || Player.Distance(target) > E.Range + 100)
            {
                target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
            }


            if ((target != null))
            {
                // Normal abilities
                if (Player.Distance(target) <= Q.Range && Config.Item("UseQCombo").GetValue <bool>() &&
                    Q.IsReady())
                {
                    Orbwalker.SetAttack(false);
                    Q.Cast(target, usePacket);
                    Orbwalker.SetAttack(true);
                }
                if (Wnorm && Player.Distance(target) <= W.Range && Config.Item("UseWCombo").GetValue <bool>() &&
                    W.IsReady() && W.GetPrediction(target).Hitchance >= hitchance)
                {
                    PredictionOutput pred = W.GetPrediction(target);
                    W.Cast(pred.CastPosition, usePacket);
                }

                if (Player.Distance(target) <= E.Range && Config.Item("UseECombo").GetValue <bool>() &&
                    E.IsReady() && Player.Distance(target) > Q.Range)
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead)
                    {
                        E.Cast(pred.CastPosition, usePacket);
                    }
                }

                // Use EQ AND EW Synergy
                if ((Player.Distance(target) <= E.Range + Q.Range && Player.Distance(target) > Q.Range && E.IsReady() &&
                     Config.Item("UseEGapclose").GetValue <bool>()) || (Player.Distance(target) <= E.Range + W.Range && Player.Distance(target) > Q.Range && E.IsReady() && W.IsReady() &&
                                                                        Config.Item("UseEGapcloseW").GetValue <bool>()))
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead)
                    {
                        E.Cast(pred.CastPosition, usePacket);
                    }
                    if (Config.Item("UseRGapcloseW").GetValue <bool>() && R.IsReady())
                    {
                        R.CastOnUnit(ObjectManager.Player);
                    }
                }


                // Ult Usage
                if (R.IsReady() && !Q.IsReady() && !W.IsReady() && !E.IsReady() &&
                    Config.Item("UseRCombo").GetValue <bool>())
                {
                    R.Cast();
                    if (Config.Item("Debugon").GetValue <bool>())
                    {
                        Game.PrintChat("9 - Basic Ult Cast");
                    }
                }
                // Evolved

                if (Wevolved && Player.Distance(target) <= WE.Range && Config.Item("UseWCombo").GetValue <bool>() &&
                    W.IsReady() && W.GetPrediction(target).Hitchance >= hitchance)
                {
                    PredictionOutput pred = WE.GetPrediction(target);
                    // W.Cast(pred.CastPosition, usePacket);
                    CastWE(target, pred.UnitPosition.To2D());
                }
                if (Wevolved && Player.Distance(target) <= WE.Range && Config.Item("UseWCombo").GetValue <bool>() &&
                    W.IsReady() && W.GetPrediction(target).Hitchance >= HitChance.Collision)
                {
                    List <Obj_AI_Base> PCollision = W.GetPrediction(target).CollisionObjects;
                    foreach (
                        Obj_AI_Base PredCollisionChar in
                        PCollision.Where(PredCollisionChar => PredCollisionChar.Distance(target) <= 30))
                    {
                        W.Cast(PredCollisionChar.Position, usePacket);
                    }
                }

                if (Player.Distance(target) <= E.Range && Player.Distance(target) > Q.Range &&
                    Config.Item("UseECombo").GetValue <bool>() && E.IsReady())
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead)
                    {
                        E.Cast(pred.CastPosition, usePacket);
                    }
                }


                if (Config.Item("UseItems").GetValue <bool>())
                {
                    UseItems(target);
                }
            }
        }
Exemplo n.º 10
0
        static void Combo()
        {
            var target = TargetSelector.GetTarget(W.Range, DamageType.Physical);

            if ((target != null))
            {
                var dist = myHero.Distance(target);

                // Normal abilities
                if (Q.IsReady() && dist <= Q.Range && UseQCombo)
                {
                    Q.Cast(target);
                }

                if (W.IsReady() && !EvolvedW && dist <= W.Range && UseWCombo)
                {
                    var pred = W.GetPrediction(target);
                    if (pred.HitChance >= HitChance.High)
                    {
                        W.Cast(pred.CastPosition);
                    }
                }

                if (E.IsReady() && dist <= E.Range && UseECombo && dist > Q.Range + (0.7 * myHero.MoveSpeed))
                {
                    PredictionResult pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead && ShouldJump(pred.CastPosition))
                    {
                        E.Cast(pred.CastPosition);
                    }
                }

                // Use EQ AND EW Synergy
                if ((dist <= E.Range + Q.Range + (0.7 * myHero.MoveSpeed) && dist > Q.Range && E.IsReady() && UseEGapclose) || (dist <= E.Range + W.Range && dist > Q.Range && E.IsReady() && W.IsReady() && UseEGapcloseW))
                {
                    PredictionResult pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead && ShouldJump(pred.CastPosition))
                    {
                        E.Cast(pred.CastPosition);
                    }
                    if (UseRGapcloseW && R.IsReady())
                    {
                        R.Cast();
                    }
                }


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

                if (W.IsReady() && EvolvedW && dist <= WE.Range && UseWCombo)
                {
                    PredictionResult pred = WE.GetPrediction(target);
                    if (pred.HitChance >= HitChance.High)
                    {
                        CastWE(target, pred.UnitPosition.To2D(), 0, HitChance.High);
                    }
                    if (pred.HitChance >= HitChance.Collision)
                    {
                        List <Obj_AI_Base> PCollision = pred.CollisionObjects.ToList();
                        var x = PCollision.Where(PredCollisionChar => PredCollisionChar.Distance(target) <= 30).FirstOrDefault();
                        if (x != null)
                        {
                            W.Cast(x.Position);
                        }
                    }
                }

                if (dist <= E.Range + (0.7 * myHero.MoveSpeed) && dist > Q.Range && UseECombo && E.IsReady())
                {
                    PredictionResult pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead && ShouldJump(pred.CastPosition))
                    {
                        E.Cast(pred.CastPosition);
                    }
                }

                if (UseItems_)
                {
                    UseItems(target);
                }
            }
        }
Exemplo n.º 11
0
        private static void Combo()
        {
            if (Player.IsDead || Player.IsRecalling())
            {
                return;
            }
            var         isolatedlist = GetIsolatedTargets();
            HitChance   hitchance    = HarassHitChance();
            Obj_AI_Hero target       = new Obj_AI_Hero();

            if (isolatedlist != null && isolatedlist.Any())
            {
                var isolated = isolatedlist.MaxOrDefault(h => TargetSelector.GetPriority(h));
                target = isolated;
            }

            else
            {
                target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
            }

            if (target == null && target.IsValidTarget(E.Range + 100) && !target.IsZombie)
            {
                target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
            }

            if ((target != null))
            {
                // Normal abilities
                if (Vector3.Distance(Player.ServerPosition, target.ServerPosition) <= Q.Range && Config.Item("UseQCombo").GetValue <bool>() &&
                    Q.IsReady() && !Jumping)
                {
                    Orbwalker.SetAttack(false);
                    Q.Cast(target);
                    Orbwalker.SetAttack(true);
                }
                if (Wnorm && Vector3.Distance(Player.ServerPosition, target.ServerPosition) <= W.Range && Config.Item("UseWCombo").GetValue <bool>() &&
                    W.IsReady() && W.GetPrediction(target).Hitchance >= hitchance)
                {
                    PredictionOutput pred = W.GetPrediction(target);
                    W.Cast(pred.CastPosition);
                }

                if (Vector3.Distance(Player.ServerPosition, target.ServerPosition) <= E.Range && Config.Item("UseECombo").GetValue <bool>() &&
                    E.IsReady() && Vector3.Distance(Player.ServerPosition, target.ServerPosition) > Q.Range + (0.7 * Player.MoveSpeed))
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead)
                    {
                        E.Cast(pred.CastPosition);
                    }
                }

                // Use EQ AND EW Synergy
                if ((Vector3.Distance(Player.ServerPosition, target.ServerPosition) <= E.Range + Q.Range + (0.7 * Player.MoveSpeed) && Vector3.Distance(Player.ServerPosition, target.ServerPosition) > Q.Range && E.IsReady() &&
                     Config.Item("UseEGapclose").GetValue <bool>()) || (Vector3.Distance(Player.ServerPosition, target.ServerPosition) <= E.Range + W.Range && Vector3.Distance(Player.ServerPosition, target.ServerPosition) > Q.Range && E.IsReady() && W.IsReady() &&
                                                                        Config.Item("UseEGapcloseW").GetValue <bool>()))
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead)
                    {
                        E.Cast(pred.CastPosition);
                    }
                    if (Config.Item("UseRGapcloseW").GetValue <bool>() && R.IsReady())
                    {
                        R.CastOnUnit(ObjectManager.Player);
                    }
                }


                // Ult Usage
                if (R.IsReady() && !Q.IsReady() && !W.IsReady() && !E.IsReady() &&
                    Config.Item("UseRCombo").GetValue <bool>())
                {
                    R.Cast();
                }
                // Evolved

                if (Wevolved && Vector3.Distance(Player.ServerPosition, target.ServerPosition) <= WE.Range && Config.Item("UseWCombo").GetValue <bool>() &&
                    W.IsReady())
                {
                    PredictionOutput pred = WE.GetPrediction(target);
                    if (pred.Hitchance >= hitchance)
                    {
                        CastWE(target, pred.UnitPosition.To2D());
                    }
                    if (pred.Hitchance >= HitChance.Collision)
                    {
                        List <Obj_AI_Base> PCollision = pred.CollisionObjects;
                        var x = PCollision.Where(PredCollisionChar => PredCollisionChar.Distance(target) <= 30).FirstOrDefault();
                        if (x != null)
                        {
                            W.Cast(x.Position);
                        }
                    }
                }

                if (Vector3.Distance(Player.ServerPosition, target.ServerPosition) <= E.Range + (0.7 * Player.MoveSpeed) && Vector3.Distance(Player.ServerPosition, target.ServerPosition) > Q.Range &&
                    Config.Item("UseECombo").GetValue <bool>() && E.IsReady())
                {
                    PredictionOutput pred = E.GetPrediction(target);
                    if (target.IsValid && !target.IsDead)
                    {
                        E.Cast(pred.CastPosition);
                    }
                }

                if (Config.Item("UseItems").GetValue <bool>())
                {
                    UseItems(target);
                }
            }
        }