Ejemplo n.º 1
0
        public void Find()
        {
            if (sleeper.Sleeping)
            {
                return;
            }

            if (locked && Target != null && Target.IsAlive)
            {
                return;
            }
            Target =
                Heroes.GetByTeam(Variable.EnemyTeam)
                .Where(
                    x =>
                    x.IsValid && x.IsAlive && !x.IsIllusion && x.IsVisible &&
                    x.Distance2D(Game.MousePosition) < 2000)
                .MinOrDefault(x => x.Distance2D(Game.MousePosition));
            sleeper.Sleep(100);
        }
Ejemplo n.º 2
0
        public void OnlyBearLastHitExecute()
        {
            Update();
            setAutoAttackMode();
            if (!Variable.OnlyBearLastHitActive)
            {
                return;
            }
            if (!anyCreepsAround(Bear))
            {
                return;
            }
            //Hero Control

            if (Bear.Distance2D(Me) > 1100)
            {
                if (Utils.SleepCheck("Move"))
                {
                    Me.Move(Bear.Position);
                    Utils.Sleep(100, "Move");
                }
            }
            else
            {
                if (Utils.SleepCheck("Hold"))
                {
                    Me.Hold();
                    Utils.Sleep(100, "Hold");
                }
            }
            //Bear Control
            getLowestHpCreep(Bear, 1000);
            if (_LowestHpCreep == null)
            {
                return;
            }
            getKillableCreep(_LowestHpCreep, true);
            if (_creepTarget == null)
            {
                return;
            }


            if (_creepTarget.IsValid && _creepTarget.IsVisible && _creepTarget.IsAlive)
            {
                var damageThreshold       = GetDamangeOnUnit(Bear, _creepTarget, 0);
                var numOfMeleeOnKillable  = MeleeCreepsAttackKillableTarget(_creepTarget);
                var numOfRangedOnKillable = RangedCreepsAttackKillableTarget(_creepTarget);
                if (numOfMeleeOnKillable + numOfRangedOnKillable != 0)
                {
                    if (_creepTarget.Distance2D(Bear) <= Bear.AttackRange)
                    {     //bear can attack
                        if (_creepTarget.Health < damageThreshold)
                        { // if attack below killable dmg, instant attack it
                            if (Bear.CanAttack())
                            {
                                Bear.Attack(_creepTarget);
                            }
                        }
                        else if (_creepTarget.Health < damageThreshold * 2.5 && _creepTarget.Health > damageThreshold && Utils.SleepCheck("A-Stop"))
                        {  // Attack-Hold
                            Bear.Attack(_creepTarget);
                            Bear.Hold();
                            Utils.Sleep(100, "A-Stop");
                        }
                    }
                    else
                    {
                        if (Utils.SleepCheck("Follow"))
                        {
                            Bear.Follow(_LowestHpCreep);
                            Utils.Sleep(100, "Follow");
                        }
                    }
                }
                else
                {
                    Console.WriteLine("no one is attacking");
                    //no one is hitting that creeps, go ahead and kill it
                    if (Bear.CanAttack() && _creepTarget.Health <= 1.5 * damageThreshold)
                    {
                        Bear.Attack(_creepTarget);
                        bearAttackSleeper.Sleep(100);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public void Pause(float duration)
 {
     sleeper.Sleep(duration);
 }