Пример #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            default:
            case 1:
            {
                _Blocker = (LOSBlocker)reader.ReadItem();
                goto case 0;
            }

            case 0:
            {
                BoardGameControlItem = (BoardGameControlItem)reader.ReadItem();

                Offset.X = reader.ReadInt();
                Offset.Y = reader.ReadInt();
                Offset.Z = reader.ReadInt();
                break;
            }
            }
        }
Пример #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            if (reader.ReadBool())
            {
                m_Blocker = reader.ReadItem() as Blocker;

                if (m_Blocker != null)
                {
                    m_Blocker.Delete();
                }
            }

            if (reader.ReadBool())
            {
                m_LOSBlocker = reader.ReadItem() as LOSBlocker;

                if (m_LOSBlocker != null)
                {
                    m_LOSBlocker.Delete();
                }
            }

            Delete();
        }
Пример #3
0
        private static void GenLOSBlockers()
        {
            LOSBlocker blocker = null;

            for (int y = 2392; y < 2407; y++)
            {
                blocker = new LOSBlocker();
                blocker.MoveToWorld(new Point3D(583, y, 0), Map.TerMur);
            }
        }
Пример #4
0
        //master constructor
        public GamePiece(int itemid, string name, bool blocklos) : base(itemid)
        {
            Movable = false;
            Name    = name;

            if (blocklos)
            {
                _Blocker = new LOSBlocker();
            }
        }
Пример #5
0
        public ChamberBarrier(Point3D loc)
            : base(0x3979)
        {
            Light = LightType.Circle150;

            Movable = false;
            MoveToWorld(loc, Map.TerMur);

            m_Blocker = new Blocker();
            m_Blocker.MoveToWorld(loc, Map.TerMur);

            m_LOSBlocker = new LOSBlocker();
            m_LOSBlocker.MoveToWorld(loc, Map.TerMur);
        }
Пример #6
0
        private static void GenerateCoral_OnCommand(CommandEventArgs e)
        {
            e.Mobile.SendMessage("Generating Corals...");

            int count = 0;

            for (int i = 0; i < limits.Length; i++)
            {
                Point2D actual = limits[i];
                Point2D next   = (i == limits.Length - 1 ? limits[0] : limits[i + 1]);

                for (int x = actual.X, y = actual.Y; x != next.X || y != next.Y;)
                {
                    if (x != next.X)
                    {
                        if (x < next.X)
                        {
                            x++;
                        }
                        else
                        {
                            x--;
                        }
                    }
                    if (y != next.Y)
                    {
                        if (y < next.Y)
                        {
                            y++;
                        }
                        else
                        {
                            y--;
                        }
                    }

                    Static rock       = new Static(rocks[Utility.Random(0, rocks.Count)]);
                    Item   blocker    = new Blocker();
                    Item   losBlocker = new LOSBlocker();

                    int z = map.GetAverageZ(x, y);                     // on récupère la hauteur du sol à cet endroit
                    rock.MoveToWorld(new Point3D(x, y, z), map);       // le rocher pour la forme
                    blocker.MoveToWorld(new Point3D(x, y, z), map);    // un blocker pour empêcher de passer même avec un sea horse par exemple
                    losBlocker.MoveToWorld(new Point3D(x, y, z), map); // pour empêcher tout sort de téléport de fonctionner

                    count++;
                }
            }
            e.Mobile.SendMessage(String.Format("{0} Corals have been generated !", count));
        }
        public virtual void AddComponents()
        {
            if (this == null)
            {
                return;
            }
            if (Deleted)
            {
                return;
            }
            if (!m_AddLOSBlocker)
            {
                return;
            }

            LOSBlocker LOSBlocker = new LOSBlocker();

            LOSBlocker.MoveToWorld(Location, Map);
            m_LOSBlocker = LOSBlocker;
        }
