Пример #1
0
        public override void Setup()
        {
            Armor          = new List <Item>();
            DestroyedArmor = new List <Item>();
            Spawn          = new List <BaseCreature>();
            Items          = new List <Item>();

            int toSpawn = 1 + (PartySize() * 2);

            ColUtility.For(SpawnPoints, (i, p) =>
            {
                ConvertOffset(ref p);

                var armor = new CursedSuitOfArmor(this);
                armor.MoveToWorld(p, Map.TerMur);
                Armor.Add(armor);

                if (i > 13)
                {
                    armor.ItemID = 0x1512;
                }
            });

            for (int i = 0; i < toSpawn; i++)
            {
                SpawnRandom();
            }

            Item    item = new Static(3633);
            Point3D pnt  = new Point3D(-4, 2, 0);

            ConvertOffset(ref pnt);
            item.MoveToWorld(pnt, Map.TerMur);
            Items.Add(item);

            item = new Static(3633);
            pnt  = new Point3D(-4, -4, 0);
            ConvertOffset(ref pnt);
            item.MoveToWorld(pnt, Map.TerMur);
            Items.Add(item);

            item = new Static(3633);
            pnt  = new Point3D(2, -4, 0);
            ConvertOffset(ref pnt);
            item.MoveToWorld(pnt, Map.TerMur);
            Items.Add(item);

            item = new PurifyingFlames();
            pnt  = new Point3D(-4, 2, 8);
            ConvertOffset(ref pnt);
            item.MoveToWorld(pnt, Map.TerMur);
            Items.Add(item);

            item = new PurifyingFlames();
            pnt  = new Point3D(-4, -4, 8);
            ConvertOffset(ref pnt);
            item.MoveToWorld(pnt, Map.TerMur);
            Items.Add(item);

            item = new PurifyingFlames();
            pnt  = new Point3D(2, -4, 8);
            ConvertOffset(ref pnt);
            item.MoveToWorld(pnt, Map.TerMur);
            Items.Add(item);
        }
Пример #2
0
        public override void OnDoubleClick(Mobile m)
        {
            if (IsChildOf(m.Backpack))
            {
                m.SendLocalizedMessage(1010086); // What do you want to use this on?
                m.BeginTarget(3, false, Targeting.TargetFlags.None, (from, targeted) =>
                {
                    if (targeted is PurifyingFlames)
                    {
                        PurifyingFlames flames = targeted as PurifyingFlames;

                        if (!from.InLOS(flames))
                        {
                            from.SendLocalizedMessage(500237); // Target cannot be seen.
                        }
                        else if (!Purified)
                        {
                            m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1156225, m.NetState); // *You purify the phylactery!*

                            Effects.SendLocationParticles(EffectItem.Create(flames.Location, flames.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                            Effects.PlaySound(flames.Location, flames.Map, 0x225); //TODO: Get sound

                            Purified = true;
                            InvalidateProperties();
                        }
                    }
                    else if (targeted is CursedSuitOfArmor)
                    {
                        CursedSuitOfArmor armor = targeted as CursedSuitOfArmor;

                        if (!from.InLOS(armor))
                        {
                            from.SendLocalizedMessage(500237); // Target cannot be seen.
                        }
                        else if (!_Purified)
                        {
                            m.SendLocalizedMessage(1156224); // *The cursed armor rejects the phylactery!*
                        }
                        else
                        {
                            m.SendLocalizedMessage(1156222); // *You throw the phylactery at the armor causing it to disintegrate!*

                            Map map = armor.Map;
                            Point3D p;

                            if (armor.ItemID == 5402)
                            {
                                p = new Point3D(armor.X - 1, armor.Y, armor.Z);
                            }
                            else
                            {
                                p = new Point3D(armor.X, armor.Y - 1, armor.Z);
                            }

                            armor.Delete();
                            Delete();

                            Effects.SendLocationParticles(EffectItem.Create(p, map, EffectItem.DefaultDuration), 0x3709, 10, 30, 2720, 7, 5052, 0);
                            Effects.PlaySound(p, map, 0x225); //TODO: Get sound

                            Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
                            {
                                Item item = new Static(Utility.Random(8762, 16))
                                {
                                    Hue  = 1111,
                                    Name = "Broken Armor"
                                };
                                item.MoveToWorld(p, Map.TerMur);

                                ArmoryEncounter encounter = ShadowguardController.GetEncounter(p, Map.TerMur) as ArmoryEncounter;

                                if (encounter != null)
                                {
                                    encounter.AddDestroyedArmor(item);
                                }

                                int ticks = 1;
                                Timer.DelayCall(TimeSpan.FromMilliseconds(50), TimeSpan.FromMilliseconds(50), 2, () =>
                                {
                                    Misc.Geometry.Circle2D(p, map, ticks, (pnt, mob) =>
                                    {
                                        Effects.PlaySound(pnt, mob, 0x307);
                                        Effects.SendLocationEffect(pnt, mob, Utility.RandomBool() ? 14000 : 14013, 20, 2018, 0);
                                    });

                                    ticks++;
                                });
                            });
                        }
                    }
                });
            }
        }