Ejemplo n.º 1
0
        public override async Task ExecuteAsync(CancellationToken token)
        {
            if (TargetSelector.IsActive)
            {
                Target = TargetSelector.Active.GetTargets().FirstOrDefault();
            }

            if (Target != null)
            {
                if (Output.Unit != null && Output.AoeTargetsHit.Count >= (Config.AmountItem.Value == 1 ? 0 : Config.AmountItem.Value) &&
                    (BlackHole == null || !BlackHole.Ability.IsChanneling))
                {
                    Elsecount = 0;

                    // Blink
                    if (Blink != null &&
                        BlackHole != null &&
                        BlackHole.IsReady &&
                        Owner.Distance2D(Output.CastPosition) <= Blink.CastRange
                        + (Lens != null ? Lens.GetCastRange() : 0) &&
                        Config.ItemsToggler.Value.IsEnabled(Blink.Item.Name) &&
                        Blink.CanBeCasted &&
                        Owner.Distance2D(Output.CastPosition) >= 400)
                    {
                        Blink.UseAbility(Output.CastPosition);
                        await Await.Delay(Blink.GetCastDelay(Target.Position), token);
                    }

                    if (Blink == null || !Blink.CanBeCasted || !Config.ItemsToggler.Value.IsEnabled(Blink.Item.Name) || Owner.Distance2D(Output.CastPosition) <= 400)
                    {
                        UseItem(token);
                    }

                    // BlackHole
                    if (BlackHole != null &&
                        Config.AbilityToggler.Value.IsEnabled(BlackHole.Ability.Name) &&
                        BlackHole.CanBeCasted &&
                        Elsecount == 6)
                    {
                        BlackHole.UseAbility(Output.CastPosition);
                        await Await.Delay(BlackHole.GetCastDelay(Output.CastPosition), token);
                    }
                    else
                    {
                        Elsecount += 1;
                    }

                    // Refresher
                    if (Refresher != null &&
                        Config.ItemsToggler.Value.IsEnabled(Refresher.Item.Name) &&
                        Refresher.CanBeCasted &&
                        BlackHole != null && !BlackHole.CanBeCasted && !BlackHole.Ability.IsChanneling &&
                        Elsecount == 7)
                    {
                        Refresher.UseAbility();
                        await Await.Delay(Refresher.GetCastDelay(), token);
                    }
                }

                if (Target.IsAttackImmune() || Target.IsInvulnerable() && (BlackHole == null || !BlackHole.Ability.IsChanneling))
                {
                    Orbwalker.Move(Game.MousePosition);
                }
                else if (BlackHole == null || !BlackHole.Ability.IsChanneling)
                {
                    Orbwalker.OrbwalkTo(Target);
                }
            }
            else if (BlackHole == null || !BlackHole.Ability.IsChanneling)
            {
                Orbwalker.Move(Game.MousePosition);
            }
        }