Beispiel #1
0
        /// <summary>
        /// Checks if given unit is last hitable
        /// </summary>
        /// <param name="unit">Unit</param>
        /// <returns>true if last hitable</returns>
        public static bool IsLastHitable(Obj_AI_Base unit, float extraWindup = 0)
        {
            //float health = unit.Health - GetPrediction(unit, (Math.Max(0, unit.ServerPosition.To2D().Distance(ObjectManager.Player.ServerPosition.To2D()) - ObjectManager.Player.BoundingRadius) / Orbwalking.Utility.GetProjectileSpeed() + ObjectManager.Player.AttackCastDelay) * 1000f);
            var t = (int)(ObjectManager.Player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                    1000 * (int)Math.Max(0, ObjectManager.Player.Distance(unit.ServerPosition) - ObjectManager.Player.BoundingRadius) / (int)Orbwalking.Utility.GetProjectileSpeed();

            float health = HealthPrediction.GetHealthPrediction(unit, t, 30);

            //float health = unit.Health - dmg;
            return(health < AutoAttack.GetDamage(unit, true));
        }
Beispiel #2
0
        /// <summary>
        /// Checks if given unit is unkillable
        /// </summary>
        /// <param name="unit">Unit</param>
        /// <returns>true if unkillable</returns>
        public static bool IsUnkillable(Obj_AI_Base unit, int t = 0)
        {
            float health = unit.Health - GetPrediction(unit, ((unit.Distance(ObjectManager.Player.ServerPosition) / Orbwalking.Utility.GetProjectileSpeed() + ObjectManager.Player.AttackCastDelay) * 2f) * 1000f);

            return(health <= AutoAttack.GetDamage(unit));
        }
Beispiel #3
0
        /// <summary>
        /// Checks if given unit is last hitable
        /// </summary>
        /// <param name="unit">Unit</param>
        /// <returns>true if last hitable</returns>
        public static bool IsLastHitable(Obj_AI_Base unit, float extraWindup = 0)
        {
            float health = unit.Health - GetPrediction(unit, (unit.Distance(ObjectManager.Player.ServerPosition) / Orbwalking.Utility.GetProjectileSpeed() + ObjectManager.Player.AttackCastDelay) * 1000f);

            return(health <= AutoAttack.GetDamage(unit, true));
        }