Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. public static implicit operator byte[](SpawnEntityPacket packet)
  2. {
  3. byte[] data = new byte[80 + packet.Names.Length];//100
  4. fixed (byte* ptr = data)
  5. {
  6. PacketBuilder.AppendHeader(ptr, data.Length, 1014);
  7. *((uint*)(ptr + 4)) = packet.UID;
  8. *((uint*)(ptr + 8)) = packet.Lookface;
  9. *((ClientEffect*)(ptr + 12)) = packet.StatusEffects;
  10. *((uint*)(ptr + 20)) = packet.GuildID;
  11. *((byte*)(ptr + 23)) = packet.GuildRank;
  12. *((uint*)(ptr + 24)) = packet.DisguiseGarmentType != 0 ? packet.DisguiseGarmentType : packet.GarmentType;
  13. *((uint*)(ptr + 28)) = packet.HelmetType;
  14. *((uint*)(ptr + 32)) = packet.ArmorType;
  15. *((uint*)(ptr + 36)) = packet.WeaponRType;
  16. *((uint*)(ptr + 40)) = packet.WeaponLType;
  17.  
  18. //48 uint realted to hp?
  19.  
  20. *((ushort*)(ptr + 44)) = (ushort)packet.MaximumLife;
  21. *((ushort*)(ptr + 48)) = (ushort)packet.Life;
  22. *((ushort*)(ptr + 50)) = packet.Level;
  23.  
  24. *((ushort*)(ptr + 52)) = packet.PositionX;
  25. *((ushort*)(ptr + 54)) = packet.PositionY;
  26. *((ushort*)(ptr + 56)) = packet.Hair;
  27. *(ptr + 58) = packet.Direction;
  28. *(ptr + 59) = (byte)packet.Action;
  29. *(ptr + 60) = packet.RebornCount;
  30. *((ushort*)(ptr + 62)) = packet.Level;
  31. *((byte*)(ptr + 68)) = packet.Nobility;
  32. *((uint*)(ptr + 72)) = packet.UID;//REMOVE ME?
  33. *((uint*)(ptr + 76)) = packet.NobilityRank;
  34. PacketBuilder.AppendNetStringPacker(ptr + 80, packet.Names);
  35. }
  36. return data;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement