コード例 #1
1
ファイル: VendorInventory.cs プロジェクト: nathanvy/runuo
        public VendorInventory( BaseHouse house, GenericReader reader )
        {
            m_House = house;

            int version = reader.ReadEncodedInt();

            m_Owner = reader.ReadMobile();
            m_VendorName = reader.ReadString();
            m_ShopName = reader.ReadString();

            m_Items = reader.ReadStrongItemList();
            m_Gold = reader.ReadInt();

            m_ExpireTime = reader.ReadDeltaTime();

            if ( m_Items.Count == 0 && m_Gold == 0 )
            {
                Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) );
            }
            else
            {
                TimeSpan delay = m_ExpireTime - DateTime.UtcNow;
                m_ExpireTimer = new ExpireTimer( this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero );
                m_ExpireTimer.Start();
            }
        }
コード例 #2
0
ファイル: KeyRing.cs プロジェクト: Godkong/Origins
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadEncodedInt();

            m_Keys = reader.ReadStrongItemList<Key>();
        }
コード例 #3
0
ファイル: PitChampionSpawn.cs プロジェクト: Ravenwolfe/xrunuo
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            /*int version = */
            reader.ReadInt();

            m_DecoItems = reader.ReadStrongItemList();
        }
コード例 #4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        m_AddonComponents = reader.ReadStrongItemList<ScriptBasedBuildingAddon>();
                        break;
                    }
            }
        }
コード例 #5
0
 public static void Deserialize(GenericReader reader)
 {
     int version = reader.ReadInt();
     switch (version)
     {
         case 0:
             int count = reader.ReadInt();
             for (int i = 0; i < count; i++)
             {
                 List<Item> list = reader.ReadStrongItemList();
                 foreach (Item item in list)
                     if (item != null && !item.Deleted)
                         item.Delete();
             }
             break;
     }
 }
コード例 #6
0
ファイル: PreviewHouse.cs プロジェクト: nathanvy/runuo
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_Components = reader.ReadStrongItemList();

                    break;
                }
            }

            Timer.DelayCall( TimeSpan.Zero, new TimerCallback( this.Delete ) );
        }
コード例 #7
0
ファイル: PreviewHouse.cs プロジェクト: Godkong/RunUO
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_Components = reader.ReadStrongItemList();

                    break;
                }
            }

            Delete();
        }
コード例 #8
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 2:
				{
					m_Guardians = reader.ReadStrongMobileList();
					m_Temporary = reader.ReadBool();

					goto case 1;
				}
				case 1:
				{
					m_Owner = reader.ReadMobile();

					goto case 0;
				}
				case 0:
				{
					m_Level = reader.ReadInt();
					m_DeleteTime = reader.ReadDeltaTime();
					m_Lifted = reader.ReadStrongItemList();

					if ( version < 2 )
						m_Guardians = new List<Mobile>();

					break;
				}
			}

			if ( !m_Temporary )
			{
				m_Timer = new DeleteTimer( this, m_DeleteTime );
				m_Timer.Start();
			}
			else
			{
				Delete();
			}
		}
コード例 #9
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadEncodedInt();

			m_Charges = reader.ReadEncodedInt();
			m_Receivers = reader.ReadStrongItemList<ReceiverCrystal>();
		}
コード例 #10
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				#region Mondain's Legacy
				case 2:
					m_Resource = (CraftResource) reader.ReadInt();

					goto case 1;
				#endregion
				case 1:
				case 0:
				{
					m_Components = reader.ReadStrongItemList<AddonComponent>();
					break;
				}
			}

			if ( version < 1 && Weight == 0 )
				Weight = -1;
		}
コード例 #11
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_Components = reader.ReadStrongItemList<AddonContainerComponent>();
			m_Resource = (CraftResource) reader.ReadInt();

			AddonComponent.ApplyLightTo( this );
		}
コード例 #12
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadEncodedInt();

            m_Components = reader.ReadStrongItemList<PlagueBeastComponent>();
            m_BrainHue = reader.ReadInt();
            m_Opened = reader.ReadBool();
        }
コード例 #13
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize (reader);

			int version = reader.ReadInt();

			switch ( version )
			{
                case 5:

			        SafeZone = reader.ReadBool();
			        goto case 4;

                case 4:

			        m_BoardWhiteHue = reader.ReadInt();
                    m_BoardBlackHue = reader.ReadInt();
                    m_BoardStairsHue = reader.ReadInt();
			        m_BoardWhiteTiles = reader.ReadStrongItemList();
                    m_BoardBlackTiles = reader.ReadStrongItemList();
                    m_BoardStairsTiles = reader.ReadStrongItemList();
			        goto case 3;

				case 3:

					m_OverrideMinorHue = reader.ReadBool();
					m_AllowSpectators = reader.ReadBool();
					goto case 2;

				case 2 :

					m_Orientation = (BoardOrientation) reader.ReadByte();
					m_BlackMinorHue = reader.ReadInt();
					m_WhiteMinorHue = reader.ReadInt();
					goto case 1;

				case 1:

					m_ChessSet = ( ChessSet ) reader.ReadInt();
					m_WhiteHue = reader.ReadInt();
					m_BlackHue = reader.ReadInt();
					m_AttackEffect = reader.ReadInt();
					m_CaptureEffect = reader.ReadInt();
					m_BoltOnDeath = reader.ReadBool();
					goto case 0;

				case 0:
					
					m_Bounds = reader.ReadRect2D();
					m_SquareWidth = reader.ReadInt();
					m_BoardHeight = reader.ReadInt();
					break;
			}
		}
コード例 #14
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                case 0:
                {
                    m_Components = reader.ReadStrongItemList<AddonComponent>();
                    break;
                }
            }

            if ( version < 1 && Weight == 0 )
                Weight = -1;
        }
コード例 #15
0
ファイル: GauntletSpawner.cs プロジェクト: Godkong/Origins
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_RegionBounds = reader.ReadRect2D();
					m_Traps = reader.ReadStrongItemList<BaseTrap>();

					goto case 0;
				}
				case 0:
				{
					if ( version < 1 )
					{
						m_Traps = new List<BaseTrap>();
						m_RegionBounds = new Rectangle2D( X - 40, Y - 40, 80, 80 );
					}

					m_Creatures = reader.ReadStrongMobileList();

					m_TypeName = reader.ReadString();
					m_Door = reader.ReadItem<BaseDoor>(); ;
					m_Addon = reader.ReadItem<BaseAddon>(); ;
					m_Sequence = reader.ReadItem<GauntletSpawner>();

					State = (GauntletSpawnerState)reader.ReadInt();

					break;
				}
			}
		}
コード例 #16
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_Levers = reader.ReadStrongItemList();
			m_Statues = reader.ReadStrongItemList();
			m_Teles = reader.ReadStrongItemList();

			m_Box = reader.ReadItem() as LampRoomBox;

			m_Tiles = new List<LeverPuzzleRegion>();
			for (int i = 4; i<9; i++)
				m_Tiles.Add( new LeverPuzzleRegion( this, TA[i] ));

			m_LampRoom = new LampRoomRegion( this );
			m_Enabled = true;
			m_TheirKey = 0;
			m_MyKey = 0;
			GenKey();
		}
コード例 #17
0
		public virtual void Deserialize(GenericReader reader)
		{
			int version = reader.GetVersion();

			if (version > 5)
			{
				reader.ReadBlock(
					r =>
					{
						if (version > 6)
						{
							Serial = new PvPSerial(r);
						}
						else
						{
							Serial = r.ReadTypeCreate<PvPSerial>(r) ?? new PvPSerial(r);
						}
					});
			}

			switch (version)
			{
				case 7:
				case 6:
				case 5:
					Hidden = reader.ReadBool();
					goto case 4;
				case 4:
					FloorItemDelete = reader.ReadBool();
					goto case 3;
				case 3:
				case 2:
					{
						Gate = reader.ReadItem<PvPSpectatorGate>();

						if (Gate != null)
						{
							Gate.Battle = this;
						}
					}
					goto case 1;
				case 1:
					{
						Category = reader.ReadString();
						Ranked = reader.ReadBool();
						InviteWhileRunning = reader.ReadBool();
					}
					goto case 0;
				case 0:
					{
						if (version < 6)
						{
							reader.ReadBlock(r => Serial = r.ReadTypeCreate<PvPSerial>(r) ?? new PvPSerial(r));
						}

						DebugMode = reader.ReadBool();
						State = reader.ReadFlag<PvPBattleState>();
						Name = reader.ReadString();
						Description = reader.ReadString();
						AutoAssign = reader.ReadBool();
						UseTeamColors = reader.ReadBool();
						IgnoreCapacity = reader.ReadBool();
						SubCommandPrefix = reader.ReadChar();
						QueueAllowed = reader.ReadBool();
						SpectateAllowed = reader.ReadBool();
						KillPoints = version < 3 ? (reader.ReadBool() ? 1 : 0) : reader.ReadInt();
						PointsBase = reader.ReadInt();
						PointsRankFactor = reader.ReadDouble();
						IdleKick = reader.ReadBool();
						IdleThreshold = reader.ReadTimeSpan();
						LastState = reader.ReadFlag<PvPBattleState>();
						LastStateChange = reader.ReadDateTime();
						LightLevel = reader.ReadInt();
						LogoutDelay = reader.ReadTimeSpan();

						Doors.AddRange(reader.ReadStrongItemList<BaseDoor>());

						reader.ReadBlock(r => Options = r.ReadTypeCreate<PvPBattleOptions>(r) ?? new PvPBattleOptions(r));

						if (Schedule != null && Schedule.Running)
						{
							Schedule.Stop();
						}

						reader.ReadBlock(r => Schedule = r.ReadTypeCreate<Schedule>(r) ?? new Schedule("Battle " + Serial.Value, false));
						reader.ReadBlock(r => BattleRegion = r.ReadTypeCreate<PvPBattleRegion>(this, r) ?? new PvPBattleRegion(this, r));
						reader.ReadBlock(
							r => SpectateRegion = r.ReadTypeCreate<PvPSpectateRegion>(this, r) ?? new PvPSpectateRegion(this, r));

						reader.ReadBlockList(r => r.ReadTypeCreate<PvPTeam>(this, r) ?? new PvPTeam(this, r), Teams);
					}
					break;
			}
		}
コード例 #18
0
ファイル: Item.cs プロジェクト: Ravenwolfe/xrunuo
        public virtual void Deserialize( GenericReader reader )
        {
            int version = reader.ReadInt();

            SetLastMoved();

            switch ( version )
            {
                case 14:
                    {
                        m_InstanceID = reader.ReadInt();

                        SaveFlag flags = (SaveFlag) reader.ReadInt();

                        int minutes = reader.ReadEncodedInt();

                        try { LastMoved = DateTime.Now - TimeSpan.FromMinutes( minutes ); }
                        catch { LastMoved = DateTime.Now; }

                        if ( GetSaveFlag( flags, SaveFlag.Direction ) )
                            m_Direction = (Direction) reader.ReadByte();

                        if ( GetSaveFlag( flags, SaveFlag.LightType ) )
                            m_LightType = (LightType) reader.ReadByte();

                        if ( GetSaveFlag( flags, SaveFlag.Bounce ) )
                            m_Bounce = BounceInfo.Deserialize( reader );

                        if ( GetSaveFlag( flags, SaveFlag.LootType ) )
                            m_LootType = (LootType) reader.ReadByte();

                        int x = 0, y = 0, z = 0;

                        if ( GetSaveFlag( flags, SaveFlag.LocationFull ) )
                        {
                            x = reader.ReadEncodedInt();
                            y = reader.ReadEncodedInt();
                            z = reader.ReadEncodedInt();
                        }
                        else
                        {
                            if ( GetSaveFlag( flags, SaveFlag.LocationByteXY ) )
                            {
                                x = reader.ReadByte();
                                y = reader.ReadByte();
                            }
                            else if ( GetSaveFlag( flags, SaveFlag.LocationShortXY ) )
                            {
                                x = reader.ReadShort();
                                y = reader.ReadShort();
                            }

                            if ( GetSaveFlag( flags, SaveFlag.LocationSByteZ ) )
                                z = reader.ReadSByte();
                        }

                        m_Location = new Point3D( x, y, z );

                        if ( GetSaveFlag( flags, SaveFlag.ItemID ) )
                            m_ItemID = reader.ReadEncodedInt();

                        if ( GetSaveFlag( flags, SaveFlag.Hue ) )
                            m_Hue = reader.ReadEncodedInt();

                        if ( GetSaveFlag( flags, SaveFlag.Amount ) )
                            m_Amount = reader.ReadEncodedInt();
                        else
                            m_Amount = 1;

                        if ( GetSaveFlag( flags, SaveFlag.Layer ) )
                            m_Layer = (Layer) reader.ReadByte();

                        if ( GetSaveFlag( flags, SaveFlag.Name ) )
                            m_Name = string.Intern( reader.ReadString() );

                        if ( GetSaveFlag( flags, SaveFlag.Parent ) )
                        {
                            Serial parent = reader.ReadInt();

                            if ( parent.IsMobile )
                                m_Parent = World.Instance.FindMobile( parent );
                            else if ( parent.IsItem )
                                m_Parent = World.Instance.FindItem( parent );
                            else
                                m_Parent = null;

                            if ( m_Parent == null && ( parent.IsMobile || parent.IsItem ) )
                                Delete();
                        }

                        if ( GetSaveFlag( flags, SaveFlag.Items ) )
                            m_Items = reader.ReadStrongItemList();

                        if ( GetSaveFlag( flags, SaveFlag.IntWeight ) )
                            m_Weight = reader.ReadEncodedInt();
                        else if ( GetSaveFlag( flags, SaveFlag.WeightNot1or0 ) )
                            m_Weight = reader.ReadDouble();
                        else if ( GetSaveFlag( flags, SaveFlag.WeightIs0 ) )
                            m_Weight = 0.0;
                        else
                            m_Weight = 1.0;

                        if ( GetSaveFlag( flags, SaveFlag.Map ) )
                            m_Map = reader.ReadMap();
                        else
                            m_Map = Map.Internal;

                        if ( GetSaveFlag( flags, SaveFlag.Visible ) )
                            SetFlag( ImplFlag.Visible, reader.ReadBool() );
                        else
                            SetFlag( ImplFlag.Visible, true );

                        if ( GetSaveFlag( flags, SaveFlag.Movable ) )
                            SetFlag( ImplFlag.Movable, reader.ReadBool() );
                        else
                            SetFlag( ImplFlag.Movable, true );

                        if ( GetSaveFlag( flags, SaveFlag.Stackable ) )
                            SetFlag( ImplFlag.Stackable, reader.ReadBool() );

                        if ( GetSaveFlag( flags, SaveFlag.ImplFlags ) )
                            m_Flags = (ImplFlag) reader.ReadEncodedInt();

                        if ( GetSaveFlag( flags, SaveFlag.BlessedFor ) )
                            m_BlessedFor = reader.ReadMobile();

                        if ( GetSaveFlag( flags, SaveFlag.HeldBy ) )
                            m_HeldBy = reader.ReadMobile();

                        if ( GetSaveFlag( flags, SaveFlag.LabelNumber ) )
                            m_LabelNumber = reader.ReadInt();

                        #region Labels
                        if ( GetSaveFlag( flags, SaveFlag.Labels ) )
                        {
                            int length = reader.ReadInt();

                            m_Labels = new string[length];

                            for ( int i = 0; i < length; i++ )
                                m_Labels[i] = reader.ReadString();
                        }
                        #endregion

                        if ( GetSaveFlag( flags, SaveFlag.SavedFlags ) )
                            m_SavedFlags = reader.ReadEncodedInt();

                        if ( m_Map != null && m_Parent == null )
                            m_Map.OnEnter( this );

                        break;
                    }
            }

            if ( m_HeldBy != null )
                Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixHolding_Sandbox ) );
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            // version 0

            int version = reader.ReadInt();

            m_Player = reader.ReadMobile();
            m_Corpses = (reader.ReadStrongItemList()).ConvertAll(new System.Converter<Item, Corpse>(ItemToCorpse));
            m_LastValidCorpse = reader.ReadItem() as Corpse;
        }
