예제 #1
0
        private void OnCombo()
        {
            bool  useQ     = Menu["combo"]["useq"].Enabled;
            bool  useW     = Menu["combo"]["usew"].Enabled;
            bool  useE     = Menu["combo"]["usee"].Enabled;
            bool  useR     = Menu["combo"]["rset"]["user"].Enabled;
            bool  bursting = Menu["combo"]["rset"]["burstr"].Enabled;
            float enemies  = Menu["combo"]["rset"]["waster"].As <MenuSlider>().Value;
            var   target   = GetBestEnemyHeroTargetInRange(E.Range);

            if (!target.IsValidTarget())
            {
                return;
            }

            var items = new[] { ItemId.HextechGunblade, ItemId.BilgewaterCutlass };

            if (Player.HasItem(ItemId.HextechGunblade) || Player.HasItem(ItemId.BilgewaterCutlass))
            {
                var slot = Player.Inventory.Slots.First(s => items.Contains(s.ItemId));
                if (slot != null)
                {
                    var spellslot = slot.SpellSlot;
                    if (spellslot != SpellSlot.Unknown &&
                        Player.SpellBook.GetSpell(spellslot).State == SpellState.Ready)
                    {
                        Player.SpellBook.CastSpell(spellslot, target);
                    }
                }
            }

            if (useE && target.IsValidTarget(E.Range))
            {
                if (target != null)
                {
                    if (!bursting)
                    {
                        if (E.GetPrediction(target).CastPosition.Distance(Player) < E.Range - 100)
                        {
                            E.Cast(target);
                        }
                    }
                    if (bursting && (!R.Ready || Player.SpellBook.GetSpell(SpellSlot.R).Level == 0 || target.Health >
                                     Player.GetSpellDamage(target, SpellSlot.Q) +
                                     Player.GetSpellDamage(target, SpellSlot.W) +
                                     Player.GetSpellDamage(target, SpellSlot.E) +
                                     Player.GetSpellDamage(target, SpellSlot.R) * 3))
                    {
                        if (E.GetPrediction(target).CastPosition.Distance(Player) < E.Range - 100)
                        {
                            E.Cast(target);
                        }
                    }
                }
            }
            if (useR)
            {
                if (bursting)
                {
                    if (target.Health <
                        Player.GetSpellDamage(target, SpellSlot.Q) +
                        Player.GetSpellDamage(target, SpellSlot.W) +
                        Player.GetSpellDamage(target, SpellSlot.E) +
                        Player.GetSpellDamage(target, SpellSlot.R) * 3)
                    {
                        if (enemies >= target.CountEnemyHeroesInRange(600))
                        {
                            if (R.Ready && E.Ready)
                            {
                                if (E.GetPrediction(target).CastPosition.Distance(Player) < E.Range - 100)
                                {
                                    E.Cast(target);
                                }
                            }
                        }

                        if (Player.HasBuff("AhriTumble"))
                        {
                            switch (Menu["combo"]["rset"]["rmode"].As <MenuList>().Value)
                            {
                            case 0:
                                if (target.Distance(Player) < R.Range)
                                {
                                    var     meow      = Q.GetPredictionInput(target);
                                    var     targetpos = Prediction.Instance.GetPrediction(meow).UnitPosition.To2D();
                                    Vector2 intersec  = new Vector2();
                                    for (int i = 450; i >= 0; i = i - 50)
                                    {
                                        for (int j = 50; j <= 450; j = j + 50)
                                        {
                                            var vectors =
                                                Vector2Extensions.CircleCircleIntersection(Player.Position.To2D(),
                                                                                           targetpos, i, j);
                                            foreach (var x in vectors)
                                            {
                                                if (!AnyWallInBetween(Player.Position, x))
                                                {
                                                    intersec = x;
                                                    goto ABC;
                                                }
                                            }
                                        }
                                    }
ABC:
                                    R.Cast(intersec.To3D());
                                }
                                break;

                            case 1:
                                if (Menu["combo"]["rset"]["under"].Enabled)
                                {
                                    R.Cast(Game.CursorPos);
                                }
                                if (!Menu["combo"]["rset"]["under"].Enabled)
                                {
                                    if (!target.IsUnderEnemyTurret())
                                    {
                                        R.Cast(Game.CursorPos);
                                    }
                                }
                                break;

                            case 2:
                                if (Menu["combo"]["rset"]["under"].Enabled)
                                {
                                    R.Cast(target.ServerPosition.Extend(Player.ServerPosition, -200));
                                }
                                if (!Menu["combo"]["rset"]["under"].Enabled)
                                {
                                    if (!target.IsUnderEnemyTurret())
                                    {
                                        R.Cast(target.ServerPosition.Extend(Player.ServerPosition, -200));
                                    }
                                }
                                break;
                            }
                        }
                    }
                }
            }
            if (useR)
            {
                switch (Menu["combo"]["rset"]["rusage"].As <MenuList>().Value)
                {
                case 0:
                    switch (Menu["combo"]["rset"]["rmode"].As <MenuList>().Value)
                    {
                    case 0:
                        if (target.IsValidTarget(R.Range))
                        {
                            var     meow      = Q.GetPredictionInput(target);
                            var     targetpos = Prediction.Instance.GetPrediction(meow).UnitPosition.To2D();
                            Vector2 intersec  = new Vector2();
                            for (int i = 450; i >= 0; i = i - 50)
                            {
                                for (int j = 50; j <= 450; j = j + 50)
                                {
                                    var vectors =
                                        Vector2Extensions.CircleCircleIntersection(Player.Position.To2D(),
                                                                                   targetpos, i, j);
                                    foreach (var x in vectors)
                                    {
                                        if (!AnyWallInBetween(Player.Position, x))
                                        {
                                            intersec = x;
                                            goto ABC;
                                        }
                                    }
                                }
                            }
ABC:
                            R.Cast(intersec.To3D());
                        }
                        break;

                    case 1:
                        if (Menu["combo"]["rset"]["under"].Enabled)
                        {
                            R.Cast(Game.CursorPos);
                        }
                        if (!Menu["combo"]["rset"]["under"].Enabled)
                        {
                            if (!target.IsUnderEnemyTurret())
                            {
                                R.Cast(Game.CursorPos);
                            }
                        }
                        break;

                    case 2:
                        if (Menu["combo"]["rset"]["under"].Enabled)
                        {
                            R.Cast(target.ServerPosition.Extend(Player.ServerPosition, -200));
                        }
                        if (!Menu["combo"]["rset"]["under"].Enabled)
                        {
                            if (!target.IsUnderEnemyTurret())
                            {
                                R.Cast(target.ServerPosition.Extend(Player.ServerPosition, -200));
                            }
                        }
                        break;
                    }
                    break;

                case 1:
                    if (target.Health <
                        Player.GetSpellDamage(target, SpellSlot.Q) +
                        Player.GetSpellDamage(target, SpellSlot.W) +
                        Player.GetSpellDamage(target, SpellSlot.E) +
                        Player.GetSpellDamage(target, SpellSlot.R) * 3)
                    {
                        switch (Menu["combo"]["rset"]["rmode"].As <MenuList>().Value)
                        {
                        case 0:
                            if (target.Distance(Player) < R.Range)
                            {
                                var     meow      = Q.GetPredictionInput(target);
                                var     targetpos = Prediction.Instance.GetPrediction(meow).UnitPosition.To2D();
                                Vector2 intersec  = new Vector2();
                                for (int i = 450; i >= 0; i = i - 50)
                                {
                                    for (int j = 50; j <= 450; j = j + 50)
                                    {
                                        var vectors =
                                            Vector2Extensions.CircleCircleIntersection(Player.Position.To2D(),
                                                                                       targetpos, i, j);
                                        foreach (var x in vectors)
                                        {
                                            if (!AnyWallInBetween(Player.Position, x))
                                            {
                                                intersec = x;
                                                goto ABC;
                                            }
                                        }
                                    }
                                }
ABC:
                                R.Cast(intersec.To3D());
                            }
                            break;

                        case 1:
                            if (Menu["combo"]["rset"]["under"].Enabled)
                            {
                                R.Cast(Game.CursorPos);
                            }
                            if (!Menu["combo"]["rset"]["under"].Enabled)
                            {
                                if (!target.IsUnderEnemyTurret())
                                {
                                    R.Cast(Game.CursorPos);
                                }
                            }
                            break;

                        case 2:
                            if (Menu["combo"]["rset"]["under"].Enabled)
                            {
                                R.Cast(target.ServerPosition.Extend(Player.ServerPosition, -200));
                            }
                            if (!Menu["combo"]["rset"]["under"].Enabled)
                            {
                                if (!target.IsUnderEnemyTurret())
                                {
                                    R.Cast(target.ServerPosition.Extend(Player.ServerPosition, -200));
                                }
                            }
                            break;
                        }
                    }
                    break;
                }
            }
            if (Q.Ready && useQ && target.IsValidTarget(Q.Range))
            {
                if (target != null)
                {
                    if (!Menu["combo"]["eq"].Enabled)
                    {
                        if (Q.GetPrediction(target).CastPosition.Distance(Player) < Q.Range - 40)
                        {
                            Q.Cast(target);
                        }
                    }
                    if (Menu["combo"]["eq"].Enabled && target.HasBuff("AhriSeduce"))
                    {
                        if (Q.GetPrediction(target).CastPosition.Distance(Player) < Q.Range - 40)
                        {
                            Q.Cast(target);
                        }
                    }
                    if (Menu["combo"]["eq"].Enabled && !E.Ready)
                    {
                        if (Q.GetPrediction(target).CastPosition.Distance(Player) < Q.Range - 40)
                        {
                            Q.Cast(target);
                        }
                    }
                }
            }
            if (W.Ready && useW && target.IsValidTarget(Menu["combo"]["rangew"].As <MenuSlider>().Value))
            {
                if (target != null)
                {
                    W.Cast(target);
                }
            }
        }