Exemplo n.º 1
0
        private void Combo()
        {
            AIHeroClient target = DrawHelper.GetBetterTarget(600, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                var t2 =
                    HeroManager.Enemies.Where(
                        e => e.Distance(player) > player.MoveSpeed * 2.3 && e.Distance(player) < player.MoveSpeed * 2.6)
                    .OrderBy(e => e.Distance(player))
                    .FirstOrDefault();
                if (W.IsReady() && t2 != null)
                {
                    castW();
                }
                return;
            }
            if (config.Item("useItems").GetValue <bool>())
            {
                ItemHandler.UseItems(target, config);
            }
            var  ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
            bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;

            if (config.Item("useIgnite", true).GetValue <bool>() && ignitedmg > target.Health && hasIgnite &&
                (player.HealthPercent < 35 || player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target) + 50))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (DontChangeStance(target))
            {
                return;
            }
            var isInRange = Orbwalking.GetRealAutoAttackRange(target) > player.Distance(target);

            if (W.IsReady() && CheckDmg(target) < target.Health && player.HealthPercent < 25)
            {
                castW();
            }
            if (config.Item("useeOthers", true).GetValue <bool>() && !CanStun(target))
            {
                var others =
                    HeroManager.Enemies.Where(
                        e => e.Distance(player) < 250f && CanStun(e) && e.NetworkId != target.NetworkId);
                if (others.Any())
                {
                    orbwalker.ForceTarget(others.OrderBy(o => player.Distance(o)).FirstOrDefault());
                }
            }
            var dist         = player.Distance(target);
            var inSpellrange = dist < 300;

            if (config.Item("usew", true).GetValue <bool>() && W.IsReady() && DangerLevel() >= 2.5f)
            {
                castW();
            }
            if (config.Item("usee", true).GetValue <bool>() && E.IsReady() && CanStun(target) &&
                ((!inSpellrange && player.ManaPercent < 55) || player.ManaPercent > 55) &&
                CombatHelper.IsPossibleToReachHim2(
                    target, new float[5] {
                0.15f, 0.2f, 0.25f, 0.3f, 0.35f
            }[Q.Level - 1],
                    new float[5] {
                2f, 2.25f, 2.5f, 2.75f, 3f
            }[Q.Level - 1]) && !justR2)
            {
                E.Cast();
                return;
            }
            if ((target.Health > R.GetDamage(target) || player.Mana < Q.ManaCost * 2) && isInRange)
            {
                if (config.Item("useq", true).GetValue <bool>() && Q.IsReady())
                {
                    castQ();
                    return;
                }
                if (config.Item("user", true).GetValue <bool>() && R.IsReady())
                {
                    castR();
                    return;
                }
            }
            else
            {
                if (config.Item("user", true).GetValue <bool>() && R.IsReady())
                {
                    castR();
                    return;
                }
                if (config.Item("useq", true).GetValue <bool>() && Q.IsReady())
                {
                    castQ();
                    return;
                }
            }
        }