示例#1
0
        public void UltimaImpact_Callback(Point3D impactloc)
        {
            CurrentSpell.Clear();
            var queue = new EffectQueue();

            queue.Deferred = true;

            BaseExplodeEffect e = ExplodeFX.Smoke.CreateInstance(
                impactloc, Map, 8, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
            {
                foreach (Mobile mobile in AcquireAllTargets(impactloc, 8))
                {
                    if (mobile is PlayerMobile)
                    {
                        mobile.Damage(UltimaDamage, this);
                    }
                    else
                    {
                        mobile.Damage(UltimaPetDamage, this);
                    }
                }
            });

            e.Send();

            queue.Process();
            CantWalk = false;
        }
示例#2
0
        public void MeteorImpact_Callback(Point3D impactloc)
        {
            var queue = new EffectQueue();

            queue.Deferred = true;

            for (int i = 0; i < 10; i++)
            {
                BaseExplodeEffect e = ExplodeFX.Fire.CreateInstance(
                    impactloc, Map, MeteorRange, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
                {
                    foreach (Mobile target in AcquireTargets(impactloc, MeteorRange))
                    {
                        if (target is BaseCreature)
                        {
                            target.Damage(50, this);
                        }
                        else
                        {
                            target.Damage(10, this);
                        }
                    }
                });
                e.Send();
            }
            queue.Process();
        }
示例#3
0
        protected void GreaterExplosion_Callback()
        {
            var queue = new EffectQueue();

            queue.Deferred = false;

            List <Mobile> rangelist = AcquireTargets(Location, 15);
            int           index     = Utility.Random(rangelist.Count);

            if (index + 1 > rangelist.Count)
            {
                return;
            }

            Point3D endpoint = rangelist[index].Location;

            Point3D[] line = Location.GetLine3D(endpoint, Map);

            int n = 0;

            foreach (Point3D p in line)
            {
                n += 20;
                Point3D p1 = p;
                queue.Add(
                    new EffectInfo(
                        p,
                        Map,
                        14089,
                        0,
                        10,
                        30,
                        EffectRender.Normal,
                        TimeSpan.FromMilliseconds(n),
                        () =>
                {
                    foreach (Mobile player in AcquireTargets(p1, 0))
                    {
                        player.Damage(50, this);
                    }
                }));
            }

            queue.Callback = () =>
            {
                BaseExplodeEffect e = ExplodeFX.Fire.CreateInstance(
                    endpoint, Map, 5, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
                {
                    foreach (Mobile player in AcquireTargets(endpoint, 5))
                    {
                        player.Damage(25, this);
                    }
                });
                e.Send();
            };


            queue.Process();
        }
示例#4
0
        public override void OnDoubleClick(Mobile m)
        {
            if (!this.CheckDoubleClick(m, true, false, 3))
            {
                return;
            }

            if (ProducesWaste && Products > 0)
            {
                double   pFactor   = Products / Math.Max(Products, ProductsMax);
                TimeSpan pDuration = TimeSpan.FromSeconds(60.0 * pFactor);

                SepticWaste waste = new SepticWaste(Products);

                if (m.PlaceInBackpack(waste))
                {
                    m.SendMessage(0x55, "You gather the decomposed waste and place it in your backpack.");
                }
                else
                {
                    waste.MoveToWorld(m.Location, m.Map);
                    m.SendMessage(0x55, "The waste spills out at your feet.");
                }

                if (SwagMode)
                {
                    BaseExplodeEffect fx = GetClaimEffect(m);

                    if (fx != null)
                    {
                        if (StinkMode)
                        {
                            fx.EffectHandler = e => e.Source.GetMobilesInRange(e.Map, 0).ForEach(mob => MakeStinky(mob, pDuration, pFactor));
                        }

                        fx.Send();
                    }
                }
                else if (StinkMode)
                {
                    MakeStinky(m, pDuration, pFactor);
                }

                Products = 0;
            }
            else
            {
                m.SendMessage("You rummage around in the decomposing waste, but find nothing.");

                MakeStinky(m, TimeSpan.FromSeconds(60.0 * Utility.RandomDouble()), 0.10);
            }
        }
