Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
@Packet name Attacking
|
||||
@Packet identifier 140
|
||||
@Description Sends the attack's data to the nearby players
|
||||
@Data pId, authorTypeId, authorId, targetTypeId, targetId, damage, critical
|
||||
@Structure -
|
||||
*/
|
||||
|
||||
module.exports = function (data) {
|
||||
const packetLength = 17 + 1;
|
||||
const buffer = new ArrayBuffer(packetLength);
|
||||
const view = new DataView(buffer);
|
||||
|
||||
view.setUint8(0, 140);
|
||||
view.setUint8(1, packetLength);
|
||||
view.setUint8(2, data.authorTypeID);
|
||||
view.setUint32(3, data.authorID);
|
||||
view.setUint8(7, data.targetTypeID);
|
||||
view.setUint32(8, data.targetID);
|
||||
view.setUint32(12, data.damage);
|
||||
view.setUint8(16, +data.critical);
|
||||
view.setUint8(17, data.entityTypeID);
|
||||
|
||||
return buffer;
|
||||
};
|
||||
Reference in New Issue
Block a user