Пример #1
0
        /// <summary>
        ///     Casts the targetted spell on the unit.
        /// </summary>
        public bool CastOnUnit(Obj_AI_Base unit, bool packetCast = false)
        {
            if (!Slot.IsReady() || From.Distance6(unit.ServerPosition, true) > RangeSqr || (_menu["LimitCastingAttempts"].Cast <CheckBox>().CurrentValue&& Utils.TickCount - LastCastAttemptT < (70 + Math.Min(60, Game.Ping))))
            {
                return(false);
            }

            LastCastAttemptT = Utils.TickCount;

            if (packetCast)
            {
                return(ObjectManager.Player.Spellbook.CastSpell(Slot, unit, false));
            }
            else
            {
                return(ObjectManager.Player.Spellbook.CastSpell(Slot, unit));
            }
        }
Пример #2
0
        /// <summary>
        ///     Returns the unit health when the spell hits the unit.
        /// </summary>
        public float GetHealthPrediction(Obj_AI_Base unit)
        {
            var time = (int)(Delay * 1000 + From.Distance6(unit.ServerPosition) / Speed - 100);

            return(HealthPrediction.GetHealthPrediction(unit, time));
        }