XConquer

Untitled

Jul 1st, 2015
210
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace CM.Arg.Network.GamePackets
  4. {
  5.     public class CharacterInfo : Writer, Interfaces.IPacket
  6.     {
  7.         Client.GameState client;
  8.         public CharacterInfo(Client.GameState _client)
  9.         {
  10.             client = _client;
  11.         }
  12.         public void Deserialize(byte[] buffer)
  13.         {
  14.             throw new NotImplementedException();
  15.         }
  16.         public byte[] ToArray()
  17.         {
  18.             byte[] Packet = new byte[138 + client.Entity.Spouse.Length + client.Entity.Name.Length];
  19.             WriteUInt16((ushort)(Packet.Length - 8), 0, Packet);
  20.             WriteUInt16(1006, 2, Packet);
  21.             WriteUInt32((uint)Time32.timeGetTime().GetHashCode(), 4, Packet);
  22.             WriteUInt32(client.Entity.UID, 8, Packet);
  23.             WriteUInt32(client.Entity.Mesh, 14, Packet);
  24.             WriteUInt16(client.Entity.HairStyle, 18, Packet);
  25.             WriteUInt32(client.Entity.Money, 20, Packet);
  26.             WriteUInt32((uint)client.Entity.ConquerPoints, 28, Packet);
  27.             WriteUInt64(client.Entity.Experience, 32, Packet);
  28.             WriteUInt16(client.Entity.Strength, 60, Packet);
  29.             WriteUInt16(client.Entity.Agility, 62, Packet);
  30.             WriteUInt16(client.Entity.Vitality, 64, Packet);
  31.             WriteUInt16(client.Entity.Spirit, 66, Packet);
  32.             WriteUInt16(client.Entity.Atributes, 68, Packet);
  33.             WriteUInt32(client.Entity.Hitpoints, 70, Packet);
  34.             WriteUInt16(client.Entity.Mana, 74, Packet);
  35.             WriteUInt16(client.Entity.PKPoints, 76, Packet);
  36.             Packet[78] = client.Entity.Level;
  37.             Packet[79] = client.Entity.Class;
  38.             Packet[80] = client.Entity.FirstRebornClass;
  39.             Packet[81] = client.Entity.SecondRebornClass;
  40.             Packet[83] = client.Entity.Reborn;
  41.             WriteUInt32(client.Entity.QuizPoints, 85, Packet);
  42.             WriteUInt32(1, 89, Packet);
  43.             WriteUInt16(0/*Client.Entity.ArgentinaPuntos*/, 93, Packet);
  44.             WriteByte(client.Entity.SubClasses.Active, 111, Packet);
  45.             WriteUInt32(client.Entity.SubClasses.GetHashPoint(), 112, Packet);
  46.             WriteUInt16((UInt16)client.Entity.MyTitle, 105, Packet);
  47.             Packet[119] = 1;
  48.             WriteUInt16((ushort)client.Entity.CountryID, 124, Packet);
  49.             Writer.WriteByte(3, 126, Packet);
  50.             Packet[127] = (byte)client.Entity.Name.Length;
  51.             Writer.WriteString(client.Entity.Name, 128, Packet);
  52.             Writer.WriteByte((byte)client.Entity.Spouse.Length, 129 + client.Entity.Name.Length, Packet);
  53.             Writer.WriteString(client.Entity.Spouse, 130 + client.Entity.Name.Length, Packet);
  54.             return Packet;
  55.         }
  56.         public void Send(Client.GameState client)
  57.         {
  58.             client.Send(ToArray());
  59.         }
  60.     }
  61. } // Implementado por Pezzi! Para Sources Normales
RAW Paste Data