Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static implicit operator byte[](SpawnEntityPacket packet)
- {
- byte[] data = new byte[80 + packet.Names.Length];//100
- fixed (byte* ptr = data)
- {
- PacketBuilder.AppendHeader(ptr, data.Length, 1014);
- *((uint*)(ptr + 4)) = packet.UID;
- *((uint*)(ptr + 8)) = packet.Lookface;
- *((ClientEffect*)(ptr + 12)) = packet.StatusEffects;
- *((uint*)(ptr + 20)) = packet.GuildID;
- *((byte*)(ptr + 23)) = packet.GuildRank;
- *((uint*)(ptr + 24)) = packet.DisguiseGarmentType != 0 ? packet.DisguiseGarmentType : packet.GarmentType;
- *((uint*)(ptr + 28)) = packet.HelmetType;
- *((uint*)(ptr + 32)) = packet.ArmorType;
- *((uint*)(ptr + 36)) = packet.WeaponRType;
- *((uint*)(ptr + 40)) = packet.WeaponLType;
- //48 uint realted to hp?
- *((ushort*)(ptr + 44)) = (ushort)packet.MaximumLife;
- *((ushort*)(ptr + 48)) = (ushort)packet.Life;
- *((ushort*)(ptr + 50)) = packet.Level;
- *((ushort*)(ptr + 52)) = packet.PositionX;
- *((ushort*)(ptr + 54)) = packet.PositionY;
- *((ushort*)(ptr + 56)) = packet.Hair;
- *(ptr + 58) = packet.Direction;
- *(ptr + 59) = (byte)packet.Action;
- *(ptr + 60) = packet.RebornCount;
- *((ushort*)(ptr + 62)) = packet.Level;
- *((byte*)(ptr + 68)) = packet.Nobility;
- *((uint*)(ptr + 72)) = packet.UID;//REMOVE ME?
- *((uint*)(ptr + 76)) = packet.NobilityRank;
- PacketBuilder.AppendNetStringPacker(ptr + 80, packet.Names);
- }
- return data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement