-
Notifications
You must be signed in to change notification settings - Fork 4
/
show-effect-packet.ts
61 lines (56 loc) · 1.46 KB
/
show-effect-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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { Writer } from '../../writer';
import { Reader } from '../../reader';
import { PacketType } from '../../packet-type';
import { Packet } from '../../packet';
import { WorldPosData } from '../../data/world-pos-data';
/**
* Received to tell the player to display an effect such as an AOE grenade.
*/
export class ShowEffectPacket implements Packet {
type = PacketType.SHOWEFFECT;
propagate = true;
//#region packet-specific members
/**
* The type of effect to display.
*/
effectType: number;
/**
* > Unknown. Probably the start position of the effect.
*/
targetObjectId: number;
/**
* > Unknown. Probably the end position of the effect.
*/
pos1: WorldPosData;
/**
* > Unknown.
*/
pos2: WorldPosData;
/**
* The color of the effect.
*/
color: number;
/**
* The duration of the effect.
*/
duration: number;
//#endregion
read(reader: Reader): void {
this.effectType = reader.readUnsignedByte();
this.targetObjectId = reader.readInt32();
this.pos1 = new WorldPosData();
this.pos1.read(reader);
this.pos2 = new WorldPosData();
this.pos2.read(reader);
this.color = reader.readInt32();
this.duration = reader.readFloat();
}
write(writer: Writer): void {
writer.writeUnsignedByte(this.effectType);
writer.writeInt32(this.targetObjectId);
this.pos1.write(writer);
this.pos2.write(writer);
writer.writeInt32(this.color);
writer.writeFloat(this.duration);
}
}