コード例 #1
0
ファイル: Khazix.cs プロジェクト: qazji3/LeagueSharp-5
        void Init()
        {
            SmiteManager = new SmiteManager();

            InitSkills();
            Khazix = ObjectManager.Player;

            foreach (var t in ObjectManager.Get <Obj_AI_Turret>().Where(t => t.IsEnemy))
            {
                EnemyTurrets.Add(t);
            }

            var shop = ObjectManager.Get <Obj_Shop>().FirstOrDefault(o => o.IsAlly);

            if (shop != null)
            {
                NexusPosition = shop.Position;
            }

            HeroList = HeroManager.AllHeroes;

            jumpManager = new JumpManager(this);
        }
コード例 #2
0
ファイル: Khazix.cs プロジェクト: qazji3/LeagueSharp-5
        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();
                    }
                }
            }
        }
コード例 #3
0
ファイル: Khazix.cs プロジェクト: qazji3/LeagueSharp-5
        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);
                }
            }
        }