Exemplo n.º 1
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version

            writer.WriteDeltaTime( m_End );
        }
Exemplo n.º 2
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			
			writer.Write( (int) 0 ); // version

			writer.Write( (Mobile) m_Owner );
			writer.Write( (Mobile) m_Killer );
			writer.WriteDeltaTime( m_TimeOfDeath );
		}
Exemplo n.º 3
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0);

            writer.Write(m_Decays);

            if (m_Decays)
                writer.WriteDeltaTime(m_DecayTime);
        }
Exemplo n.º 4
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            //ARTEGORDONMOD
            // changed from version 13 to version 14
            writer.Write( (int) 14 ); // version

            writer.Write( (int)m_CurrentAI );
            writer.Write( (int)m_DefaultAI );

            writer.Write( (int)m_iRangePerception );
            writer.Write( (int)m_iRangeFight );

            writer.Write( (int)m_iTeam );

            writer.Write( (double)m_dActiveSpeed );
            writer.Write( (double)m_dPassiveSpeed );
            writer.Write( (double)m_dCurrentSpeed );

            writer.Write( (int) m_pHome.X );
            writer.Write( (int) m_pHome.Y );
            writer.Write( (int) m_pHome.Z );

            // Version 1
            writer.Write( (int) m_iRangeHome );

            int i=0;

            writer.Write( (int) m_arSpellAttack.Count );
            for ( i=0; i< m_arSpellAttack.Count; i++ )
            {
                writer.Write( m_arSpellAttack[i].ToString() );
            }

            writer.Write( (int) m_arSpellDefense.Count );
            for ( i=0; i< m_arSpellDefense.Count; i++ )
            {
                writer.Write( m_arSpellDefense[i].ToString() );
            }

            // Version 2
            writer.Write( (int) m_FightMode );

            writer.Write( (bool) m_bControled );
            writer.Write( (Mobile) m_ControlMaster );
            writer.Write( (Mobile) m_ControlTarget );
            writer.Write( (Point3D) m_ControlDest );
            writer.Write( (int) m_ControlOrder );
            writer.Write( (double) m_dMinTameSkill );
            // Removed in version 9
            //writer.Write( (double) m_dMaxTameSkill );
            writer.Write( (bool) m_bTamable );
            writer.Write( (bool) m_bSummoned );

            if ( m_bSummoned )
                writer.WriteDeltaTime( m_SummonEnd );

            writer.Write( (int) m_iControlSlots );

            // Version 3
            writer.Write( (int)m_Loyalty );

            // Version 4
            writer.Write( m_CurrentWayPoint );

            // Verison 5
            writer.Write( m_SummonMaster );

            // Version 6
            writer.Write( (int) m_HitsMax );
            writer.Write( (int) m_StamMax );
            writer.Write( (int) m_ManaMax );
            writer.Write( (int) m_DamageMin );
            writer.Write( (int) m_DamageMax );

            // Version 7
            writer.Write( (int) m_PhysicalResistance );
            writer.Write( (int) m_PhysicalDamage );

            writer.Write( (int) m_FireResistance );
            writer.Write( (int) m_FireDamage );

            writer.Write( (int) m_ColdResistance );
            writer.Write( (int) m_ColdDamage );

            writer.Write( (int) m_PoisonResistance );
            writer.Write( (int) m_PoisonDamage );

            writer.Write( (int) m_EnergyResistance );
            writer.Write( (int) m_EnergyDamage );

            // Version 8
            writer.WriteMobileList( m_Owners, true );

            // Version 10
            writer.Write( (bool) m_IsDeadPet );
            writer.Write( (bool) m_IsBonded );
            writer.Write( (DateTime) m_BondingBegin );
            writer.Write( (DateTime) m_OwnerAbandonTime );

            // Version 11
            writer.Write( (bool) m_HasGeneratedLoot );

            // Version 12
            writer.Write( (bool) m_Paragon );

            // Version 13
            writer.Write( (bool) ( m_Friends != null && m_Friends.Count > 0 ) );

            if ( m_Friends != null && m_Friends.Count > 0 )
                writer.WriteMobileList( m_Friends, true );

            // ARTEGORDONMOD
            // Version 14
            if(m_AI != null && m_AI.m_DeactivationTimer != null && m_AI.m_DeactivationTimer.Running){
                 // write out the time left on the deactivation timer
                 writer.Write( (TimeSpan) (m_AI.m_DeactivationTimer.m_End - DateTime.Now));
            } else {
                 // not active so on deserialization deactivate immediately
                 writer.Write( (TimeSpan) TimeSpan.Zero );
            }
        }
