const AttackAbortedPacket = require("../Packets/AttackAborted"); const constants = require("../Data/constants"); const { TYPES } = constants; const { ENTITY_TYPE_NPC } = TYPES; module.exports = function (ws, message, player) { const targetIdentifier = player.abortAttack(); if (!targetIdentifier) return; const packet = AttackAbortedPacket({ authorID: targetIdentifier.id, authorTypeID: targetIdentifier.typeID, targetID: player.id, targetTypeID: player.typeID }); player.map.registerIndividualNetworkPacket(player.id, packet); if (targetIdentifier.typeID === ENTITY_TYPE_NPC) { const target = player.map.getEntityFromSubgroup(targetIdentifier.id); if (!target) return; target.determineMovementState(); }; };