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

			int version = reader.ReadEncodedInt();

			m_Winner = reader.ReadString();
			m_Loser = reader.ReadString();
			m_GameEnd = reader.ReadDateTime();
			m_GameTime = reader.ReadTimeSpan();
			m_WinnerTime = reader.ReadTimeSpan();
			m_LoserTime = reader.ReadTimeSpan();
			m_WinnerScore = reader.ReadInt();
			m_LoserScore = reader.ReadInt();
		}
コード例 #2
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_GameTimeMax = reader.ReadTimeSpan();
                    m_AgeMax = reader.ReadTimeSpan();
                    m_UseGameTime = reader.ReadBool();
                    m_UseAge = reader.ReadBool();

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

            m_LifeSpan = reader.ReadTimeSpan();
            m_CreationTime = reader.ReadDateTime();

            m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), new TimerCallback( CheckExpiry ) );
        }
コード例 #4
0
		public SkillGainMod( PlayerMobile owner, GenericReader reader )
		{
			int version = reader.ReadEncodedInt();

			m_Owner = owner;
			m_Name = reader.ReadString();
			m_Skill = (SkillName)reader.ReadInt();
			m_Bonus = reader.ReadDouble();
			m_Duration = reader.ReadTimeSpan();
			m_Added = reader.ReadDateTime();
		}
コード例 #5
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            m_Summoned = reader.ReadMobile();
            m_ManaCost = reader.ReadInt();
            m_CoolDown = reader.ReadTimeSpan();
            m_NextUseAllowed = reader.ReadDateTime();
        }
コード例 #6
0
ファイル: Notification.cs プロジェクト: Jascen/UOSmart
        public void Load(GenericReader reader)
        {
            int version = reader.ReadInt();

            c_Text = reader.ReadString();
            c_Name = reader.ReadString();
            c_Gump = reader.ReadBool();
            c_AntiMacro = reader.ReadBool();
            c_Recur = reader.ReadTimeSpan();

            StartNotify();
        }
コード例 #7
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			b_switchon = reader.ReadBool();
			t_autotime = reader.ReadTimeSpan();
			t_RestartTime = reader.ReadDateTime();
			if (b_switchon)
			{
				I_Auto_Restarter tmr = new I_Auto_Restarter(this);
				tmr.Start();
			}
		}
コード例 #8
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_TimeDelay = reader.ReadTimeSpan();
            m_iEventRange = reader.ReadInt();

            if (version < 1)
                reader.ReadDateTime();

            m_sMessage = reader.ReadString();
            m_tCheck = (CursedCaveUtility.CCTriggerCheck)reader.ReadInt();
        }
コード例 #9
0
ファイル: Poison.cs プロジェクト: dpisanu/xrunuo
        public static Poison Deserialize(GenericReader reader)
        {
            switch (reader.ReadByte())
            {
            case 1: return(GetPoison(reader.ReadByte()));

            case 2:
                //no longer used, safe to remove?
                reader.ReadInt();
                reader.ReadDouble();
                reader.ReadInt();
                reader.ReadTimeSpan();
                break;
            }
            return(null);
        }
コード例 #10
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			int count;
			count = reader.ReadInt();
			for (int i = 0; i < count; i++)
				m_WallCoordinates.Add(reader.ReadPoint3D());

			count = reader.ReadInt();
			for (int i = 0; i < count; i++)
				m_StartLocations.Add(reader.ReadPoint3D());

			m_GameTime = reader.ReadTimeSpan();
			m_RegionControl = reader.ReadItem() as BMregion;
			m_ExitLosers = reader.ReadPoint3D();

			if (version >= 1)
			{
				m_LinkBombs = reader.ReadBool();
				m_ChanceForUpgrade = reader.ReadInt();

				if (version >= 2)
				{
					m_DanageWhileFS = reader.ReadBool();

					if (version >= 3)
						m_WriteScoreboard = reader.ReadBool();
					{
						if (version >= 4)
						{
							m_ExitWinner = reader.ReadPoint3D();
							m_ExitOnDraw = reader.ReadPoint3D();
							m_AutoStart = reader.ReadBool();
							m_KeepOpenJoin = reader.ReadBool();
						}
					}
				}
			}

			m_Running = false;
			m_OpenJoin = false;
		}
コード例 #11
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					int count = reader.ReadInt();

					for ( int i = 0; i < count; ++i )
					{
						Mobile m = reader.ReadMobile();
						DisguiseTimers.CreateTimer( m, reader.ReadTimeSpan() );
						m.NameMod = reader.ReadString();
					}

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

            m_Active  = reader.ReadBool();

            m_AllSpawn = reader.ReadItemList();
            m_DungeonsSpawn = reader.ReadItemList();
            m_LostLandsSpawn = reader.ReadItemList();
            m_IlshenarSpawn = reader.ReadItemList();
            m_TokunoSpawn = reader.ReadItemList();

            m_RandomizeDelay = reader.ReadTimeSpan();

            m_ActiveAltars = reader.ReadInt();

            //m_SpawnRange = 24;
            m_ExpireDelay = TimeSpan.FromMinutes( 10.0 );
            m_RestartDelay = TimeSpan.FromMinutes( 5.0 );

            if ( m_Active )
            {
                m_Timer = new RandomizeTimer( this, m_RandomizeDelay );

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 3:
				{
					m_CombatCheck = reader.ReadBool();
					goto case 2;
				}
				case 2:
				{
					m_SourceEffect = reader.ReadBool();
					m_DestEffect = reader.ReadBool();
					m_Delay = reader.ReadTimeSpan();
					m_SoundID = reader.ReadEncodedInt();

					goto case 1;
				}
				case 1:
				{
					m_Creatures = reader.ReadBool();

					goto case 0;
				}
				case 0:
				{
					m_Active = reader.ReadBool();
					m_PointDest = reader.ReadPoint3D();
					m_MapDest = reader.ReadMap();

					break;
				}
			}
		}