Exemplo n.º 5
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)4); // version
            writer.Write(m_WalkingRange);

            writer.Write(m_SpawnID);
            writer.Write(m_CountA);
            writer.Write(m_CountB);
            writer.Write(m_CountC);
            writer.Write(m_CountD);
            writer.Write(m_CountE);

            writer.Write(m_WayPoint);

            writer.Write(m_Group);

            writer.Write(m_MinDelay);
            writer.Write(m_MaxDelay);
            writer.Write(m_Count);
            writer.Write(m_Team);
            writer.Write(m_HomeRange);
            writer.Write(m_Running);

            if (m_Running)
                writer.WriteDeltaTime(m_End);

            writer.Write(m_CreaturesName.Count);

            for (int i = 0; i < m_CreaturesName.Count; ++i)
                writer.Write(m_CreaturesName[i]);

            writer.Write(m_CreaturesNameA.Count);

            for (int i = 0; i < m_CreaturesNameA.Count; ++i)
                writer.Write((string)m_CreaturesNameA[i]);

            writer.Write(m_CreaturesNameB.Count);

            for (int i = 0; i < m_CreaturesNameB.Count; ++i)
                writer.Write((string)m_CreaturesNameB[i]);

            writer.Write(m_CreaturesNameC.Count);

            for (int i = 0; i < m_CreaturesNameC.Count; ++i)
                writer.Write((string)m_CreaturesNameC[i]);

            writer.Write(m_CreaturesNameD.Count);

            for (int i = 0; i < m_CreaturesNameD.Count; ++i)
                writer.Write((string)m_CreaturesNameD[i]);

            writer.Write(m_CreaturesNameE.Count);

            for (int i = 0; i < m_CreaturesNameE.Count; ++i)
                writer.Write((string)m_CreaturesNameE[i]);

            writer.Write(m_Creatures.Count);

            for (int i = 0; i < m_Creatures.Count; ++i)
            {
                IEntity e = m_Creatures[i];

                if (e is Item)
                    writer.Write((Item)e);
                else if (e is Mobile)
                    writer.Write((Mobile)e);
                else
                    writer.Write(Serial.MinusOne);
            }

            writer.Write(m_CreaturesA.Count);

            for (int i = 0; i < m_CreaturesA.Count; ++i)
            {
                IEntity e = m_CreaturesA[i];

                if (e is Item)
                    writer.Write((Item)e);
                else if (e is Mobile)
                    writer.Write((Mobile)e);
                else
                    writer.Write(Serial.MinusOne);
            }

            writer.Write(m_CreaturesB.Count);

            for (int i = 0; i < m_CreaturesB.Count; ++i)
            {
                IEntity e = m_CreaturesB[i];

                if (e is Item)
                    writer.Write((Item)e);
                else if (e is Mobile)
                    writer.Write((Mobile)e);
                else
                    writer.Write(Serial.MinusOne);
            }

            writer.Write(m_CreaturesC.Count);

            for (int i = 0; i < m_CreaturesC.Count; ++i)
            {
                IEntity e = m_CreaturesC[i];

                if (e is Item)
                    writer.Write((Item)e);
                else if (e is Mobile)
                    writer.Write((Mobile)e);
                else
                    writer.Write(Serial.MinusOne);
            }

            writer.Write(m_CreaturesD.Count);

            for (int i = 0; i < m_CreaturesD.Count; ++i)
            {
                IEntity e = m_CreaturesD[i];

                if (e is Item)
                    writer.Write((Item)e);
                else if (e is Mobile)
                    writer.Write((Mobile)e);
                else
                    writer.Write(Serial.MinusOne);
            }

            writer.Write(m_CreaturesE.Count);

            for (int i = 0; i < m_CreaturesE.Count; ++i)
            {
                IEntity e = m_CreaturesE[i];

                if (e is Item)
                    writer.Write((Item)e);
                else if (e is Mobile)
                    writer.Write((Mobile)e);
                else
                    writer.Write(Serial.MinusOne);
            }

        }
Exemplo n.º 6
0
        public override void Serialize(GenericWriter writer)
        {
            //cleanup our anti-macro table 
            foreach (Hashtable t in m_AntiMacroTable.Values)
            {
                ArrayList remove = new ArrayList();
                foreach (CountAndTimeStamp time in t.Values)
                {
                    if (time.TimeStamp + SkillCheck.AntiMacroExpire <= DateTime.Now)
                        remove.Add(time);
                }

                for (int i = 0; i < remove.Count; ++i)
                    t.Remove(remove[i]);
            }

            //decay our kills
            if (m_ShortTermElapse < this.GameTime)
            {
                m_ShortTermElapse += TimeSpan.FromHours(8);
                if (ShortTermMurders > 0)
                    --ShortTermMurders;
            }

            if (m_LongTermElapse < this.GameTime)
            {
                m_LongTermElapse += TimeSpan.FromHours(40);
                if (Kills > 0)
                    --Kills;
            }

            CheckAtrophies(this);

            base.Serialize(writer);

            writer.Write((int)26); // version

            #region GeNova: Mondain's Legacy version 26
            QuestWriter.Quests(writer, m_Quests);
            QuestWriter.Chains(writer, m_Chains);

            if (m_Collections == null)
            {
                writer.Write((int)0);
            }
            else
            {
                writer.Write((int)m_Collections.Count);

                foreach (KeyValuePair<Collection, int> pair in m_Collections)
                {
                    writer.Write((int)pair.Key);
                    writer.Write((int)pair.Value);
                }
            }

            if (m_CollectionTitles == null)
            {
                writer.Write((int)0);
            }
            else
            {
                writer.Write((int)m_CollectionTitles.Count);

                for (int i = 0; i < m_CollectionTitles.Count; i++)
                    QuestWriter.Object(writer, m_CollectionTitles[i]);
            }

            writer.Write((int)m_SelectedTitle);
            writer.Write((DateTime)m_Peaced);
            #endregion

            if (m_AcquiredRecipes == null)
            {
                writer.Write((int)0);
            }
            else
            {
                writer.Write(m_AcquiredRecipes.Count);

                foreach (KeyValuePair<int, bool> kvp in m_AcquiredRecipes)
                {
                    writer.Write(kvp.Key);
                    writer.Write(kvp.Value);
                }
            }

            writer.WriteDeltaTime(m_LastHonorLoss);

            ChampionTitleInfo.Serialize(writer, m_ChampionTitles);

            writer.Write(m_LastValorLoss);
            writer.WriteEncodedInt(m_ToTItemsTurnedIn);
            writer.Write(m_ToTTotalMonsterFame);	//This ain't going to be a small #.

            writer.WriteEncodedInt(m_AllianceMessageHue);
            writer.WriteEncodedInt(m_GuildMessageHue);

            writer.WriteEncodedInt(m_GuildRank.Rank);
            writer.Write(m_LastOnline);

            writer.WriteEncodedInt((int)m_SolenFriendship);

            QuestSerializer.Serialize(m_Quest, writer);

            if (m_DoneQuests == null)
            {
                writer.WriteEncodedInt((int)0);
            }
            else
            {
                writer.WriteEncodedInt((int)m_DoneQuests.Count);

                for (int i = 0; i < m_DoneQuests.Count; ++i)
                {
                    QuestRestartInfo restartInfo = m_DoneQuests[i];

                    QuestSerializer.Write((Type)restartInfo.QuestType, QuestSystem.QuestTypes, writer);
                    writer.Write((DateTime)restartInfo.RestartTime);
                }
            }

            writer.WriteEncodedInt((int)m_Profession);

            writer.WriteDeltaTime(m_LastCompassionLoss);

            writer.WriteEncodedInt(m_CompassionGains);

            if (m_CompassionGains > 0)
                writer.WriteDeltaTime(m_NextCompassionDay);

            m_BOBFilter.Serialize(writer);

            bool useMods = (m_HairModID != -1 || m_BeardModID != -1);

            writer.Write(useMods);

            if (useMods)
            {
                writer.Write((int)m_HairModID);
                writer.Write((int)m_HairModHue);
                writer.Write((int)m_BeardModID);
                writer.Write((int)m_BeardModHue);
            }

            writer.Write(SavagePaintExpiration);

            writer.Write((int)m_NpcGuild);
            writer.Write((DateTime)m_NpcGuildJoinTime);
            writer.Write((TimeSpan)m_NpcGuildGameTime);

            writer.Write(m_PermaFlags, true);

            writer.Write(NextTailorBulkOrder);

            writer.Write(NextSmithBulkOrder);

            writer.WriteDeltaTime(m_LastJusticeLoss);
            writer.Write(m_JusticeProtectors, true);

            writer.WriteDeltaTime(m_LastSacrificeGain);
            writer.WriteDeltaTime(m_LastSacrificeLoss);
            writer.Write(m_AvailableResurrects);

            writer.Write((int)m_Flags);

            writer.Write(m_LongTermElapse);
            writer.Write(m_ShortTermElapse);
            writer.Write(this.GameTime);
        }
