Exemplo n.º 1
0
        private static void DRangerUpdate(EventArgs args)
        {
            if (Game.IsInGame && !Game.IsPaused && !Game.IsWatchingGame)
            {
                gameLoad = true;
                meLulz   = ObjectMgr.LocalHero;
            }
            else
            {
                gameLoad = false;
                rangesAA = null;
                rangesW  = null;
            }

            if (!gameLoad || !IsDRanger())
            {
                return;
            }

            theQ = meLulz.Spellbook.SpellQ;
            theW = meLulz.Spellbook.SpellW;
            theE = meLulz.Spellbook.SpellE;

            _target = isAABest ? TargetSelector.BestAutoAttackTarget(meLulz) : TargetSelector.ClosestToMouse(meLulz);

            Combo();

            //Console.WriteLine("Q Spell name is: " + theQ.Name);
        }
Exemplo n.º 2
0
 public static Hero BestAATarget(this Hero source)
 {
     return(TargetSelector.BestAutoAttackTarget(source));
 }
Exemplo n.º 3
0
        protected override async Task Execute(CancellationToken token)
        {
            var prioritizeEvade = ZaioMenu.ShouldRespectEvader;

            if (!ZaioMenu.ShouldLockTarget || Target == null || !Target.IsAlive)
            {
                //Log.Debug($"Find new target");
                // todo: more select0rs
                var oldTarget = Target;
                switch (ZaioMenu.TargetSelectorMode)
                {
                case TargetSelectorMode.NearestToMouse:
                    Target = TargetSelector.ClosestToMouse(MyHero);
                    break;

                case TargetSelectorMode.BestAutoAttackTarget:
                    Target = TargetSelector.BestAutoAttackTarget(MyHero);
                    break;

                case TargetSelectorMode.HighestHealth:
                    Target = TargetSelector.HighestHealthPointsTarget(MyHero, 1000);
                    break;
                }


                if (prioritizeEvade && !Utils.SleepCheck("Evader.Avoiding"))
                {
                    Log.Debug($"abort because evade2");
                    return;
                }

                if (oldTarget != Target)
                {
                    NewTargetAcquired?.Invoke(this, new EntityEventArgs(Target));
                }

                if (Target == null)
                {
                    switch (ZaioMenu.NoTargetMode)
                    {
                    case NoTargetMode.Move:
                        MyHero.Move(Game.MousePosition);
                        break;

                    case NoTargetMode.AttackMove:
                        if (!MyHero.IsAttacking())
                        {
                            MyHero.Attack(Game.MousePosition);
                        }
                        break;
                    }
                    await Await.Delay(125, token);

                    return;
                }
            }

            if (prioritizeEvade && !Utils.SleepCheck("Evader.Avoiding"))
            {
                Log.Debug($"abort because evade3");
                return;
            }


            try
            {
                await ExecuteComboAsync(Target, token);

                await Await.Delay(1, token);
            }
            finally
            {
                _executed = true;
            }
        }
Exemplo n.º 4
0
 /// <summary>
 ///     The best aa target.
 /// </summary>
 /// <param name="unit">
 ///     The unit.
 /// </param>
 /// <param name="bonusRange">
 ///     The bonus range.
 /// </param>
 /// <returns>
 ///     The <see cref="Hero" />.
 /// </returns>
 public static Hero BestAATarget(this Unit unit, float bonusRange = 0)
 {
     return(TargetSelector.BestAutoAttackTarget(unit, bonusRange));
 }
Exemplo n.º 5
0
 /// <summary>
 /// </summary>
 /// <param name="source"></param>
 /// <param name="bonusRange"></param>
 /// <returns></returns>
 public static Hero BestAATarget(this Hero source, float bonusRange = 0)
 {
     return(TargetSelector.BestAutoAttackTarget(source, bonusRange));
 }