-
Notifications
You must be signed in to change notification settings - Fork 4
/
reskin-pet-packet.ts
39 lines (34 loc) · 999 Bytes
/
reskin-pet-packet.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { Writer } from '../../../writer';
import { Reader } from '../../../reader';
import { PacketType } from '../../../packet-type';
import { Packet } from '../../../packet';
import { SlotObjectData } from '../../../data';
/**
* Sent to make an update to the pet currently following the player.
*/
export class ReskinPetPacket implements Packet {
type = PacketType.PET_CHANGE_FORM_MSG;
propagate = true;
//#region packet-specific members
/**
* The instance id of the pet to update.
*/
instanceId: number;
/**
* The pet type that the pet will become after the form change.
*/
newPetType: number;
item: SlotObjectData;
//#endregion
write(writer: Writer): void {
writer.writeInt32(this.instanceId);
writer.writeByte(this.newPetType);
this.item.write(writer);
}
read(reader: Reader): void {
this.instanceId = reader.readInt32();
this.newPetType = reader.readByte();
this.item = new SlotObjectData();
this.item.read(reader);
}
}