コード例 #20
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_PreCreatedChampion = reader.ReadMobile() as BaseCreature;
            m_Champion = reader.ReadMobile() as BaseCreature;
            m_Platform = reader.ReadItem() as BasePlatform;
            m_Altar = reader.ReadItem() as BaseAltar;
            m_Active = reader.ReadBool();
            m_iMainQueue = reader.ReadInt();

            m_RedSkulls = reader.ReadStrongItemList();
            m_WhiteSkulls = reader.ReadStrongItemList();

            if (m_Champion != null && !m_Champion.Deleted)
                m_Champion.Spawner = this;

            if (m_Platform == null || m_Altar == null)
                Delete();
            else
                CheckSpawn();
        }
コード例 #21
0
ファイル: Corpse.cs プロジェクト: Leodinas/uolite
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 11:
                    {
                        // Version 11, we move all bools to a CorpseFlag
                        m_Flags = (CorpseFlag)reader.ReadInt();

                        m_TimeOfDeath = reader.ReadDeltaTime();

                        int count = reader.ReadInt();

                        for( int i = 0; i < count; ++i )
                        {
                            Item item = reader.ReadItem();

                            if( reader.ReadBool() )
                                SetRestoreInfo( item, reader.ReadPoint3D() );
                            else if( item != null )
                                SetRestoreInfo( item, item.Location );
                        }

                        if( reader.ReadBool() )
                            BeginDecay( reader.ReadDeltaTime() - DateTime.Now );

                        m_Looters = reader.ReadStrongMobileList();
                        m_Killer = reader.ReadMobile();

                        m_Aggressors = reader.ReadStrongMobileList();
                        m_Owner = reader.ReadMobile();

                        m_CorpseName = reader.ReadString();

                        m_AccessLevel = (AccessLevel)reader.ReadInt();
                        reader.ReadInt(); // guild reserve
                        m_Kills = reader.ReadInt();

                        m_EquipItems = reader.ReadStrongItemList();
                        break;
                    }
                case 10:
                {
                    m_TimeOfDeath = reader.ReadDeltaTime();

                    goto case 9;
                }
                case 9:
                {
                    int count = reader.ReadInt();

                    for ( int i = 0; i < count; ++i )
                    {
                        Item item = reader.ReadItem();

                        if ( reader.ReadBool() )
                            SetRestoreInfo( item, reader.ReadPoint3D() );
                        else if ( item != null )
                            SetRestoreInfo( item, item.Location );
                    }

                    goto case 8;
                }
                case 8:
                {
                    SetFlag( CorpseFlag.VisitedByTaxidermist, reader.ReadBool() );

                    goto case 7;
                }
                case 7:
                {
                    if ( reader.ReadBool() )
                        BeginDecay( reader.ReadDeltaTime() - DateTime.Now );

                    goto case 6;
                }
                case 6:
                {
                    m_Looters = reader.ReadStrongMobileList();
                    m_Killer = reader.ReadMobile();

                    goto case 5;
                }
                case 5:
                {
                    SetFlag( CorpseFlag.Carved, reader.ReadBool() );

                    goto case 4;
                }
                case 4:
                {
                    m_Aggressors = reader.ReadStrongMobileList();

                    goto case 3;
                }
                case 3:
                {
                    m_Owner = reader.ReadMobile();

                    goto case 2;
                }
                case 2:
                {
                    SetFlag( CorpseFlag.NoBones, reader.ReadBool() );

                    goto case 1;
                }
                case 1:
                {
                    m_CorpseName = reader.ReadString();

                    goto case 0;
                }
                case 0:
                {
                    if ( version < 10 )
                        m_TimeOfDeath = DateTime.Now;

                    if ( version < 7 )
                        BeginDecay( m_DefaultDecayTime );

                    if ( version < 6 )
                        m_Looters = new List<Mobile>();

                    if ( version < 4 )
                        m_Aggressors = new List<Mobile>();

                    m_AccessLevel = (AccessLevel)reader.ReadInt();
                    reader.ReadInt(); // guild reserve
                    m_Kills = reader.ReadInt();
                    SetFlag( CorpseFlag.Criminal, reader.ReadBool() );

                    m_EquipItems = reader.ReadStrongItemList();

                    break;
                }
            }
        }
コード例 #22
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			
			m_Peerless = reader.ReadMobile() as BasePeerless;
			m_BossLocation = reader.ReadPoint3D();
			m_TeleportDest = reader.ReadPoint3D();
			m_ExitDest = reader.ReadPoint3D();
			
			m_Deadline = reader.ReadDateTime();
			
			// deserialize master keys
			m_MasterKeys = reader.ReadStrongItemList();		
				
			// deserialize fightes			
			m_Fighters = reader.ReadStrongMobileList();
				
			// deserialize pets
			m_Pets = new Dictionary<Mobile,List<Mobile>>();
			int count = reader.ReadInt();
			
			for ( int i = 0; i < count; i ++ )
				m_Pets.Add( reader.ReadMobile(), reader.ReadStrongMobileList() );
				
			m_Spawned = reader.ReadBool();
			
			FinishSequence();
		}
