예제 #1
0
        public void BloodoftheHydra(int count)
        {
            if (count <= 0)
            {
                return;
            }

            List <Mobile> targets = AcquireAllTargets(Location, 10);

            if (targets.Count == 0)
            {
                return;
            }

            if (targets.Count > count)
            {
                targets.Shuffle();
            }

            var q = new MovingEffectQueue
            {
                Deferred = true,
                Handler  = e => new HydraBlood(this).MoveToWorld(e.Target.Location, e.Map)
            };

            foreach (Mobile t in targets.Where(t => t != null).Take(count))
            {
                q.Add(
                    new MovingEffectInfo(Location, t.Location, t.Map, 4655, 1166, 10, EffectRender.Normal,
                                         TimeSpan.FromSeconds(1)));
            }

            q.Process();
        }
예제 #2
0
        protected bool Launch(Mobile m)
        {
            if (m == null || m.Deleted)
            {
                return(false);
            }

            var path = GetPath();

            if (path == null || path.Length == 0)
            {
                return(false);
            }

            var start = path.First();
            var end   = path.Last();

            if (!OnLaunch(m, start, end))
            {
                return(false);
            }

            var q = new MovingEffectQueue(() => Explode(m, end));

            for (var i = 0; i < path.Length; i++)
            {
                var p = path[i];

                if (i + 1 >= path.Length)
                {
                    continue;
                }

                var pn = path[i + 1];

                q.Add(
                    new MovingEffectInfo(
                        p,
                        pn,
                        Map,
                        LaunchID,
                        LaunchHue,
                        LaunchSpeed,
                        LaunchRender,
                        TimeSpan.Zero,
                        () => LaunchTrail(pn)));
            }

            q.Process();

            if (LaunchSound > 0)
            {
                Effects.PlaySound(GetWorldLocation(), Map, LaunchSound);
            }

            Visible = false;
            return(true);
        }
예제 #3
0
        protected bool Launch(Mobile m)
        {
            if (m == null || m.Deleted)
            {
                return(false);
            }

            var path = GetPath();

            if (path == null || path.Length == 0)
            {
                return(false);
            }

            Point3D start = path.First();
            Point3D end   = path.Last();

            if (!OnLaunch(m, start, end))
            {
                return(false);
            }

            MovingEffectQueue q = new MovingEffectQueue(() => Explode(m, end));

            path.For(
                (i, p) =>
            {
                if (i + 1 < path.Length)
                {
                    q.Add(
                        new MovingEffectInfo(
                            p,
                            path[i + 1],
                            Map,
                            LaunchID,
                            LaunchHue,
                            LaunchSpeed,
                            LaunchRender,
                            TimeSpan.Zero,
                            () => LaunchTrail(path[i + 1])));
                }
            });

            q.Process();

            if (LaunchSound > 0)
            {
                Effects.PlaySound(GetWorldLocation(), Map, LaunchSound);
            }

            Visible = false;
            return(true);
        }
예제 #4
0
		protected bool Launch(Mobile m)
		{
			if (m == null || m.Deleted)
			{
				return false;
			}

			var path = GetPath();

			if (path == null || path.Length == 0)
			{
				return false;
			}

			Point3D start = path.First();
			Point3D end = path.Last();

			if (!OnLaunch(m, start, end))
			{
				return false;
			}

			MovingEffectQueue q = new MovingEffectQueue(() => Explode(m, end));

			path.For(
				(i, p) =>
				{
					if (i + 1 < path.Length)
					{
						q.Add(
							new MovingEffectInfo(
								p,
								path[i + 1],
								Map,
								LaunchID,
								LaunchHue,
								LaunchSpeed,
								LaunchRender,
								TimeSpan.Zero,
								() => LaunchTrail(path[i + 1])));
					}
				});

			q.Process();

			if (LaunchSound > 0)
			{
				Effects.PlaySound(GetWorldLocation(), Map, LaunchSound);
			}

			Visible = false;
			return true;
		}
예제 #5
0
        public void BeetleDung(int count)
        {
            if (count <= 0)
            {
                return;
            }

            List<Mobile> targets = AcquireTargets(Location, 10);

            if (targets.Count == 0)
            {
                return;
            }

            if (targets.Count > count)
            {
                targets.Shuffle();
            }

            var q = new MovingEffectQueue
            {
                Deferred = true,
                Handler = e => new BeetleDung(this).MoveToWorld(e.Target.Location, e.Map)
            };

            foreach (Mobile t in targets.Where(t => t != null).Take(count))
            {
                q.Add(
                    new MovingEffectInfo(Location, t.Location, t.Map, 4655, 1166, 10, EffectRender.Normal,
                        TimeSpan.FromSeconds(1)));
            }

            q.Process();
        }
예제 #6
0
		protected bool Launch(Mobile m)
		{
			if (m == null || m.Deleted)
			{
				return false;
			}

			var path = GetPath();

			if (path == null || path.Length == 0)
			{
				return false;
			}

			var start = path.First();
			var end = path.Last();

			if (!OnLaunch(m, start, end))
			{
				return false;
			}

			var q = new MovingEffectQueue(() => Explode(m, end));

			for (var i = 0; i < path.Length; i++)
			{
				var p = path[i];

				if (i + 1 >= path.Length)
				{
					continue;
				}

				var pn = path[i + 1];

				q.Add(
					new MovingEffectInfo(
						p,
						pn,
						Map,
						LaunchID,
						LaunchHue,
						LaunchSpeed,
						LaunchRender,
						TimeSpan.Zero,
						() => LaunchTrail(pn)));
			}

			q.Process();

			if (LaunchSound > 0)
			{
				Effects.PlaySound(GetWorldLocation(), Map, LaunchSound);
			}

			Visible = false;
			return true;
		}
예제 #7
0
            public override void OnThink()
            {
                base.OnThink();

                if (Deleted || !Alive || Aspect == null || !Aspect.InCombat() || Core.TickCount < _NextHeal)
                {
                    return;
                }

                if (ControlMaster != Aspect)
                {
                    ControlMaster = Aspect;
                }

                if (ControlTarget != Aspect)
                {
                    ControlTarget = Aspect;
                }

                if (ControlOrder != OrderType.Follow)
                {
                    ControlOrder = OrderType.Follow;
                }

                if (!InRange(Aspect, Aspect.RangePerception))
                {
                    AIObject.MoveTo(Aspect, true, Aspect.RangePerception);

                    return;
                }

                _NextHeal = Core.TickCount + 5000;

                var q = new MovingEffectQueue();

                q.Callback = q.Dispose;

                for (var i = 0; i < 5; i++)
                {
                    var fx = new MovingEffectInfo(
                        this,
                        Aspect,
                        Map,
                        0x36F4,
                        1150,
                        10,
                        EffectRender.LightenMore,
                        TimeSpan.FromMilliseconds(200));

                    fx.ImpactCallback += HealAspect;

                    q.Add(fx);
                }

                if (this.PlayAttackAnimation())
                {
                    this.PlayAttackSound();

                    this.TryParalyze(
                        TimeSpan.FromSeconds(1.5),
                        m =>
                    {
                        SpellHelper.Turn(m, Aspect);

                        q.Process();
                    });
                }
                else
                {
                    SpellHelper.Turn(this, Aspect);

                    q.Process();
                }
            }