コード例 #14
0
ファイル: BombingRun.cs プロジェクト: greeduomacro/divinity
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_BombHome = reader.ReadPoint3D();

                    m_Duration = reader.ReadTimeSpan();

                    m_TeamInfo = new BRTeamInfo[reader.ReadEncodedInt()];

                    for ( int i = 0; i < m_TeamInfo.Length; ++i )
                        m_TeamInfo[i] = new BRTeamInfo( i, reader );

                    break;
                }
            }
        }
コード例 #15
0
ファイル: Guild.cs プロジェクト: Leodinas/uolite
        public WarDeclaration( GenericReader reader )
        {
            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_Kills = reader.ReadInt();
                    m_MaxKills = reader.ReadInt();

                    m_WarLength = reader.ReadTimeSpan();
                    m_WarBeginning = reader.ReadDateTime();

                    m_Guild = reader.ReadGuild() as Guild;
                    m_Opponent = reader.ReadGuild() as Guild;

                    m_WarRequester = reader.ReadBool();

                    break;
                }
            }
        }
コード例 #16
0
            public void Deserialize(GenericReader reader)
            {
                int version = reader.ReadInt();
                switch (version)
                {
                    case 1:
                        Flags = (KeywordFlags)reader.ReadInt();
                        goto case 0;
                    case 0:
                        m_Spawner = (XmlSpawner)reader.ReadItem();
                        Type = reader.ReadInt();
                        Serial = reader.ReadInt();
                        if (Type == 0)
                        {
                            // get any timer info
                            TimeSpan delay = reader.ReadTimeSpan();
                            m_Delay = reader.ReadTimeSpan();
                            m_Condition = reader.ReadString();
                            m_Goto = reader.ReadInt();

                            TimeSpan timeoutdelay = reader.ReadTimeSpan();
                            m_TimeoutEnd = DateTime.Now + timeoutdelay;
                            m_Timeout = reader.ReadTimeSpan();
                            m_TrigMob = reader.ReadMobile();

                            this.DoTimer(delay, m_Delay, m_Condition, m_Goto);
                        }
                        break;
                }
            }
コード例 #17
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));
        }
コード例 #18
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);
			int version = reader.ReadInt();
			switch (version)
			{
				case 1:
					{
						m_Cost = reader.ReadInt();
						m_AmountCollected = reader.ReadLong();
						goto case 0;
					}

				case 0:
					{
						m_Active = reader.ReadBool();
						m_Decays = reader.ReadBool();
						m_DecayTime = reader.ReadTimeSpan();
						if (reader.ReadBool())
							m_RuneBooks = reader.ReadItemList();
						if (m_Decays)
							m_TimeLeft = reader.ReadTimeSpan();
						LootType = LootType.Blessed;
						break;
					}
			}
		}
コード例 #19
0
ファイル: XmlSpawner2.cs プロジェクト: greeduomacro/hubroot
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			bool haveproximityrange = false;
			bool hasnewobjectinfo = false;
			int tmpSpawnListSize = 0;
			ArrayList tmpSubGroup = null;
			ArrayList tmpSequentialResetTime = null;
			ArrayList tmpSequentialResetTo = null;
			ArrayList tmpKillsNeeded = null;
			ArrayList tmpRequireSurface = null;
			ArrayList tmpRestrictKillsToSubgroup = null;
			ArrayList tmpClearOnAdvance = null;
			ArrayList tmpMinDelay = null;
			ArrayList tmpMaxDelay = null;
			ArrayList tmpNextSpawn = null;
			ArrayList tmpDisableSpawn = null;
			ArrayList tmpPackRange = null;
			ArrayList tmpSpawnsPer = null;

			switch( version )
			{
				case 30:
					{
						m_AllowNPCTriggering = reader.ReadBool();
						goto case 29;
					}
				case 29:
					{
						tmpSpawnListSize = reader.ReadInt();
						tmpSpawnsPer = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							int spawnsper = reader.ReadInt();

							tmpSpawnsPer.Add( spawnsper );

						}
						goto case 28;
					}
				case 28:
					{
						if( version < 29 )
							tmpSpawnListSize = reader.ReadInt();

						tmpPackRange = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							int packrange = reader.ReadInt();

							tmpPackRange.Add( packrange );

						}
						goto case 27;
					}
				case 27:
					{
						if( version < 28 )
							tmpSpawnListSize = reader.ReadInt();

						tmpDisableSpawn = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							bool disablespawn = reader.ReadBool();

							tmpDisableSpawn.Add( disablespawn );

						}
						goto case 26;
					}
				case 26:
					{
						m_SpawnOnTrigger = reader.ReadBool();
						m_FirstModified = reader.ReadDateTime();
						m_LastModified = reader.ReadDateTime();
						goto case 25;
					}
				case 25:
					{
						goto case 24;
					}
				case 24:
					{
						if( version < 27 )
							tmpSpawnListSize = reader.ReadInt();
						tmpRestrictKillsToSubgroup = new ArrayList( tmpSpawnListSize );
						tmpClearOnAdvance = new ArrayList( tmpSpawnListSize );
						tmpMinDelay = new ArrayList( tmpSpawnListSize );
						tmpMaxDelay = new ArrayList( tmpSpawnListSize );
						tmpNextSpawn = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							bool restrictkills = reader.ReadBool();
							bool clearadvance = reader.ReadBool();
							double mind = reader.ReadDouble();
							double maxd = reader.ReadDouble();
							DateTime nextspawn = reader.ReadDeltaTime();

							tmpRestrictKillsToSubgroup.Add( restrictkills );
							tmpClearOnAdvance.Add( clearadvance );
							tmpMinDelay.Add( mind );
							tmpMaxDelay.Add( maxd );
							tmpNextSpawn.Add( nextspawn );
						}

						bool hasitems = reader.ReadBool();

						if( hasitems )
						{
							m_ShowBoundsItems = reader.ReadItemList();
						}
						goto case 23;
					}
				case 23:
					{
						IsInactivated = reader.ReadBool();
						SmartSpawning = reader.ReadBool();

						goto case 22;
					}
				case 22:
					{
						SkillTrigger = reader.ReadString();    // note this will also register the skill
						m_skill_that_triggered = (SkillName)reader.ReadInt();
						m_FreeRun = reader.ReadBool();
						m_mob_who_triggered = reader.ReadMobile();
						goto case 21;
					}
				case 21:
					{
						m_DespawnTime = reader.ReadTimeSpan();
						goto case 20;
					}
				case 20:
					{
						if( version < 24 )
							tmpSpawnListSize = reader.ReadInt();
						tmpRequireSurface = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							bool requiresurface = reader.ReadBool();
							tmpRequireSurface.Add( requiresurface );
						}
						goto case 19;
					}
				case 19:
					{
						m_ConfigFile = reader.ReadString();
						m_OnHold = reader.ReadBool();
						m_HoldSequence = reader.ReadBool();
						m_FirstModifiedBy = reader.ReadString();
						m_LastModifiedBy = reader.ReadString();
						// deserialize the keyword tag list
						int tagcount = reader.ReadInt();
						m_KeywordTagList = new ArrayList( tagcount );
						for( int i = 0; i < tagcount; i++ )
						{
							BaseXmlSpawner.KeywordTag tag = new BaseXmlSpawner.KeywordTag( null, this );
							tag.Deserialize( reader );
						}
						goto case 18;
					}
				case 18:
					{
						m_AllowGhostTriggering = reader.ReadBool();
						goto case 17;
					}
				case 17:
					{
						if( version < 25 )
						{
							// the textentrybooks are deleted on deserialization so no need to track them
							reader.ReadItem();
						}
						goto case 16;
					}
				case 16:
					{
						hasnewobjectinfo = true;
						m_SequentialSpawning = reader.ReadInt();
						TimeSpan seqdelay = reader.ReadTimeSpan();
						m_SeqEnd = DateTime.Now + seqdelay;
						if( version < 20 )
						{
							tmpSpawnListSize = reader.ReadInt();
						}
						tmpSubGroup = new ArrayList( tmpSpawnListSize );
						tmpSequentialResetTime = new ArrayList( tmpSpawnListSize );
						tmpSequentialResetTo = new ArrayList( tmpSpawnListSize );
						tmpKillsNeeded = new ArrayList( tmpSpawnListSize );
						for( int i = 0; i < tmpSpawnListSize; ++i )
						{
							int subgroup = reader.ReadInt();
							double resettime = reader.ReadDouble();
							int resetto = reader.ReadInt();
							int killsneeded = reader.ReadInt();
							tmpSubGroup.Add( subgroup );
							tmpSequentialResetTime.Add( resettime );
							tmpSequentialResetTo.Add( resetto );
							tmpKillsNeeded.Add( killsneeded );
						}
						m_RegionName = reader.ReadString();	// 2004.02.08 :: Omega Red
						goto case 15;
					}
				case 15:
					{
						m_ExternalTriggering = reader.ReadBool();
						m_ExternalTrigger = reader.ReadBool();
						goto case 14;
					}
				case 14:
					{
						m_NoItemTriggerName = reader.ReadString();
						goto case 13;
					}
				case 13:
					{
						m_GumpState = reader.ReadString();
						goto case 12;
					}
				case 12:
					{
						int todtype = reader.ReadInt();
						switch( todtype )
						{
							case (int)TODModeType.Gametime:
								m_TODMode = TODModeType.Gametime;
								break;
							case (int)TODModeType.Realtime:
								m_TODMode = TODModeType.Realtime;
								break;
						}
						goto case 11;
					}
				case 11:
					{
						m_KillReset = reader.ReadInt();
						m_skipped = reader.ReadBool();
						m_spawncheck = reader.ReadInt();
						goto case 10;
					}
				case 10:
					{
						m_SetPropertyItem = reader.ReadItem();
						goto case 9;
					}
				case 9:
					{
						m_TriggerProbability = reader.ReadDouble();
						goto case 8;
					}
				case 8:
					{
						m_MobPropertyName = reader.ReadString();
						m_MobTriggerName = reader.ReadString();
						m_PlayerPropertyName = reader.ReadString();
						goto case 7;
					}
				case 7:
					{
						m_SpeechTrigger = reader.ReadString();
						goto case 6;
					}
				case 6:
					{
						m_ItemTriggerName = reader.ReadString();
						goto case 5;
					}
				case 5:
					{
						m_ProximityTriggerMessage = reader.ReadString();
						m_ObjectPropertyItem = reader.ReadItem();
						m_ObjectPropertyName = reader.ReadString();
						m_killcount = reader.ReadInt();
						goto case 4;
					}
				case 4:
					{
						haveproximityrange = true;
						m_ProximityRange = reader.ReadInt();
						m_ProximityTriggerSound = reader.ReadInt();
						m_proximityActivated = reader.ReadBool();
						m_durActivated = reader.ReadBool();
						m_refractActivated = reader.ReadBool();
						m_StackAmount = reader.ReadInt();
						m_TODStart = reader.ReadTimeSpan();
						m_TODEnd = reader.ReadTimeSpan();
						m_MinRefractory = reader.ReadTimeSpan();
						m_MaxRefractory = reader.ReadTimeSpan();
						if( m_refractActivated == true )
						{
							TimeSpan delay = reader.ReadTimeSpan();
							DoTimer3( delay );
						}
						if( m_durActivated == true )
						{
							TimeSpan delay = reader.ReadTimeSpan();
							DoTimer2( delay );
						}
						goto case 3;
					}
				case 3:
					{
						m_ShowContainerStatic = reader.ReadItem() as Static;
						goto case 2;
					}
				case 2:
					{
						m_Duration = reader.ReadTimeSpan();
						goto case 1;
					}
				case 1:
					{
						m_UniqueId = reader.ReadString();
						m_HomeRangeIsRelative = reader.ReadBool();
						goto case 0;
					}
				case 0:
					{
						m_Name = reader.ReadString();
						// backward compatibility with old name storage
						if( m_Name != null && m_Name != String.Empty ) Name = m_Name;
						m_X = reader.ReadInt();
						m_Y = reader.ReadInt();
						m_Width = reader.ReadInt();
						m_Height = reader.ReadInt();
						if( m_Width == m_Height )
							m_SpawnRange = m_Width / 2;
						else
							m_SpawnRange = -1;
						if( !haveproximityrange )
						{
							m_ProximityRange = -1;
						}
						m_WayPoint = reader.ReadItem() as WayPoint;
						m_Group = reader.ReadBool();
						m_MinDelay = reader.ReadTimeSpan();
						m_MaxDelay = reader.ReadTimeSpan();
						m_Count = reader.ReadInt();
						m_Team = reader.ReadInt();
						m_HomeRange = reader.ReadInt();
						m_Running = reader.ReadBool();

						if( m_Running == true )
						{
							TimeSpan delay = reader.ReadTimeSpan();
							DoTimer( delay );
						}

						// Read in the size of the spawn object list
						int SpawnListSize = reader.ReadInt();
						m_SpawnObjects = new ArrayList( SpawnListSize );
						for( int i = 0; i < SpawnListSize; ++i )
						{
							string TypeName = reader.ReadString();
							int TypeMaxCount = reader.ReadInt();

							SpawnObject TheSpawnObject = new SpawnObject( TypeName, TypeMaxCount );

							m_SpawnObjects.Add( TheSpawnObject );

							string typeName = BaseXmlSpawner.ParseObjectType( TypeName );
							// does it have a substitution that might change its validity?
							// if so then let it go

							if( typeName == null || ((SpawnerType.GetType( typeName ) == null) &&
								(!BaseXmlSpawner.IsTypeOrItemKeyword( typeName ) && typeName.IndexOf( '{' ) == -1 && !typeName.StartsWith( "*" ) && !typeName.StartsWith( "#" ))) )
							{
								if( m_WarnTimer == null )
									m_WarnTimer = new WarnTimer2();

								m_WarnTimer.Add( Location, Map, TypeName );

								this.status_str = "invalid type: " + typeName;
							}

							// Read in the number of spawns already
							int SpawnedCount = reader.ReadInt();

							TheSpawnObject.SpawnedObjects = new ArrayList( SpawnedCount );

							for( int x = 0; x < SpawnedCount; ++x )
							{
								int serial = reader.ReadInt();
								if( serial < -1 )
								{
									// minusone is reserved for unknown types by default
									//  minustwo on is used for referencing keyword tags
									int tagserial = -1 * (serial + 2);
									// get the tag with that serial and add it
									BaseXmlSpawner.KeywordTag t = BaseXmlSpawner.GetFromTagList( this, tagserial );
									if( t != null )
									{
										TheSpawnObject.SpawnedObjects.Add( t );
									}
								}
								else
								{
									IEntity e = World.FindEntity( serial );

									if( e != null )
										TheSpawnObject.SpawnedObjects.Add( e );
								}
							}
						}
						// now have to reintegrate the later version spawnobject information into the earlier version desered objects
						if( hasnewobjectinfo && tmpSpawnListSize == SpawnListSize )
						{
							for( int i = 0; i < SpawnListSize; ++i )
							{
								SpawnObject so = (SpawnObject)m_SpawnObjects[i];

								so.SubGroup = (int)tmpSubGroup[i];
								so.SequentialResetTime = (double)tmpSequentialResetTime[i];
								so.SequentialResetTo = (int)tmpSequentialResetTo[i];
								so.KillsNeeded = (int)tmpKillsNeeded[i];
								if( version > 19 )
									so.RequireSurface = (bool)tmpRequireSurface[i];
								bool restrictkills = false;
								bool clearadvance = true;
								double mind = -1;
								double maxd = -1;
								DateTime nextspawn = DateTime.MinValue;
								if( version > 23 )
								{
									restrictkills = (bool)tmpRestrictKillsToSubgroup[i];
									clearadvance = (bool)tmpClearOnAdvance[i];
									mind = (double)tmpMinDelay[i];
									maxd = (double)tmpMaxDelay[i];
									nextspawn = (DateTime)tmpNextSpawn[i];
								}
								so.RestrictKillsToSubgroup = restrictkills;
								so.ClearOnAdvance = clearadvance;
								so.MinDelay = mind;
								so.MaxDelay = maxd;
								so.NextSpawn = nextspawn;

								bool disablespawn = false;
								if( version > 26 )
								{
									disablespawn = (bool)tmpDisableSpawn[i];
								}
								so.Disabled = disablespawn;

								int packrange = -1;
								if( version > 27 )
								{
									packrange = (int)tmpPackRange[i];
								}
								so.PackRange = packrange;

								int spawnsper = 1;
								if( version > 28 )
								{
									spawnsper = (int)tmpSpawnsPer[i];
								}
								so.SpawnsPerTick = spawnsper;

							}
						}

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

			int version = reader.ReadInt();

			switch ( version )
			{
                case 2:
				case 1:
				{
					key_KeyVal = reader.ReadUInt();
					key_Description = reader.ReadString();
					key_Max = reader.ReadInt();
					key_Delay = TimeSpan.Parse(reader.ReadString());
					i_Door = reader.ReadItem();

					goto case 0;
				}
				case 0:
				{
                    m_WalkingRange = reader.ReadInt();
					m_WayPoint = reader.ReadItem() as WayPoint;
					m_MinDelay = reader.ReadTimeSpan();
					m_MaxDelay = reader.ReadTimeSpan();
					m_Count = reader.ReadInt();
					m_Team = reader.ReadInt();
					m_HomeRange = reader.ReadInt();
					m_Running = reader.ReadBool();

                    if (version == 1)
                        m_WalkingRange = m_HomeRange;

					TimeSpan ts = TimeSpan.Zero;

					if ( m_Running )
						ts = reader.ReadDeltaTime() - DateTime.Now;
					
					int size = reader.ReadInt();

					m_CreaturesName = new ArrayList( size );

					for ( int i = 0; i < size; ++i )
					{
						string typeName = reader.ReadString();

						m_CreaturesName.Add( typeName );

						if ( SpawnerType.GetType( typeName ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new gWarnTimer();

							m_WarnTimer.Add( Location, Map, typeName );
						}
					}

					int count = reader.ReadInt();

					m_Creatures = new ArrayList( count );

					for ( int i = 0; i < count; ++i )
					{
						IEntity e = World.FindEntity( reader.ReadInt() );

						if ( e != null )
							m_Creatures.Add( e );
					}

					if ( m_Running )
						DoTimer( ts );

					break;
				}
			}
		}
コード例 #21
0
ファイル: Poison.cs プロジェクト: greeduomacro/UO-Forever
		public static Poison Deserialize( GenericReader reader )
		{
			switch ( reader.ReadByte() )
			{
				case 1: return GetPoison( reader.ReadByte() );
				case 2:
					//no longer used, safe to remove?
					reader.ReadInt();
					reader.ReadDouble();
					reader.ReadInt();
					reader.ReadTimeSpan();
					break;
			}
			return null;
		}
コード例 #22
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            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 != MaxLoyalty )
                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();
            }

            TimeSpan deleteTime = TimeSpan.Zero;

            if ( version >= 17 )
                deleteTime = reader.ReadTimeSpan();

            if ( deleteTime > TimeSpan.Zero || LastOwner != null && !Controlled && !IsStabled )
            {
                if ( deleteTime == TimeSpan.Zero )
                    deleteTime = TimeSpan.FromDays( 3.0 );

                m_DeleteTimer = new DeleteTimer( this, deleteTime );
                m_DeleteTimer.Start();
            }

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

            CheckStatTimers();

            ChangeAIType(m_CurrentAI);

            AddFollowers();

            if ( IsAnimatedDead )
                Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );
        }