示例#5
0
        protected override void OnTrashed(Mobile m, Item trashed, ref int tokens, bool message = true)
        {
            base.OnTrashed(m, trashed, ref tokens, message);

            if (tokens > 0 && ProductionTimeBonus < TimeSpan.FromSeconds(ProductionDelay.TotalSeconds / 2))
            {
                ProductionTimeBonus += TimeSpan.FromMinutes(tokens);
            }

            BaseExplodeEffect fx = GetProductionEffect();

            if (fx != null)
            {
                fx.Send();
            }
        }
示例#6
0
        public void MeteorImpact_Callback(Point3D impactloc)
        {
            var queue = new EffectQueue();

            queue.Deferred = true;

            BaseExplodeEffect e = ExplodeFX.Fire.CreateInstance(
                impactloc, Map, MeteorRange, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
            {
                foreach (Mobile player in AcquireTargets(impactloc, MeteorRange))
                {
                    player.Damage(50, this);
                }
            });

            e.Send();
            queue.Process();
        }
示例#7
0
        public static void BeginGoldExplosion(
            ExplodeFX fx,
            Point3D center,
            Map map,
            int range,
            int minGold,
            int maxGold,
            int[] explodeSounds = null,
            int[] dropSounds    = null)
        {
            BaseExplodeEffect efx = fx.CreateInstance(center, map, 2, 3);

            if (efx == null)
            {
                return;
            }

            minGold = Math.Max(10, Math.Min(60000, minGold));
            maxGold = Math.Max(minGold, Math.Min(60000, maxGold));

            explodeSounds = explodeSounds ?? new[] { 284, 285, 286, 776, 1231 };

            efx.AverageZ = false;

            efx.EffectHandler = e =>
            {
                if (Utility.RandomDouble() < 0.25)
                {
                    Effects.PlaySound(e.Source, e.Map, explodeSounds.GetRandom());
                }
            };

            efx.Callback = () =>
            {
                efx.Start = efx.Start.Clone3D(0, 0, 10);

                if (efx.CurProcess >= efx.Repeat)
                {
                    EndGoldExplosion(fx, center.Clone3D(0, 0, 10 * efx.Repeat), map, range, minGold, maxGold, dropSounds);
                }
            };

            efx.Send();
        }
示例#8
0
        public void CaveIn_Callback()
        {
            List <Mobile> rangelist = AcquireTargets(Location, 20);
            int           index     = Utility.Random(rangelist.Count);

            if (index + 1 > rangelist.Count)
            {
                return;
            }

            var startloc = new Point3D(rangelist[index].X, rangelist[index].Y, 100);
            var point    = new Point3D(rangelist[index].Location);

            new MovingEffectInfo(
                startloc,
                point,
                Map,
                4534, 0, 10, EffectRender.Normal, TimeSpan.FromMilliseconds(1)).MovingImpact(
                e =>
            {
                BaseExplodeEffect eff = ExplodeFX.Earth.CreateInstance(
                    point, Map, CaveInRange, 0, TimeSpan.FromMilliseconds(1), null, () =>
                {
                });
                eff.Send();

                foreach (Mobile player in AcquireAllTargets(point, CaveInRange))
                {
                    if (player is BaseCreature && player.IsControlled())
                    {
                        player.Damage(250, this);
                    }
                    else
                    {
                        player.Damage(65, this);
                    }
                }
            });


            //Timer.DelayCall(TimeSpan.FromSeconds(3.0), CaveInImpact_Callback, point);
        }
示例#9
0
        public void OpenPortal()
        {
            var portal = new CrippledKingPortal();

            portal.MoveToWorld(new Point3D(1365, 1666, 35), Map.Felucca);
            Say(
                "The Portal to the Crippled King's keep is open. Tread carefully, we know not what awaits you on the other side.");

            var loc             = new Point3D(1365, 1666, 35);
            BaseExplodeEffect e = ExplodeFX.Air.CreateInstance(
                loc, Map, 3, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
            {
                foreach (Mobile player in AcquireTargets(loc, 3))
                {
                    player.Damage(100, this);
                }
            });

            e.Send();

            if (ShardsGiven != null)
            {
                foreach (KeyValuePair <PlayerMobile, int> kvp in ShardsGiven)
                {
                    kvp.Key.BankBox.DropItem(new CrippledKingFragment());
                    kvp.Key.SendMessage(
                        "A refined stone fragment has been added to your bank for participating in the opening of the gateway to the Crippled King's keep.");
                }
                Dictionary <PlayerMobile, int> topThree = (from entry in ShardsGiven
                                                           orderby entry.Value descending
                                                           select entry)
                                                          .Take(3)
                                                          .ToDictionary(pair => pair.Key, pair => pair.Value);
                foreach (KeyValuePair <PlayerMobile, int> kvp in topThree)
                {
                    kvp.Key.BankBox.DropItem(new TitleScroll("The Pathmaker"));
                    kvp.Key.SendMessage(
                        "You were in the top 3 for Stone Shards contributions! The title scroll: The Pathmaker has been placed in your bankbox.");
                }
            }
        }
示例#10
0
            protected override void OnTick()
            {
                TicCount++;
                if (m_Item.Deleted)
                {
                    return;
                }

                m_Item.Hue = m_Item.Hue == 0 ? 33 : 0;

                int count = m_Item.AcquireTargets(m_Item.Location, 2).Count;

                if (count >= 1)
                {
                    m_Item.PublicOverheadMessage(MessageType.Label, 34, true, "*DETONATES*");
                    BaseExplodeEffect e = ExplodeFX.Fire.CreateInstance(
                        m_Item.Location, m_Item.Map, 2, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
                    {
                        foreach (Mobile mobile in m_Item.AcquireAllTargets(m_Item.Location, 2))
                        {
                            if (mobile is BaseCreature && mobile.IsControlled())
                            {
                                mobile.Damage(500);
                            }
                            else if (mobile is PlayerMobile)
                            {
                                mobile.Damage(40);
                            }
                        }
                        m_Item.Delete();
                        Stop();
                    });
                    e.Send();
                }

                if (TicCount == 300)
                {
                    m_Item.Delete();
                    Stop();
                }
            }
        protected override void OnInvoke(BaseAspect aspect)
        {
            BaseExplodeEffect fx = CreateEffect(aspect);

            if (fx == null)
            {
                return;
            }

            fx.EffectHandler = e =>
            {
                if (e.ProcessIndex != 0)
                {
                    return;
                }

                foreach (var t in AcquireTargets <Mobile>(aspect, e.Source.Location, 0))
                {
                    OnTargeted(aspect, t);
                }
            };

            fx.Send();
        }
示例#12
0
        private void Explode()
        {
            if (!Deleted && Beetle != null && !Beetle.Deleted && Beetle.Alive)
            {
                BaseExplodeEffect e = ExplodeFX.Fire.CreateInstance(
                    Location, Map, 2, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
                {
                    foreach (Mobile mobile in AcquireAllTargets(Location, 2))
                    {
                        if (mobile is BaseCreature && mobile.IsControlled())
                        {
                            mobile.Damage(500);
                        }
                        else if (mobile is PlayerMobile)
                        {
                            mobile.Damage(40);
                        }
                    }
                });
                e.Send();
            }

            Delete();
        }
示例#13
0
        public void Quicksand(Mobile target)
        {
            BaseExplodeEffect e = ExplodeFX.Earth.CreateInstance(
                target, Map, 1, 1, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
            {
                Mobile spawn;

                switch (Utility.Random(2))
                {
                default:
                case 0:
                    spawn = new Sandworm();
                    break;

                case 1:
                    spawn = new WindTitan();
                    break;
                }

                spawn.MoveToWorld(target.Location, target.Map);
            });

            e.Send();
        }
			public static void WAVEFX_SEND(TriggerObject trigObject, BaseExplodeEffect effect)
			{
				if (effect != null)
				{
					effect.Send();
				}
			}
示例#15
0
        public static void EndGoldExplosion(
            ExplodeFX fx, Point3D center, Map map, int range, int minGold, int maxGold, int[] dropSounds = null)
        {
            BaseExplodeEffect efx = fx.CreateInstance(center, map, range);

            if (efx == null)
            {
                return;
            }

            efx.AverageZ = false;

            efx.Callback = () =>
            {
                var points = new List <Point3D>();

                center.ScanRange(
                    map,
                    range,
                    r =>
                {
                    if (!r.Excluded)
                    {
                        if (r.QueryMap.CanFit(r.Current, 1, false, false) || r.QueryMap.HasWater(r.Current))
                        {
                            points.Add(r.Current);
                        }
                        else
                        {
                            r.Exclude();
                        }
                    }

                    return(false);
                });

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

                dropSounds = dropSounds ?? new[] { 553, 554 };

                Timer goldTimer = null;

                goldTimer = Timer.DelayCall(
                    TimeSpan.FromSeconds(1),
                    TimeSpan.FromMilliseconds(100),
                    points.Count,
                    () =>
                {
                    if (points.Count == 0)
                    {
                        if (goldTimer != null)
                        {
                            goldTimer.Running = false;
                            goldTimer         = null;
                        }

                        return;
                    }

                    Point3D p = points.GetRandom();
                    points.Remove(p);

                    Effects.PlaySound(p, map, dropSounds.GetRandom());

                    new MovingEffectInfo(p.Clone3D(0, 0, Utility.RandomMinMax(30, 50)), p, map, 3823, 0, 10,
                                         EffectRender.Lighten)
                    .MovingImpact(
                        e =>
                    {
                        int amount = Utility.RandomMinMax(minGold, maxGold);

                        if (amount <= 0)
                        {
                            return;
                        }

                        var g = new Gold(amount);
                        g.MoveToWorld(e.Target.Location, e.Map);

                        new EffectInfo(e.Target, e.Map, 14202, 51, 10, 40, EffectRender.Lighten).Send();
                        Effects.PlaySound(e.Target, e.Map, g.GetDropSound());
                    });
                });
            };

            efx.Send();
        }
示例#16
0
        public void DoAbilityMoltenBreath(BaseCreature target, BaseMetaPet pet)
        {
            pet.PlaySound(pet.BaseSoundID);
            pet.Animate(12, 5, 1, true, false, 0);

            var queue = new EffectQueue();

            queue.Deferred = false;

            Point3D endpoint = target.Location;

            Point3D[] line = pet.Location.GetLine3D(endpoint, pet.Map);

            if (target.InRange(pet.Location, 10))
            {
                int n = 0;
                foreach (Point3D p in line)
                {
                    n += 20;
                    Point3D p1 = p;
                    queue.Add(
                        new EffectInfo(
                            p,
                            pet.Map,
                            14089,
                            0,
                            10,
                            30,
                            EffectRender.Normal,
                            TimeSpan.FromMilliseconds(n),
                            () =>
                    {
                        foreach (Mobile player in AcquireTargets(pet, p1, 0))
                        {
                            player.Damage(Level * 9, pet);
                        }
                    }));
                }

                queue.Callback = () =>
                {
                    BaseExplodeEffect e = ExplodeFX.Fire.CreateInstance(
                        endpoint, pet.Map, 2, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
                    {
                        foreach (Mobile mobile in AcquireTargets(pet, endpoint, 2))
                        {
                            mobile.Damage(Level * 8, pet);
                        }
                    });
                    e.Send();
                };


                queue.Process();
                Experience++;

                if (Experience >= NextLevelExperience)
                {
                    LevelUpMoltenBreath(pet.ControlMaster);
                }

                NextUse = DateTime.UtcNow + CoolDown;
            }
        }