/// <summary>
        ///     Cast Spell directly onto a unit
        /// </summary>
        /// <param name="unit">Target</param>
        /// <returns>Was Spell Casted</returns>
        public bool CastOnUnit(Obj_AI_Base unit)
        {
            if (!Slot.IsReady() || From.DistanceSquared(unit.ServerPosition) > RangeSqr)
            {
                return(false);
            }

            LastCastAttemptT = Variables.TickCount;

            return(ObjectManager.Player.Spellbook.CastSpell(Slot, unit));
        }
Exemple #2
0
        public bool CastOnUnit(Obj_AI_Base unit)
        {
            if (unit == null)
            {
                return(false);
            }

            if (!IsReady() || From.DistanceSquared(unit.ServerPosition) > RangeSqr)
            {
                return(false);
            }

            if (CastCondition != null && !CastCondition())
            {
                return(false);
            }

            LastCastAttemptT = Core.GameTickCount;

            return(Player.Instance.Spellbook.CastSpell(Slot, unit));
        }