Files
2026-08-24 22:20:36 +02:00

23 lines
746 B
JavaScript

/*
@Packet name EntityDie
@Packet identifier 143
@Description Sends the death information to the nearby players
@Data pId, deadEntityTypeId, entityId, lastShotEntityTypeID, lastShotId
@Structure -
*/
module.exports = function (data) {
const packetLength = 12 + 1;
const buffer = new ArrayBuffer(packetLength);
const view = new DataView(buffer);
view.setUint8(0, 143);
view.setUint8(1, packetLength);
view.setUint8(2, data.typeID);
view.setUint32(3, data.targetID);
view.setUint8(7, data.lastShotTypeID);
view.setUint32(8, data.lastShotID);
view.setUint8(12, data.targetEntityTypeID);
return buffer;
};