Exemplo n.º 7
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int)4 ); // version

            writer.Write( m_ConfinedRoaming );
            writer.WriteItem<IdolOfTheChampion>( m_Idol );
            writer.Write( m_HasBeenAdvanced );
            writer.Write( m_SpawnArea );

            writer.Write( m_RandomizeType );

            //			writer.Write( m_SpawnRange );
            writer.Write( m_Kills );

            writer.Write( (bool)m_Active );
            writer.Write( (int)m_Type );
            writer.Write( m_Creatures, true );
            writer.Write( m_RedSkulls, true );
            writer.Write( m_WhiteSkulls, true );
            writer.WriteItem<ChampionPlatform>( m_Platform );
            writer.WriteItem<ChampionAltar>( m_Altar );
            writer.Write( m_ExpireDelay );
            writer.WriteDeltaTime( m_ExpireTime );
            writer.Write( m_Champion );
            writer.Write( m_RestartDelay );

            writer.Write( m_RestartTimer != null );

            if( m_RestartTimer != null )
                writer.WriteDeltaTime( m_RestartTime );
        }
Exemplo n.º 8
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 1 ); // version

			writer.Write( (bool) BaseHouse.NewVendorSystem );
			writer.Write( (string) m_ShopName );
			writer.WriteDeltaTime( (DateTime) m_NextPayTime );
			writer.Write( (Item) House );

			writer.Write( (Mobile) m_Owner );
			writer.Write( (int) m_BankAccount );
			writer.Write( (int) m_HoldGold );

			writer.Write( (int) m_SellItems.Count );
			foreach ( VendorItem vi in m_SellItems.Values )
			{
				writer.Write( (Item) vi.Item );
				writer.Write( (int) vi.Price );
				writer.Write( (string) vi.Description );

				writer.Write( (DateTime) vi.Created );
			}
		}
Exemplo n.º 9
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)5); // version

            writer.Write(m_DamageEntries.Count);
            foreach (KeyValuePair<Mobile, int> kvp in m_DamageEntries)
            {
                writer.Write(kvp.Key);
                writer.Write(kvp.Value);
            }

            writer.Write(m_ConfinedRoaming);
            writer.WriteItem<IdolOfTheChampion>(m_Idol);
            writer.Write(m_HasBeenAdvanced);
            writer.Write(m_SpawnArea);

            writer.Write(m_RandomizeType);

            //			writer.Write( m_SpawnRange );
            writer.Write(m_Kills);

            writer.Write((bool)m_Active);
            writer.Write((int)m_Type);
            writer.Write(m_Creatures, true);
            writer.Write(m_RedSkulls, true);
            writer.Write(m_WhiteSkulls, true);
            writer.WriteItem<ChampionPlatform>(m_Platform);
            writer.WriteItem<ChampionAltar>(m_Altar);
            writer.Write(m_ExpireDelay);
            writer.WriteDeltaTime(m_ExpireTime);
            writer.Write(m_Champion);
            writer.Write(m_RestartDelay);

            writer.Write(m_RestartTimer != null);

            if (m_RestartTimer != null)
                writer.WriteDeltaTime(m_RestartTime);
        }