コード例 #23
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            int test = 0;

            if (version > 57)
            {
                m_Orders = new List<OrderInfo>();
                int orderCount = reader.ReadInt();
                for (int i = 0; i < orderCount; i++)
                {
                    OrderInfo newOrder = new OrderInfo("", 1, 1, this);
                    OrderInfo.Deserialize(reader, newOrder);
                    m_Orders.Add(newOrder);
                }
            }

            if (version > 55)
            {
                m_Deadly = reader.ReadInt();
            }

            if (version > 54)
            {
                m_Nation = (Nation)reader.ReadInt();
                m_Government = (GovernmentEntity)reader.ReadItem();
                m_Organization = (CustomGuildStone)reader.ReadItem();
            }

            if( version > 53 )
                m_AuraType = (AuraType)reader.ReadInt();

            if( version > 52 )
                m_CustomBreathType = (CustomBreathType)reader.ReadInt();

            if( version > 51 )
                m_ManeuverResistance = reader.ReadInt();

            if( version > 50 )
            {
                m_CantInterrupt = reader.ReadBool();
                m_CantParry = reader.ReadBool();
                m_HasNoCorpse = reader.ReadBool();
            }

            if( version > 49 )
            {
                int count = reader.ReadInt();

                for( int i = 0; i < count; i++ )
                    m_SecondaryWikiConfigs.Add( reader.ReadString() );

                count = reader.ReadInt();

                for( int i = 0; i < count; i++ )
                {
                    XMLEventType eventType = (XMLEventType)reader.ReadInt();
                    List<string> list = new List<string>();
                    int codeCount = reader.ReadInt();

                    for( int a = 0; a < codeCount; a++ )
                        list.Add( reader.ReadString() );

                    m_XMLEventsDatabase.Add( eventType, list );
                }
            }

            if( version > 48 )
                m_RangedAttackType = (RangedAttackType)reader.ReadInt();

            if( version > 47 )
                m_CustomSkinnableParts = reader.ReadStrongItemList();

            if( version > 46 )
            {
                m_NoWoundedMovePenalty = reader.ReadBool();
                m_MeleeAttackType = (MeleeAttackType)reader.ReadInt();
            }

            if( version > 45 )
                m_WikiConfig = reader.ReadString();

            if( version > 44 )
            {
                m_Technique = reader.ReadString();
                m_TechniqueLevel = reader.ReadInt();
            }

            if( version > 43 )
                m_StableTicket = reader.ReadItem();

            if( version > 41 )
                m_StabledOwner = reader.ReadMobile();

            if( version > 40 )
                m_ReceivedNewLoot = reader.ReadBool();

            if( version > 39 )
            {
                m_TimeOfDeath = reader.ReadDeltaTime();

                if( reader.ReadBool() )
                    BeginRess( reader.ReadDeltaTime() - DateTime.Now, this.Corpse );

                m_Lives = reader.ReadInt();
            }

            if( version > 38 )
                m_ReleaseTime = reader.ReadDateTime();

            if( version > 37 )
                m_MarkedForTermination = reader.ReadBool();

            if( version > 36 )
            {
                m_FavouriteStance = reader.ReadString();
                m_FavouriteManeuver = reader.ReadString();
            }

            if( version > 34 )
                m_CombatStyles = new CombatStyles( reader );

            if( version > 32 )
                m_Feats = new Feats( reader, true );

            if( version > 33 )
                m_FixedScales = reader.ReadBool();

            if( version > 31 )
            {
                m_NoDeathCondition = reader.ReadBool();
                m_NoDeath = reader.ReadBool();
                m_NoDeathMsg = reader.ReadString();
                m_NoDeathSound = reader.ReadInt();
            }

            if( version > 30 )
                this.Frozen = reader.ReadBool();

            if( version > 27 )
            {
                m_VanishTime = reader.ReadDateTime();
                m_VanishEmote = reader.ReadString();
            }

            m_CreatureGroup = (CreatureGroup)reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_IsSneaky = test > 0;
            }

            else
                m_IsSneaky = reader.ReadBool();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_TakesLifeOnKill = test > 0;
            }

            else
                m_TakesLifeOnKill = reader.ReadBool();

            m_Description = reader.ReadString();

            m_Intimidated = reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_IsHuntingHound = test > 0;
            }

            else
                m_IsHuntingHound = reader.ReadBool();

            m_XPScale = reader.ReadInt();

            m_StatScale = reader.ReadInt();

            m_SkillScale = reader.ReadInt();

            m_Level = reader.ReadInt();

            m_XP = reader.ReadInt();

            m_NextLevel = reader.ReadInt();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_Warned = test > 0;
            }

            else
                m_Warned = reader.ReadBool();

            m_WarningTime = reader.ReadDateTime();

            m_BribingTime = reader.ReadDateTime();

            m_EmployerFeatLevel = reader.ReadInt();

            m_TargetsName = reader.ReadString();

            m_Employer = reader.ReadMobile();

            m_HiringTime = reader.ReadDateTime();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_Bribed = test > 0;
            }

            else
                m_Bribed = reader.ReadBool();

            m_LastSeen = reader.ReadDateTime();

            if( version < 29 )
            {
                test = reader.ReadInt();
                m_CanBeInformant = test > 0;
            }

            else
                m_CanBeInformant = reader.ReadBool();

            m_CurrentAI = (AIType)reader.ReadInt();
            m_DefaultAI = (AIType)reader.ReadInt();

            m_iRangePerception = reader.ReadInt();
            m_iRangeFight = reader.ReadInt();

            m_iTeam = reader.ReadInt();

            m_dActiveSpeed = reader.ReadDouble();
            m_dPassiveSpeed = reader.ReadDouble();
            m_dCurrentSpeed = reader.ReadDouble();

            if ( m_iRangePerception == OldRangePerception )
                m_iRangePerception = DefaultRangePerception;

            m_pHome.X = reader.ReadInt();
            m_pHome.Y = reader.ReadInt();
            m_pHome.Z = reader.ReadInt();

            if ( version >= 1 )
            {
                m_iRangeHome = reader.ReadInt();

                int i, iCount;

                iCount = reader.ReadInt();
                for ( i=0; i< iCount; i++ )
                {
                    string str = reader.ReadString();
                    Type type = Type.GetType( str );

                    if ( type != null )
                    {
                        m_arSpellAttack.Add( type );
                    }
                }

                iCount = reader.ReadInt();
                for ( i=0; i< iCount; i++ )
                {
                    string str = reader.ReadString();
                    Type type = Type.GetType( str );

                    if ( type != null )
                    {
                        m_arSpellDefense.Add( type );
                    }
                }
            }
            else
            {
                m_iRangeHome = 0;
            }

            if ( version >= 2 )
            {
                m_FightMode = ( FightMode )reader.ReadInt();

                m_bControlled = reader.ReadBool();
                m_ControlMaster = reader.ReadMobile();
                m_ControlTarget = reader.ReadMobile();
                m_ControlDest = reader.ReadPoint3D();
                m_ControlOrder = (OrderType) reader.ReadInt();

                m_dMinTameSkill = reader.ReadDouble();

                if ( version < 9 )
                    reader.ReadDouble();

                m_bTamable = reader.ReadBool();
                m_bSummoned = reader.ReadBool();

                if ( m_bSummoned )
                {
                    m_SummonEnd = reader.ReadDeltaTime();
                    new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
                }

                m_iControlSlots = reader.ReadInt();
            }
            else
            {
                m_FightMode = FightMode.Closest;

                m_bControlled = false;
                m_ControlMaster = null;
                m_ControlTarget = null;
                m_ControlOrder = OrderType.None;
            }

            if ( version >= 3 )
                m_Loyalty = reader.ReadInt();
            else
                m_Loyalty = MaxLoyalty; // Wonderfully Happy

            if ( version >= 4 )
                m_CurrentWayPoint = reader.ReadItem() as WayPoint;

            if ( version >= 5 )
                m_SummonMaster = reader.ReadMobile();

            if ( version >= 6 )
            {
                //m_HitsMax = reader.ReadInt();
                //m_StamMax = reader.ReadInt();
                //m_ManaMax = reader.ReadInt();
                m_DamageMin = reader.ReadInt();
                m_DamageMax = reader.ReadInt();
            }

            if ( version >= 7 )
            {
                m_PhysicalResistance = reader.ReadInt();
                m_PhysicalDamage = reader.ReadInt();

                m_FireResistance = reader.ReadInt();
                m_FireDamage = reader.ReadInt();

                m_ColdResistance = reader.ReadInt();
                m_ColdDamage = reader.ReadInt();

                m_PoisonResistance = reader.ReadInt();
                m_PoisonDamage = reader.ReadInt();

                m_EnergyResistance = reader.ReadInt();
                m_EnergyDamage = reader.ReadInt();
            }

            if ( version >= 8 )
                m_Owners = reader.ReadStrongMobileList();
            else
                m_Owners = new List<Mobile>();

            if ( version >= 10 )
            {
                m_IsDeadPet = reader.ReadBool();
                m_IsBonded = reader.ReadBool();
                m_BondingBegin = reader.ReadDateTime();
                m_OwnerAbandonTime = reader.ReadDateTime();
            }

            if ( version >= 11 )
                m_HasGeneratedLoot = reader.ReadBool();
            else
                m_HasGeneratedLoot = true;

            if ( version >= 12 )
                m_Paragon = reader.ReadBool();
            else
                m_Paragon = false;

            if ( version >= 13 && reader.ReadBool() )
                m_Friends = reader.ReadStrongMobileList();
            else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
                ++m_ControlOrder;

            if ( version < 16 )
                Loyalty *= 10;

            double activeSpeed = m_dActiveSpeed;
            double passiveSpeed = m_dPassiveSpeed;

            SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );

            bool isStandardActive = false;
            for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
                isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );

            bool isStandardPassive = false;
            for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
                isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );

            if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
                m_dCurrentSpeed = activeSpeed;
            else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
                m_dCurrentSpeed = passiveSpeed;

            if ( isStandardActive && !m_Paragon )
                m_dActiveSpeed = activeSpeed;

            if ( isStandardPassive && !m_Paragon )
                m_dPassiveSpeed = passiveSpeed;

            if ( version >= 14 )
            {
                m_RemoveIfUntamed = reader.ReadBool();
                m_RemoveStep = reader.ReadInt();
            }

            if( version <= 14 && m_Paragon && Hue == 0x31 )
            {
                Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
            }

            m_BluntResistance = reader.ReadInt();
            m_BluntDamage = reader.ReadInt();
            m_SlashingResistance = reader.ReadInt();
            m_SlashingDamage = reader.ReadInt();
            m_PiercingResistance = reader.ReadInt();
            m_PiercingDamage = reader.ReadInt();

            CheckStatTimers();

            Timer.DelayCall( TimeSpan.FromSeconds( 5 ), new TimerCallback( WaitToChangeAI ) );

            AddFollowers();

            if ( IsAnimatedDead )
                Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );

            if( this.Level < 1 )
                this.Level = 1;

            if( this.Blessed && this.Alive )
                this.CanBeInformant = true;

            m_Intimidated = 0;

            if( !( this is Mercenary ) && version < 34 && this.Level > 1 )
            {
                int bonus = this.Level / 2;
                int rest = this.Level % 2;

                this.DamageMax += bonus + rest;
                this.DamageMin += bonus;
            }

            LevelSystem.FixStatsAndSkills( this );

            m_Deserialized = true;
        }
