Exemplo n.º 1
0
        private static void Game_OnTick(EventArgs args)
        {
            try
            {
                if (Player.Instance.IsDead)
                {
                    return;
                }

                if (Randuins.ItemReady(Def) && Def.CompareSlider(Randuins.Id + "hp", Player.Instance.HealthPercent) && Player.Instance.CountEnemiesInRange(Randuins.Range) > 0 &&
                    Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                {
                    Randuins.Cast();
                }
            }
            catch (Exception ex)
            {
                Logger.Send("Activator Defence Error At Game_OnTick", ex, Logger.LogLevel.Error);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Does the combo.
        /// </summary>
        private static void DoCombo()
        {
            var target = TargetSelector.GetTarget(Q.Range);

            var useQ                 = Menu["Combo"]["UseQ"].GetValue <MenuBool>().Value;
            var useQGapclose         = Menu["Combo"]["UseQGapclose"].GetValue <MenuBool>().Value;
            var useQGapcloseInfinite = Menu["Combo"]["UseQGapcloseInfinite"].GetValue <MenuBool>().Value;
            var useW                 = Menu["Combo"]["UseW"].GetValue <MenuBool>().Value;
            var useE                 = Menu["Combo"]["UseE"].GetValue <MenuBool>().Value;
            var useEStunOnly         = Menu["Combo"]["UseEStunOnly"].GetValue <MenuBool>().Value;
            var useR                 = Menu["Combo"]["UseR"].GetValue <MenuBool>().Value;
            var procSheenBeforeR     = Menu["Combo"]["ProcSheenBeforeR"].GetValue <MenuBool>().Value;
            var useRtoQ              = Menu["Combo"]["UseRToQ"].GetValue <MenuBool>().Value;
            var useBotrk             = Menu["Combo"]["UseBotrk"].GetValue <MenuBool>().Value;
            var useRanduin           = Menu["Combo"]["UseRanduin"].GetValue <MenuBool>().Value;
            var useHextech           = Menu["Combo"]["UseHextech"].GetValue <MenuBool>().Value;
            var mode                 = Menu["Combo"]["Mode"].GetValue <MenuList <string> >().SelectedValue;

            if (target == null && useQGapclose)
            {
                var gapcloseMinion = useQGapcloseInfinite
                                         ? GameObjects.EnemyMinions.Where(
                    x =>
                    x.IsValidTarget(Q.Range) &&
                    Player.GetSpellDamage(x, SpellSlot.Q) > x.Health &&
                    Player.Distance(
                        GameObjects.EnemyHeroes.OrderBy(y => y.Distance(Player))
                        .FirstOrDefault())
                    < x.Distance(
                        GameObjects.EnemyHeroes.OrderBy(y => y.Distance(Player))
                        .FirstOrDefault()))
                                     .FirstOrDefault(
                    x =>
                    x.Distance(
                        GameObjects.EnemyHeroes.OrderBy(y => y.Distance(Player))
                        .FirstOrDefault()) < Q.Range)
                                         : GameObjects.EnemyMinions.Where(
                    x =>
                    x.IsValidTarget(Q.Range) &&
                    Player.GetSpellDamage(x, SpellSlot.Q) > x.Health)
                                     .FirstOrDefault(
                    x => x.Distance(TargetSelector.GetTarget(Q.Range * 5)) < Q.Range);

                if (gapcloseMinion != null)
                {
                    Q.CastOnUnit(gapcloseMinion);
                }
                else if (useRtoQ && R.IsReady())
                {
                    var minionR =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(
                            x =>
                            x.IsValidTarget() && x.Distance(Player) < Q.Range &&
                            GameObjects.EnemyHeroes.Count(y => x.Distance(y) < Q.Range) > 0)
                        .FirstOrDefault(
                            x =>
                            x.Health - Player.GetSpellDamage(x, SpellSlot.R) < Player.GetSpellDamage(x, SpellSlot.Q));

                    if (minionR != null)
                    {
                        R.Cast(minionR);
                    }
                }

                return;
            }

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

            if (useBotrk && Botrk.IsReady)
            {
                Botrk.Cast(target);
            }

            if (useRanduin && Randuins.IsReady && Player.Distance(target) < 500 &&
                Player.Distance(target) > Player.GetRealAutoAttackRange())
            {
                Randuins.Cast();
            }

            if (useHextech && Hextech.IsReady)
            {
                Hextech.Cast(target);
            }

            if (useQ && Q.IsReady())
            {
                Q.CastOnUnit(target);
            }

            if (mode.Equals("Q -> W -> E"))
            {
                if (useW && W.IsReady())
                {
                    W.Cast();
                }

                if (useE && E.IsReady())
                {
                    UseE(target, useEStunOnly);
                }
            }
            else
            {
                if (useE && E.IsReady())
                {
                    UseE(target, useEStunOnly);
                }

                if (useW && W.IsReady())
                {
                    W.Cast();
                }
            }

            if (!useR || !R.IsReady())
            {
                return;
            }

            var ultTarget = TargetSelector.GetTarget(R.Range);

            if (procSheenBeforeR)
            {
                // Cast ult on the target if we have the sheen buff only if they are out of the AA range
                if (Player.Distance(ultTarget) > Player.GetRealAutoAttackRange() || !Player.HasBuff("sheen"))
                {
                    R.Cast(ultTarget);
                }
            }
            else if (!procSheenBeforeR)
            {
                R.Cast(target);
            }
        }