Item ID

From Sylverant
Jump to navigationJump to search

Item IDs are treated somewhat strangely by PSO... Here's a few notes regarding them that I've figured out from what I've learned thus far...

The first client (whose client ID is 1) in a lobby's Item IDs are (when a game starts) 0x0021xxxx, where xxxx is as described in the next paragraph. This is regardless of what the character data says when the game starts. The second client (whose client ID is 2) in a lobby's Item IDs are formed similarly, but are 0x0041xxxx. The third person in the lobby (client ID 3) has Item IDs of the form 0x0061xxxx. The last person in a lobby (with client ID 0) is formed as 0x0001xxxx. Thus, if divided into two parts (an upper word and a lower word), the upper word is formed as follows: ((client ID << 5) | 0x0001). The lower word is the index within the items for that client ID (see paragraph below for the lower word).

If no client has been in a given slot, the lower word will start from 0x0000 and count up to whatever is in their inventory. If a client has been in a given slot, the item IDs start from where that earlier client left off. For instance, if the client with ID 1, and their highest item ID was 0x00210011, the next person that comes in and gets assigned client ID 1, their first item ID starts from 0x00210012. What happens when it overflows, I have no idea (by then, it'd most likely have to be safe to go back to 0x0000 as the base).

When an item is picked up in-game, the item ID does not change from what the item on the ground said it was. It will change when the user leaves the lobby (to match what is stated above), but will not actually change in the character's data until the user logs off. When a user picks up an item that is stackable (Monomate, for instance), if they already have a stack of them, the new item gets added to the current stack (and thus inherits the current stack's ID).

Meseta has an Item ID when its on the ground, but does not appear in the user's inventory (it is stored elsewhere in the character data). Removing meseta from a user is done by using a delete item message (Packet 0x60, Subcommand 0x29) with the Item ID set to 0xFFFFFFFF.