public void SetFlag(ExtRegionFlag flag, bool value)
 {
     if (value)
     {
         m_ExtFlags |= flag;
     }
     else
     {
         m_ExtFlags &= ~flag;
     }
 }
 public bool GetFlag(ExtRegionFlag flag)
 {
     return((m_ExtFlags & flag) != 0);
 }
示例#3
0
 public void SetDefaultFlags()
 {
     // Set the default region control settings
     m_PlayerLogoutDelay = TimeSpan.FromMinutes(5.0);
     m_ExtFlags = ExtRegionFlag.AllowGateIn | ExtRegionFlag.AllowHiding | ExtRegionFlag.AllowRecallIn | ExtRegionFlag.AllowCutCorpse;
     m_Flags = RegionFlag.AllowBenefitNPC | RegionFlag.AllowBenefitPlayer | RegionFlag.AllowHarmNPC | RegionFlag.AllowHarmPlayer
         | RegionFlag.AllowSpawn | RegionFlag.CanBeDamaged | RegionFlag.CanEnter | RegionFlag.CanHeal
         | RegionFlag.CanLootNPCCorpse | RegionFlag.CanLootOwnCorpse | RegionFlag.CanLootPlayerCorpse
         | RegionFlag.CanMountEthereal | RegionFlag.CanRessurect | RegionFlag.CanUsePotions
         | RegionFlag.CanUseStuckMenu | RegionFlag.ItemDecay;
 }
示例#4
0
 public void SetFlag(ExtRegionFlag flag, bool value)
 {
     if (value)
         m_ExtFlags |= flag;
     else
     {
         m_ExtFlags &= ~flag;
     }
 }
示例#5
0
 public bool GetFlag(ExtRegionFlag flag)
 {
     return ((m_ExtFlags & flag) != 0);
 }
示例#6
0
		public override void Deserialize( GenericReader reader )
		{
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 6:
                    {
                        m_ExtFlags = (ExtRegionFlag)reader.ReadEncodedInt();
                        m_LogoutMoveLocation = reader.ReadPoint3D();
                        m_LogoutMoveMap = reader.ReadMap();
                        goto case 5;
                    }
                // New RunUO 2.0 Version (case 5 and 4)
                case 5:
                {
                    // used to be custom go location but is now removed
                    reader.ReadPoint3D();
                    goto case 4;
                }
                case 4:
                {
                    m_RegionArea = ReadRect3DArray(reader);
                    
                    m_Flags = (RegionFlag)reader.ReadInt();

                    m_RestrictedSpells = ReadBitArray(reader);
                    m_RestrictedSkills = ReadBitArray(reader);

                    m_Active = reader.ReadBool();

                    m_RegionName = reader.ReadString();
                    m_RegionPriority = reader.ReadInt();
                    m_Music = (MusicName)reader.ReadInt();
                    m_PlayerLogoutDelay = reader.ReadTimeSpan();
                    m_LightLevel = reader.ReadInt();

                    m_MoveNPCToMap = reader.ReadMap();
                    m_MoveNPCToLoc = reader.ReadPoint3D();
                    m_MovePlayerToMap = reader.ReadMap();
                    m_MovePlayerToLoc = reader.ReadPoint3D();

                    break;
                }

                // Old RunUO 1.0 Version (cases 3-0)
                case 3:
                {
                    m_LightLevel = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Music = (MusicName)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    List<Rectangle2D> rects2d = ReadRect2DArray(reader);
                    foreach (Rectangle2D rect in rects2d)
                    {
                        Rectangle3D newrect = Server.Region.ConvertTo3D(rect);
                        DoChooseArea(null, this.Map, newrect.Start, newrect.End, this);
                    }

                    m_RegionPriority = reader.ReadInt();
                    m_PlayerLogoutDelay = reader.ReadTimeSpan();

                    m_RestrictedSpells = ReadBitArray(reader);
                    m_RestrictedSkills = ReadBitArray(reader);

                    m_Flags = (RegionFlag)reader.ReadInt();
                    if (NoPlayerCorpses)
                    {
                        DeleteNPCCorpse = true;
                        DeletePlayerCorpse = true;                          
                    }
                    if (NoItemDrop)
                    {
                        NoPlayerItemDrop = true;
                        NoNPCItemDrop = true;
                    }
                    // Invert because of change from "Cannot" to "Can"
                    if (CanLootOwnCorpse)
                    {
                        CanLootOwnCorpse = false;
                    }
                    if (CanEnter)
                    {
                        CanEnter = false;
                    }

                    m_RegionName = reader.ReadString();
                    break;
                }
                case 0:
                {
                    List<Rectangle2D> rects2d = ReadRect2DArray(reader);
                    foreach (Rectangle2D rect in rects2d)
                    {
                        Rectangle3D newrect = Server.Region.ConvertTo3D(rect);
                        DoChooseArea(null, this.Map, newrect.Start, newrect.End, this);
                    }

                    m_RestrictedSpells = ReadBitArray(reader);
                    m_RestrictedSkills = ReadBitArray(reader);

                    m_Flags = (RegionFlag)reader.ReadInt();
                    if (NoPlayerCorpses)
                    {
                        DeleteNPCCorpse = true;
                        DeletePlayerCorpse = true;
                    }
                    if (NoItemDrop)
                    {
                        NoPlayerItemDrop = true;
                        NoNPCItemDrop = true;
                    }
                    // Invert because of change from "Cannot" to "Can"
                    if (CanLootOwnCorpse)
                    {
                        CanLootOwnCorpse = false;
                    }
                    if (CanEnter)
                    {
                        CanEnter = false;
                    }

                    m_RegionName = reader.ReadString();
                    break;
                }
            }

            m_AllControls.Add(this);

            if(RegionNameTaken(m_RegionName))
                m_RegionName = FindNewName(m_RegionName);

            UpdateRegion();
            //m_CustomGoLocation = customGoLoc; // (previously removed?)
            //CustomGoLocation = customGoLoc; // (previously removed?)
		}