User:Malgalad/Links research

From Guild Wars 2 Wiki
Jump to: navigation, search

Items[edit]

Items links in-game are presented in special encoded formatting: [&AgEBWgAA]. It is constructed from the two parts: AgEBWgAA contains information and [& ] is needed to distinguish normal text and links. The AgEBWgAA is a w:Base64 encoded string, decoding it gives you another string with mainly unprintable characters. Then this string is converted into it's numeric representation, according to w:ASCII character table: 2 1 1 90 0 0 in decimal or 0x02 0x01 0x01 0x5a 0x00 0x00 in w:hexademical radix. We will work in decimal radix since it is more human-friendly.

Normal items[edit]

2 Q B1 B2 0 F, where:

  • 2 const.
type of the subsequent link, 2 is used for item links.
  • Q 1 byte, 0..255
quantity of the item, usually 1.
  • B1, B2 1 byte each, 0..255
2 bytes representing ID of the item. Bytes are written in w:little endian numbering, i.e. the least significant byte value is at the lowest address.
B1 is the lowest address, and it takes values from 0 to 255
B2 is the second address, and it's value should be multiplied by 256, i.e. 0 10 means 0+10*256=2560
Together they can form any number from 0+0*256=0 to 255+255*256=65535, which is the actual item ID.
  • 0 F 1 byte each, 0..255
and empty byte and flag byte, that will be described later.

Example[edit]

Lets take our old friend [&AgEBWgAA], since we already decrypted it in 2 1 1 90 0 0. Here we have:

2
means this is the item link
1
means that this is only one item
1 90
means that the item ID is 1+90*256=23041 (which is Fine Salvage Kit)
0 0
means that the flag byte is unused.