Exemplo n.º 10
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int)30 ); // version
			// Version 30
			writer.Write( m_AllowNPCTriggering );

			// Version 29
			if( m_SpawnObjects != null )
			{
				writer.Write( m_SpawnObjects.Count );
				for( int i = 0; i < m_SpawnObjects.Count; ++i )
				{
					// Write the spawns per tick value
					writer.Write( ((SpawnObject)m_SpawnObjects[i]).SpawnsPerTick );
				}
			}
			else
			{
				// empty spawner
				writer.Write( (int)0 );
			}

			// Version 28
			if( m_SpawnObjects != null )
			{
				for( int i = 0; i < m_SpawnObjects.Count; ++i )
				{
					// Write the pack range value
					writer.Write( ((SpawnObject)m_SpawnObjects[i]).PackRange );
				}
			}


			// Version 27
			if( m_SpawnObjects != null )
			{
				for( int i = 0; i < m_SpawnObjects.Count; ++i )
				{
					// Write the disable spawn flag
					writer.Write( ((SpawnObject)m_SpawnObjects[i]).Disabled );
				}
			}

			// Version 26
			writer.Write( m_SpawnOnTrigger );
			writer.Write( m_FirstModified );
			writer.Write( m_LastModified );

			// Version 25
			// eliminated the textentrybook serialization (they autodelete on deser now)

			// Version 24
			if( m_SpawnObjects != null )
			{
				for( int i = 0; i < m_SpawnObjects.Count; ++i )
				{
					SpawnObject so = (SpawnObject)m_SpawnObjects[i];
					// Write the restrict kills flag
					writer.Write( so.RestrictKillsToSubgroup );
					// Write the clear on advance flag
					writer.Write( so.ClearOnAdvance );
					// Write the mindelay
					writer.Write( so.MinDelay );
					// Write the maxdelay
					writer.Write( so.MaxDelay );
					// write the next spawn time for the subgrop
					writer.WriteDeltaTime( so.NextSpawn );

				}
			}

			if( m_ShowBoundsItems != null && m_ShowBoundsItems.Count > 0 )
			{
				writer.Write( true );
				writer.WriteItemList( m_ShowBoundsItems );
			}
			else
			{
				// empty showbounds item list
				writer.Write( false );
			}

			// Version 23
			writer.Write( IsInactivated );
			writer.Write( m_SmartSpawning );
			// Version 22
			writer.Write( m_SkillTrigger );
			writer.Write( (int)m_skill_that_triggered );
			writer.Write( m_FreeRun );
			writer.Write( m_mob_who_triggered );
			// Version 21
			writer.Write( m_DespawnTime );
			// Version 20
			if( m_SpawnObjects != null )
			{
				for( int i = 0; i < m_SpawnObjects.Count; ++i )
				{
					// Write the requiresurface flag
					writer.Write( ((SpawnObject)m_SpawnObjects[i]).RequireSurface );
				}
			}
			// Version 19
			writer.Write( m_ConfigFile );
			writer.Write( m_OnHold );
			writer.Write( m_HoldSequence );
			writer.Write( m_FirstModifiedBy );
			writer.Write( m_LastModifiedBy );
			// compute the number of tags to save
			int tagcount = 0;
			for( int i = 0; i < m_KeywordTagList.Count; i++ )
			{
				// only save WAIT type keywords or other keywords that have the save flag set
				if( (((BaseXmlSpawner.KeywordTag)(m_KeywordTagList[i])).Flags & BaseXmlSpawner.KeywordFlags.Serialize) != 0 )
					tagcount++;
			}
			writer.Write( tagcount );
			// and write them out
			for( int i = 0; i < m_KeywordTagList.Count; i++ )
			{
				if( (((BaseXmlSpawner.KeywordTag)(m_KeywordTagList[i])).Flags & BaseXmlSpawner.KeywordFlags.Serialize) != 0 )
				{
					((BaseXmlSpawner.KeywordTag)(m_KeywordTagList[i])).Serialize( writer );
				}
			}
			// Version 18
			writer.Write( m_AllowGhostTriggering );
			// Version 17
			// removed in version 25
			//writer.Write( m_TextEntryBook);
			// Version 16
			writer.Write( m_SequentialSpawning );
			// write out the remaining time until sequential reset
			writer.Write( NextSeqReset );
			// Write the spawn object list
			if( m_SpawnObjects != null )
			{
				for( int i = 0; i < m_SpawnObjects.Count; ++i )
				{
					SpawnObject so = (SpawnObject)m_SpawnObjects[i];
					// Write the subgroup and sequential reset time
					writer.Write( so.SubGroup );
					writer.Write( so.SequentialResetTime );
					writer.Write( so.SequentialResetTo );
					writer.Write( so.KillsNeeded );
				}
			}
			writer.Write( m_RegionName );	// 2004.02.08 :: Omega Red


			// Version 15
			writer.Write( m_ExternalTriggering );
			writer.Write( m_ExternalTrigger );

			// Version 14
			writer.Write( m_NoItemTriggerName );

			// Version 13
			writer.Write( m_GumpState );

			// Version 12
			int todtype = (int)m_TODMode;
			writer.Write( todtype );

			// Version 11
			writer.Write( m_KillReset );
			writer.Write( m_skipped );
			writer.Write( m_spawncheck );

			// Version 10
			writer.Write( m_SetPropertyItem );

			// Version 9
			writer.Write( m_TriggerProbability );

			// Version 8
			writer.Write( m_MobPropertyName );
			writer.Write( m_MobTriggerName );
			writer.Write( m_PlayerPropertyName );

			// Version 7
			writer.Write( m_SpeechTrigger );

			// Version 6
			writer.Write( m_ItemTriggerName );

			// Version 5
			writer.Write( m_ProximityTriggerMessage );
			writer.Write( m_ObjectPropertyItem );
			writer.Write( m_ObjectPropertyName );
			writer.Write( m_killcount );

			// Version 4
			writer.Write( m_ProximityRange );
			writer.Write( m_ProximityTriggerSound );
			writer.Write( m_proximityActivated );
			writer.Write( m_durActivated );
			writer.Write( m_refractActivated );
			writer.Write( m_StackAmount );
			writer.Write( m_TODStart );
			writer.Write( m_TODEnd );
			writer.Write( m_MinRefractory );
			writer.Write( m_MaxRefractory );
			if( m_refractActivated )
				writer.Write( m_RefractEnd - DateTime.Now );
			if( m_durActivated )
				writer.Write( m_DurEnd - DateTime.Now );
			// Version 3
			writer.Write( m_ShowContainerStatic );
			// Version 2
			writer.Write( m_Duration );

			// Version 1
			writer.Write( m_UniqueId );
			writer.Write( m_HomeRangeIsRelative );

			// Version 0
			writer.Write( m_Name );
			writer.Write( m_X );
			writer.Write( m_Y );
			writer.Write( m_Width );
			writer.Write( m_Height );
			writer.Write( m_WayPoint );
			writer.Write( m_Group );
			writer.Write( m_MinDelay );
			writer.Write( m_MaxDelay );
			writer.Write( m_Count );
			writer.Write( m_Team );
			writer.Write( m_HomeRange );
			writer.Write( m_Running );

			if( m_Running )
				writer.Write( m_End - DateTime.Now );

			// Write the spawn object list
			int nso = 0;
			if( m_SpawnObjects != null ) nso = m_SpawnObjects.Count;
			writer.Write( nso );
			for( int i = 0; i < nso; ++i )
			{
				SpawnObject so = (SpawnObject)m_SpawnObjects[i];

				// Write the type and maximum count
				writer.Write( (string)so.TypeName );
				writer.Write( (int)so.ActualMaxCount );

				// Write the spawned object information
				writer.Write( so.SpawnedObjects.Count );
				for( int x = 0; x < so.SpawnedObjects.Count; ++x )
				{
					object o = so.SpawnedObjects[x];

					if( o is Item )
						writer.Write( (Item)o );
					else if( o is Mobile )
						writer.Write( (Mobile)o );
					else
					{

						// if this is a keyword tag then add some more info
						if( o is BaseXmlSpawner.KeywordTag )
						{
							writer.Write( -1 * ((BaseXmlSpawner.KeywordTag)o).Serial - 2 );
						}
						else
						{
							writer.Write( Serial.MinusOne );
						}
					}
				}
			}
		}
