public MacroUnequipItem(PacketReader reader, bool send) : base(reader, send)
		{
			reader.ReadUInt16();

            m_LayerCount = reader.ReadByte();
            for (int i = 0; i < (int)(m_LayerCount); i++)
			{
                m_LayerIds.Add(reader.ReadByte());
			}
		}
		public ContainerContentUpdate( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Serial = reader.ReadUInt32();
			m_ItemId = reader.ReadUInt16();

			reader.ReadByte();

			m_Amount = reader.ReadUInt16();
			m_X = reader.ReadInt16();
			m_Y = reader.ReadInt16();
            m_Grid = reader.ReadByte();
			m_ContSerial = reader.ReadUInt32();
			m_Hue = reader.ReadUInt16();
		}
		public LocalizedMessageAffix( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();
			m_ModelId = reader.ReadUInt16();
			m_SpeechType = reader.ReadByte();
			m_Hue = reader.ReadUInt16();
			m_Font = reader.ReadUInt16();
			m_Number = reader.ReadUInt32();
			m_AffixType = reader.ReadByte();
			m_SourceName = reader.ReadASCIIString( 30 );
			m_Affix = reader.ReadASCIIString();
			m_Append = reader.ReadUnicodeString();
		}
Exemple #4
0
		public PlaySound( PacketReader reader, bool send ) : base( reader, send )
		{
			m_SoundMode = reader.ReadByte();
			m_SoundId = reader.ReadUInt16();
			m_Unknown = reader.ReadInt16();
			m_Position = new Point3D( reader.ReadInt16(), reader.ReadInt16(), reader.ReadInt16() );
		}
Exemple #5
0
		public Gump( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			uint serial = reader.ReadUInt32();
			uint gumpId = reader.ReadUInt32();
			uint x = reader.ReadUInt32();
			uint y = reader.ReadUInt32();

			ushort layoutLength = reader.ReadUInt16();
			string layout = reader.ReadASCIIString( layoutLength - 1 );
			reader.ReadByte();

			ArrayList textList = new ArrayList();
			ushort n = reader.ReadUInt16();
			for ( int i = 0; i < n; i++ )
			{
				int length = reader.ReadUInt16() * 2;

				string s = reader.ReadUnicodeString( length );
				textList.Add( s );
			}
			string[] text = (string[])textList.ToArray( typeof( string ) );

			Init( serial, gumpId, x, y, layout, text );
		}
		public GraphicalEffect( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Type = reader.ReadByte();
			m_From = reader.ReadUInt32();
			m_To = reader.ReadUInt32();
			m_ItemId = reader.ReadUInt16();
			m_FromPoint = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_ToPoint = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_Speed = reader.ReadByte();
			m_Duration = reader.ReadByte();

			reader.ReadByte();
			reader.ReadByte();

			m_FixedDirection = reader.ReadBoolean();
			m_Explode = reader.ReadBoolean();
		}
        public MacroEquipItem(PacketReader reader, bool send) : base(reader, send)
		{
			reader.ReadUInt16();

            m_ItemCount = reader.ReadByte();
            for (int i = 0; i < (int)(m_ItemCount); i++)
			{
                m_ItemUids.Add(reader.ReadUInt32());
			}
		}
		public MobileAnimation( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Serial = reader.ReadUInt32();
			m_Action = reader.ReadUInt16();
			m_FrameCount = reader.ReadUInt16();
			m_RepeatCount = reader.ReadUInt16();
			m_Forward = !reader.ReadBoolean();
			m_Repeat = reader.ReadBoolean();
			m_Delay = reader.ReadByte();
		}
Exemple #9
0
		public WorldItem( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();
			m_ItemId = reader.ReadUInt16();

			if ( (m_Serial & 0x80000000) != 0 )
			{
				m_Serial &= ~0x80000000;
				m_Count = reader.ReadUInt16();
			}
			else
				m_Count = 0;

			if ( (m_ItemId & 0x8000) != 0 )
			{
				m_ItemId &= 0x7FFF;
				m_ItemId += reader.ReadByte();
			}

			ushort x = reader.ReadUInt16();
			ushort y = reader.ReadUInt16();

			if ( (x & 0x8000) != 0 )
				m_Direction = reader.ReadByte();
			else
				m_Direction = 0;

			sbyte z = reader.ReadSByte();

			if ( (y & 0x8000) != 0 )
				m_Hue = reader.ReadUInt16();
			else
				m_Hue = 0;

			if ( (y & 0x4000) != 0 )
				m_Flag = reader.ReadByte();
			else
				m_Flag = 0;

			m_Position = new Point3D( x & ~0x8000, y & ~0xC000, z );
		}
Exemple #10
0
		public static Packet Create( byte[] data, bool send )
		{
			PacketReader reader = new PacketReader( data );
			byte cmd = reader.ReadByte();

			Type type = m_Table[cmd];
			if ( type != null )
				return (Packet)Activator.CreateInstance( type, new object[] { reader, send } );
			else
				return new Packet( reader, send );
		}