Пример #8
0
        public static void Generate()
        {
            Map map = Map.TerMur;
            int z   = -19;

            Static s = new Static(40142);

            s.MoveToWorld(new Point3D(888, 2303, z), map);

            s = new Static(40142);
            s.MoveToWorld(new Point3D(889, 2304, z), map);

            s = new Static(40142);
            s.MoveToWorld(new Point3D(896, 2295, z), map);

            s = new Static(40142);
            s.MoveToWorld(new Point3D(897, 2296, z), map);

            s = new Static(40142);
            s.MoveToWorld(new Point3D(904, 2303, z), map);

            s = new Static(40142);
            s.MoveToWorld(new Point3D(905, 2304, z), map);

            s = new Static(40142);
            s.MoveToWorld(new Point3D(896, 2311, z), map);

            s = new Static(40142);
            s.MoveToWorld(new Point3D(897, 2312, z), map);

            s = new Static(40169);
            s.MoveToWorld(new Point3D(887, 2304, z), map);

            s = new Static(40169);
            s.MoveToWorld(new Point3D(888, 2305, z), map);

            s = new Static(40169);
            s.MoveToWorld(new Point3D(895, 2296, z), map);

            s = new Static(40169);
            s.MoveToWorld(new Point3D(896, 2297, z), map);

            s = new Static(40169);
            s.MoveToWorld(new Point3D(903, 2304, z), map);

            s = new Static(40169);
            s.MoveToWorld(new Point3D(904, 2305, z), map);

            s = new Static(40169);
            s.MoveToWorld(new Point3D(895, 2312, z), map);

            s = new Static(40169);
            s.MoveToWorld(new Point3D(896, 2313, z), map);

            z = -20;

            s = new Static(40161);
            s.MoveToWorld(new Point3D(897, 2305, z), map);

            s = new Static(40165);
            s.MoveToWorld(new Point3D(894, 2306, z), map);

            MoonstonePowerGeneratorAddon addon = new MoonstonePowerGeneratorAddon(true);

            addon.MoveToWorld(new Point3D(884, 2292, z), map);

            addon = new MoonstonePowerGeneratorAddon(true);
            addon.MoveToWorld(new Point3D(896, 2286, z), map);

            addon = new MoonstonePowerGeneratorAddon(true);
            addon.MoveToWorld(new Point3D(909, 2291, z), map);

            addon = new MoonstonePowerGeneratorAddon(true);
            addon.MoveToWorld(new Point3D(914, 2305, z), map);

            addon = new MoonstonePowerGeneratorAddon(true);
            addon.MoveToWorld(new Point3D(909, 2318, z), map);

            addon = new MoonstonePowerGeneratorAddon(true);
            addon.MoveToWorld(new Point3D(896, 2323, z), map);

            addon = new MoonstonePowerGeneratorAddon(true);
            addon.MoveToWorld(new Point3D(884, 2316, z), map);

            addon = new MoonstonePowerGeneratorAddon(true);
            addon.MoveToWorld(new Point3D(878, 2304, z), map);

            MyrmidexIdol idol = new MyrmidexIdol();

            idol.MoveToWorld(new Point3D(488, 1856, 111), map);

            Teleporter teleporter = new Teleporter(new Point3D(487, 1857, 95), map);

            teleporter.MoveToWorld(new Point3D(896, 2304, 45), map);

            teleporter = new MyrmidexQueenTeleporter(new Point3D(711, 2302, 0), map);
            teleporter.MoveToWorld(new Point3D(121, 1682, -3), map);

            teleporter = new MyrmidexQueenTeleporter(new Point3D(711, 2303, 0), Map.TerMur);
            teleporter.MoveToWorld(new Point3D(121, 1683, -2), map);

            teleporter = new MyrmidexQueenTeleporter(new Point3D(711, 2304, 0), Map.TerMur);
            teleporter.MoveToWorld(new Point3D(121, 1684, -1), map);

            teleporter = new Teleporter(new Point3D(120, 1682, -1), map);
            teleporter.MoveToWorld(new Point3D(711, 2302, 0), map);

            teleporter = new Teleporter(new Point3D(120, 1683, 1), map);
            teleporter.MoveToWorld(new Point3D(711, 2303, 0), map);

            teleporter = new Teleporter(new Point3D(120, 1684, 2), map);
            teleporter.MoveToWorld(new Point3D(711, 2304, 0), map);

            teleporter = new Teleporter(new Point3D(120, 1684, 2), map);
            teleporter.MoveToWorld(new Point3D(711, 2305, 0), map);

            teleporter = new MyrmidexPitTeleporter(Allegiance.Myrmidex, new Point3D(985, 1883, 0), map);
            teleporter.MoveToWorld(new Point3D(176, 1835, 90), map);

            teleporter = new MyrmidexPitTeleporter(Allegiance.Myrmidex, new Point3D(986, 1883, 0), map);
            teleporter.MoveToWorld(new Point3D(177, 1835, 90), map);

            teleporter = new Teleporter(new Point3D(176, 1834, 90), map);
            teleporter.MoveToWorld(new Point3D(985, 1887, 0), map);

            teleporter = new Teleporter(new Point3D(177, 1834, 90), map);
            teleporter.MoveToWorld(new Point3D(986, 1887, 0), map);

            teleporter = new MyrmidexPitTeleporter(Allegiance.Tribes, new Point3D(853, 1777, 0), map);
            teleporter.MoveToWorld(new Point3D(224, 1724, 6), map);

            teleporter = new MyrmidexPitTeleporter(Allegiance.Tribes, new Point3D(854, 1777, 0), map);
            teleporter.MoveToWorld(new Point3D(224, 1725, 6), map);

            teleporter = new Teleporter(new Point3D(225, 1724, 6), map);
            teleporter.MoveToWorld(new Point3D(853, 1776, 11), map);

            teleporter = new Teleporter(new Point3D(225, 1725, 6), map);
            teleporter.MoveToWorld(new Point3D(854, 1776, 11), map);

            teleporter = new Teleporter(new Point3D(225, 1725, 6), map);
            teleporter.MoveToWorld(new Point3D(855, 1776, 11), map);

            LOSBlocker los = new LOSBlocker();

            los.MoveToWorld(new Point3D(121, 1682, -3), map);

            los = new LOSBlocker();
            los.MoveToWorld(new Point3D(121, 1683, -3), map);

            los = new LOSBlocker();
            los.MoveToWorld(new Point3D(121, 1684, -3), map);

            AllegianceIdol allegianceIdol = new AllegianceIdol(Allegiance.Tribes);

            allegianceIdol.MoveToWorld(new Point3D(267, 1741, 85), map);

            allegianceIdol = new AllegianceIdol(Allegiance.Myrmidex);
            allegianceIdol.MoveToWorld(new Point3D(176, 1813, 91), map);

            HealerCamp camp = new HealerCamp();

            camp.Map      = Map.TerMur;
            camp.Location = new Point3D(262, 1716, 80);

            GeoffreyCampAddon gcamp = new GeoffreyCampAddon();

            gcamp.MoveToWorld(new Point3D(264, 1732, 80), Map.TerMur);

            BattleSpawner spawner = new BattleSpawner();

            spawner.MoveToWorld(new Point3D(851, 1776, 0), Map.TerMur);

            Item st = new Static(0xA1F);

            st.MoveToWorld(new Point3D(913, 1871, 0), Map.TerMur);

            st = new Static(0xA1F);
            st.MoveToWorld(new Point3D(914, 1871, 0), Map.TerMur);

            BattleFlag bflag = new BattleFlag(0x42CB, 0);

            bflag.MoveToWorld(new Point3D(914, 1872, 5), Map.TerMur);

            st = new Static(0xA1F);
            st.MoveToWorld(new Point3D(913, 1792, 0), Map.TerMur);

            bflag = new BattleFlag(0x42C, 2520);
            bflag.MoveToWorld(new Point3D(914, 1793, 6), Map.TerMur);

            st = new Static(0x42D);
            st.MoveToWorld(new Point3D(913, 1793, 6), Map.TerMur);

            XmlSpawner sp = new XmlSpawner("Yar");

            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(169, 1813, 80), map);
            sp.Respawn();

            sp            = new XmlSpawner("Bront");
            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(1448, 3774, 0), Map.Trammel);
            sp.Respawn();

            sp            = new XmlSpawner("CollectorOfOddities");
            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(4305, 1003, 0), Map.Trammel);
            sp.Respawn();

            sp            = new XmlSpawner("Carroll");
            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(2878, 723, 0), Map.Trammel);
            sp.Respawn();

            sp            = new XmlSpawner("Eriathwen");
            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(1426, 1653, 0), Map.Trammel);
            sp.Respawn();

            sp            = new XmlSpawner("EllieRafkin");
            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(261, 1742, 80), map);
            sp.Respawn();

            sp            = new XmlSpawner("Yero");
            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(3692, 2252, 26), Map.Trammel);
            sp.Respawn();

            sp            = new XmlSpawner("Alida");
            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(5257, 4012, 40), Map.Trammel);
            sp.Respawn();

            sp            = new XmlSpawner("Foxx");
            sp.SpawnRange = 1;
            sp.HomeRange  = 5;
            sp.MoveToWorld(new Point3D(269, 1727, 80), map);
            sp.Respawn();

            sp            = new XmlSpawner("MyrmidexQueen/Cantwalk/true");
            sp.SpawnRange = 0;
            sp.HomeRange  = 1;
            sp.MoveToWorld(new Point3D(768, 2303, 0), map);
            sp.Respawn();
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            int storedHitPoints    = 1000;
            int storedMaxHitPoints = 1000;

            //Version 0
            if (version >= 0)
            {
                m_AllowRepair                      = reader.ReadBool();
                m_RepairSound                      = reader.ReadInt();
                m_DamageState                      = (DamageStateType)reader.ReadInt();
                m_InteractionRange                 = reader.ReadInt();
                m_InteractionDelay                 = reader.ReadDouble();
                m_MinInteractDamage                = reader.ReadInt();
                m_MaxInteractDamage                = reader.ReadInt();
                m_InteractDamageScalar             = reader.ReadDouble();
                m_WeaponDamageScalar               = reader.ReadDouble();
                m_LockpickDamageScalar             = reader.ReadDouble();
                m_MiningDamageScalar               = reader.ReadDouble();
                m_LumberjackingDamageScalar        = reader.ReadDouble();
                m_ObjectBreakingDeviceDamageScalar = reader.ReadDouble();

                storedHitPoints    = reader.ReadInt();
                storedMaxHitPoints = reader.ReadInt();

                m_AddLOSBlocker = reader.ReadBool();
                m_HitSound      = reader.ReadInt();

                m_NormalItemId = reader.ReadInt();
                m_NormalHue    = reader.ReadInt();

                m_LightlyDamagedPercent = reader.ReadDouble();
                m_LightlyDamagedSound   = reader.ReadInt();
                m_LightlyDamagedItemId  = reader.ReadInt();
                m_LightlyDamagedHue     = reader.ReadInt();

                m_HeavilyDamagedPercent = reader.ReadDouble();
                m_HeavilyDamagedSound   = reader.ReadInt();
                m_HeavilyDamagedItemId  = reader.ReadInt();
                m_HeavilyDamagedHue     = reader.ReadInt();

                m_BrokenSound  = reader.ReadInt();
                m_BrokenItemId = reader.ReadInt();
                m_BrokenHue    = reader.ReadInt();

                m_DeleteOnBreak = reader.ReadBool();
                m_CreateTimedStaticAfterBreak = reader.ReadBool();

                m_TimedStaticOnBreakItemId             = reader.ReadInt();
                m_TimedStaticOnBreakHue                = reader.ReadInt();
                m_TimedStaticDuration                  = reader.ReadDouble();
                m_TimedStaticOnBreakName               = reader.ReadString();
                m_RevealNearbyHiddenItemsOnBreak       = reader.ReadBool();
                m_RevealNearbyHiddenItemsOnBreakRadius = reader.ReadInt();
                m_RefreshNearbyMovables                = reader.ReadBool();
                m_RefreshNearbyMovablesRadius          = reader.ReadInt();
                m_LOSBlocker = reader.ReadItem() as LOSBlocker;
            }

            //Version 1
            if (version >= 1)
            {
                m_RequiresFullRepair = reader.ReadBool();
                m_PlayerPlaced       = reader.ReadBool();
                m_Facing             = (Direction)reader.ReadInt();
            }


            //--------

            //Make Sure This Gets Fired Off Last
            MaxHitPoints = storedMaxHitPoints;
            HitPoints    = storedHitPoints;
        }
Пример #10
0
        public static void GenerateMapDecoration(Map map)
        {
            blocker.ToList().ForEach(x =>
            {
                if (map.FindItem <Blocker>(new Point3D(x)) == null)
                {
                    Blocker bl = new Blocker();

                    bl.MoveToWorld(new Point3D(x), map);
                }

                if (map.FindItem <LOSBlocker>(new Point3D(x)) == null)
                {
                    LOSBlocker lb = new LOSBlocker();

                    lb.MoveToWorld(new Point3D(x), map);
                }
            });

            for (int i = 0; i < Workers.Length; i++)
            {
                Point3D p = Workers[i];

                if (map.FindMobile <Worker>(p) == null)
                {
                    Worker w = new Worker((FellowshipChain)(i + 1));

                    w.MoveToWorld(p, map);
                }
            }

            FellowshipChain c = FellowshipChain.One;

            for (int t = 0; t < Teleporters.Length / 2; t++)
            {
                Point3D p = Teleporters[t, 0];

                if (map.FindItem <BlackthornDungeonTeleporter>(p) == null)
                {
                    BlackthornDungeonTeleporter bl;

                    if (t % 2 == 0)
                    {
                        bl = new BlackthornDungeonTeleporter(c)
                        {
                            Dest = Teleporters[t, 1]
                        };

                        c++;
                    }
                    else
                    {
                        bl = new BlackthornDungeonTeleporter()
                        {
                            Dest = Teleporters[t, 1]
                        };
                    }

                    bl.MoveToWorld(p, map);
                }
            }
        }