コード例 #24
0
ファイル: BaseCamp.cs プロジェクト: romeov007/imagine-uo
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Items = reader.ReadStrongItemList();
					m_Mobiles = reader.ReadStrongMobileList();
					m_DecayTime = reader.ReadDeltaTime();

					RefreshDecay( false );

					break;
				}
			}
		}
コード例 #25
0
		public override void Deserialize( GenericReader reader )
		{
			int version = reader.ReadInt();

			switch( version )
			{
				case 5:
				case 4:
				{
					m_Signpost = reader.ReadItem();
					m_SignpostGraphic = reader.ReadInt();

					goto case 3;
				}
				case 3:
				{
					m_Type = (FoundationType)reader.ReadInt();

					goto case 2;
				}
				case 2:
				{
					m_SignHanger = reader.ReadItem();

					goto case 1;
				}
				case 1:
				{
					if( version < 5 )
						m_DefaultPrice = reader.ReadInt();

					goto case 0;
				}
				case 0:
				{
					if( version < 3 )
						m_Type = FoundationType.Stone;

					if( version < 4 )
						m_SignpostGraphic = 9;

					m_LastRevision = reader.ReadInt();
					m_Fixtures = reader.ReadStrongItemList();

					m_Current = new DesignState( this, reader );
					m_Design = new DesignState( this, reader );
					m_Backup = new DesignState( this, reader );

					break;
				}
			}

			base.Deserialize( reader );
		}