Exemplo n.º 11
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 1 );

            writer.WriteDeltaTime( m_NextWoolTime );
        }
Exemplo n.º 12
0
        public override void Serialize( GenericWriter writer )
        {
            //cleanup our anti-macro table
            foreach ( Hashtable t in m_AntiMacroTable.Values )
            {
                ArrayList remove = new ArrayList();
                foreach ( CountAndTimeStamp time in t.Values )
                {
                    if ( time.TimeStamp + SkillCheck.AntiMacroExpire <= DateTime.Now )
                        remove.Add( time );
                }

                for (int i=0;i<remove.Count;++i)
                    t.Remove( remove[i] );
            }

            if ( m_NextBountyDecay != DateTime.MinValue )
            {
                bool update = false;
                while ( m_Bounty > 0 && m_NextBountyDecay < DateTime.Now )
                {
                    update = true;
                    m_Bounty -= 100;
                    m_NextBountyDecay += TimeSpan.FromDays( 1.0 );
                }

                if ( m_Bounty < 0 )
                    m_Bounty = 0;

                if ( update )
                    BountyBoard.Update( this );
            }

            base.Serialize( writer );

            writer.Write( (int) 18 ); // version

            writer.Write( m_NextBountyDecay );

            writer.Write( m_LastUpdate );
            writer.Write( m_LastLogin );

            writer.Write( m_NextNotoUp );
            writer.Write( m_Cohesion );
            writer.Write( (TimeSpan)(DateTime.Now - m_LastCohesion) );
            writer.Write( m_AssumeGhost );
            writer.Write( (byte)m_SkillUsageOrder.Length );
            for(int i=0;i<m_SkillUsageOrder.Length;i++)
                writer.Write( (byte)m_SkillUsageOrder[i] );

             	writer.Write( (int) m_Bounty );

            writer.WriteEncodedInt( m_CompassionGains );

            if ( m_CompassionGains > 0 )
                writer.WriteDeltaTime( m_NextCompassionDay );

            bool useMods = ( m_HairModID != -1 || m_BeardModID != -1 );

            writer.Write( useMods );

            if ( useMods )
            {
                writer.Write( (int) m_HairModID );
                writer.Write( (int) m_HairModHue );
                writer.Write( (int) m_BeardModID );
                writer.Write( (int) m_BeardModHue );
            }

            writer.Write( SavagePaintExpiration );

            writer.Write( (int) m_NpcGuild );
            writer.Write( (DateTime) m_NpcGuildJoinTime );
            writer.Write( (TimeSpan) m_NpcGuildGameTime );

            writer.WriteMobileList( m_PermaFlags, true );

            writer.Write( NextTailorBulkOrder );

            writer.Write( NextSmithBulkOrder );

            writer.WriteDeltaTime( m_LastJusticeLoss );
            writer.WriteMobileList( m_JusticeProtectors, true );

            writer.WriteDeltaTime( m_LastSacrificeGain );
            writer.WriteDeltaTime( m_LastSacrificeLoss );
            writer.Write( m_AvailableResurrects );

            writer.Write( (int) m_Flags );

            writer.Write( m_LongTermElapse );
            writer.Write( m_ShortTermElapse );
            writer.Write( this.GameTime );
        }