コード例 #23
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);
			int version = reader.ReadInt();

			switch (version)
			{
				case 1:
					{
						m_Cost = reader.ReadInt();
						m_AmountCollected = reader.ReadLong();
						goto case 0;
					}

				case 0:
					{
						m_Active = reader.ReadBool();
						m_Owner = reader.ReadMobile();
						m_Decays = reader.ReadBool();
						m_DecayTime = reader.ReadTimeSpan();

						m_AccessLevel = (AccessLevel)reader.ReadInt();
						if (reader.ReadBool())
							m_RuneBooks = reader.ReadItemList();
						m_DecayRunning = reader.ReadBool();
						if (m_DecayRunning)
							this.DoDecayTimer(reader.ReadTimeSpan());
						break;
					}
		}
			UpdateDate();
		}
コード例 #24
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            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();

            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_dActiveSpeed = activeSpeed;

            if ( isStandardPassive )
                m_dPassiveSpeed = passiveSpeed;

            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_bControled = 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_bControled = false;
                m_ControlMaster = null;
                m_ControlTarget = null;
                m_ControlOrder = OrderType.None;
            }

            if ( version >= 3 )
                m_Loyalty = (PetLoyalty)reader.ReadInt();
            else
                m_Loyalty = PetLoyalty.WonderfullyHappy;

            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.ReadMobileList();
            else
                m_Owners = new ArrayList();

            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;

                // temporary mod for conversion
                //reader.ReadTimeSpan();
                //m_Paragon = reader.ReadBool();

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

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

            CheckStatTimers();

            ChangeAIType(m_CurrentAI);

            // ARTEGORDONMOD
            // PlayerRangeSensitiveMod
            if ( version >= 14 )
            {
                TimeSpan restartDeactivationdelay = reader.ReadTimeSpan();
                if(m_AI != null) {
                    m_AI.m_RestartDeactivationdelay = restartDeactivationdelay;
                }
            }

            if ( m_IsBonded == true )
                m_IsBonded = false;

            AddFollowers();

            if ( IsAnimatedDead )
                Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );
        }
コード例 #25
0
ファイル: PortalKey.cs プロジェクト: OurUO/ouruo-server
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
            m_creation = reader.ReadDateTime();
            m_EndTime = reader.ReadDateTime();
            m_RemainTime = reader.ReadTimeSpan();
            m_map = reader.ReadMap();
            m_Destination = reader.ReadPoint3D();
            m_Active = reader.ReadBool();
            m_Expires = reader.ReadBool();
        }
コード例 #26
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 4:
                    {
                        m_WalkingRange = reader.ReadInt();
                        m_SpawnID = reader.ReadInt();
                        m_CountA = reader.ReadInt();
                        m_CountB = reader.ReadInt();
                        m_CountC = reader.ReadInt();
                        m_CountD = reader.ReadInt();
                        m_CountE = reader.ReadInt();

                        goto case 3;
                    }
                case 3:
                case 2:
                    {
                        m_WayPoint = reader.ReadItem() as WayPoint;

                        goto case 1;
                    }

                case 1:
                    {
                        m_Group = reader.ReadBool();

                        goto case 0;
                    }

                case 0:
                    {
                        m_MinDelay = reader.ReadTimeSpan();
                        m_MaxDelay = reader.ReadTimeSpan();
                        m_Count = reader.ReadInt();
                        m_Team = reader.ReadInt();
                        m_HomeRange = reader.ReadInt();
                        m_Running = reader.ReadBool();

                        TimeSpan ts = TimeSpan.Zero;

                        if (m_Running)
                            ts = reader.ReadDeltaTime() - DateTime.Now;

                        int size = reader.ReadInt();
                        m_CreaturesName = new List<string>(size);
                        for (int i = 0; i < size; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesName.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeA = reader.ReadInt();
                        m_CreaturesNameA = new List<string>(sizeA);
                        for (int i = 0; i < sizeA; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameA.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeB = reader.ReadInt();
                        m_CreaturesNameB = new List<string>(sizeB);
                        for (int i = 0; i < sizeB; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameB.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeC = reader.ReadInt();
                        m_CreaturesNameC = new List<string>(sizeC);
                        for (int i = 0; i < sizeC; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameC.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeD = reader.ReadInt();
                        m_CreaturesNameD = new List<string>(sizeD);
                        for (int i = 0; i < sizeD; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameD.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int sizeE = reader.ReadInt();
                        m_CreaturesNameE = new List<string>(sizeE);
                        for (int i = 0; i < sizeE; ++i)
                        {
                            string creatureString = reader.ReadString();

                            m_CreaturesNameE.Add(creatureString);
                            string typeName = ParseType(creatureString);

                            if (ScriptCompiler.FindTypeByName(typeName) == null)
                            {
                                if (m_WarnTimer == null)
                                    m_WarnTimer = new WarnTimer();

                                m_WarnTimer.Add(Location, Map, typeName);
                            }
                        }

                        int count = reader.ReadInt();
                        m_Creatures = new List<IEntity>(count);
                        for (int i = 0; i < count; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_Creatures.Add(e);
                        }

                        int countA = reader.ReadInt();
                        m_CreaturesA = new List<IEntity>(countA);
                        for (int i = 0; i < countA; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesA.Add(e);
                        }

                        int countB = reader.ReadInt();
                        m_CreaturesB = new List<IEntity>(countB);
                        for (int i = 0; i < countB; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesB.Add(e);
                        }

                        int countC = reader.ReadInt();
                        m_CreaturesC = new List<IEntity>(countC);
                        for (int i = 0; i < countC; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesC.Add(e);
                        }

                        int countD = reader.ReadInt();
                        m_CreaturesD = new List<IEntity>(countD);
                        for (int i = 0; i < countD; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesD.Add(e);
                        }

                        int countE = reader.ReadInt();
                        m_CreaturesE = new List<IEntity>(countE);
                        for (int i = 0; i < countE; ++i)
                        {
                            IEntity e = World.FindEntity(reader.ReadInt());

                            if (e != null)
                                m_CreaturesE.Add(e);
                        }

                        if (m_Running)
                            DoTimer(ts);

                        break;
                    }
            }

            if (version < 3 && Weight == 0)
                Weight = -1;
        }
コード例 #27
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));
        }