コード例 #26
0
ファイル: PlayerMobile.cs プロジェクト: Telm/RunUO_EME
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();

            switch ( version )
            {
                case 34:
                    {
                        //SYSTEM IMION  Setname
                        //Odczytywanie danych
                        int count = reader.ReadInt();
                        m_SetNames = new Dictionary<int, string>();
                        for (int i = 0; i < count; i++)
                        {
                            int ri = reader.ReadInt();
                            string rs = reader.ReadString();
                            m_SetNames.Add(ri, rs);
                            //Console.WriteLine();
                            //Console.WriteLine("{0}: {1}: {2}", DateTime.Now, ri, rs);
                        }
                        goto case 33;
                        //SYSTEM IMION  <-- KONIEC
                    }
                case 33:
                    {

                        //Timer od oslonki po wskrzeszeniu
                        DateTime ADShield = reader.ReadDateTime();
                        DateTime Shield = ADShield;
                        Shield = Shield.AddMinutes(PlayerMobile.c_ADShield);
                        if (Shield.CompareTo(DateTime.Now) > 0)
                        {
                            TimeSpan Minutes = Shield.Subtract(DateTime.Now);
                            this.m_ADShieldTimer = new ADShieldTimer(this, Minutes.TotalMinutes);
                            this.m_ADShieldTimer.Start();
                            this.m_ADShieldTime = ADShield;
                        }
                        //////////
                        goto case 32;
                    }
                case 32:
                {

                    int huesCount = reader.ReadInt();

                    if( huesCount > 0 )
                    {
                        m_LanguageHues = new Dictionary<int, int>();

                        for( int i = 0; i < huesCount; i++ )
                        {
                            int key = reader.ReadInt();
                            int v = reader.ReadInt();
                                m_LanguageHues.Add( key, v );
                        }
                    }
                    goto case 31;
                }

                case 31:
                    {
                        //SYSTEM IMION
                        //Odczytywanie danych
                        int count = reader.ReadInt();
                        m_KnewNames = new List<int>();
                        for (int i = 0; i < count; i++)
                        {
                            int ri = reader.ReadInt();
                            //string rs = reader.ReadString();
                            this.m_KnewNames.Add(ri);
                            //Console.WriteLine();
                            //Console.WriteLine("{0}: {1}: {2}", DateTime.Now, ri, rs);
                        }
                        goto case 30;
                        //SYSTEM IMION  <-- KONIEC
                    }
                case 30:
                {
                    this.PDcount = reader.ReadInt();
                    goto case 29;
                }
                case 29:
                {
                    //LISTA PD
                    int i = reader.ReadInt();
                    //Console.Write("array size: " + i);
                    for(int n = 0; n < i; n++ ){
                        int Amount = reader.ReadInt();
                        string GM_name = reader.ReadString();
                        string Reason = reader.ReadString();
                        //Console.Write(n + ": Amount -" + Amount + "\n");
                        //Console.Write(n + ":GM_name-" + GM_name + "\n");
                        //Console.Write(n + ": Reason-" + Reason + "\n");
                        this.ListaPD.Add(new Object[3] {Amount, GM_name, Reason} );
                    }
                    ////////////////
                    goto case 28;
                }
                case 28:
                {

                    //Timer od umierania i wskrzeszania
                    DateTime DeathTime = reader.ReadDateTime();
                    DateTime ResTime = DeathTime;
                    ResTime = ResTime.AddMinutes(PlayerMobile.c_DeathTime);
                    if(ResTime.CompareTo(DateTime.Now) > 0){
                        TimeSpan Minutes = ResTime.Subtract(DateTime.Now);
                        this.m_DeathTimer = new DeathTimer(this, Minutes.TotalMinutes);
                        this.m_DeathTimer.Start();
                        this.m_DeathTime = DeathTime;
                    }
                    //////////

                    m_PeacedUntil = reader.ReadDateTime();

                    goto case 27;
                }
                case 27:
                {
                    m_AnkhNextUse = reader.ReadDateTime();

                    goto case 26;
                }
                case 26:
                {
                    m_AutoStabled = reader.ReadStrongMobileList();

                    goto case 25;
                }
                case 25:
                {
                    int recipeCount = reader.ReadInt();

                    if( recipeCount > 0 )
                    {
                        m_AcquiredRecipes = new Dictionary<int, bool>();

                        for( int i = 0; i < recipeCount; i++ )
                        {
                            int r = reader.ReadInt();
                            if( reader.ReadBool() )	//Don't add in recipies which we haven't gotten or have been removed
                                m_AcquiredRecipes.Add( r, true );
                        }
                    }
                    goto case 24;
                }
                case 24:
                {
                    m_LastHonorLoss = reader.ReadDeltaTime();
                    goto case 23;
                }
                case 23:
                {
                    m_ChampionTitles = new ChampionTitleInfo( reader );
                    goto case 22;
                }
                case 22:
                {
                    m_LastValorLoss = reader.ReadDateTime();
                    goto case 21;
                }
                case 21:
                {
                    m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                    m_ToTTotalMonsterFame = reader.ReadInt();
                    goto case 20;
                }
                case 20:
                {
                    m_AllianceMessageHue = reader.ReadEncodedInt();
                    m_GuildMessageHue = reader.ReadEncodedInt();

                    goto case 19;
                }
                case 19:
                {
                    int rank = reader.ReadEncodedInt();
                    int maxRank = Guilds.RankDefinition.Ranks.Length -1;
                    if( rank > maxRank )
                        rank = maxRank;

                    m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                    m_LastOnline = reader.ReadDateTime();
                    goto case 18;
                }
                case 18:
                {
                    m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();

                    goto case 17;
                }
                case 17: // changed how DoneQuests is serialized
                case 16:
                {
                    m_Quest = QuestSerializer.DeserializeQuest( reader );

                    if ( m_Quest != null )
                        m_Quest.From = this;

                    int count = reader.ReadEncodedInt();

                    if ( count > 0 )
                    {
                        m_DoneQuests = new List<QuestRestartInfo>();

                        for ( int i = 0; i < count; ++i )
                        {
                            Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
                            DateTime restartTime;

                            if ( version < 17 )
                                restartTime = DateTime.MaxValue;
                            else
                                restartTime = reader.ReadDateTime();

                            m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
                        }
                    }

                    m_Profession = reader.ReadEncodedInt();
                    goto case 15;
                }
                case 15:
                {
                    m_LastCompassionLoss = reader.ReadDeltaTime();
                    goto case 14;
                }
                case 14:
                {
                    m_CompassionGains = reader.ReadEncodedInt();

                    if ( m_CompassionGains > 0 )
                        m_NextCompassionDay = reader.ReadDeltaTime();

                    goto case 13;
                }
                case 13: // just removed m_PayedInsurance list
                case 12:
                {
                    m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
                    goto case 11;
                }
                case 11:
                {
                    if ( version < 13 )
                    {
                        List<Item> payed = reader.ReadStrongItemList();

                        for ( int i = 0; i < payed.Count; ++i )
                            payed[i].PayedInsurance = true;
                    }

                    goto case 10;
                }
                case 10:
                {
                    if ( reader.ReadBool() )
                    {
                        m_HairModID = reader.ReadInt();
                        m_HairModHue = reader.ReadInt();
                        m_BeardModID = reader.ReadInt();
                        m_BeardModHue = reader.ReadInt();
                    }

                    goto case 9;
                }
                case 9:
                {
                    SavagePaintExpiration = reader.ReadTimeSpan();

                    if ( SavagePaintExpiration > TimeSpan.Zero )
                    {
                        BodyMod = ( Female ? 184 : 183 );
                        HueMod = 0;
                    }

                    goto case 8;
                }
                case 8:
                {
                    m_NpcGuild = (NpcGuild)reader.ReadInt();
                    m_NpcGuildJoinTime = reader.ReadDateTime();
                    m_NpcGuildGameTime = reader.ReadTimeSpan();
                    goto case 7;
                }
                case 7:
                {
                    m_PermaFlags = reader.ReadStrongMobileList();
                    goto case 6;
                }
                case 6:
                {
                    NextTailorBulkOrder = reader.ReadTimeSpan();
                    goto case 5;
                }
                case 5:
                {
                    NextSmithBulkOrder = reader.ReadTimeSpan();
                    goto case 4;
                }
                case 4:
                {
                    m_LastJusticeLoss = reader.ReadDeltaTime();
                    m_JusticeProtectors = reader.ReadStrongMobileList();
                    goto case 3;
                }
                case 3:
                {
                    m_LastSacrificeGain = reader.ReadDeltaTime();
                    m_LastSacrificeLoss = reader.ReadDeltaTime();
                    m_AvailableResurrects = reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Flags = (PlayerFlag)reader.ReadInt();
                    goto case 1;
                }
                case 1:
                {
                    m_LongTermElapse = reader.ReadTimeSpan();
                    m_ShortTermElapse = reader.ReadTimeSpan();
                    m_GameTime = reader.ReadTimeSpan();
                    goto case 0;
                }
                case 0:
                {
                    if( version < 26 )
                        m_AutoStabled = new List<Mobile>();
                    break;
                }
            }

            if (m_RecentlyReported == null)
                m_RecentlyReported = new List<Mobile>();

            // Professions weren't verified on 1.0 RC0
            if ( !CharacterCreation.VerifyProfession( m_Profession ) )
                m_Profession = 0;

            if ( m_PermaFlags == null )
                m_PermaFlags = new List<Mobile>();

            if ( m_JusticeProtectors == null )
                m_JusticeProtectors = new List<Mobile>();

            if ( m_BOBFilter == null )
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            if( m_GuildRank == null )
                m_GuildRank = Guilds.RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

            if( m_LastOnline == DateTime.MinValue && Account != null )
                m_LastOnline = ((Account)Account).LastLogin;

            if( m_ChampionTitles == null )
                m_ChampionTitles = new ChampionTitleInfo();

            if ( AccessLevel > AccessLevel.Player )
                m_IgnoreMobiles = true;

            List<Mobile> list = this.Stabled;

            for ( int i = 0; i < list.Count; ++i )
            {
                BaseCreature bc = list[i] as BaseCreature;

                if ( bc != null )
                    bc.IsStabled = true;
            }

            CheckAtrophies( this );

            if( Hidden )	//Hiding is the only buff where it has an effect that's serialized.
                AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) );
        }
コード例 #27
0
ファイル: ChampionSpawn.cs プロジェクト: PepeBiondi/runsa
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            m_DamageEntries = new Dictionary<Mobile, int>();

            int version = reader.ReadInt();

            switch (version)
            {
                case 5:
                    {
                        int entries = reader.ReadInt();
                        Mobile m;
                        int damage;
                        for (int i = 0; i < entries; ++i)
                        {
                            m = reader.ReadMobile();
                            damage = reader.ReadInt();

                            if (m == null)
                                continue;

                            m_DamageEntries.Add(m, damage);
                        }

                        goto case 4;
                    }
                case 4:
                    {
                        m_ConfinedRoaming = reader.ReadBool();
                        m_Idol = reader.ReadItem<IdolOfTheChampion>();
                        m_HasBeenAdvanced = reader.ReadBool();

                        goto case 3;
                    }
                case 3:
                    {
                        m_SpawnArea = reader.ReadRect2D();

                        goto case 2;
                    }
                case 2:
                    {
                        m_RandomizeType = reader.ReadBool();

                        goto case 1;
                    }
                case 1:
                    {
                        if (version < 3)
                        {
                            int oldRange = reader.ReadInt();

                            m_SpawnArea = new Rectangle2D(new Point2D(X - oldRange, Y - oldRange), new Point2D(X + oldRange, Y + oldRange));
                        }

                        m_Kills = reader.ReadInt();

                        goto case 0;
                    }
                case 0:
                    {
                        if (version < 1)
                            m_SpawnArea = new Rectangle2D(new Point2D(X - 24, Y - 24), new Point2D(X + 24, Y + 24));	//Default was 24

                        bool active = reader.ReadBool();
                        m_Type = (ChampionSpawnType)reader.ReadInt();
                        m_Creatures = reader.ReadStrongMobileList();
                        m_RedSkulls = reader.ReadStrongItemList();
                        m_WhiteSkulls = reader.ReadStrongItemList();
                        m_Platform = reader.ReadItem<ChampionPlatform>();
                        m_Altar = reader.ReadItem<ChampionAltar>();
                        m_ExpireDelay = reader.ReadTimeSpan();
                        m_ExpireTime = reader.ReadDeltaTime();
                        m_Champion = reader.ReadMobile();
                        m_RestartDelay = reader.ReadTimeSpan();

                        if (reader.ReadBool())
                        {
                            m_RestartTime = reader.ReadDeltaTime();
                            BeginRestart(m_RestartTime - DateTime.Now);
                        }

                        if (version < 4)
                        {
                            m_Idol = new IdolOfTheChampion(this);
                            m_Idol.MoveToWorld(new Point3D(X, Y, Z - 15), Map);
                        }

                        if (m_Platform == null || m_Altar == null || m_Idol == null)
                            Delete();
                        else if (active)
                            Start();

                        break;
                    }
            }

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(UpdateRegion));
        }
コード例 #28
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                    _Rect = reader.ReadRect2D();
                    _Items = reader.ReadStrongItemList();
                    _Battle = reader.ReadItem<BattleController>();
                    _Owner = reader.ReadInt();
                    _ScoreFactor = reader.ReadSByte();
                    break;
            }

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(UpdateRect));

            _CheckTimer = Timer.DelayCall(TimeSpan.Zero, TimeSpan.FromSeconds(1.0), new TimerCallback(CheckOwner));
        }
