Exemple #1
0
 /// <summary>
 ///     The projectile speed.
 /// </summary>
 /// <param name="hero">
 ///     The hero.
 /// </param>
 /// <returns>
 ///     The <see cref="double" />.
 /// </returns>
 public static double ProjectileSpeed(this Hero hero)
 {
     return(UnitDatabase.GetProjectileSpeed(hero));
 }
Exemple #2
0
 /// <summary>
 ///     The projectile speed.
 /// </summary>
 /// <param name="unit">
 ///     The unit.
 /// </param>
 /// <returns>
 ///     The <see cref="double" />.
 /// </returns>
 public static double ProjectileSpeed(this Unit unit)
 {
     return(UnitDatabase.GetProjectileSpeed(unit));
 }
Exemple #3
0
        private static void LastHit(bool deny)
        {
            var PossibleMinion = (deny) ? (ObjectMgr.GetEntities <Creep>()
                                           .Where(creep => creep.IsAlive && creep.IsValid && me.Distance2D(creep) < me.GetAttackRange()).OrderBy(creep => creep.Health).DefaultIfEmpty(null).FirstOrDefault()) :
                                 (ObjectMgr.GetEntities <Creep>()
                                  .Where(creep => creep.IsAlive && creep.IsValid && creep.Team == me.GetEnemyTeam() && me.Distance2D(creep) < me.GetAttackRange()).OrderBy(creep => creep.Health).DefaultIfEmpty(null).FirstOrDefault());

            if (PossibleMinion != null)
            {
                var CheckTime = UnitDatabase.GetAttackPoint(me) * 1000 - CustomWaitTime + Game.Ping + me.GetTurnTime(PossibleMinion) * 1000 + Math.Max(0,
                                                                                                                                                       me.Distance2D(PossibleMinion) / UnitDatabase.GetProjectileSpeed(me) * 1000);

                var predHealth = PredictedHealth(PossibleMinion, (int)CheckTime);

                if (predHealth > 0 && predHealth <= GetPhysDamage(PossibleMinion))
                {
                    if (me.CanAttack())
                    {
                        me.Attack(PossibleMinion);
                    }
                }
                else
                {
                    if (LHHold.IsActive && lastMoveT + 80 < Environment.TickCount)
                    {
                        lastMoveT = Environment.TickCount;
                        me.Move(Game.MousePosition);
                    }
                }
            }
            else
            {
                if (LHHold.IsActive && lastMoveT + 80 < Environment.TickCount)
                {
                    lastMoveT = Environment.TickCount;
                    me.Move(Game.MousePosition);
                }
            }
        }