Exemplo n.º 1
0
        protected override void OnThrownAt(Mobile from, Mobile target)
        {
            if (from == null || from.Deleted || target == null || target.Deleted)
            {
                return;
            }

            var fx = new FireExplodeEffect(target, target.Map, ExplosionRange)
            {
                EffectHandler = e =>
                {
                    if (e.ProcessIndex != 0)
                    {
                        ExplosionDamage(e);
                    }
                }
            };

            fx.Send();

            base.OnThrownAt(from, target);
        }
Exemplo n.º 2
0
        public override void Ignite()
        {
            var points = new List <Point3D>();

            Location.ScanRange(
                Map,
                5,
                r =>
            {
                if (!Map.CanSpawnMobile(r.Current))
                {
                    r.Exclude();
                }

                if (!r.Excluded)
                {
                    points.Add(r.Current);
                }

                return(false);
            });

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

            var t = this.GetRandomSpawn();

            if (t == null)
            {
                return;
            }

            var m = VitaNexCore.TryCatchGet(() => t.CreateInstance <Mobile>(), DeceitBraziers.CMOptions.ToConsole);

            if (m == null)
            {
                return;
            }

            VitaNexCore.TryCatch(
                () =>
            {
                Duration  = CoolDown;
                Protected = true;
                base.Ignite();

                var fx = new FireExplodeEffect(this, Map, 5, 2)
                {
                    Reversed      = true,
                    EffectHandler = e =>
                                    e.Source.GetMobilesInRange(e.Map, 0)
                                    .Where(v => v != null && v.CanBeDamaged())
                                    .ForEach(v => AOS.Damage(v, Utility.RandomMinMax(10, 20), 10, 80, 0, 0, 10))
                };

                fx.Callback = () =>
                {
                    if (fx.CurrentProcess < fx.Repeat)
                    {
                        return;
                    }

                    new SmokeExplodeEffect(Location, Map, 1).Send();
                    m.MoveToWorld(points.GetRandom(), Map);
                };

                fx.Send();
            },
                ex => m.Delete());
        }
Exemplo n.º 3
0
		public override void Ignite()
		{
			var points = new List<Point3D>();

			Location.ScanRange(
				Map,
				5,
				r =>
				{
					if (!Map.CanSpawnMobile(r.Current))
					{
						r.Exclude();
					}

					if (!r.Excluded)
					{
						points.Add(r.Current);
					}

					return false;
				});

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

			var t = this.GetRandomSpawn();

			if (t == null)
			{
				return;
			}

			var m = VitaNexCore.TryCatchGet(() => t.CreateInstance<Mobile>(), DeceitBraziers.CMOptions.ToConsole);

			if (m == null)
			{
				return;
			}

			VitaNexCore.TryCatch(
				() =>
				{
					Duration = CoolDown;
					Protected = true;
					base.Ignite();

					var fx = new FireExplodeEffect(this, Map, 5, 2)
					{
						Reversed = true,
						EffectHandler =
							e =>
								e.Source.GetMobilesInRange(e.Map, 0)
								 .Where(v => v != null && v.CanBeDamaged())
								 .ForEach(v => AOS.Damage(v, Utility.RandomMinMax(10, 20), 10, 80, 0, 0, 10))
					};

					fx.Callback = () =>
					{
						if (fx.CurrentProcess < fx.Repeat)
						{
							return;
						}

						new SmokeExplodeEffect(Location, Map, 1).Send();
						m.MoveToWorld(points.GetRandom(), Map);
					};

					fx.Send();
				},
				ex => m.Delete());
		}