コード例 #28
0
ファイル: BaseLight.cs プロジェクト: Ravenwolfe/xrunuo
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                    {
                        m_BurntOut = reader.ReadBool();
                        m_Burning = reader.ReadBool();
                        m_Duration = reader.ReadTimeSpan();
                        m_Protected = reader.ReadBool();

                        if ( m_Burning && m_Duration != TimeSpan.Zero )
                        {
                            DoTimer( reader.ReadDeltaTime() - DateTime.Now );
                        }

                        break;
                    }
            }
        }
コード例 #29
0
ファイル: PremiumSpawner.cs プロジェクト: greeduomacro/annox
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 3:
				{
					m_SpawnRange = reader.ReadInt();
					m_SpawnID = reader.ReadInt();
					m_DeSpawn = reader.ReadInt();
					m_PlayerRangeSensitive = reader.ReadInt();
					m_SubCountA = reader.ReadInt();
					m_SubCountB = reader.ReadInt();
					m_SubCountC = reader.ReadInt();
					m_SubCountD = reader.ReadInt();
					m_SubCountE = reader.ReadInt();

					goto case 2;
				}
				case 2:
				{
					m_WayPoint = reader.ReadItem() as WayPoint;

					goto case 1;
				}
				case 1:
				{
					m_Group = reader.ReadBool();

					goto case 0;
				}
				case 0:
				{
					m_MinDelay = reader.ReadTimeSpan();
					m_MaxDelay = reader.ReadTimeSpan();
					m_Count = reader.ReadInt();
					m_Team = reader.ReadInt();
					m_HomeRange = reader.ReadInt();
					m_Running = reader.ReadBool();
					TimeSpan ts = TimeSpan.Zero;
					if ( m_Running )
						ts = reader.ReadDeltaTime() - DateTime.Now;
 
					int size = reader.ReadInt();
					m_CreaturesName = new ArrayList( size );
					for ( int i = 0; i < size; ++i )
					{
						string typeName = reader.ReadString();
						m_CreaturesName.Add( typeName );
						if ( SpawnerType.GetType( typeName ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeName );
						}
					}

					int sizeA = reader.ReadInt();
					m_SubSpawnerA = new ArrayList( sizeA );
					for ( int i = 0; i < sizeA; ++i )
					{
						string typeNameA = reader.ReadString();
						m_SubSpawnerA.Add( typeNameA );
						if ( SpawnerType.GetType( typeNameA ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameA );
						}
					}

					int sizeB = reader.ReadInt();
					m_SubSpawnerB = new ArrayList( sizeB );
					for ( int i = 0; i < sizeB; ++i )
					{
						string typeNameB = reader.ReadString();
						m_SubSpawnerB.Add( typeNameB );
						if ( SpawnerType.GetType( typeNameB ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameB );
						}
					}

					int sizeC = reader.ReadInt();
					m_SubSpawnerC = new ArrayList( sizeC );
					for ( int i = 0; i < sizeC; ++i )
					{
						string typeNameC = reader.ReadString();
						m_SubSpawnerC.Add( typeNameC );
						if ( SpawnerType.GetType( typeNameC ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameC );
						}
					}

					int sizeD = reader.ReadInt();
					m_SubSpawnerD = new ArrayList( sizeD );
					for ( int i = 0; i < sizeD; ++i )
					{
						string typeNameD = reader.ReadString();
						m_SubSpawnerD.Add( typeNameD );
						if ( SpawnerType.GetType( typeNameD ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameD );
						}
					}

					int sizeE = reader.ReadInt();
					m_SubSpawnerE = new ArrayList( sizeE );
					for ( int i = 0; i < sizeE; ++i )
					{
						string typeNameE = reader.ReadString();
						m_SubSpawnerE.Add( typeNameE );
						if ( SpawnerType.GetType( typeNameE ) == null )
						{
							if ( m_WarnTimer == null )
								m_WarnTimer = new WarnTimer();
							m_WarnTimer.Add( Location, Map, typeNameE );
						}
					}

					int count = reader.ReadInt();
					m_Creatures = new ArrayList( count );
					for ( int i = 0; i < count; ++i )
					{
						IEntity e = World.FindEntity( reader.ReadInt() );
						if ( e != null )
							m_Creatures.Add( e );
					}

					int countA = reader.ReadInt();
					m_SubCreaturesA = new ArrayList( countA );
					for ( int i = 0; i < countA; ++i )
					{
						IEntity eA = World.FindEntity( reader.ReadInt() );
						if ( eA != null )
							m_SubCreaturesA.Add( eA );
					}

					int countB = reader.ReadInt();
					m_SubCreaturesB = new ArrayList( countB );
					for ( int i = 0; i < countB; ++i )
					{
						IEntity eB = World.FindEntity( reader.ReadInt() );
						if ( eB != null )
							m_SubCreaturesB.Add( eB );
					}

					int countC = reader.ReadInt();
					m_SubCreaturesC = new ArrayList( countC );
					for ( int i = 0; i < countC; ++i )
					{
						IEntity eC = World.FindEntity( reader.ReadInt() );
						if ( eC != null )
							m_SubCreaturesC.Add( eC );
					}

					int countD = reader.ReadInt();
					m_SubCreaturesD = new ArrayList( countD );
					for ( int i = 0; i < countD; ++i )
					{
						IEntity eD = World.FindEntity( reader.ReadInt() );
						if ( eD != null )
						m_SubCreaturesD.Add( eD );
					}

					int countE = reader.ReadInt();
					m_SubCreaturesE = new ArrayList( countE );
					for ( int i = 0; i < countE; ++i )
					{
						IEntity eE = World.FindEntity( reader.ReadInt() );
						if ( eE != null )
						m_SubCreaturesE.Add( eE );
					}

					if ( m_Running )
						DoTimer( ts );

					break;
				}
			}

			m_SpawnRange = ( version <= 2 ? m_HomeRange : m_SpawnRange );
		}
