Esempio n. 1
0
        protected override void OnInvoke(BaseAspect aspect)
        {
            if (aspect == null || aspect.Deleted)
            {
                return;
            }

            var t =
                AcquireTargets <Mobile>(aspect).Where(m => aspect.GetDistanceToSqrt(m) >= aspect.RangePerception * 0.25).GetRandom();

            if (t == null || t.Deleted || !t.Alive)
            {
                return;
            }

            aspect.CantWalk = true;

            SpellHelper.Turn(aspect, t);

            int x = 0, y = 0;

            Movement.Movement.Offset(aspect.Direction & Direction.Mask, ref x, ref y);

            var loc = aspect.Location.Clone3D(x, y, 5);

            if (aspect.PlayAttackAnimation())
            {
                aspect.PlayAttackSound();
            }

            new MovingEffectInfo(loc, t.Location, aspect.Map, 4534)
            {
                SoundID = 541
            }.MovingImpact(
                e =>
            {
                BoulderImpact(aspect, e.Target.Location, 4);
                aspect.CantWalk = false;
            });
        }