Exemplo n.º 13
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 11 ); // version

            writer.Write( (int)m_Flags );

            writer.WriteDeltaTime( m_TimeOfDeath );

            List<KeyValuePair<Item, Point3D>> list = ( m_RestoreTable == null ? null : new List<KeyValuePair<Item, Point3D>>( m_RestoreTable ) );
            int count = ( list == null ? 0 : list.Count );

            writer.Write( count );

            for ( int i = 0; i < count; ++i )
            {
                KeyValuePair<Item, Point3D> kvp = list[i];
                Item item = kvp.Key;
                Point3D loc = kvp.Value;

                writer.Write( item );

                if ( item.Location == loc )
                {
                    writer.Write( false );
                }
                else
                {
                    writer.Write( true );
                    writer.Write( loc );
                }
            }

            writer.Write( m_DecayTimer != null );

            if ( m_DecayTimer != null )
                writer.WriteDeltaTime( m_DecayTime );

            writer.Write( m_Looters );
            writer.Write( m_Killer );

            writer.Write( m_Aggressors );

            writer.Write( m_Owner );

            writer.Write( (string) m_CorpseName );

            writer.Write( (int) m_AccessLevel );
            writer.Write( (Guild) m_Guild );
            writer.Write( (int) m_Kills );

            writer.Write( m_EquipItems );
        }
Exemplo n.º 14
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 1 );

            writer.Write( m_Crafter );
            writer.WriteEncodedInt( (int) m_Quality );
            writer.WriteEncodedInt( (int) m_Resource );

            writer.Write( m_BurntOut );
            writer.Write( m_Burning );
            writer.Write( m_Duration );
            writer.Write( m_Protected );

            if ( m_Burning && m_Duration != TimeSpan.Zero )
                writer.WriteDeltaTime( m_End );
        }
Exemplo n.º 15
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version

            writer.WriteItemList( m_Items, true );
            writer.WriteMobileList( m_Mobiles, true );
            writer.WriteDeltaTime( m_DecayTime );
        }
Exemplo n.º 16
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 2 ); // version

			writer.Write( m_Guardians, true );
			writer.Write( (bool) m_Temporary );

			writer.Write( m_Owner );

			writer.Write( (int) m_Level );
			writer.WriteDeltaTime( m_DeleteTime );
			writer.Write( m_Lifted, true );
		}
Exemplo n.º 17
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 );
            writer.Write( m_BurntOut );
            writer.Write( m_Burning );
            writer.Write( m_Duration );
            writer.Write( m_Protected );

            if ( m_Burning && m_Duration != TimeSpan.Zero )
            {
                writer.WriteDeltaTime( m_End );
            }
        }
Exemplo n.º 18
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 3 );

			writer.Write( (Item) m_MapItem );
			writer.Write( (int) m_NextNavPoint );

			writer.Write( (int) m_Facing );

			writer.WriteDeltaTime( m_DecayTime );

			writer.Write( m_Owner );
			writer.Write( m_PPlank );
			writer.Write( m_SPlank );
			writer.Write( m_TillerMan );
			writer.Write( m_Hold );
			writer.Write( m_Anchored );
			writer.Write( m_ShipName );

			CheckDecay();
		}
Exemplo n.º 19
0
        public void Serialize( GenericWriter writer )
        {
            writer.WriteEncodedInt( 0 ); // version

            writer.Write( (Mobile) m_Owner );
            writer.Write( (string) m_VendorName );
            writer.Write( (string) m_ShopName );

            writer.Write( m_Items, true );
            writer.Write( (int) m_Gold );

            writer.WriteDeltaTime( m_ExpireTime );
        }
Exemplo n.º 20
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            if (HeadKiller != null)
            {
                writer.Write( (int) 2 ); // version
                writer.Write( (Mobile) HeadKiller);
                writer.Write( (Mobile) HeadOwner);
                writer.WriteDeltaTime( (DateTime) DateKill);
            }
            else writer.Write( (int) 1 ); // version

            writer.Write( (string) m_PlayerName );
            writer.WriteEncodedInt( (int) m_HeadType );
        }
Exemplo n.º 21
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.WriteEncodedInt( (int) 0 ); // version

			writer.WriteDeltaTime( m_When );
		}
Exemplo n.º 22
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.WriteEncodedInt( 0 ); // version

            writer.WriteEncodedInt( m_RentalDuration.ID );

            writer.Write( (int) m_RentalPrice );
            writer.Write( (bool) m_LandlordRenew );
            writer.Write( (bool) m_RenterRenew );
            writer.Write( (int) m_RenewalPrice );

            writer.Write( (int) m_RentalGold );

            writer.WriteDeltaTime( (DateTime) m_RentalExpireTime );
        }
Exemplo n.º 23
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0);

            writer.Write((int)m_Armaments);
            writer.Write((int)m_PayRate);
            writer.WriteDeltaTime(m_speechInterval);
            writer.Write((int)m_Training);
            writer.Write((String)m_BaseName);
        }