コード例 #29
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                case 26:
                    {
                        #region GeNova: Mondain's Legacy
                        m_Quests = QuestReader.Quests(reader, this);
                        m_Chains = QuestReader.Chains(reader);

                        m_Collections = new Dictionary<Collection, int>();
                        m_CollectionTitles = new List<object>();

                        for (int i = reader.ReadInt(); i > 0; i--)
                            m_Collections.Add((Collection)reader.ReadInt(), reader.ReadInt());

                        for (int i = reader.ReadInt(); i > 0; i--)
                            m_CollectionTitles.Add(QuestReader.Object(reader));

                        m_SelectedTitle = reader.ReadInt();
                        m_Peaced = reader.ReadDateTime();
                        #endregion

                        goto case 25;
                    }
                case 25:
                    {
                        int recipeCount = reader.ReadInt();

                        if (recipeCount > 0)
                        {
                            m_AcquiredRecipes = new Dictionary<int, bool>();

                            for (int i = 0; i < recipeCount; i++)
                            {
                                int r = reader.ReadInt();
                                if (reader.ReadBool())	//Don't add in recipies which we haven't gotten or have been removed
                                    m_AcquiredRecipes.Add(r, true);
                            }
                        }
                        goto case 24;
                    }
                case 24:
                    {
                        m_LastHonorLoss = reader.ReadDeltaTime();
                        goto case 23;
                    }
                case 23:
                    {
                        m_ChampionTitles = new ChampionTitleInfo(reader);
                        goto case 22;
                    }
                case 22:
                    {
                        m_LastValorLoss = reader.ReadDateTime();
                        goto case 21;
                    }
                case 21:
                    {
                        m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                        m_ToTTotalMonsterFame = reader.ReadInt();
                        goto case 20;
                    }
                case 20:
                    {
                        m_AllianceMessageHue = reader.ReadEncodedInt();
                        m_GuildMessageHue = reader.ReadEncodedInt();

                        goto case 19;
                    }
                case 19:
                    {
                        int rank = reader.ReadEncodedInt();
                        int maxRank = Guilds.RankDefinition.Ranks.Length - 1;
                        if (rank > maxRank)
                            rank = maxRank;

                        m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                        m_LastOnline = reader.ReadDateTime();
                        goto case 18;
                    }
                case 18:
                    {
                        m_SolenFriendship = (SolenFriendship)reader.ReadEncodedInt();

                        goto case 17;
                    }
                case 17: // changed how DoneQuests is serialized
                case 16:
                    {
                        m_Quest = QuestSerializer.DeserializeQuest(reader);

                        if (m_Quest != null)
                            m_Quest.From = this;

                        int count = reader.ReadEncodedInt();

                        if (count > 0)
                        {
                            m_DoneQuests = new List<QuestRestartInfo>();

                            for (int i = 0; i < count; ++i)
                            {
                                Type questType = QuestSerializer.ReadType(QuestSystem.QuestTypes, reader);
                                DateTime restartTime;

                                if (version < 17)
                                    restartTime = DateTime.MaxValue;
                                else
                                    restartTime = reader.ReadDateTime();

                                m_DoneQuests.Add(new QuestRestartInfo(questType, restartTime));
                            }
                        }

                        m_Profession = reader.ReadEncodedInt();
                        goto case 15;
                    }
                case 15:
                    {
                        m_LastCompassionLoss = reader.ReadDeltaTime();
                        goto case 14;
                    }
                case 14:
                    {
                        m_CompassionGains = reader.ReadEncodedInt();

                        if (m_CompassionGains > 0)
                            m_NextCompassionDay = reader.ReadDeltaTime();

                        goto case 13;
                    }
                case 13: // just removed m_PayedInsurance list
                case 12:
                    {
                        m_BOBFilter = new Engines.BulkOrders.BOBFilter(reader);
                        goto case 11;
                    }
                case 11:
                    {
                        if (version < 13)
                        {
                            List<Item> payed = reader.ReadStrongItemList();

                            for (int i = 0; i < payed.Count; ++i)
                                payed[i].PayedInsurance = true;
                        }

                        goto case 10;
                    }
                case 10:
                    {
                        if (reader.ReadBool())
                        {
                            m_HairModID = reader.ReadInt();
                            m_HairModHue = reader.ReadInt();
                            m_BeardModID = reader.ReadInt();
                            m_BeardModHue = reader.ReadInt();

                            // We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
                            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(RevertHair));
                        }

                        goto case 9;
                    }
                case 9:
                    {
                        SavagePaintExpiration = reader.ReadTimeSpan();

                        if (SavagePaintExpiration > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 0;
                        }

                        goto case 8;
                    }
                case 8:
                    {
                        m_NpcGuild = (NpcGuild)reader.ReadInt();
                        m_NpcGuildJoinTime = reader.ReadDateTime();
                        m_NpcGuildGameTime = reader.ReadTimeSpan();
                        goto case 7;
                    }
                case 7:
                    {
                        m_PermaFlags = reader.ReadStrongMobileList();
                        goto case 6;
                    }
                case 6:
                    {
                        NextTailorBulkOrder = reader.ReadTimeSpan();
                        goto case 5;
                    }
                case 5:
                    {
                        NextSmithBulkOrder = reader.ReadTimeSpan();
                        goto case 4;
                    }
                case 4:
                    {
                        m_LastJusticeLoss = reader.ReadDeltaTime();
                        m_JusticeProtectors = reader.ReadStrongMobileList();
                        goto case 3;
                    }
                case 3:
                    {
                        m_LastSacrificeGain = reader.ReadDeltaTime();
                        m_LastSacrificeLoss = reader.ReadDeltaTime();
                        m_AvailableResurrects = reader.ReadInt();
                        goto case 2;
                    }
                case 2:
                    {
                        m_Flags = (PlayerFlag)reader.ReadInt();
                        goto case 1;
                    }
                case 1:
                    {
                        m_LongTermElapse = reader.ReadTimeSpan();
                        m_ShortTermElapse = reader.ReadTimeSpan();
                        m_GameTime = reader.ReadTimeSpan();
                        goto case 0;
                    }
                case 0:
                    {
                        break;
                    }
            }

            #region GeNova: Mondain's Legacy
            if (m_Quests == null)
                m_Quests = new List<BaseQuest>();

            if (m_Chains == null)
                m_Chains = new Dictionary<QuestChain, BaseChain>();

            if (m_DoneQuests == null)
                m_DoneQuests = new List<QuestRestartInfo>();

            if (m_Collections == null)
                m_Collections = new Dictionary<Collection, int>();

            if (m_CollectionTitles == null)
                m_CollectionTitles = new List<object>();
            #endregion

            // Professions weren't verified on 1.0 RC0
            if (!CharacterCreation.VerifyProfession(m_Profession))
                m_Profession = 0;

            if (m_PermaFlags == null)
                m_PermaFlags = new List<Mobile>();

            if (m_JusticeProtectors == null)
                m_JusticeProtectors = new List<Mobile>();

            if (m_BOBFilter == null)
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            if (m_GuildRank == null)
                m_GuildRank = Guilds.RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

            if (m_LastOnline == DateTime.MinValue && Account != null)
                m_LastOnline = ((Account)Account).LastLogin;

            if (m_ChampionTitles == null)
                m_ChampionTitles = new ChampionTitleInfo();

            List<Mobile> list = this.Stabled;

            for (int i = 0; i < list.Count; ++i)
            {
                BaseCreature bc = list[i] as BaseCreature;

                if (bc != null)
                    bc.IsStabled = true;
            }

            CheckAtrophies(this);


            if (Hidden)	//Hiding is the only buff where it has an effect that's serialized.
                AddBuff(new BuffInfo(BuffIcon.HidingAndOrStealth, 1075655));
        }
コード例 #30
0
ファイル: KeyRing.cs プロジェクト: greeduomacro/vivre-uo
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadEncodedInt();

            if (version == 0) LootType = LootType.Blessed;

			m_Keys = reader.ReadStrongItemList<Key>();
		}