It will help to use correctly refactored client as reference.
What you call lockon, is index of the targeted NPC.
Code:
if (opcode == 117) {
int sourcePos = buffer.readUByte();
int sourceX = localX + (sourcePos >> 4 & 7);
int sourceZ = localZ + (sourcePos & 7);
int destinationX = sourceX + buffer.readByte();
int destinationY = sourceZ + buffer.readByte();
int target = buffer.readShort();
int graphic = buffer.readUShort();
int sourceElevationOffset = buffer.readUByte() * 4;
int destinationElevation = buffer.readUByte() * 4;
int ticksToEnd = buffer.readUShort();
int ticksToStart = buffer.readUShort();
int elevationPitch = buffer.readUByte();
int leapScale = buffer.readUByte();
if (sourceX >= 0 && sourceZ >= 0 && sourceX < 104 && sourceZ < 104
&& destinationX >= 0 && destinationY >= 0
&& destinationX < 104 && destinationY < 104
&& graphic != 65535) {
sourceX = sourceX * 128 + 64;
sourceZ = sourceZ * 128 + 64;
destinationX = destinationX * 128 + 64;
destinationY = destinationY * 128 + 64;
Projectile projectile = new Projectile(sourceX, sourceZ,
getFloorDrawHeight(sourceX, sourceZ, plane)
- sourceElevationOffset, destinationElevation,
elevationPitch, ticksToStart + tick, ticksToEnd + tick,
leapScale, plane, target, graphic);
projectile.target(destinationX, destinationY,
getFloorDrawHeight(destinationX, destinationY, plane)
- destinationElevation, ticksToEnd + tick);
projectiles.pushBack(projectile);
}
}
in the projectile process code we see:
Code:
if (projectile.target > 0) {
Npc npc = npcs[projectile.target - 1];
if (npc != null && npc.sceneX >= 0 && npc.sceneX < 13312
&& npc.sceneZ >= 0 && npc.sceneZ < 13312) {
projectile
.target(npc.sceneX,
npc.sceneZ,
getFloorDrawHeight(npc.sceneX,
npc.sceneZ, projectile.plane)
- projectile.destinationElevation,
tick);
}
}
if (projectile.target < 0) {
int index = -projectile.target - 1;
Player player;
if (index == localPlayerIndex) {
player = localPlayer;
} else {
player = players[index];
}
if (player != null && player.sceneX >= 0
&& player.sceneX < 13312 && player.sceneZ >= 0
&& player.sceneZ < 13312) {
projectile
.target(player.sceneX,
player.sceneZ,
getFloorDrawHeight(player.sceneX,
player.sceneZ, projectile.plane)
- projectile.destinationElevation,
tick);
}
}
so to remove the "lock on", try sending -1 in place of NPC index.