Esempio n. 1
0
        public override void MutateEffect(EffectInfo e)
        {
            base.MutateEffect(e);

            if (e != null && e.EffectID == -1)
            {
                switch (Utility.GetDirection(Start, e.Source))
                {
                case Direction.Up:
                case Direction.North:
                    e.EffectID = 8099;
                    break;

                case Direction.Down:
                case Direction.South:
                    e.EffectID = 8114;
                    break;

                case Direction.Right:
                case Direction.East:
                    e.EffectID = 8109;
                    break;

                case Direction.Left:
                case Direction.West:
                    e.EffectID = 8104;
                    break;
                }
            }
        }
Esempio n. 2
0
        public override EffectInfo CloneEffectInfo(EffectInfo src)
        {
            if (src != null && src.EffectID == 8429 && !DisplayElemental)
            {
                return(null);
            }

            return(base.CloneEffectInfo(src));
        }
Esempio n. 3
0
        public override void MutateEffect(EffectInfo e)
        {
            base.MutateEffect(e);

            if (e != null)
            {
                e.Hue = Utility.RandomMinMax(550, 580);
            }
        }
Esempio n. 4
0
        public override void MutateEffect(EffectInfo e)
        {
            base.MutateEffect(e);

            if (e != null && e.EffectID == 14201)
            {
                e.Source = new Entity(Serial.Zero, e.Source.Location.Clone3D(zOffset: -5), e.Map);
            }
        }
Esempio n. 5
0
        public override void MutateEffect(EffectInfo e)
        {
            base.MutateEffect(e);

            if (e == null || e.EffectID != -1)
            {
                return;
            }

            e.EffectID = Utility.RandomMinMax(4963, 4973);
            e.Source   = new Entity(Serial.Zero, e.Source.Location.Clone3D(zOffset: 5), e.Map);
        }
Esempio n. 6
0
        public override void MutateEffect(EffectInfo e)
        {
            base.MutateEffect(e);

            if (e == null)
            {
                return;
            }

            switch (e.EffectID)
            {
            case -1:
                e.EffectID = Utility.RandomMinMax(11666, 11668);
                break;

            default:
                e.Hue = Utility.RandomMinMax(550, 580);
                break;
            }
        }
Esempio n. 7
0
        public override void MutateEffect(EffectInfo e)
        {
            base.MutateEffect(e);

            if (e == null)
            {
                return;
            }

            switch (e.EffectID)
            {
            case 8448:
                e.Source = new Entity(Serial.Zero, e.Source.Location.Clone3D(zOffset: -10), e.Map);
                break;

            case 14201:
                e.Source = new Entity(Serial.Zero, e.Source.Location.Clone3D(zOffset: -5), e.Map);
                break;
            }
        }
Esempio n. 8
0
        public override void MutateEffect(EffectInfo e)
        {
            base.MutateEffect(e);

            e.Duration = 7 + (int)(Interval.TotalMilliseconds / 100.0);

            switch (Utility.Random(3))
            {
            case 0:
                e.Render = EffectRender.Darken;
                break;

            case 1:
                e.Render = EffectRender.SemiTransparent;
                break;

            case 2:
                e.Render = EffectRender.ShadowOutline;
                break;
            }
        }
Esempio n. 9
0
		protected void Fail(Mobile m)
		{
			if (FailEffectID > 0)
			{
				var fx = new EffectInfo(
					GetWorldLocation(), Map, FailEffectID, FailEffectHue, FailEffectSpeed, FailEffectDuration, FailEffectRender);

				fx.Send();
			}

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

			Movable = Visible = true;

			OnFail(m);
		}
Esempio n. 10
0
		protected void IgniteFuse(Mobile m)
		{
			if (m == null || m.Deleted || FuseLit)
			{
				return;
			}

			if (!OnIgnite(m))
			{
				return;
			}

			if (IgniteEffectID > 0)
			{
				var fx = new EffectInfo(
					GetWorldLocation(),
					Map,
					IgniteEffectID,
					IgniteEffectHue,
					IgniteEffectSpeed,
					(int)Math.Ceiling(FuseDelay.TotalMilliseconds / 100.0),
					IgniteEffectRender);

				fx.Send();
			}

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

			_FuseTimer = Timer.DelayCall(
				FuseDelay,
				() =>
				{
					_FuseTimer = null;

					InvalidateProperties();

					if (!OnFuseBurned(m))
					{
						Fail(m);
					}
				});
		}
Esempio n. 11
0
		protected EffectInfo[] GetEffects()
		{
			var l = GetWorldLocation();
			var c = MultiData.GetComponents(MultiID);

			_Center = l.Clone3D(c.Center.X, c.Center.Y, l.Z);

			var list = new EffectInfo[c.List.Length];

			Parallel.For(
				0,
				list.Length,
				index =>
				{
					var t = c.List[index];
					var p = l.Clone3D(t.m_OffsetX, t.m_OffsetY, t.m_OffsetZ);

					list[index] = new EffectInfo(p, Map, t.m_ItemID, Hue, Speed, Duration, Render);
				});

			return list;
		}
Esempio n. 12
0
        public override void MutateEffect(EffectInfo e)
        {
            base.MutateEffect(e);

            if (e == null || e.EffectID != -1)
            {
                return;
            }

            switch (Direction)
            {
            case Direction.North:
            {
                switch (Utility.GetDirection(Start, e.Source))
                {
                case Direction.Up:
                case Direction.North:
                case Direction.Right:
                    e.EffectID = 8099;
                    break;
                }
            }
            break;

            case Direction.East:
            {
                switch (Utility.GetDirection(Start, e.Source))
                {
                case Direction.Down:
                case Direction.East:
                case Direction.Right:
                    e.EffectID = 8109;
                    break;
                }
            }
            break;

            case Direction.South:
            {
                switch (Utility.GetDirection(Start, e.Source))
                {
                case Direction.Down:
                case Direction.South:
                case Direction.Left:
                    e.EffectID = 8114;
                    break;
                }
            }
            break;

            case Direction.West:
            {
                switch (Utility.GetDirection(Start, e.Source))
                {
                case Direction.Up:
                case Direction.West:
                case Direction.Left:
                    e.EffectID = 8104;
                    break;
                }
            }
            break;

            default:
            {
                switch (Utility.GetDirection(Start, e.Source))
                {
                case Direction.Up:
                case Direction.North:
                    e.EffectID = 8099;
                    break;

                case Direction.Right:
                case Direction.East:
                    e.EffectID = 8109;
                    break;

                case Direction.Down:
                case Direction.South:
                    e.EffectID = 8114;
                    break;

                case Direction.Left:
                case Direction.West:
                    e.EffectID = 8104;
                    break;
                }
            }
            break;
            }
        }
Esempio n. 13
0
		protected virtual void OnWeatherImpact(EffectInfo info)
		{
			if (info == null || Deleted || !Options.Weather.Impacts)
			{
				return;
			}

			if (Options.Weather.ImpactEffectSound > 0)
			{
				Effects.PlaySound(info.Source, info.Map, Options.Weather.ImpactEffectSound);
			}

			if (!Options.SuddenDeath.Enabled || !Options.SuddenDeath.Active || !Options.SuddenDeath.Damages)
			{
				return;
			}

			foreach (var pm in info.Source.GetPlayersInRange(info.Map, Options.SuddenDeath.DamageRange))
			{
				Options.SuddenDeath.Damage(pm);
			}
		}
Esempio n. 14
0
		protected virtual void WeatherImpactHandler(MovingEffectInfo info)
		{
			if (info == null || Deleted || !Options.Weather.Impacts || Options.Weather.ImpactEffectID <= 0 ||
				Options.Weather.ImpactEffectSpeed <= 0 || Options.Weather.ImpactEffectDuration <= 0)
			{
				return;
			}

			OnWeatherImpact(info);

			if (Options.Weather.ImpactEffectID <= 0)
			{
				return;
			}

			var effect = new EffectInfo(
				info.Target,
				info.Map,
				Options.Weather.ImpactEffectID,
				Options.Weather.ImpactEffectHue,
				Options.Weather.ImpactEffectSpeed,
				Options.Weather.ImpactEffectDuration,
				Options.Weather.ImpactEffectRender);

			effect.Send();

			OnWeatherImpact(effect);
		}
		protected void LaunchTrail(Point3D p)
		{
			if (TrailID > 0)
			{
				var fx = new EffectInfo(p, Map, TrailID, TrailHue, TrailSpeed, TrailDuration, TrailRender);

				fx.Send();
			}

			if (TrailSound > 0)
			{
				Effects.PlaySound(p, Map, TrailSound);
			}
		}
		protected void Explode(Mobile m, Point3D p)
		{
			if (m == null || m.Deleted)
			{
				return;
			}

			if (!OnExplode(m, p))
			{
				return;
			}

			if (ExplodeID > 0)
			{
				var fx = new EffectInfo(p, Map, ExplodeID, ExplodeHue, ExplodeSpeed, ExplodeDuration, ExplodeRender);

				fx.Send();
			}

			if (ExplodeSound >= 0)
			{
				Effects.PlaySound(p, Map, ExplodeSound);
			}

			ExplodeStars(
				m,
				StarsEffect,
				p,
				Utility.RandomMinMax(StarsRangeMin, StarsRangeMax),
				StarsSound,
				Stars.ToArray(),
				StarsHue > 0 ? new[] {StarsHue} : StarHues.ToArray());

			Movable = false;
			Timer.DelayCall(
				TimeSpan.FromSeconds(1.0),
				() =>
				{
					Movable = true;
					Consume();
				});
		}
Esempio n. 17
0
        protected void Explode(Mobile m, Point3D p)
        {
            if (m == null || m.Deleted)
            {
                return;
            }

            if (ExplodeID > 0)
            {
                var fx = new EffectInfo(p, Map, ExplodeID, ExplodeHue, ExplodeSpeed, ExplodeDuration, ExplodeRender);

                fx.Send();
            }

            if (ExplodeSound >= 0)
            {
                Effects.PlaySound(p, Map, ExplodeSound);
            }

            ExplodeStars(
                m,
                StarsEffect,
                p,
                Utility.RandomMinMax(StarsRangeMin, StarsRangeMax),
                StarsSound,
                Stars.ToArray(),
                StarsHue > 0 ? new[] { StarsHue } : StarHues.ToArray());
        }