i'm advice you to use uo.LastTile it mean that Z isn't of your char.
Look here:
Injection ask client to target apear then client own calculate target information and trying send it to server, but injectin catch this try.
Client send
Code:
Packet: 0x6C
Sent By: Both
Size: 19 Bytes
Packet Build
BYTE[1] cmd
BYTE[1] type
0x00 = Select Object
0x01 = Select X, Y, Z
BYTE[4] cursorID
BYTE[1] Cursor Type
0 = ?
1 = ?
2 = ?
3 = Cancel current targetting
The following are always sent but are only valid if sent by client
BYTE[4] Clicked On ID
BYTE[2] click xLoc
BYTE[2] click yLoc
BYTE unknown (0x00)
BYTE click zLoc
BYTE[2] model # (if a static tile, 0 if a map/landscape tile)
but injection haven't handle BYTE click zLoc of target as player Z, but it handle it as Tile information and u have access to it thought uo.LastTile(3)