Пример #11
0
        public static void GenerateMapDecoration(Map map)
        {
            List <Point3D> list = new List <Point3D>();

            for (var index = 0; index < blocker.Length; index++)
            {
                var point3D = blocker[index];

                list.Add(point3D);
            }

            for (var index = 0; index < list.Count; index++)
            {
                var x = list[index];

                if (map.FindItem <Blocker>(new Point3D(x)) == null)
                {
                    Blocker bl = new Blocker();

                    bl.MoveToWorld(new Point3D(x), map);
                }

                if (map.FindItem <LOSBlocker>(new Point3D(x)) == null)
                {
                    LOSBlocker lb = new LOSBlocker();

                    lb.MoveToWorld(new Point3D(x), map);
                }
            }

            for (int i = 0; i < Workers.Length; i++)
            {
                Point3D p = Workers[i];

                if (map.FindMobile <Worker>(p) == null)
                {
                    Worker w = new Worker((FellowshipChain)(i + 1));

                    w.MoveToWorld(p, map);
                }
            }

            FellowshipChain c = FellowshipChain.One;

            for (int t = 0; t < Teleporters.Length / 2; t++)
            {
                Point3D p = Teleporters[t, 0];

                if (map.FindItem <BlackthornDungeonTeleporter>(p) == null)
                {
                    BlackthornDungeonTeleporter bl;

                    if (t % 2 == 0)
                    {
                        bl = new BlackthornDungeonTeleporter(c)
                        {
                            Dest = Teleporters[t, 1]
                        };

                        c++;
                    }
                    else
                    {
                        bl = new BlackthornDungeonTeleporter
                        {
                            Dest = Teleporters[t, 1]
                        };
                    }

                    bl.MoveToWorld(p, map);
                }
            }
        }