public SetItemState(UnitType ownerType, uint ownerUID, uint itemUID, ItemStateType state) : base(Build(ownerType, ownerUID, itemUID, state)) { this.ownerType = ownerType; this.ownerUID = ownerUID; this.itemUID = itemUID; this.state = state; this.state2 = state; }
public static byte[] Build(UnitType ownerType, uint ownerUID, uint itemUID, ItemStateType state) { byte[] buffer = new byte[0x12]; buffer[0] = 0x7d; buffer[1] = (byte) ownerType; buffer[2] = (byte) ownerUID; buffer[3] = (byte) (ownerUID >> 8); buffer[4] = (byte) (ownerUID >> 0x10); buffer[5] = (byte) (ownerUID >> 0x18); buffer[6] = (byte) itemUID; buffer[7] = (byte) (itemUID >> 8); buffer[8] = (byte) (itemUID >> 0x10); buffer[9] = (byte) (itemUID >> 0x18); buffer[11] = (byte) state; buffer[12] = (byte) (((int) state) >> 8); buffer[13] = (byte) (((int) state) >> 0x10); buffer[14] = (byte) (((int) state) >> 0x18); buffer[15] = (byte) state; buffer[0x10] = (byte) (((ushort) state) >> 8); return buffer; }
// Methods public SetItemState(byte[] data) : base(data) { this.ownerType = (UnitType) data[1]; this.ownerUID = BitConverter.ToUInt32(data, 2); this.itemUID = BitConverter.ToUInt32(data, 6); this.unknown10 = data[10]; this.state = (ItemStateType) BitConverter.ToUInt32(data, 11); this.state2 = (ItemStateType) BitConverter.ToUInt16(data, 15); this.unknown17 = data[0x11]; }