示例#1
0
        protected void Orbwalk()
        {
            switch (ZaioMenu.OrbwalkerMode)
            {
            case OrbwalkerMode.Mouse:
                Orbwalker.OrbwalkOn(Target);
                break;

            case OrbwalkerMode.Target:
                var distance        = MyHero.IsRanged ? MyHero.GetAttackRange() / 2 : 0;
                var currentDistance = Target.Distance2D(MyHero);
                if (currentDistance <= distance)
                {
                    Orbwalker.Attack(Target, true);
                }
                else
                {
                    var pos = (Target.NetworkPosition - MyHero.NetworkPosition).Normalized();
                    pos *= distance;
                    Orbwalker.OrbwalkOn(Target, Target.NetworkPosition - pos);
                }
                break;

            case OrbwalkerMode.Attack:
                Orbwalker.Attack(Target, true);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
示例#2
0
 private static void OnBuffGain(AIBaseClient sender, AIBaseClientBuffGainEventArgs args)
 {
     if (sender.IsEnemy && (args.Buff.Type == BuffType.Sleep || args.Buff.Type == BuffType.Snare || args.Buff.Type == BuffType.Stun) && misc.check("PS") && !sender.HasBuff(EnemyPassiveProced) && sender.DistanceToPlayer() < 600)
     {
         Orbwalker.Attack(sender);
     }
 }
示例#3
0
        /// <summary>
        ///     Fired when the game is updated.
        /// </summary>
        public void Combo()
        {
            /// <summary>
            ///     Orbwalk on minions.
            /// </summary>
            var minion = ObjectCache.EnemyLaneMinions
                         .Where(m => m.IsValidSpellTarget(UtilityClass.Player.GetAutoAttackRange(m)))
                         .OrderBy(s => s.GetBuffCount("kalistaexpungemarker"))
                         .MinBy(o => o.HP);

            if (minion != null &&
                !ObjectCache.EnemyHeroes.Any(t => t.IsValidTarget(UtilityClass.Player.GetAutoAttackRange(t) + 25)) &&
                MenuClass.Miscellaneous["minionsorbwalk"].Enabled)
            {
                Orbwalker.Attack(minion);
            }

            /// <summary>
            ///     The Q Combo Logic.
            /// </summary>
            if (SpellClass.Q.Ready &&
                MenuClass.Q["combo"].Enabled &&
                UtilityClass.Player.AutoAttacksPerSecond() < 1.5)
            {
                var bestTarget = Extensions.GetBestEnemyHeroTargetInRange(SpellClass.Q.Range);
                if (bestTarget != null)
                {
                    var collisions = SpellClass.Q.GetPrediction(bestTarget).CollisionObjects
                                     .Where(c => Extensions.GetAllGenericMinionsTargetsInRange(SpellClass.Q.Range).Contains(c))
                                     .ToList();
                    if (collisions.Any())
                    {
                        if (collisions.All(c => c.GetRealHealth(DamageType.Physical) <= GetQDamage(c)))
                        {
                            SpellClass.Q.Cast(bestTarget);
                        }
                    }
                    else
                    {
                        SpellClass.Q.Cast(bestTarget);
                    }
                }
            }

            /// <summary>
            ///     The E Combo Minion Harass Logic.
            /// </summary>
            if (SpellClass.E.Ready &&
                Extensions.GetEnemyLaneMinionsTargets()
                .Any(m => IsPerfectRendTarget(m) && m.HP <= GetEDamage(m)) &&
                MenuClass.E["harass"].Enabled)
            {
                if (ObjectCache.EnemyHeroes.Where(IsPerfectRendTarget)
                    .Any(enemy => !enemy.HasBuffOfType(BuffType.Slow) || !MenuClass.E["dontharassslowed"].Enabled))
                {
                    SpellClass.E.Cast();
                }
            }
        }
示例#4
0
        private void OrbwalkTo(Unit target)
        {
            if (target.IsInvulnerable() || target.IsAttackImmune()) //TODO
            {
                Orbwalker.MoveToMousePosition();
                return;
            }

            switch (SmartArcaneBoltMenu.OrbwalkerItem.Value)
            {
            case "Default":
            {
                Orbwalker.OrbwalkTo(target);
            }
            break;

            case "Distance":
            {
                var ownerDis = Math.Min(Owner.Distance2D(GameManager.MousePosition), 230);
                var ownerPos = Owner.Position.Extend(GameManager.MousePosition, ownerDis);
                var pos      = target.Position.Extend(ownerPos, SmartArcaneBoltMenu.MinDisInOrbwalkItem.Value);

                Orbwalker.OrbwalkTo(target, pos);
            }
            break;

            case "Free":
            {
                var attackRange = Owner.AttackRange(target);
                if (Owner.Distance2D(target) <= attackRange && !SmartArcaneBoltMenu.FullFreeModeItem || target.Distance2D(GameManager.MousePosition) <= attackRange)
                {
                    Orbwalker.OrbwalkTo(target);
                }
                else
                {
                    Orbwalker.MoveToMousePosition();
                }
            }
            break;

            case "Only Attack":
            {
                Orbwalker.Attack(target);
            }
            break;

            case "No Move":
            {
                if (Owner.Distance2D(target) < Owner.AttackRange(target))
                {
                    Orbwalker.Attack(target);
                }
            }
            break;
            }
        }
示例#5
0
        /// <summary>
        ///     Fired when the game is updated.
        /// </summary>
        public void LaneClear()
        {
            /// <summary>
            ///     Orbwalk on minions.
            /// </summary>
            var minion = ObjectCache.EnemyLaneMinions
                         .Where(m => m.IsValidSpellTarget(UtilityClass.Player.GetAutoAttackRange(m)))
                         .OrderBy(s => s.GetBuffCount("kalistaexpungemarker"))
                         .MinBy(o => o.HP);

            if (minion != null)
            {
                Orbwalker.Attack(minion);
            }

            /// <summary>
            ///     The Q Laneclear Logic.
            /// </summary>
            if (SpellClass.Q.Ready &&
                UtilityClass.Player.MPPercent()
                > ManaManager.GetNeededMana(SpellClass.Q.Slot, MenuClass.Q["laneclear"]) &&
                MenuClass.Q["laneclear"].Enabled)
            {
                /*
                 * var farmLocation = Extensions.GetAllGenericMinionsTargets().Where(m => m.GetRealHealth(DamageType.Physical) < (float)UtilityClass.Player.GetSpellDamage(m, SpellSlot.Q)).ToList();
                 * if (SpellClass.Q.GetLineFarmLocation(farmLocation, SpellClass.Q.Width).MinionsHit >= 3)
                 * {
                 * SpellClass.Q.Cast(SpellClass.Q.GetLineFarmLocation(farmLocation, SpellClass.Q.Width).Position);
                 * }
                 */
            }

            /// <summary>
            ///     The E Laneclear Logics.
            /// </summary>
            if (SpellClass.E.Ready &&
                MenuClass.E["laneclear"].Enabled)
            {
                if (Extensions.GetEnemyLaneMinionsTargetsInRange(SpellClass.E.Range)
                    .Count(m => IsPerfectRendTarget(m) && m.HP <= GetEDamage(m)) >= MenuClass.E["laneclear"].Value)
                {
                    SpellClass.E.Cast();
                }

                else if (Extensions.GetEnemyPetsInRange(SpellClass.E.Range)
                         .Any(m => IsPerfectRendTarget(m) && m.HP <= GetEDamage(m)))
                {
                    SpellClass.E.Cast();
                }
            }
        }
示例#6
0
        public static void Orbwalk(AttackableUnit target = null, Vector3?position = null)
        {
            if (Orbwalker.CanAttack() && Orbwalker.AttackState)
            {
                var gTarget = target ?? Orbwalker.GetTarget();
                if (gTarget.InAutoAttackRange())
                {
                    Orbwalker.Attack(gTarget);
                }
            }

            if (Orbwalker.CanMove() && Orbwalker.MovementState)
            {
                Orbwalker.Move(position.HasValue && position.Value.IsValid() ? position.Value : Game.CursorPos);
            }
        }
示例#7
0
        private bool GlaivesOfWisdomCast(Hero target)
        {
            var GlaivesOfWisdom       = Main.GlaivesOfWisdom;
            var ModifierHurricanePike = Owner.HasModifier("modifier_item_hurricane_pike_range");

            if (!GlaivesOfWisdom.IsReady || Owner.IsMuted() || Owner.IsSilenced() || !Config.AbilityToggler.Value.IsEnabled(GlaivesOfWisdom.ToString()) ||
                (target.IsMagicImmune() && GlaivesOfWisdom.PiercesSpellImmunity != SpellPierceImmunityType.EnemiesYes))
            {
                if (ModifierHurricanePike)
                {
                    return(Orbwalker.Attack(target));
                }

                return(false);
            }

            // GlaivesOfWisdom Autocast
            if (ModifierHurricanePike)
            {
                if (!GlaivesOfWisdom.Ability.IsAutoCastEnabled)
                {
                    GlaivesOfWisdom.Ability.ToggleAutocastAbility();
                }

                return(Orbwalker.Attack(target));
            }
            else if (GlaivesOfWisdom.Ability.IsAutoCastEnabled)
            {
                GlaivesOfWisdom.Ability.ToggleAutocastAbility();
            }

            // GlaivesOfWisdom
            if (Owner.Distance2D(target) < Owner.AttackRange(target) &&
                Orbwalker.CanAttack(target))
            {
                var time = Game.RawGameTime;
                if ((time - LastCastAttempt) > 0.1f)
                {
                    GlaivesOfWisdom.UseAbility(target);
                    LastCastAttempt = time;
                }

                return(true);
            }

            return(false);
        }
示例#8
0
        private bool ImpetusCast(Hero target)
        {
            var Impetus = Main.Impetus;
            var ModifierHurricanePike = Owner.HasModifier("modifier_item_hurricane_pike_range");

            if (!Impetus.IsReady || Owner.IsMuted() || Owner.IsSilenced() || !Config.AbilityToggler.Value.IsEnabled(Impetus.ToString()))
            {
                if (ModifierHurricanePike)
                {
                    return(Orbwalker.Attack(target));
                }

                return(false);
            }

            // Impetus Autocast
            if (ModifierHurricanePike)
            {
                if (!Impetus.Ability.IsAutoCastEnabled)
                {
                    Impetus.Ability.ToggleAutocastAbility();
                }

                return(Orbwalker.Attack(target));
            }
            else if (Impetus.Ability.IsAutoCastEnabled)
            {
                Impetus.Ability.ToggleAutocastAbility();
            }

            // Impetus
            if (Owner.Distance2D(target) < Owner.AttackRange(target) &&
                Orbwalker.CanAttack(target))
            {
                var time = Game.RawGameTime;
                if ((time - LastCastAttempt) > 0.1f)
                {
                    Impetus.UseAbility(target);
                    LastCastAttempt = time;
                }

                return(true);
            }

            return(false);
        }
示例#9
0
        private static void KillSteal()
        {
            if (ObjectManager.Player.Level < MainMenu["Misc"]["Killsteal"]["killstealAALvl"].GetValue <MenuSlider>().Value)
            {
                return;
            }
            {
                if (MainMenu["Misc"]["Killsteal"]["killstealAA"].GetValue <MenuBool>().Enabled&& Orbwalker.CanAttack())
                {
                    foreach (var target in GameObjects.EnemyHeroes.Where(enemy =>
                                                                         enemy.IsValidTarget(585f) && !enemy.IsInvulnerable))
                    {
                        if (target.IsValid && target.Health < ObjectManager.Player.GetAutoAttackDamage(target) - 30.00 &&
                            Orbwalker.ActiveMode == EnsoulSharp.SDK.OrbwalkerMode.Combo)
                        {
                            Orbwalker.Attack(target);
                        }
                    }
                }
            }

            if (!MainMenu["Misc"]["Killsteal"]["killstealW"].GetValue <MenuBool>().Enabled || !W.IsReady())
            {
                return;
            }
            {
                foreach (var target in GameObjects.EnemyHeroes.Where(enemy =>
                                                                     enemy.IsValidTarget(W.Range - 65f) && !enemy.IsInvulnerable))
                {
                    var wPred = W.GetPrediction(target);
                    if (target.IsValid && target.Health < W.GetDamage(target) - 15f &&
                        wPred.Hitchance >= HitChance.Medium)
                    {
                        W.Cast(wPred.UnitPosition);
                    }
                }
            }
        }
示例#10
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!ObjectManager.Player.HasBuff("SionR"))
            {
                return;
            }

            var obj = new GameObject();

            var pos = ObjectManager.Player.Position.Extend(Game.CursorPos, 1000);

            Geometry.Line line = new Geometry.Line(ObjectManager.Player.Position, pos);

            line.Draw(Color.White, 200);

            foreach (var l in line.Points)
            {
                if (obj.Position.Distance(l) < 100)
                {
                    Orbwalker.Attack((AIBaseClient)obj);
                }
            }
        }
 private static bool OnAttack(AIBaseClient target)
 {
     return(Orbwalker.Attack(target) || Player.IssueOrder(GameObjectOrder.AttackUnit, target));
 }
示例#12
0
        private static void SimpleLaneClear()
        {
            foreach (var target in GameObjects.Jungle.Where(x => x.IsValidTarget(100000)))
            {
                if (target != null)
                {
                    if (MenuSettings.Combo.Qcombo.Enabled)
                    {
                        if (Calibrum.IsReady())
                        {
                            if (Player.HasBuff("ApheliosCalibrumManager"))
                            {
                                CastQCalibrum(target);
                            }
                            if (Player.HasBuff("ApheliosSeverummManager"))
                            {
                                CastQSeverum(target);
                            }
                            if (Player.HasBuff("ApheliosGravitumManager"))
                            {
                                CastQGravitum(target);
                            }
                            if (Player.HasBuff("ApheliosInfernumManager"))
                            {
                                CastQInfernum(target);
                            }
                            if (Player.HasBuff("ApheliosCrescendumManager"))
                            {
                                CastQCrescendum(target);
                            }
                        }
                    }
                    if (Orbwalker.ActiveMode == OrbwalkerMode.Combo && MenuSettings.Combo.Rcombo.Enabled)
                    {
                        if (R4isready)
                        {
                            if (R.IsReady())
                            {
                                if (Player.HasBuff("ApheliosInfernumManager"))
                                {
                                    CastR(target);
                                }
                                else
                                {
                                    W.Cast(target);
                                    CastR(target);
                                }
                            }
                        }
                        else
                        {
                            if (R.IsReady())
                            {
                                CastR(target);
                            }
                        }
                    }
                    if (MenuSettings.Combo.Wcombo.Enabled)
                    {
                        if (Player.HasBuff("ApheliosOffHandBuffCalibrum") && target.DistanceToPlayer() > 550)
                        {
                            W.Cast(target);
                        }
                        if (Player.HasBuff("ApheliosOffHandBuffGravitum") && target.DistanceToPlayer() > 550)
                        {
                            if (!Player.HasBuff("ApheliosCalibrumManager") || !Player.HasBuff("ApheliosOffHandBuffCalibrum"))
                            {
                                W.Cast(target);
                            }
                        }
                    }
                    if (target.HasBuff("aphelioscalibrumbonusrangebuff"))
                    {
                        Orbwalker.Attack(target);
                    }

                    if (MenuSettings.Combo.Qcombo.Enabled)
                    {
                        if (Q1isready && target.IsValidTarget(Calibrum.Range))
                        {
                            if (Player.HasBuff("ApheliosOffHandBuffCalibrum"))
                            {
                                if (!Calibrum.IsReady())
                                {
                                    W.Cast(target);
                                }
                                CastQCalibrum(target);
                            }
                            if (Player.HasBuff("ApheliosCalibrumManager"))
                            {
                                CastQCalibrum(target);
                            }
                        }

                        if (Q2isready && target.IsValidTarget(objPlayer.GetRealAutoAttackRange()))
                        {
                            if (Player.HasBuff("ApheliosOffHandBuffSeverum"))
                            {
                                if (!Calibrum.IsReady())
                                {
                                    W.Cast(target);
                                }
                                CastQSeverum(target);
                            }
                            if (Player.HasBuff("ApheliosSeverumManager"))
                            {
                                CastQSeverum(target);
                            }
                        }

                        if (Q3isready)
                        {
                            if (target.IsValidTarget(550) || target.HasBuff("ApheliosGravitumDebuff"))
                            {
                                if (Player.HasBuff("ApheliosOffHandBuffGravitum"))
                                {
                                    if (!Calibrum.IsReady())
                                    {
                                        W.Cast(target);
                                    }
                                    CastQGravitum(target);
                                }
                                if (Player.HasBuff("ApheliosGravitumManager"))
                                {
                                    CastQGravitum(target);
                                }
                            }
                        }

                        if (Q4isready && target.IsValidTarget(Infernum.Range))
                        {
                            if (Player.HasBuff("ApheliosOffHandBuffInfernum"))
                            {
                                if (!Calibrum.IsReady())
                                {
                                    W.Cast(target);
                                }
                                CastQInfernum(target);
                            }
                            if (Player.HasBuff("ApheliosInfernumManager"))
                            {
                                CastQInfernum(target);
                            }
                        }

                        if (Q5isready && target.IsValidTarget(Crescendum.Range + 100))
                        {
                            if (Player.HasBuff("ApheliosOffHandBuffCrescendum"))
                            {
                                if (!Calibrum.IsReady())
                                {
                                    W.Cast(target);
                                }
                                CastQCrescendum(target);
                            }
                            if (Player.HasBuff("ApheliosCrescendumManager"))
                            {
                                CastQCrescendum(target);
                            }
                        }
                    }
                }
            }
        }
示例#13
0
        private void OnOrbwalkingAction(object sender, OrbwalkingActionArgs orbwalkingActionArgs)
        {
            if (orbwalkingActionArgs.Type == OrbwalkingType.AfterAttack)
            {
                Orbwalker.ForceTarget = null;
                var possible2WTarget = ValidTargets.FirstOrDefault(
                    h =>
                    h.ServerPosition.Distance(ObjectManager.Player.ServerPosition) < 500 &&
                    h.GetBuffCount("vaynesilvereddebuff") == 2);
                if (Orbwalker.ActiveMode != OrbwalkingMode.Combo)
                {
                    if (possible2WTarget.IsValidTarget() && UseEAs3rdWProcBool && possible2WTarget.GetWaypoints().LastOrDefault().Distance(ObjectManager.Player.ServerPosition) < 1000)
                    {
                        if (EDelaySlider.Value > 0)
                        {
                            var thisEnemy = possible2WTarget;
                            DelayAction.Add(EDelaySlider.Value, () => E.CastOnUnit(thisEnemy));
                            return;
                        }
                        E.CastOnUnit(possible2WTarget);
                    }
                }
                if (orbwalkingActionArgs.Target is Obj_AI_Hero && UseQBool)
                {
                    if (Q.IsReady())
                    {
                        var tg = orbwalkingActionArgs.Target as Obj_AI_Hero;
                        if (tg != null)
                        {
                            var mode           = QModeStringList.SelectedValue;
                            var tumblePosition = Game.CursorPos;
                            switch (mode)
                            {
                            case "PRADA":
                                tumblePosition = GetTumblePos(tg);
                                break;

                            default:
                                tumblePosition = Game.CursorPos;
                                break;
                            }
                            if (tumblePosition.Distance(ObjectManager.Player.Position) > 2000 || IsDangerousPosition(tumblePosition))
                            {
                                return;
                            }
                            Q.Cast(tumblePosition);
                        }
                    }
                }
                if (orbwalkingActionArgs.Target is Obj_AI_Minion && Orbwalker.ActiveMode == OrbwalkingMode.LaneClear)
                {
                    var tg = orbwalkingActionArgs.Target as Obj_AI_Minion;
                    if (E.IsReady())
                    {
                        if (this.IsMinionCondemnable(tg) && GameObjects.Jungle.Any(m => m.NetworkId == tg.NetworkId) && tg.IsValidTarget() && this.UseEJungleFarm)
                        {
                            if (this.EDelaySlider.Value > 0)
                            {
                                var thisEnemy = tg;
                                DelayAction.Add(EDelaySlider.Value, () => E.CastOnUnit(thisEnemy));
                                return;
                            }
                            E.CastOnUnit(tg);
                        }
                    }
                    if (this.UseQFarm && this.Q.IsReady())
                    {
                        if (tg.CharData.BaseSkinName.Contains("SRU_") && !tg.CharData.BaseSkinName.Contains("Mini") && tg.IsValidTarget() && !this.IsDangerousPosition(Game.CursorPos))
                        {
                            Q.Cast(Game.CursorPos);
                        }
                        if (ObjectManager.Player.UnderAllyTurret() && GameObjects.EnemyMinions.Count(
                                m =>
                                m.Position.Distance(ObjectManager.Player.Position) < 550 && m.Health < ObjectManager.Player.GetAutoAttackDamage(m) && Health.GetPrediction(m, (int)(100 + (Game.Ping / 2) + ObjectManager.Player.AttackCastDelay * 1000)) > 3) > 1 &&
                            !this.IsDangerousPosition(Game.CursorPos))
                        {
                            Q.Cast(Game.CursorPos);
                        }
                        if (ObjectManager.Player.UnderAllyTurret())
                        {
                            if (GameObjects.EnemyMinions.Count(
                                    m =>
                                    m.Position.Distance(ObjectManager.Player.Position) < 550 &&
                                    m.Health < ObjectManager.Player.GetAutoAttackDamage(m) + Q.GetDamage(m)) > 0 && !this.IsDangerousPosition(Game.CursorPos))
                            {
                                Q.Cast(Game.CursorPos);
                            }
                        }
                    }
                }
                if (UseQOnlyAt2WStacksBool && Orbwalker.ActiveMode != OrbwalkingMode.Combo && possible2WTarget.IsValidTarget())
                {
                    Q.Cast(GetTumblePos(possible2WTarget));
                }
            }
            if (orbwalkingActionArgs.Type == OrbwalkingType.BeforeAttack)
            {
                var possible2WTarget = ValidTargets.FirstOrDefault(
                    h =>
                    h.ServerPosition.Distance(ObjectManager.Player.ServerPosition) < 500 &&
                    h.GetBuffCount("vaynesilvereddebuff") == 2);
                if (TryToFocus2WBool && possible2WTarget.IsValidTarget())
                {
                    Orbwalker.ForceTarget = possible2WTarget;
                }
                if (ObjectManager.Player.HasBuff("vaynetumblefade") && DontAttackWhileInvisibleAndMeelesNearBool)
                {
                    if (
                        ValidTargets.Any(
                            e => e.ServerPosition.Distance(ObjectManager.Player.ServerPosition) < 350 && e.IsMelee))
                    {
                        orbwalkingActionArgs.Process = false;
                    }
                }
                var possibleTarget = Variables.TargetSelector.GetTarget(615, DamageType.Physical);
                if (possibleTarget != null && orbwalkingActionArgs.Target is Obj_AI_Minion &&
                    UseQBonusOnEnemiesNotCS && ObjectManager.Player.HasBuff("vaynetumblebonus"))
                {
                    Orbwalker.ForceTarget = possibleTarget;
                    Orbwalker.Attack(possibleTarget);
                    orbwalkingActionArgs.Process = false;
                }
                var possibleNearbyMeleeChampion =
                    ValidTargets.FirstOrDefault(
                        e => e.ServerPosition.Distance(ObjectManager.Player.ServerPosition) < 350);

                if (possibleNearbyMeleeChampion.IsValidTarget())
                {
                    if (Q.IsReady() && UseQBool)
                    {
                        var pos = ObjectManager.Player.ServerPosition.Extend(possibleNearbyMeleeChampion.ServerPosition,
                                                                             -350);
                        if (!IsDangerousPosition(pos))
                        {
                            Q.Cast(pos);
                            orbwalkingActionArgs.Process = false;
                        }
                    }
                    if (UseEWhenMeleesNearBool && !Q.IsReady() && E.IsReady())
                    {
                        var possibleMeleeChampionsGapclosers = from tuplet in CachedGapclosers
                                                               where tuplet.Item1 == possibleNearbyMeleeChampion.CharData.BaseSkinName
                                                               select tuplet.Item2;
                        if (possibleMeleeChampionsGapclosers.FirstOrDefault() != null)
                        {
                            if (
                                possibleMeleeChampionsGapclosers.Any(
                                    gapcloserEntry =>
                                    possibleNearbyMeleeChampion.Spellbook.GetSpell(gapcloserEntry.Slot).IsReady()))
                            {
                                return;
                            }
                        }
                        if (
                            possibleNearbyMeleeChampion.GetWaypoints()
                            .LastOrDefault()
                            .Distance(ObjectManager.Player.ServerPosition) < possibleNearbyMeleeChampion.AttackRange)
                        {
                            if (EDelaySlider.Value > 0)
                            {
                                var thisEnemy = possibleNearbyMeleeChampion;
                                DelayAction.Add(EDelaySlider.Value, () => E.CastOnUnit(thisEnemy));
                                return;
                            }
                            E.CastOnUnit(possibleNearbyMeleeChampion);
                        }
                    }
                }
            }
        }
示例#14
0
        public override async Task ExecuteAsync(CancellationToken token)
        {
            var target = Config.UpdateMode.Target;

            if (target == null || Menu.BladeMailItem && target.HasModifier("modifier_item_blade_mail_reflect"))
            {
                Orbwalker.Move(Game.MousePosition);
                return;
            }

            // Blink
            var blink = Abilities.Blink;

            if (blink != null &&
                Menu.ItemToggler.Value.IsEnabled(blink.ToString()) &&
                Owner.Distance2D(Game.MousePosition) > Menu.BlinkActivationItem &&
                Owner.Distance2D(target) > 600 &&
                blink.CanBeCasted)
            {
                var blinkPos = target.Position.Extend(Game.MousePosition, Menu.BlinkDistanceEnemyItem);
                if (Owner.Distance2D(blinkPos) < blink.CastRange)
                {
                    blink.UseAbility(blinkPos);
                    await Await.Delay(blink.GetCastDelay(blinkPos), token);
                }
            }

            if (Extensions.Cancel(target) && StartCombo(target))
            {
                if (!target.IsBlockingAbilities())
                {
                    var comboBreaker = Extensions.ComboBreaker(target);
                    var stunDebuff   = target.Modifiers.FirstOrDefault(x => x.IsStunDebuff);
                    var hexDebuff    = target.Modifiers.FirstOrDefault(x => x.Name == "modifier_sheepstick_debuff");

                    // Hex
                    var hex = Abilities.Hex;
                    if (hex != null &&
                        Menu.ItemToggler.Value.IsEnabled(hex.ToString()) &&
                        hex.CanBeCasted &&
                        hex.CanHit(target) &&
                        !comboBreaker &&
                        (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.3f) &&
                        (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.3f))
                    {
                        hex.UseAbility(target);
                        await Await.Delay(hex.GetCastDelay(target), token);
                    }

                    // Orchid
                    var orchid = Abilities.Orchid;
                    if (orchid != null &&
                        Menu.ItemToggler.Value.IsEnabled(orchid.ToString()) &&
                        orchid.CanBeCasted &&
                        orchid.CanHit(target) &&
                        !comboBreaker)
                    {
                        orchid.UseAbility(target);
                        await Await.Delay(orchid.GetCastDelay(target), token);
                    }

                    // Bloodthorn
                    var bloodthorn = Abilities.Bloodthorn;
                    if (bloodthorn != null &&
                        Menu.ItemToggler.Value.IsEnabled(bloodthorn.ToString()) &&
                        bloodthorn.CanBeCasted &&
                        bloodthorn.CanHit(target) &&
                        !comboBreaker)
                    {
                        bloodthorn.UseAbility(target);
                        await Await.Delay(bloodthorn.GetCastDelay(target), token);
                    }

                    // MysticFlare
                    var mysticFlare = Abilities.MysticFlare;
                    if (Menu.AbilityToggler.Value.IsEnabled(mysticFlare.ToString()) &&
                        Menu.MinHealthToUltItem <= ((float)target.Health / target.MaximumHealth) * 100 &&
                        mysticFlare.CanBeCasted &&
                        mysticFlare.CanHit(target) &&
                        !comboBreaker &&
                        (BadUlt(target) || Extensions.Active(target)))
                    {
                        var enemies = EntityManager <Hero> .Entities.Where(x =>
                                                                           x.IsValid &&
                                                                           x.IsVisible &&
                                                                           x.IsAlive &&
                                                                           !x.IsIllusion &&
                                                                           x.IsEnemy(Owner) &&
                                                                           x.Distance2D(Owner) <= mysticFlare.CastRange).ToList();

                        var dubleMysticFlare = Owner.HasAghanimsScepter() && enemies.Count() == 1;
                        var input            = new PredictionInput
                        {
                            Owner  = Owner,
                            Range  = mysticFlare.CastRange,
                            Radius = dubleMysticFlare ? -250 : -100
                        };

                        var output = Prediction.GetPrediction(input.WithTarget(target));

                        mysticFlare.UseAbility(output.CastPosition);
                        await Await.Delay(mysticFlare.GetCastDelay(output.CastPosition), token);
                    }

                    // Nullifier
                    var nullifier = Abilities.Nullifier;
                    if (nullifier != null &&
                        Menu.ItemToggler.Value.IsEnabled(nullifier.ToString()) &&
                        nullifier.CanBeCasted &&
                        nullifier.CanHit(target) &&
                        !comboBreaker &&
                        (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f) &&
                        (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.5f))
                    {
                        nullifier.UseAbility(target);
                        await Await.Delay(nullifier.GetCastDelay(target), token);
                    }

                    // RodofAtos
                    var atosDebuff = target.Modifiers.Any(x => x.IsValid && x.Name == "modifier_rod_of_atos_debuff" && x.RemainingTime > 0.5f);
                    var rodofAtos  = Abilities.RodofAtos;
                    if (rodofAtos != null &&
                        Menu.ItemToggler.Value.IsEnabled(rodofAtos.ToString()) &&
                        rodofAtos.CanBeCasted &&
                        rodofAtos.CanHit(target) &&
                        !atosDebuff &&
                        (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f))
                    {
                        rodofAtos.UseAbility(target);
                        await Await.Delay(rodofAtos.GetCastDelay(target), token);
                    }

                    // AncientSeal
                    var ancientSeal = Abilities.AncientSeal;
                    if (Menu.AbilityToggler.Value.IsEnabled(ancientSeal.ToString()) &&
                        ancientSeal.CanBeCasted &&
                        ancientSeal.CanHit(target) &&
                        !comboBreaker)
                    {
                        ancientSeal.UseAbility(target);
                        await Await.Delay(ancientSeal.GetCastDelay(target), token);

                        return;
                    }

                    // Veil
                    var veil = Abilities.Veil;
                    if (veil != null &&
                        Menu.ItemToggler.Value.IsEnabled(veil.ToString()) &&
                        veil.CanBeCasted &&
                        veil.CanHit(target))
                    {
                        veil.UseAbility(target.Position);
                        await Await.Delay(veil.GetCastDelay(target.Position), token);
                    }

                    // Ethereal
                    var ethereal = Abilities.Ethereal;
                    if (ethereal != null &&
                        Menu.ItemToggler.Value.IsEnabled(ethereal.ToString()) &&
                        ethereal.CanBeCasted &&
                        ethereal.CanHit(target) &&
                        !comboBreaker)
                    {
                        ethereal.UseAbility(target);
                        MultiSleeper.Sleep(ethereal.GetHitTime(target), "ethereal");
                        await Await.Delay(ethereal.GetCastDelay(target), token);
                    }

                    // Shivas
                    var shivas = Abilities.Shivas;
                    if (shivas != null &&
                        Menu.ItemToggler.Value.IsEnabled(shivas.ToString()) &&
                        shivas.CanBeCasted &&
                        shivas.CanHit(target))
                    {
                        shivas.UseAbility();
                        await Await.Delay(shivas.GetCastDelay(), token);
                    }

                    if (!MultiSleeper.Sleeping("ethereal") || target.IsEthereal())
                    {
                        // ConcussiveShot
                        var concussiveShot = Abilities.ConcussiveShot;
                        if (Menu.AbilityToggler.Value.IsEnabled(concussiveShot.ToString()) &&
                            Extensions.ConcussiveShotTarget(target, concussiveShot.TargetHit) &&
                            concussiveShot.CanBeCasted &&
                            concussiveShot.CanHit(target))
                        {
                            concussiveShot.UseAbility();
                            await Await.Delay(concussiveShot.GetCastDelay(), token);
                        }

                        // ArcaneBolt
                        var arcaneBolt = Abilities.ArcaneBolt;
                        if (Menu.AbilityToggler.Value.IsEnabled(arcaneBolt.ToString()) &&
                            arcaneBolt.CanBeCasted &&
                            arcaneBolt.CanHit(target))
                        {
                            arcaneBolt.UseAbility(target);

                            UpdateManager.BeginInvoke(() =>
                            {
                                MultiSleeper.Sleep(arcaneBolt.GetHitTime(target) - (arcaneBolt.GetCastDelay(target) + 350), $"arcanebolt_{ target.Name }");
                            },
                                                      arcaneBolt.GetCastDelay(target) + 50);

                            await Await.Delay(arcaneBolt.GetCastDelay(target), token);

                            return;
                        }

                        // Dagon
                        var dagon = Abilities.Dagon;
                        if (dagon != null &&
                            Menu.ItemToggler.Value.IsEnabled("item_dagon_5") &&
                            dagon.CanBeCasted &&
                            dagon.CanHit(target) &&
                            !comboBreaker)
                        {
                            dagon.UseAbility(target);
                            await Await.Delay(dagon.GetCastDelay(target), token);

                            return;
                        }
                    }

                    // UrnOfShadows
                    var urnOfShadows = Abilities.UrnOfShadows;
                    if (urnOfShadows != null &&
                        Menu.ItemToggler.Value.IsEnabled(urnOfShadows.ToString()) &&
                        urnOfShadows.CanBeCasted &&
                        urnOfShadows.CanHit(target) &&
                        !comboBreaker)
                    {
                        urnOfShadows.UseAbility(target);
                        await Await.Delay(urnOfShadows.GetCastDelay(target), token);
                    }

                    // SpiritVessel
                    var spiritVessel = Abilities.SpiritVessel;
                    if (spiritVessel != null &&
                        Menu.ItemToggler.Value.IsEnabled(spiritVessel.ToString()) &&
                        spiritVessel.CanBeCasted &&
                        spiritVessel.CanHit(target) &&
                        !comboBreaker)
                    {
                        spiritVessel.UseAbility(target);
                        await Await.Delay(spiritVessel.GetCastDelay(target), token);
                    }
                }
                else
                {
                    Config.LinkenBreaker.Handler.RunAsync();
                }
            }

            if (target.IsInvulnerable() || target.IsAttackImmune())
            {
                Orbwalker.Move(Game.MousePosition);
            }
            else
            {
                if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Default"))
                {
                    Orbwalker.OrbwalkTo(target);
                }
                else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Distance"))
                {
                    var ownerDis = Math.Min(Owner.Distance2D(Game.MousePosition), 230);
                    var ownerPos = Owner.Position.Extend(Game.MousePosition, ownerDis);
                    var pos      = target.Position.Extend(ownerPos, Menu.MinDisInOrbwalkItem);

                    Orbwalker.OrbwalkingPoint = pos;
                    Orbwalker.OrbwalkTo(target);
                    Orbwalker.OrbwalkingPoint = Vector3.Zero;
                }
                else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Free"))
                {
                    if (Owner.Distance2D(target) < Owner.AttackRange(target) && target.Distance2D(Game.MousePosition) < Owner.AttackRange(target))
                    {
                        Orbwalker.OrbwalkTo(target);
                    }
                    else
                    {
                        Orbwalker.Move(Game.MousePosition);
                    }
                }
                else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Only Attack"))
                {
                    Orbwalker.Attack(target);
                }
                else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("No Move"))
                {
                    if (Owner.Distance2D(target) < Owner.AttackRange(target))
                    {
                        Orbwalker.Attack(target);
                    }
                }
            }
        }
示例#15
0
 /// <summary>
 ///     Attacks target, uses spell UniqueAttackModifiers if enabled
 /// </summary>
 /// <param name="target">
 ///     The target.
 /// </param>
 /// <param name="useModifiers">
 ///     The use Modifiers.
 /// </param>
 public static void Attack(Unit target, bool useModifiers)
 {
     orbwalker.Attack(target, useModifiers);
 }
示例#16
0
        public override async Task ExecuteAsync(CancellationToken token)
        {
            try
            {
                if (Owner.IsChanneling())
                {
                    return;
                }

                var target = UpdateMode.Target;
                if (target == null || Menu.BladeMailItem && target.HasModifier("modifier_item_blade_mail_reflect"))
                {
                    Orbwalker.Move(Game.MousePosition);
                    return;
                }

                // ForceStaff
                var hook       = Main.Hook;
                var forceStaff = Main.ForceStaff;
                var blink      = Main.Blink;
                if (forceStaff != null &&
                    Menu.ItemToggler.Value.IsEnabled(forceStaff.ToString()) &&
                    !HookModifierDetected &&
                    Owner.Distance2D(target) > 500 &&
                    forceStaff.CanBeCasted)
                {
                    var forceStaffHook = hook.CanBeCasted && Owner.Distance2D(target) < hook.CastRange + forceStaff.PushLength;

                    var blinkReady      = blink != null && blink.CanBeCasted;
                    var forceStaffBlink = blinkReady && Owner.Distance2D(target) < blink.CastRange + forceStaff.PushLength;
                    if (forceStaffBlink && !blink.CanHit(target) || !blinkReady && forceStaffHook)
                    {
                        if (Owner.FindRotationAngle(target.Position) <= 0.3f)
                        {
                            forceStaff.UseAbility(Owner);
                            await Task.Delay((int)((forceStaff.PushLength / forceStaff.PushSpeed) * 1000), token);

                            return;
                        }

                        Owner.MoveToDirection(target.Position);
                        await Task.Delay(100);

                        return;
                    }
                }

                // Blink
                if (blink != null &&
                    Menu.ItemToggler.Value.IsEnabled(blink.ToString()) &&
                    !HookModifierDetected &&
                    blink.CanBeCasted &&
                    Owner.Distance2D(target, true) <= blink.CastRange &&
                    Owner.Distance2D(target) > 500)
                {
                    blink.UseAbility(target.Position);
                    await Task.Delay(blink.GetCastDelay(target.Position), token);

                    return;
                }

                var dismember           = Main.Dismember;
                var comboBreaker        = Extensions.ComboBreaker(target);
                var isBlockingAbilities = target.IsBlockingAbilities();

                var cancel            = Extensions.Cancel(target);
                var cancelMagicImmune = Extensions.CancelMagicImmune(target);
                if (cancel || cancelMagicImmune)
                {
                    if (!isBlockingAbilities)
                    {
                        var modifiers  = target.Modifiers.ToList();
                        var stunDebuff = modifiers.FirstOrDefault(x => x.IsStunDebuff);
                        var hexDebuff  = modifiers.FirstOrDefault(x => x.Name == "modifier_sheepstick_debuff");

                        // Hex
                        var dismemberReady = !Menu.AbilityToggler.Value.IsEnabled(dismember.ToString()) || !dismember.CanBeCasted || !dismember.CanHit(target);
                        var hex            = Main.Hex;
                        if (hex != null &&
                            Menu.ItemToggler.Value.IsEnabled(hex.ToString()) &&
                            hex.CanBeCasted &&
                            hex.CanHit(target) &&
                            !HookModifierDetected &&
                            dismemberReady &&
                            !comboBreaker &&
                            (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.3f) &&
                            (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.3f))
                        {
                            hex.UseAbility(target);
                            await Task.Delay(hex.GetCastDelay(target), token);

                            return;
                        }

                        // Orchid
                        var orchid = Main.Orchid;
                        if (orchid != null &&
                            Menu.ItemToggler.Value.IsEnabled(orchid.ToString()) &&
                            orchid.CanBeCasted &&
                            orchid.CanHit(target) &&
                            !comboBreaker)
                        {
                            orchid.UseAbility(target);
                            await Task.Delay(orchid.GetCastDelay(target), token);
                        }

                        // Bloodthorn
                        var bloodthorn = Main.Bloodthorn;
                        if (bloodthorn != null &&
                            Menu.ItemToggler.Value.IsEnabled(bloodthorn.ToString()) &&
                            bloodthorn.CanBeCasted &&
                            bloodthorn.CanHit(target) &&
                            !comboBreaker)
                        {
                            bloodthorn.UseAbility(target);
                            await Task.Delay(bloodthorn.GetCastDelay(target), token);
                        }

                        // Nullifier
                        var hookReady = !Menu.AbilityToggler.Value.IsEnabled(hook.ToString()) || !hook.CanBeCasted;
                        var nullifier = Main.Nullifier;
                        if (nullifier != null &&
                            Menu.ItemToggler.Value.IsEnabled(nullifier.ToString()) &&
                            nullifier.CanBeCasted &&
                            nullifier.CanHit(target) &&
                            !HookModifierDetected &&
                            dismemberReady &&
                            hookReady &&
                            !comboBreaker &&
                            (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f) &&
                            (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.5f))
                        {
                            nullifier.UseAbility(target);
                            await Task.Delay(nullifier.GetCastDelay(target), token);
                        }

                        var atosDebuff = modifiers.Any(x => x.Name == "modifier_rod_of_atos_debuff" && x.RemainingTime > 0.5f);
                        var atos       = Main.Atos;
                        if (atos != null &&
                            Menu.ItemToggler.Value.IsEnabled(atos.ToString()) &&
                            atos.CanBeCasted &&
                            atos.CanHit(target) &&
                            !HookModifierDetected &&
                            dismemberReady &&
                            hookReady &&
                            !atosDebuff &&
                            (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f))
                        {
                            atos.UseAbility(target);
                            MultiSleeper.Sleep(atos.GetHitTime(target), "atos");
                            await Task.Delay(atos.GetCastDelay(target), token);
                        }

                        // Veil
                        var veil = Main.Veil;
                        if (veil != null &&
                            Menu.ItemToggler.Value.IsEnabled(veil.ToString()) &&
                            veil.CanBeCasted &&
                            veil.CanHit(target))
                        {
                            veil.UseAbility(target.Position);
                            await Task.Delay(veil.GetCastDelay(target.Position), token);
                        }

                        // Ethereal
                        var ethereal = Main.Ethereal;
                        if (ethereal != null &&
                            Menu.ItemToggler.Value.IsEnabled(ethereal.ToString()) &&
                            ethereal.CanBeCasted &&
                            ethereal.CanHit(target) &&
                            !comboBreaker)
                        {
                            ethereal.UseAbility(target);
                            MultiSleeper.Sleep(ethereal.GetHitTime(target), "ethereal");
                            await Task.Delay(ethereal.GetCastDelay(target), token);
                        }

                        // Shivas
                        var shivas = Main.Shivas;
                        if (shivas != null &&
                            Menu.ItemToggler.Value.IsEnabled(shivas.ToString()) &&
                            shivas.CanBeCasted &&
                            shivas.CanHit(target))
                        {
                            shivas.UseAbility();
                            await Task.Delay(shivas.GetCastDelay(), token);
                        }

                        if (!MultiSleeper.Sleeping("ethereal") || target.IsEthereal())
                        {
                            // Dismember
                            if (Menu.AbilityToggler.Value.IsEnabled(dismember.ToString()) &&
                                dismember.CanBeCasted &&
                                dismember.CanHit(target) &&
                                !comboBreaker)
                            {
                                dismember.UseAbility(target);
                                await Task.Delay(dismember.GetCastDelay(target) + 50, token);

                                return;
                            }

                            // Hook
                            if (Menu.AbilityToggler.Value.IsEnabled(hook.ToString()) &&
                                hook.CanBeCasted &&
                                hook.CanHit(target))
                            {
                                // Atos
                                var hookOutput = hook.GetPredictionOutput(hook.GetPredictionInput(target));
                                if (atos != null &&
                                    Menu.ItemToggler.Value.IsEnabled(atos.ToString()) &&
                                    !HookModifierDetected &&
                                    atos.CanBeCasted &&
                                    atos.CanHit(target) &&
                                    !atosDebuff &&
                                    (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f))
                                {
                                    if (hookOutput.HitChance != HitChance.OutOfRange && hookOutput.HitChance != HitChance.Collision)
                                    {
                                        atos.UseAbility(target);
                                        MultiSleeper.Sleep(atos.GetHitTime(target), "atos");
                                        await Task.Delay(atos.GetCastDelay(target), token);
                                    }
                                }

                                if (Extensions.ShouldCastHook(hookOutput) && !MultiSleeper.Sleeping("atos") || target.HasModifier("modifier_rod_of_atos_debuff"))
                                {
                                    HookCastPosition = hookOutput.UnitPosition;
                                    hook.UseAbility(HookCastPosition);
                                    await Task.Delay(hook.GetCastDelay(HookCastPosition), token);

                                    return;
                                }
                            }

                            // Dagon
                            var dagon = Main.Dagon;
                            if (dagon != null &&
                                Menu.ItemToggler.Value.IsEnabled("item_dagon_5") &&
                                dagon.CanBeCasted &&
                                dagon.CanHit(target) &&
                                !comboBreaker)
                            {
                                dagon.UseAbility(target);
                                await Task.Delay(dagon.GetCastDelay(target), token);

                                return;
                            }
                        }

                        // Urn
                        var urn = Main.Urn;
                        if (urn != null &&
                            Menu.ItemToggler.Value.IsEnabled(urn.ToString()) &&
                            urn.CanBeCasted &&
                            urn.CanHit(target) &&
                            !comboBreaker &&
                            !modifiers.Any(x => x.Name == urn.TargetModifierName))
                        {
                            urn.UseAbility(target);
                            await Task.Delay(urn.GetCastDelay(target), token);
                        }

                        // Vessel
                        var vessel = Main.Vessel;
                        if (vessel != null &&
                            Menu.ItemToggler.Value.IsEnabled(vessel.ToString()) &&
                            vessel.CanBeCasted &&
                            vessel.CanHit(target) &&
                            !comboBreaker &&
                            !modifiers.Any(x => x.Name == vessel.TargetModifierName))
                        {
                            vessel.UseAbility(target);
                            await Task.Delay(vessel.GetCastDelay(target), token);
                        }
                    }
                    else
                    {
                        Config.LinkenBreaker.Handler.RunAsync();
                    }
                }

                if (Menu.DismemberIsMagicImmune && cancel && !cancelMagicImmune && !isBlockingAbilities)
                {
                    // Dismember
                    if (Menu.AbilityToggler.Value.IsEnabled(dismember.ToString()) &&
                        dismember.CanBeCasted &&
                        dismember.CanHit(target) &&
                        !comboBreaker)
                    {
                        dismember.UseAbility(target);
                        await Task.Delay(dismember.GetCastDelay(target) + 50, token);

                        return;
                    }
                }

                if (isBlockingAbilities)
                {
                    // Hook
                    if (Menu.AbilityToggler.Value.IsEnabled(hook.ToString()) &&
                        hook.CanBeCasted &&
                        hook.CanHit(target))
                    {
                        var hookOutput = hook.GetPredictionOutput(hook.GetPredictionInput(target));
                        if (Extensions.ShouldCastHook(hookOutput))
                        {
                            HookCastPosition = hookOutput.UnitPosition;
                            hook.UseAbility(HookCastPosition);
                            await Task.Delay(hook.GetCastDelay(HookCastPosition), token);
                        }
                    }
                }

                if (HookModifierDetected)
                {
                    return;
                }

                if (target.IsInvulnerable() || target.IsAttackImmune())
                {
                    Orbwalker.Move(Game.MousePosition);
                }
                else
                {
                    if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Free"))
                    {
                        var attackRange = Owner.AttackRange(target);
                        if (Owner.Distance2D(target) <= attackRange && !Menu.FullFreeModeItem || target.Distance2D(Game.MousePosition) <= attackRange)
                        {
                            Orbwalker.OrbwalkTo(target);
                        }
                        else
                        {
                            Orbwalker.Move(Game.MousePosition);
                        }
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Default"))
                    {
                        Orbwalker.OrbwalkTo(target);
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Only Attack"))
                    {
                        Orbwalker.Attack(target);
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("No Move"))
                    {
                        if (Owner.Distance2D(target) <= Owner.AttackRange(target))
                        {
                            Orbwalker.Attack(target);
                        }
                    }
                }
            }
            catch (TaskCanceledException)
            {
                // canceled
            }
            catch (Exception e)
            {
                Main.Log.Error(e);
            }
        }
示例#17
0
        private async Task ExecuteAsync(CancellationToken token)
        {
            try
            {
                if (Target == null || !Target.IsValid || !Target.IsAlive)
                {
                    if (Menu.SpamArcaneBoltUnitItem)
                    {
                        Target =
                            EntityManager <Unit> .Entities.Where(x =>
                                                                 x.IsValid &&
                                                                 x.IsVisible &&
                                                                 x.IsAlive &&
                                                                 !x.IsIllusion &&
                                                                 x.IsSpawned &&
                                                                 x.IsEnemy(Owner) &&
                                                                 x.Distance2D(Game.MousePosition) <= 100 &&
                                                                 (x.NetworkName == "CDOTA_BaseNPC_Creep_Neutral" ||
                                                                  x.NetworkName == "CDOTA_BaseNPC_Invoker_Forged_Spirit" ||
                                                                  x.NetworkName == "CDOTA_BaseNPC_Warlock_Golem" ||
                                                                  x.NetworkName == "CDOTA_BaseNPC_Creep" ||
                                                                  x.NetworkName == "CDOTA_BaseNPC_Creep_Lane" ||
                                                                  x.NetworkName == "CDOTA_BaseNPC_Creep_Siege" ||
                                                                  x.NetworkName == "CDOTA_Unit_Hero_Beastmaster_Boar" ||
                                                                  x.NetworkName == "CDOTA_Unit_Broodmother_Spiderling" ||
                                                                  x.NetworkName == "CDOTA_Unit_SpiritBear")).OrderBy(x => x.Distance2D(Game.MousePosition)).FirstOrDefault();
                    }

                    if (Target == null)
                    {
                        Target = Config.UpdateMode.Target;
                    }
                }

                if (Target != null)
                {
                    Particle.DrawTargetLine(
                        Owner,
                        "SpamTarget",
                        Target.Position,
                        Color.Green);

                    if (!Target.IsMagicImmune())
                    {
                        // ArcaneBolt
                        var arcaneBolt = Main.ArcaneBolt;
                        if (arcaneBolt.CanBeCasted && arcaneBolt.CanHit(Target))
                        {
                            arcaneBolt.UseAbility(Target);

                            if (Target is Hero)
                            {
                                UpdateManager.BeginInvoke(() =>
                                {
                                    Config.MultiSleeper.Sleep(arcaneBolt.GetHitTime(Target) - (arcaneBolt.GetCastDelay(Target) + 350), $"arcanebolt_{ Target.Name }");
                                },
                                                          arcaneBolt.GetCastDelay(Target) + 50);
                            }

                            await Await.Delay(arcaneBolt.GetCastDelay(Target), token);
                        }
                    }

                    if (Target.IsInvulnerable() || Target.IsAttackImmune())
                    {
                        Orbwalker.Move(Game.MousePosition);
                    }
                    else
                    {
                        if (Menu.OrbwalkerArcaneBoltItem.Value.SelectedValue.Contains("Default"))
                        {
                            Orbwalker.OrbwalkTo(Target);
                        }
                        else if (Menu.OrbwalkerArcaneBoltItem.Value.SelectedValue.Contains("Distance"))
                        {
                            var ownerDis = Math.Min(Owner.Distance2D(Game.MousePosition), 230);
                            var ownerPos = Owner.Position.Extend(Game.MousePosition, ownerDis);
                            var pos      = Target.Position.Extend(ownerPos, Menu.MinDisInOrbwalkArcaneBoltItem);

                            Orbwalker.OrbwalkingPoint = pos;
                            Orbwalker.OrbwalkTo(Target);
                            Orbwalker.OrbwalkingPoint = Vector3.Zero;
                        }
                        else if (Menu.OrbwalkerArcaneBoltItem.Value.SelectedValue.Contains("Free"))
                        {
                            if (Owner.Distance2D(Target) < Owner.AttackRange(Target) && Target.Distance2D(Game.MousePosition) < Owner.AttackRange(Target))
                            {
                                Orbwalker.OrbwalkTo(Target);
                            }
                            else
                            {
                                Orbwalker.Move(Game.MousePosition);
                            }
                        }
                        else if (Menu.OrbwalkerArcaneBoltItem.Value.SelectedValue.Contains("Only Attack"))
                        {
                            Orbwalker.Attack(Target);
                        }
                        else if (Menu.OrbwalkerArcaneBoltItem.Value.SelectedValue.Contains("No Move"))
                        {
                            if (Owner.Distance2D(Target) < Owner.AttackRange(Target))
                            {
                                Orbwalker.Attack(Target);
                            }
                        }
                    }
                }
                else
                {
                    Orbwalker.Move(Game.MousePosition);
                    Particle.Remove("SpamTarget");
                }
            }
            catch (TaskCanceledException)
            {
                // canceled
            }
            catch (Exception e)
            {
                Main.Log.Error(e);
            }
        }
示例#18
0
        public override async Task ExecuteAsync(CancellationToken token)
        {
            var target = Config.UpdateMode.Target;

            if (target != null && (!Menu.BladeMailItem || !target.HasModifier("modifier_item_blade_mail_reflect")))
            {
                var stunDebuff            = target.Modifiers.FirstOrDefault(x => x.IsStunDebuff);
                var hexDebuff             = target.Modifiers.FirstOrDefault(x => x.Name == "modifier_sheepstick_debuff");
                var atosDebuff            = target.Modifiers.FirstOrDefault(x => x.Name == "modifier_rod_of_atos_debuff");
                var modifierHurricanePike = Owner.HasModifier("modifier_item_hurricane_pike_range");

                // Blink
                var blink = Main.Blink;
                if (blink != null &&
                    Menu.ItemToggler.Value.IsEnabled(blink.ToString()) &&
                    Owner.Distance2D(Game.MousePosition) > Menu.BlinkActivationItem &&
                    Owner.Distance2D(target) > 600 &&
                    blink.CanBeCasted)
                {
                    var blinkPos = target.Position.Extend(Game.MousePosition, Menu.BlinkDistanceEnemyItem);
                    if (Owner.Distance2D(blinkPos) < blink.CastRange)
                    {
                        blink.UseAbility(blinkPos);
                        await Await.Delay(blink.GetCastDelay(blinkPos), token);
                    }
                }

                if (Extensions.Cancel(target))
                {
                    if (!target.IsBlockingAbilities())
                    {
                        // Hex
                        var hex = Main.Hex;
                        if (hex != null &&
                            Menu.ItemToggler.Value.IsEnabled(hex.ToString()) &&
                            hex.CanBeCasted &&
                            hex.CanHit(target) &&
                            (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.3f) &&
                            (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.3f))
                        {
                            hex.UseAbility(target);
                            await Await.Delay(hex.GetCastDelay(target), token);
                        }

                        // Orchid
                        var orchid = Main.Orchid;
                        if (orchid != null &&
                            Menu.ItemToggler.Value.IsEnabled(orchid.ToString()) &&
                            orchid.CanBeCasted &&
                            orchid.CanHit(target))
                        {
                            Main.Orchid.UseAbility(target);
                            await Await.Delay(Main.Orchid.GetCastDelay(target), token);
                        }

                        // Bloodthorn
                        var bloodthorn = Main.Bloodthorn;
                        if (bloodthorn != null &&
                            Menu.ItemToggler.Value.IsEnabled(bloodthorn.ToString()) &&
                            bloodthorn.CanBeCasted &&
                            bloodthorn.CanHit(target))
                        {
                            bloodthorn.UseAbility(target);
                            await Await.Delay(bloodthorn.GetCastDelay(target), token);
                        }

                        // Nullifier
                        var nullifier = Main.Nullifier;
                        if (nullifier != null &&
                            Menu.ItemToggler.Value.IsEnabled(nullifier.ToString()) &&
                            nullifier.CanBeCasted &&
                            nullifier.CanHit(target) &&
                            (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f) &&
                            (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.5f))
                        {
                            nullifier.UseAbility(target);
                            await Await.Delay(nullifier.GetCastDelay(target), token);
                        }

                        // RodofAtos
                        var rodofAtos = Main.RodofAtos;
                        if (rodofAtos != null &&
                            Menu.ItemToggler.Value.IsEnabled(rodofAtos.ToString()) &&
                            rodofAtos.CanBeCasted &&
                            rodofAtos.CanHit(target) &&
                            (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f) &&
                            (atosDebuff == null || !atosDebuff.IsValid || atosDebuff.RemainingTime <= 0.5f))
                        {
                            rodofAtos.UseAbility(target);
                            await Await.Delay(rodofAtos.GetCastDelay(target), token);
                        }

                        // GraveChill
                        var graveChill = Main.GraveChill;
                        if (Menu.AbilityToggler.Value.IsEnabled(graveChill.ToString()) &&
                            graveChill.CanBeCasted &&
                            graveChill.CanHit(target))
                        {
                            graveChill.UseAbility(target);
                            await Await.Delay(graveChill.GetCastDelay(target), token);
                        }

                        // HurricanePike
                        var hurricanePike = Main.HurricanePike;
                        if (hurricanePike != null &&
                            Menu.ItemToggler.Value.IsEnabled(hurricanePike.ToString()) &&
                            hurricanePike.CanBeCasted &&
                            hurricanePike.CanHit(target) &&
                            !MultiSleeper.Sleeping("ethereal") &&
                            !target.IsEthereal())
                        {
                            hurricanePike.UseAbility(target);
                            await Await.Delay(hurricanePike.GetCastDelay(target), token);

                            return;
                        }

                        // HeavensHalberd
                        var heavensHalberd = Main.HeavensHalberd;
                        if (heavensHalberd != null &&
                            Menu.ItemToggler.Value.IsEnabled(heavensHalberd.ToString()) &&
                            heavensHalberd.CanBeCasted &&
                            heavensHalberd.CanHit(target))
                        {
                            heavensHalberd.UseAbility(target);
                            await Await.Delay(heavensHalberd.GetCastDelay(target), token);
                        }

                        // Veil
                        var veil = Main.Veil;
                        if (veil != null &&
                            Menu.ItemToggler.Value.IsEnabled(veil.ToString()) &&
                            veil.CanBeCasted &&
                            veil.CanHit(target))
                        {
                            veil.UseAbility(target.Position);
                            await Await.Delay(veil.GetCastDelay(target.Position), token);
                        }

                        // Ethereal
                        var ethereal = Main.Ethereal;
                        if (ethereal != null &&
                            Menu.ItemToggler.Value.IsEnabled(ethereal.ToString()) &&
                            ethereal.CanBeCasted &&
                            ethereal.CanHit(target) &&
                            !modifierHurricanePike)
                        {
                            ethereal.UseAbility(target);
                            MultiSleeper.Sleep(ethereal.GetHitTime(target), "ethereal");
                            await Await.Delay(ethereal.GetCastDelay(target), token);
                        }

                        // Shivas
                        var shivas = Main.Shivas;
                        if (shivas != null &&
                            Menu.ItemToggler.Value.IsEnabled(shivas.ToString()) &&
                            shivas.CanBeCasted &&
                            shivas.CanHit(target))
                        {
                            shivas.UseAbility();
                            await Await.Delay(shivas.GetCastDelay(), token);
                        }

                        if (!MultiSleeper.Sleeping("ethereal") || target.IsEthereal())
                        {
                            // SoulAssumption
                            var SoulAssumption = Main.SoulAssumption;
                            if (Menu.AbilityToggler.Value.IsEnabled(SoulAssumption.ToString()) &&
                                SoulAssumption.CanBeCasted &&
                                SoulAssumption.CanHit(target) &&
                                SoulAssumption.MaxCharges)
                            {
                                SoulAssumption.UseAbility(target);
                                await Await.Delay(SoulAssumption.GetCastDelay(target), token);

                                return;
                            }

                            // Dagon
                            var Dagon = Main.Dagon;
                            if (Dagon != null &&
                                Menu.ItemToggler.Value.IsEnabled("item_dagon_5") &&
                                Dagon.CanBeCasted &&
                                Dagon.CanHit(target))
                            {
                                Dagon.UseAbility(target);
                                await Await.Delay(Dagon.GetCastDelay(target), token);

                                return;
                            }
                        }

                        // Medallion
                        var medallion = Main.Medallion;
                        if (medallion != null &&
                            Menu.ItemToggler.Value.IsEnabled(medallion.ToString()) &&
                            medallion.CanBeCasted &&
                            medallion.CanHit(target))
                        {
                            medallion.UseAbility(target);
                            await Await.Delay(medallion.GetCastDelay(target), token);
                        }

                        // SolarCrest
                        var solarCrest = Main.SolarCrest;
                        if (solarCrest != null &&
                            Menu.ItemToggler.Value.IsEnabled(solarCrest.ToString()) &&
                            solarCrest.CanBeCasted &&
                            solarCrest.CanHit(target))
                        {
                            solarCrest.UseAbility(target);
                            await Await.Delay(solarCrest.GetCastDelay(target), token);
                        }

                        // UrnOfShadows
                        var urnOfShadows = Main.UrnOfShadows;
                        if (urnOfShadows != null &&
                            Menu.ItemToggler.Value.IsEnabled(urnOfShadows.ToString()) &&
                            urnOfShadows.CanBeCasted &&
                            urnOfShadows.CanHit(target))
                        {
                            urnOfShadows.UseAbility(target);
                            await Await.Delay(urnOfShadows.GetCastDelay(target), token);
                        }

                        // SpiritVessel
                        var spiritVessel = Main.SpiritVessel;
                        if (spiritVessel != null &&
                            Menu.ItemToggler.Value.IsEnabled(spiritVessel.ToString()) &&
                            spiritVessel.CanBeCasted &&
                            spiritVessel.CanHit(target))
                        {
                            spiritVessel.UseAbility(target);
                            await Await.Delay(spiritVessel.GetCastDelay(target), token);
                        }
                    }
                    else
                    {
                        Config.LinkenBreaker.Handler.RunAsync();
                    }
                }

                // Necronomicon
                var necronomicon = Main.Necronomicon;
                if (necronomicon != null &&
                    Menu.ItemToggler.Value.IsEnabled("item_necronomicon_3") &&
                    necronomicon.CanBeCasted &&
                    Owner.Distance2D(target) <= Owner.AttackRange)
                {
                    necronomicon.UseAbility();
                    await Await.Delay(necronomicon.GetCastDelay(), token);
                }

                // Armlet
                var armlet = Main.Armlet;
                if (armlet != null &&
                    Menu.ItemToggler.Value.IsEnabled(armlet.ToString()) &&
                    !armlet.Enabled &&
                    Owner.Distance2D(target) <= Owner.AttackRange)
                {
                    armlet.UseAbility();
                    await Await.Delay(armlet.GetCastDelay(), token);
                }

                if (target.IsInvulnerable() || target.IsAttackImmune())
                {
                    Orbwalker.Move(Game.MousePosition);
                }
                else
                {
                    if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Only Attack") || modifierHurricanePike)
                    {
                        Orbwalker.Attack(target);
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Default"))
                    {
                        Orbwalker.OrbwalkingPoint = Vector3.Zero;
                        Orbwalker.OrbwalkTo(target);
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Distance"))
                    {
                        var ownerDis = Math.Min(Owner.Distance2D(Game.MousePosition), 230);
                        var ownerPos = Owner.Position.Extend(Game.MousePosition, ownerDis);
                        var pos      = target.Position.Extend(ownerPos, Menu.MinDisInOrbwalkItem);

                        Orbwalker.OrbwalkTo(target);
                        Orbwalker.OrbwalkingPoint = pos;
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Free"))
                    {
                        if (Owner.Distance2D(target) < Owner.AttackRange(target) && target.Distance2D(Game.MousePosition) < Owner.AttackRange(target))
                        {
                            Orbwalker.OrbwalkingPoint = Vector3.Zero;
                            Orbwalker.OrbwalkTo(target);
                        }
                        else
                        {
                            Orbwalker.Move(Game.MousePosition);
                        }
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("No Move"))
                    {
                        if (Owner.Distance2D(target) < Owner.AttackRange(target))
                        {
                            Orbwalker.Attack(target);
                        }
                    }
                }
            }
            else
            {
                Orbwalker.Move(Game.MousePosition);
            }
        }
示例#19
0
        public override async Task ExecuteAsync(CancellationToken token)
        {
            try
            {
                var target = targetSelector.Active.GetTargets().FirstOrDefault(x => x.IsValidTarget()) as Hero;

                if (target == null || !menu.AntiBladeMail && target.HasModifier("modifier_item_blade_mail_reflect"))
                {
                    if (Orbwalker.CanMove())
                    {
                        Orbwalker.Move(Game.MousePosition);
                    }

                    return;
                }
                if (target != null && target.IsAlive && !Owner.IsVisibleToEnemies && !menu.LockTarget || menu.LockTarget)
                {
                    Orbwalker.OrbwalkTo(target);
                }
                else
                {
                    if (Orbwalker.CanMove())
                    {
                        Orbwalker.Move(Game.MousePosition);
                    }
                }
                if (target != null && target.IsAlive && Owner.IsVisibleToEnemies)
                {
                    var Son = EntityManager <Unit> .Entities.Where(x => x.NetworkName == "CDOTA_Unit_Broodmother_Spiderling").ToList();

                    for (int i = 0; i < Son.Count(); i++)
                    {
                        if (Son[i].Distance2D(target) <= 2000 && Utils.SleepCheck(Son[i].Handle.ToString() + "Sons"))//&& Utils.SleepCheck(Son[i].Handle.ToString() + "Sons")
                        {
                            Son[i].Attack(target);
                            //Utils.Sleep(350, Son[i].Handle.ToString() + "Sons");
                        }
                    }
                    for (int i = 0; i < Son.Count(); i++)
                    {
                        if (Son[i].Distance2D(target) >= 2000 && Utils.SleepCheck(Son[i].Handle.ToString() + "Sons"))
                        {
                            Son[i].Move(Game.MousePosition);
                            //Utils.Sleep(350, Son[i].Handle.ToString() + "Sons");
                        }
                    }
                }

                var me      = ObjectManager.LocalHero;
                var linkens = target.Modifiers.Any(x => x.Name == "modifier_item_spheretarget") || target.Inventory.Items.Any(x => x.Name == "item_sphere");
                var enemies = ObjectManager.GetEntities <Hero>().Where(hero => hero.IsAlive && !hero.IsIllusion && hero.IsVisible && hero.Team != me.Team).ToList();
                if (target != null && target.IsAlive && !target.IsIllusion && me.Distance2D(target) <= 2000)
                {
                    var W   = abilities.W;
                    var web = EntityManager <Unit> .Entities.Where(unit => unit.NetworkName == "CDOTA_Unit_Broodmother_Web").ToList();

                    var SpinWeb = GetClosestToWeb(web, me);
                    if (menu.AbilityTogglerItem.Value.IsEnabled(W.Ability.Name) && W.CanBeCasted && !W.Ability.IsHidden)
                    {
                        if ((me.Distance2D(SpinWeb) >= 900) && me.Distance2D(target) <= 800 && Utils.SleepCheck(SpinWeb.Handle.ToString() + "SpideWeb"))
                        {
                            W.UseAbility(target.Predict(1100));
                            //await Task.Delay(W.GetCastDelay(), token);
                            Utils.Sleep(300, SpinWeb.Handle.ToString() + "SpideWeb");
                        }
                    }


                    if (!target.IsMagicImmune())
                    {
                        var Q = abilities.Q;
                        if (menu.AbilityTogglerItem.Value.IsEnabled(Q.Ability.Name) && Q.CanBeCasted && !Q.Ability.IsHidden && !target.IsMagicImmune() && Owner.Distance2D(target) <= 600)
                        {
                            Q.UseAbility(target);
                            await Task.Delay(Q.GetCastDelay(target), token);
                        }
                        var R = abilities.R;
                        if (menu.AbilityTogglerItem.Value.IsEnabled(R.Ability.Name) && R.CanBeCasted && target.IsValidTarget() && Owner.Distance2D(target) <= 350)
                        {
                            R.UseAbility();
                            await Task.Delay(R.GetCastDelay(), token);
                        }

                        var orchid = me.GetItemById(ItemId.item_orchid) ??
                                     me.GetItemById(ItemId.item_bloodthorn);
                        if (orchid != null &&
                            orchid.CanBeCasted() &&
                            !linkens &&
                            orchid.CanHit(target) &&
                            Utils.SleepCheck("orchid") && me.Distance2D(target) <= 1000)
                        {
                            orchid.UseAbility(target);
                            Utils.Sleep(250, "orchid");
                        }
                        var sheep = me.GetItemById(ItemId.item_sheepstick);
                        if (sheep != null &&
                            menu.ItemTogglerItem.Value.IsEnabled(sheep.ToString()) &&
                            sheep.CanBeCasted() &&
                            !linkens &&
                            sheep.CanHit(target) &&
                            Utils.SleepCheck("sheep") && me.Distance2D(target) <= 600)
                        {
                            sheep.UseAbility(target);
                            Utils.Sleep(250, "sheep");
                        }
                        var Soul = me.GetItemById(ItemId.item_soul_ring);
                        if (Soul != null &&
                            menu.ItemTogglerItem.Value.IsEnabled(Soul.ToString()) &&
                            Owner.Health / Owner.MaximumHealth <= 0.5 &&
                            Owner.Mana <= Q.ManaCost &&
                            Soul.CanBeCasted())
                        {
                            Soul.UseAbility();
                        }
                        var shiva = me.GetItemById(ItemId.item_shivas_guard);
                        if (shiva != null &&
                            menu.ItemTogglerItem.Value.IsEnabled(shiva.ToString()) &&
                            shiva.CanBeCasted() &&
                            shiva.CanHit(target) && Utils.SleepCheck("shiva") &&
                            me.Distance2D(target) <= 600)
                        {
                            shiva.UseAbility();
                            //await Task.Delay(shiva.GetCastDelay(), token);
                            Utils.Sleep(250, "shiva");
                        }
                        var mom = me.GetItemById(ItemId.item_mask_of_madness);
                        if (mom != null &&
                            menu.ItemTogglerItem.Value.IsEnabled(mom.ToString()) &&
                            mom.CanBeCasted() && Utils.SleepCheck("mom") &&
                            me.Distance2D(target) <= 700)
                        {
                            mom.UseAbility();
                            Utils.Sleep(250, "mom");
                        }
                        var medall = me.GetItemById(ItemId.item_solar_crest) ??
                                     me.GetItemById(ItemId.item_medallion_of_courage);
                        if (medall != null &&
                            medall.CanBeCasted() && Utils.SleepCheck("medall") &&
                            me.Distance2D(target) <= 500)
                        {
                            medall.UseAbility(target);
                            Utils.Sleep(250, "Medall");
                        }
                        var abyssal = me.GetItemById(ItemId.item_abyssal_blade);
                        if (abyssal != null &&
                            menu.ItemTogglerItem.Value.IsEnabled(abyssal.ToString()) &&
                            abyssal.CanBeCasted() && Utils.SleepCheck("abyssal") &&
                            me.Distance2D(target) <= 400)
                        {
                            abyssal.UseAbility(target);
                            Utils.Sleep(250, "abyssal");
                        }
                        var halberd = me.GetItemById(ItemId.item_heavens_halberd);
                        if (halberd != null &&
                            menu.ItemTogglerItem.Value.IsEnabled(halberd.ToString()) &&
                            halberd.CanBeCasted() && Utils.SleepCheck("halberd") &&
                            me.Distance2D(target) <= 700)
                        {
                            halberd.UseAbility(target);
                            Utils.Sleep(250, "halberd");
                        }
                        var mjollnir = me.GetItemById(ItemId.item_mjollnir);
                        if (mjollnir != null &&
                            menu.ItemTogglerItem.Value.IsEnabled(mjollnir.ToString()) &&
                            mjollnir.CanBeCasted() && Utils.SleepCheck("mjollnir") &&
                            me.Distance2D(target) <= 600)
                        {
                            mjollnir.UseAbility(Owner);
                            Utils.Sleep(250, "mjollnir");
                        }
                        var satanic = me.GetItemById(ItemId.item_satanic);
                        if (satanic != null &&
                            menu.ItemTogglerItem.Value.IsEnabled(satanic.ToString()) &&
                            Owner.Health / Owner.MaximumHealth <= 0.4 &&
                            satanic.CanBeCasted() && Utils.SleepCheck("Satanic") &&
                            me.Distance2D(target) <= 300)
                        {
                            satanic.UseAbility();
                            Utils.Sleep(250, "Satanic");
                        }

                        if ((!Owner.CanAttack() || Owner.Distance2D(target) >= 0) && Owner.NetworkActivity != NetworkActivity.Attack &&
                            Owner.Distance2D(target) <= 600 && Utils.SleepCheck("Move"))
                        {
                            Orbwalker.Move(target.Predict(500));
                            //Utils.Sleep(390, "Move");
                        }
                        if (Owner.Distance2D(target) <= Owner.AttackRange + 100 && (!Owner.IsAttackImmune() || !target.IsAttackImmune()) &&
                            Owner.NetworkActivity != NetworkActivity.Attack && Owner.CanAttack() && Utils.SleepCheck("attack"))
                        {
                            Orbwalker.Attack(target);
                            // Utils.Sleep(160, "attack");
                        }
                    }
                }
                await Task.Delay(290, token);
            }
            catch (TaskCanceledException)
            {
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
        }
示例#20
0
        public override async Task ExecuteAsync(CancellationToken token)
        {
            try
            {
                var target = UpdateMode.Target;
                if (target == null || Menu.BladeMailItem && target.HasModifier("modifier_item_blade_mail_reflect"))
                {
                    Orbwalker.Move(Game.MousePosition);
                    return;
                }

                if (!Owner.IsInvisible())
                {
                    var blockingAbilities = target.IsBlockingAbilities();
                    var comboBreaker      = Extensions.ComboBreaker(target);

                    var cancelAdditionally = Extensions.CancelAdditionally(target);
                    if (Extensions.Cancel(target) && cancelAdditionally)
                    {
                        var modifiers = target.Modifiers.ToList();

                        if (!target.IsMagicImmune())
                        {
                            if (!blockingAbilities)
                            {
                                var stunDebuff = modifiers.FirstOrDefault(x => x.IsStunDebuff);
                                var hexDebuff  = modifiers.FirstOrDefault(x => x.Name == "modifier_sheepstick_debuff");

                                // Abyssal Blade
                                var abyssalBlade = Main.AbyssalBlade;
                                if (abyssalBlade != null &&
                                    Menu.ItemToggler.Value.IsEnabled(abyssalBlade.ToString()) &&
                                    abyssalBlade.CanBeCasted &&
                                    Owner.Distance2D(target) < abyssalBlade.CastRange + 60 &&
                                    !comboBreaker &&
                                    (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.3f) &&
                                    (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.3f))
                                {
                                    abyssalBlade.UseAbility(target);
                                    await Task.Delay(abyssalBlade.GetCastDelay(target), token);

                                    return;
                                }

                                // Hex
                                var hex = Main.Hex;
                                if (hex != null &&
                                    Menu.ItemToggler.Value.IsEnabled(hex.ToString()) &&
                                    hex.CanBeCasted &&
                                    hex.CanHit(target) &&
                                    !comboBreaker &&
                                    (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.3f) &&
                                    (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.3f))
                                {
                                    hex.UseAbility(target);
                                    await Task.Delay(hex.GetCastDelay(target), token);
                                }

                                // Orchid
                                var orchid = Main.Orchid;
                                if (orchid != null &&
                                    Menu.ItemToggler.Value.IsEnabled(orchid.ToString()) &&
                                    orchid.CanBeCasted &&
                                    orchid.CanHit(target) &&
                                    !comboBreaker)
                                {
                                    orchid.UseAbility(target);
                                    await Task.Delay(orchid.GetCastDelay(target), token);
                                }

                                // Bloodthorn
                                var bloodthorn = Main.Bloodthorn;
                                if (bloodthorn != null &&
                                    Menu.ItemToggler.Value.IsEnabled(bloodthorn.ToString()) &&
                                    bloodthorn.CanBeCasted &&
                                    bloodthorn.CanHit(target) &&
                                    !comboBreaker)
                                {
                                    bloodthorn.UseAbility(target);
                                    await Task.Delay(bloodthorn.GetCastDelay(target), token);
                                }

                                // Nullifier
                                var nullifier = Main.Nullifier;
                                if (nullifier != null &&
                                    Menu.ItemToggler.Value.IsEnabled(nullifier.ToString()) &&
                                    nullifier.CanBeCasted &&
                                    nullifier.CanHit(target) &&
                                    !comboBreaker &&
                                    (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f) &&
                                    (hexDebuff == null || !hexDebuff.IsValid || hexDebuff.RemainingTime <= 0.5f))
                                {
                                    nullifier.UseAbility(target);
                                    await Task.Delay(nullifier.GetCastDelay(target), token);
                                }

                                // Atos
                                var atosDebuff = modifiers.Any(x => x.Name == "modifier_rod_of_atos_debuff" && x.RemainingTime > 0.5f);
                                var atos       = Main.Atos;
                                if (atos != null &&
                                    Menu.ItemToggler.Value.IsEnabled(atos.ToString()) &&
                                    atos.CanBeCasted &&
                                    atos.CanHit(target) &&
                                    !atosDebuff &&
                                    (stunDebuff == null || !stunDebuff.IsValid || stunDebuff.RemainingTime <= 0.5f))
                                {
                                    atos.UseAbility(target);
                                    MultiSleeper.Sleep(atos.GetHitTime(target), "atos");
                                    await Task.Delay(atos.GetCastDelay(target), token);
                                }

                                // Veil
                                var veil = Main.Veil;
                                if (veil != null &&
                                    Menu.ItemToggler.Value.IsEnabled(veil.ToString()) &&
                                    veil.CanBeCasted &&
                                    veil.CanHit(target))
                                {
                                    veil.UseAbility(target.Position);
                                    await Task.Delay(veil.GetCastDelay(target.Position), token);
                                }

                                // Ethereal
                                var ethereal = Main.Ethereal;
                                if (ethereal != null &&
                                    Menu.ItemToggler.Value.IsEnabled(ethereal.ToString()) &&
                                    ethereal.CanBeCasted &&
                                    ethereal.CanHit(target) &&
                                    !comboBreaker)
                                {
                                    ethereal.UseAbility(target);
                                    MultiSleeper.Sleep(ethereal.GetHitTime(target), "ethereal");
                                    await Task.Delay(ethereal.GetCastDelay(target), token);
                                }

                                // Shivas
                                var shivas = Main.Shivas;
                                if (shivas != null &&
                                    Menu.ItemToggler.Value.IsEnabled(shivas.ToString()) &&
                                    shivas.CanBeCasted &&
                                    shivas.CanHit(target))
                                {
                                    shivas.UseAbility();
                                    await Task.Delay(shivas.GetCastDelay(), token);
                                }

                                if (!MultiSleeper.Sleeping("ethereal") || target.IsEthereal())
                                {
                                    // Dagon
                                    var dagon = Main.Dagon;
                                    if (dagon != null &&
                                        Menu.ItemToggler.Value.IsEnabled("item_dagon_5") &&
                                        dagon.CanBeCasted &&
                                        dagon.CanHit(target) &&
                                        !comboBreaker)
                                    {
                                        dagon.UseAbility(target);
                                        await Task.Delay(dagon.GetCastDelay(target), token);
                                    }
                                }

                                // Urn
                                var urn = Main.Urn;
                                if (urn != null &&
                                    Menu.ItemToggler.Value.IsEnabled(urn.ToString()) &&
                                    urn.CanBeCasted &&
                                    urn.CanHit(target) &&
                                    !comboBreaker &&
                                    !modifiers.Any(x => x.Name == urn.TargetModifierName))
                                {
                                    urn.UseAbility(target);
                                    await Task.Delay(urn.GetCastDelay(target), token);
                                }

                                // Vessel
                                var vessel = Main.Vessel;
                                if (vessel != null &&
                                    Menu.ItemToggler.Value.IsEnabled(vessel.ToString()) &&
                                    vessel.CanBeCasted &&
                                    vessel.CanHit(target) &&
                                    !comboBreaker &&
                                    !modifiers.Any(x => x.Name == vessel.TargetModifierName))
                                {
                                    vessel.UseAbility(target);
                                    await Task.Delay(vessel.GetCastDelay(target), token);
                                }
                            }
                            else
                            {
                                LinkenBreaker.Handler.RunAsync();
                            }

                            // Solar Crest
                            var solarCrest = Main.SolarCrest;
                            if (solarCrest != null &&
                                Menu.ItemToggler.Value.IsEnabled(solarCrest.ToString()) &&
                                solarCrest.CanBeCasted &&
                                solarCrest.CanHit(target))
                            {
                                solarCrest.UseAbility(target);
                                await Task.Delay(solarCrest.GetCastDelay(target), token);
                            }
                        }

                        if (!MultiSleeper.Sleeping("ethereal") || target.IsEthereal())
                        {
                            // Overwhelming Odds
                            var overwhelmingOdds = Main.OverwhelmingOdds;
                            if (Menu.AbilityToggler.Value.IsEnabled(overwhelmingOdds.ToString()) &&
                                overwhelmingOdds.CanBeCasted &&
                                !comboBreaker)
                            {
                                var heroes = EntityManager <Hero> .Entities.Where(x => x.IsValid && x.IsVisible && x.IsAlive && x.IsEnemy(Owner) && !x.IsInvulnerable()).ToArray();

                                if (heroes.All(x => x.Distance2D(Owner) < overwhelmingOdds.CastRange + 300))
                                {
                                    var input = new PredictionInput
                                    {
                                        Owner                   = Owner,
                                        AreaOfEffect            = overwhelmingOdds.HasAreaOfEffect,
                                        AreaOfEffectTargets     = heroes,
                                        CollisionTypes          = overwhelmingOdds.CollisionTypes,
                                        Delay                   = overwhelmingOdds.CastPoint + overwhelmingOdds.ActivationDelay,
                                        Speed                   = overwhelmingOdds.Speed,
                                        Range                   = overwhelmingOdds.CastRange,
                                        Radius                  = overwhelmingOdds.Radius,
                                        PredictionSkillshotType = overwhelmingOdds.PredictionSkillshotType
                                    };

                                    var castPosition = overwhelmingOdds.GetPredictionOutput(input.WithTarget(target)).CastPosition;
                                    if (Owner.Distance2D(castPosition) <= overwhelmingOdds.CastRange)
                                    {
                                        overwhelmingOdds.UseAbility(castPosition);
                                        await Task.Delay(overwhelmingOdds.GetCastDelay(castPosition), token);
                                    }
                                }
                            }
                        }
                    }

                    var blink      = Main.Blink;
                    var distance   = Owner.Distance2D(target, true);
                    var blinkReady = blink != null && Menu.ItemToggler.Value.IsEnabled(blink.ToString()) && blink.CanBeCasted;

                    if (cancelAdditionally)
                    {
                        if (distance <= (blinkReady ? blink.CastRange : 250))
                        {
                            // Press The Attack
                            var pressTheAttack      = Main.PressTheAttack;
                            var pressTheAttackReady = Menu.AbilityToggler.Value.IsEnabled(pressTheAttack.ToString()) && pressTheAttack.CanBeCasted;
                            if (pressTheAttackReady)
                            {
                                pressTheAttack.UseAbility(Owner);
                                await Task.Delay(pressTheAttack.GetCastDelay(), token);
                            }

                            // Mjollnir
                            var mjollnir      = Main.Mjollnir;
                            var mjollnirReady = mjollnir != null && Menu.ItemToggler.Value.IsEnabled(mjollnir.ToString()) && mjollnir.CanBeCasted;
                            if (mjollnirReady)
                            {
                                mjollnir.UseAbility(Owner);
                                await Task.Delay(mjollnir.GetCastDelay(), token);
                            }

                            // Armlet
                            var armlet      = Main.Armlet;
                            var armletReady = armlet != null && Menu.ItemToggler.Value.IsEnabled(armlet.ToString()) && !armlet.Enabled;
                            if (armletReady)
                            {
                                armlet.Enabled = true;
                                await Task.Delay(armlet.GetCastDelay(), token);
                            }

                            // Blade Mail
                            var bladeMail      = Main.BladeMail;
                            var bladeMailReady = bladeMail != null && Menu.ItemToggler.Value.IsEnabled(bladeMail.ToString()) && bladeMail.CanBeCasted && !comboBreaker;
                            if (bladeMailReady)
                            {
                                bladeMail.UseAbility();
                                await Task.Delay(bladeMail.GetCastDelay(), token);
                            }

                            // Satanic
                            var satanic      = Main.Satanic;
                            var satanicReady = satanic != null && Menu.ItemToggler.Value.IsEnabled(satanic.ToString()) && satanic.CanBeCasted && !comboBreaker;
                            if (satanicReady)
                            {
                                satanic.UseAbility();
                                await Task.Delay(satanic.GetCastDelay(), token);
                            }

                            // Black King Bar
                            var blackKingBar      = Main.BlackKingBar;
                            var blackKingBarReady = blackKingBar != null && Menu.ItemToggler.Value.IsEnabled(blackKingBar.ToString()) && blackKingBar.CanBeCasted && !comboBreaker;
                            if (blackKingBarReady)
                            {
                                blackKingBar.UseAbility();
                                await Task.Delay(blackKingBar.GetCastDelay(), token);
                            }

                            if (pressTheAttackReady || mjollnirReady || armletReady || bladeMailReady || satanicReady || blackKingBarReady)
                            {
                                await Task.Delay(125, token);

                                return;
                            }
                        }

                        if (!blockingAbilities)
                        {
                            // Duel
                            var duel = Main.Duel;
                            if (Menu.AbilityToggler.Value.IsEnabled(duel.ToString()) &&
                                duel.CanBeCasted &&
                                Owner.Distance2D(target) < duel.CastRange + 50 &&
                                !comboBreaker)
                            {
                                duel.UseAbility(target);
                                await Task.Delay(duel.GetCastDelay(target), token);
                            }
                        }
                        else
                        {
                            LinkenBreaker.Handler.RunAsync();
                        }
                    }

                    // Blink
                    if (blinkReady && distance <= blink.CastRange && distance > 150)
                    {
                        blink.UseAbility(target.Position);
                        await Task.Delay(blink.GetCastDelay(target.Position), token);
                    }
                }

                if (target.IsInvulnerable() || target.IsAttackImmune())
                {
                    Orbwalker.Move(Game.MousePosition);
                }
                else
                {
                    if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Default"))
                    {
                        Orbwalker.OrbwalkTo(target);
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Free"))
                    {
                        var attackRange = Owner.AttackRange(target);
                        if (Owner.Distance2D(target) <= attackRange && !Menu.FullFreeModeItem || target.Distance2D(Game.MousePosition) <= attackRange)
                        {
                            Orbwalker.OrbwalkTo(target);
                        }
                        else
                        {
                            Orbwalker.Move(Game.MousePosition);
                        }
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("Only Attack"))
                    {
                        Orbwalker.Attack(target);
                    }
                    else if (Menu.OrbwalkerItem.Value.SelectedValue.Contains("No Move"))
                    {
                        if (Owner.Distance2D(target) <= Owner.AttackRange(target))
                        {
                            Orbwalker.Attack(target);
                        }
                    }
                }
            }
            catch (TaskCanceledException)
            {
                // canceled
            }
            catch (Exception e)
            {
                Main.Log.Error(e);
            }
        }