Exemplo n.º 24
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 4 ); // version
			writer.Write( m_WalkingRange );

			writer.Write( m_WayPoint );

			writer.Write( m_Group );

			writer.Write( m_MinDelay );
			writer.Write( m_MaxDelay );
			writer.Write( m_Count );
			writer.Write( m_Team );
			writer.Write( m_HomeRange );
			writer.Write( m_Running );
			
			if ( m_Running )
				writer.WriteDeltaTime( m_End );

			writer.Write( m_CreaturesName.Count );

			for ( int i = 0; i < m_CreaturesName.Count; ++i )
				writer.Write( m_CreaturesName[i] );

			writer.Write( m_Creatures.Count );

			for ( int i = 0; i < m_Creatures.Count; ++i )
			{
				IEntity e = m_Creatures[i];

				if ( e is Item )
					writer.Write( (Item)e );
				else if ( e is Mobile )
					writer.Write( (Mobile)e );
				else
					writer.Write( Serial.MinusOne );
			}
		}
Exemplo n.º 25
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 1 ); // version

            writer.Write( m_DecayTimer != null );

            if ( m_DecayTimer != null )
                writer.WriteDeltaTime( m_DecayTime );
        }
Exemplo n.º 26
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version

            EDI dest = GetDestination();

            writer.Write( dest != null );

            if ( dest != null )
                writer.Write( dest.Name );

            writer.Write( m_DeleteTimer != null );

            if ( m_DeleteTimer != null )
                writer.WriteDeltaTime( m_DeleteTime );
        }
Exemplo n.º 27
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
            writer.WriteDeltaTime(m_creation);
            writer.WriteDeltaTime(m_EndTime);
            writer.Write((TimeSpan)m_RemainTime);
            writer.Write((Map)m_map);
            writer.Write((Point3D)Destination);
            writer.Write(m_Active);
            writer.Write(m_Expires);
        }
Exemplo n.º 28
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 2 ); // version

			writer.Write( key_KeyVal );
			writer.Write( key_Description );
			writer.Write( key_Max );
			writer.Write( (string)key_Delay.ToString() );
			writer.Write( (Item)i_Door );

			writer.Write( m_WalkingRange ); 
			writer.Write( m_WayPoint );
			writer.Write( m_MinDelay );
			writer.Write( m_MaxDelay );
			writer.Write( m_Count );
			writer.Write( m_Team );
			writer.Write( m_HomeRange );
			writer.Write( m_Running );
			
			if ( m_Running )
				writer.WriteDeltaTime( m_End );

			writer.Write( m_CreaturesName.Count );

			for ( int i = 0; i < m_CreaturesName.Count; ++i )
				writer.Write( (string)m_CreaturesName[i] );

			writer.Write( m_Creatures.Count );

			for ( int i = 0; i < m_Creatures.Count; ++i )
			{
				object o = m_Creatures[i];

				if ( o is Mobile )
					writer.Write( (Mobile)o );
				else
					writer.Write( Serial.MinusOne );
			}
		}
Exemplo n.º 29
0
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 3 ); // version

			writer.Write( m_SpawnRange );
			writer.Write( m_SpawnID );
			writer.Write( m_DeSpawn );
			writer.Write( m_PlayerRangeSensitive );
			writer.Write( m_SubCountA );
			writer.Write( m_SubCountB );
			writer.Write( m_SubCountC );
			writer.Write( m_SubCountD );
			writer.Write( m_SubCountE );

			writer.Write( m_WayPoint );

			writer.Write( m_Group );

			writer.Write( m_MinDelay );
			writer.Write( m_MaxDelay );
			writer.Write( m_Count );
			writer.Write( m_Team );
			writer.Write( m_HomeRange );
			writer.Write( m_Running );
			
			if ( m_Running )
				writer.WriteDeltaTime( m_End );

			writer.Write( m_CreaturesName.Count );

			for ( int i = 0; i < m_CreaturesName.Count; ++i )
				writer.Write( (string)m_CreaturesName[i] );

			writer.Write( m_SubSpawnerA.Count );

			for ( int i = 0; i < m_SubSpawnerA.Count; ++i )
				writer.Write( (string)m_SubSpawnerA[i] );

			writer.Write( m_SubSpawnerB.Count );

			for ( int i = 0; i < m_SubSpawnerB.Count; ++i )
				writer.Write( (string)m_SubSpawnerB[i] );

			writer.Write( m_SubSpawnerC.Count );

			for ( int i = 0; i < m_SubSpawnerC.Count; ++i )
				writer.Write( (string)m_SubSpawnerC[i] );

			writer.Write( m_SubSpawnerD.Count );

			for ( int i = 0; i < m_SubSpawnerD.Count; ++i )
				writer.Write( (string)m_SubSpawnerD[i] );

			writer.Write( m_SubSpawnerE.Count );

			for ( int i = 0; i < m_SubSpawnerE.Count; ++i )
				writer.Write( (string)m_SubSpawnerE[i] );

			writer.Write( m_Creatures.Count );

			for ( int i = 0; i < m_Creatures.Count; ++i )
			{
				object o = m_Creatures[i];

				if ( o is Item )
					writer.Write( (Item)o );
				else if ( o is Mobile )
					writer.Write( (Mobile)o );
				else
					writer.Write( Serial.MinusOne );
			}

			writer.Write( m_SubCreaturesA.Count );

			for ( int i = 0; i < m_SubCreaturesA.Count; ++i )
			{
				object oA = m_SubCreaturesA[i];

				if ( oA is Item )
					writer.Write( (Item)oA );
				else if ( oA is Mobile )
					writer.Write( (Mobile)oA );
				else
					writer.Write( Serial.MinusOne );
			}

			writer.Write( m_SubCreaturesB.Count );

			for ( int i = 0; i < m_SubCreaturesB.Count; ++i )
			{
				object oB = m_SubCreaturesB[i];

				if ( oB is Item )
					writer.Write( (Item)oB );
				else if ( oB is Mobile )
					writer.Write( (Mobile)oB );
				else
					writer.Write( Serial.MinusOne );
			}

			writer.Write( m_SubCreaturesC.Count );

			for ( int i = 0; i < m_SubCreaturesC.Count; ++i )
			{
				object oC = m_SubCreaturesC[i];

				if ( oC is Item )
					writer.Write( (Item)oC );
				else if ( oC is Mobile )
					writer.Write( (Mobile)oC );
				else
					writer.Write( Serial.MinusOne );
			}

			writer.Write( m_SubCreaturesD.Count );

			for ( int i = 0; i < m_SubCreaturesD.Count; ++i )
			{
				object oD = m_SubCreaturesD[i];

				if ( oD is Item )
					writer.Write( (Item)oD );
				else if ( oD is Mobile )
					writer.Write( (Mobile)oD );
				else
					writer.Write( Serial.MinusOne );
			}

			writer.Write( m_SubCreaturesE.Count );

			for ( int i = 0; i < m_SubCreaturesE.Count; ++i )
			{
				object oE = m_SubCreaturesE[i];

				if ( oE is Item )
					writer.Write( (Item)oE );
				else if ( oE is Mobile )
					writer.Write( (Mobile)oE );
				else
					writer.Write( Serial.MinusOne );
			}
		}
Exemplo n.º 30
0
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 17 ); // version

            writer.Write( (int)m_CurrentAI );
            writer.Write( (int)m_DefaultAI );

            writer.Write( (int)m_iRangePerception );
            writer.Write( (int)m_iRangeFight );

            writer.Write( (int)m_iTeam );

            writer.Write( (double)m_dActiveSpeed );
            writer.Write( (double)m_dPassiveSpeed );
            writer.Write( (double)m_dCurrentSpeed );

            writer.Write( (int) m_pHome.X );
            writer.Write( (int) m_pHome.Y );
            writer.Write( (int) m_pHome.Z );

            // Version 1
            writer.Write( (int) m_iRangeHome );

            int i=0;

            writer.Write( (int) m_arSpellAttack.Count );
            for ( i=0; i< m_arSpellAttack.Count; i++ )
            {
                writer.Write( m_arSpellAttack[i].ToString() );
            }

            writer.Write( (int) m_arSpellDefense.Count );
            for ( i=0; i< m_arSpellDefense.Count; i++ )
            {
                writer.Write( m_arSpellDefense[i].ToString() );
            }

            // Version 2
            writer.Write( (int) m_FightMode );

            writer.Write( (bool) m_bControlled );
            writer.Write( (Mobile) m_ControlMaster );
            writer.Write( (Mobile) m_ControlTarget );
            writer.Write( (Point3D) m_ControlDest );
            writer.Write( (int) m_ControlOrder );
            writer.Write( (double) m_dMinTameSkill );
            // Removed in version 9
            //writer.Write( (double) m_dMaxTameSkill );
            writer.Write( (bool) m_bTamable );
            writer.Write( (bool) m_bSummoned );

            if ( m_bSummoned )
                writer.WriteDeltaTime( m_SummonEnd );

            writer.Write( (int) m_iControlSlots );

            // Version 3
            writer.Write( (int)m_Loyalty );

            // Version 4
            writer.Write( m_CurrentWayPoint );

            // Verison 5
            writer.Write( m_SummonMaster );

            // Version 6
            writer.Write( (int) m_HitsMax );
            writer.Write( (int) m_StamMax );
            writer.Write( (int) m_ManaMax );
            writer.Write( (int) m_DamageMin );
            writer.Write( (int) m_DamageMax );

            // Version 7
            writer.Write( (int) m_PhysicalResistance );
            writer.Write( (int) m_PhysicalDamage );

            writer.Write( (int) m_FireResistance );
            writer.Write( (int) m_FireDamage );

            writer.Write( (int) m_ColdResistance );
            writer.Write( (int) m_ColdDamage );

            writer.Write( (int) m_PoisonResistance );
            writer.Write( (int) m_PoisonDamage );

            writer.Write( (int) m_EnergyResistance );
            writer.Write( (int) m_EnergyDamage );

            // Version 8
            writer.Write( m_Owners, true );

            // Version 10
            writer.Write( (bool) m_IsDeadPet );
            writer.Write( (bool) m_IsBonded );
            writer.Write( (DateTime) m_BondingBegin );
            writer.Write( (DateTime) m_OwnerAbandonTime );

            // Version 11
            writer.Write( (bool) m_HasGeneratedLoot );

            // Version 12
            writer.Write( (bool) m_Paragon );

            // Version 13
            writer.Write( (bool) ( m_Friends != null && m_Friends.Count > 0 ) );

            if ( m_Friends != null && m_Friends.Count > 0 )
                writer.Write( m_Friends, true );

            // Version 14
            writer.Write( (bool)m_RemoveIfUntamed );
            writer.Write( (int)m_RemoveStep );

            // Version 17
            if ( IsStabled || ( Controlled && ControlMaster != null ) )
                writer.Write( TimeSpan.Zero );
            else
                writer.Write( DeleteTimeLeft );
        }