Exemple #11
0
		public BookHeader( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();

			reader.ReadByte();

			m_Writable = reader.ReadBoolean();
			m_PagesCount = reader.ReadUInt16();

			int titleLength = reader.ReadUInt16() - 1;
			byte[] titleBuffer = reader.ReadBytes( titleLength );
			m_Title = Encoding.UTF8.GetString( titleBuffer );
			reader.ReadByte();

			int authorLength = reader.ReadUInt16() - 1;
			byte[] authorBuffer = reader.ReadBytes( authorLength );
			m_Author = Encoding.UTF8.GetString( authorBuffer );
			reader.ReadByte();
		}
		public ASCIIMessage( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();
			m_ModelId = reader.ReadUInt16();
			m_SpeechType = reader.ReadByte();
			m_Hue = reader.ReadUInt16();
			m_Font = reader.ReadUInt16();
			m_SourceName = reader.ReadASCIIString( 30 );
			m_Text = reader.ReadASCIIString();
		}
		public CorpseEquip( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();

			ArrayList list = new ArrayList();
			while ( true )
			{
				byte layer = reader.ReadByte();
				if ( layer == 0 )
					break;

				uint serial = reader.ReadUInt32();

				list.Add( new CorpseItem( (byte)(layer - 1), serial ) );
			}

			m_CorpseItems = (CorpseItem[])list.ToArray( typeof( CorpseItem ) );
		}
		public BookPageDetails( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();

			int pagesCount = reader.ReadUInt16();
			m_Pages = new BookPageInfo[pagesCount];

			for ( int i = 0; i < m_Pages.Length; i++ )
			{
				int index = reader.ReadUInt16();

				int linesCount = reader.ReadInt16();
				if ( linesCount < 0 )
				{
					m_Pages[i] = new BookPageInfo( index, true, new string[0] );
					continue;
				}

				string[] lines = new string[linesCount];

				for ( int j = 0; j < linesCount; j++ )
				{
					ArrayList buffer = new ArrayList();

					while ( true )
					{
						byte b = reader.ReadByte();

						if ( b != 0 )
						{
							buffer.Add( b );
						}
						else
						{
							byte[] bytes = (byte[])buffer.ToArray( typeof( byte ) );
							lines[j] = Encoding.UTF8.GetString( bytes );

							break;
						}
					}
				}

				m_Pages[i] = new BookPageInfo( index, false, lines );
			}
		}
Exemple #15
0
 public ReqMove(PacketReader reader, bool send) : base(reader, send)
 {
     m_Direction = reader.ReadByte();
     m_Sequence  = reader.ReadByte();
     m_Fastwalk  = reader.ReadUInt32();
 }
		public ParticleEffect( PacketReader reader, bool send ) : base( reader, send )
		{
			m_Type = reader.ReadByte();
			m_From = reader.ReadUInt32();
			m_To = reader.ReadUInt32();
			m_ItemId = reader.ReadUInt16();
			m_FromPoint = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_ToPoint = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_Speed = reader.ReadByte();
			m_Duration = reader.ReadByte();

			reader.ReadByte();
			reader.ReadByte();

			m_FixedDirection = reader.ReadBoolean();
			m_Explode = reader.ReadBoolean();
			m_Hue = reader.ReadUInt32();
			m_RenderMode = reader.ReadUInt32();
			m_Effect = reader.ReadUInt16();
			m_ExplodeEffect = reader.ReadUInt16();
			m_ExplodeSound = reader.ReadUInt16();
			m_Serial = reader.ReadUInt32();
			m_Layer = reader.ReadByte();
			m_Unknown = reader.ReadInt16();
		}
		public ContainerContent( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			ushort n = reader.ReadUInt16();
			m_ContainedItems = new ContainedItem[n];

			for ( int i = 0; i < n; i++ )
			{
				uint serial = reader.ReadUInt32();
				ushort itemId = reader.ReadUInt16();

				reader.ReadByte();

				ushort amount = reader.ReadUInt16();
				short x = reader.ReadInt16();
				short y = reader.ReadInt16();
                byte grid = reader.ReadByte();
				uint contSerial = reader.ReadUInt32();
				ushort hue = reader.ReadUInt16();

                m_ContainedItems[i] = new ContainedItem(serial, itemId, amount, x, y, grid, contSerial, hue);
			}
		}
		public MobileIncoming( PacketReader reader, bool send ) : base( reader, send )
		{
			reader.ReadUInt16();

			m_Serial = reader.ReadUInt32();
			m_ModelId = reader.ReadUInt16();
			m_Position = new Point3D( reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadSByte() );
			m_Direction = reader.ReadByte();
			m_Hue = reader.ReadUInt16();
			m_Flag = reader.ReadByte();
			m_Notoriety = reader.ReadByte();

			ArrayList list = new ArrayList();
			uint serial;
			while ( (serial = reader.ReadUInt32()) != 0 )
			{
				ushort itemId = reader.ReadUInt16();
				byte layer = reader.ReadByte();

				ushort hue;
				if ( (itemId & 0x8000) != 0 )
				{
					itemId &= 0x7FFF;
					hue = reader.ReadUInt16();
				}
				else
					hue = 0;

				list.Add( new EquipInfo( serial, itemId, layer, hue ) );
			}

			m_Equipment = (EquipInfo[])list.ToArray( typeof( EquipInfo ) );
		}