コード例 #30
0
		public override void Deserialize( GenericReader reader ) 
		{ 
			base.Deserialize( reader ); 

			int version = reader.ReadInt(); 

			m_BandageContainer = reader.ReadItem() as Container;
			m_GHPotionContainer = reader.ReadItem() as Container;
			m_ReagentContainer = reader.ReadItem() as Container;
			m_Running = reader.ReadBool(); 

			if ( m_Running ) 
			{ 
				TimeSpan delay = reader.ReadTimeSpan(); 
				DoTimer( delay ); 
			} 
		}
コード例 #31
0
ファイル: ShardPoller.cs プロジェクト: zerodowned/angelisland
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Title = reader.ReadString();
					m_Duration = reader.ReadTimeSpan();
					m_StartTime = reader.ReadDateTime();
					m_Active = reader.ReadBool();

					m_Options = new ShardPollOption[reader.ReadInt()];

					for ( int i = 0; i < m_Options.Length; ++i )
						m_Options[i] = new ShardPollOption( reader );

					if ( m_Active )
						m_ActivePollers.Add( this );

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

            //Version 0
            if (version >= 0)
            {
                m_LastEventTime = reader.ReadDateTime();
                m_Player        = reader.ReadMobile() as PlayerMobile;
                m_ArenaMatch    = (ArenaMatch)reader.ReadItem();

                m_ReadyToggled = reader.ReadBool();
                m_FightStatus  = (FightStatusType)reader.ReadInt();

                m_LowestHealth   = reader.ReadInt();
                m_TimeAlive      = reader.ReadTimeSpan();
                m_DamageDealt    = reader.ReadInt();
                m_DamageReceived = reader.ReadInt();

                int spellUsages = reader.ReadInt();
                for (int a = 0; a < spellUsages; a++)
                {
                    string typeText  = reader.ReadString();
                    Type   spellType = null;

                    if (typeText != "null")
                    {
                        spellType = Type.GetType(typeText);
                    }

                    int usages = reader.ReadInt();

                    if (spellType != null)
                    {
                        m_SpellUsages.Add(new ArenaSpellUsage(spellType, usages));
                    }
                }

                int itemUsages = reader.ReadInt();
                for (int a = 0; a < itemUsages; a++)
                {
                    string typeText = reader.ReadString();
                    Type   itemType = null;

                    if (typeText != "null")
                    {
                        itemType = Type.GetType(typeText);
                    }

                    int usages = reader.ReadInt();

                    if (itemType != null)
                    {
                        m_ItemUsages.Add(new ArenaItemUsage(itemType, usages));
                    }
                }
            }

            //----

            //Force On System Start
            m_ReadyToggled = false;

            if (m_ArenaMatch == null)
            {
                Delete();
            }
        }