ItemLink

__NOTOC__
An item link consists of a data part and a text part. The text part allows using colors. The data part starts with the item id in hex and is followed by all basic items data. The data is seperated by spaces. 
All parts of the item link are hexadecial values. The data is seperated into blocks of 4 bytes (up to 8 digits hexadecimal). One block may contain 1 value with 4 bytes, 2 values with 2 bytes or 4 values with 1 byte.
== Basic Itemlink ==
|Hitem:<id> <bind type> <runes><plus><tiering><max dura> <stat><stat>*3 <rune>*4 <current dura> <hash>|h|cff<color>[<name>]|r|h
=== Data Part ===
:;id
::number in hex - the id of the item. If you skipp all remaining parts this will list the basic item without any stats, plussing, runes and whatever.
:;bind type
::number - bound status (1 = nonbindable ,2 = bound, 3 = boe)
:;runes
::number of rune slots (1 byte value stored in hex, 2 = 1 slot, 4 = 2 slots, 6 = 3 slots, 8 = 4 slots)
:;plus
::number - plussing of the item (1 byte value stored in hex)
:;tier
::number - tier of the item (0a = not tiered, any higher than that is + to default tier; 1 byte value stored in hex) 
:;max dura
::number - the usual maximum dura of the item (1 byte value stored in hex)
:;stat
::id - One of the 6 stats of the item. (2 byte value stored in hex, add a 7 to the beginning of the 2 byte hex and you have the stats ID number in hex, convert to decimal and you can find the stat's name using TEXT("Sys######_name")) 
:;rune
::itemid - the itemid of the rune 
:;current dura
::number - the actual dura multiplied by 100 (thus 112 current dura would result in 11200 so in hex "2BC0"; may be higher than max dura; for quest items should be 8000 in hex) 
:;hash
::number - two bytes hash code (See code below).
Note that the part <runes><plus><tiering><max dura> may also be used for other purposes if an item doesn't requires these values.
==Egg item itemlink==
|Hitem:<id> <bind type> <timestamp1> <timestamp2> <model> <talent points> <level><element><color> <str><00><Aptitude> <int><00><dex> <sta><00><wis> 0 <hash>|h|cff<color>[<name>]|r|h
=== Data Part ===
:;id
::id of egg item in hex
element	color	color	color	color 	color
element	White	Green	Blue 	Purple	Orange
None 	31edd	None 	31edb	31eda 	31edc
earth 	31ebc	31ec2	31ec8	31ece 	31ed4
water 	31ebd	31ec3	31ec9	31ecf 	31ed5
fire 	31ebe	31ec4	31eca	31ed0 	31ed6
wind 	31ebf	31ec5	31ecb	31ed1 	31ed7
light 	31ec0	31ec6	31ecc	31ed2 	31ed8
dark 	31ec1	31ec7	31ecd	31ed3 	31ed9
:;bind type
::currently only seen as 1 = nonbinable
:;timestap1
::seems to run up like a timestamp on each new egg found on the server
:;timestap2
::seems to run up like a timestamp on each new egg found on the server
:;model
::model\type of the creature in the egg
:;talent points
::TP to invest in passive skills
:;level
::level of pet in hex
:;element(*)
::element of pet (00 = earth, 01 = water, 02 = fire, 03 = wind, 04 = light, 05 = dark, ff = none, some blanks to fill in later)
:;color(*)
::color or rarity of the egg, this decides how strong the basestats are (01 = green, 02 = blue, 03 = purple, 04 = orange)
:;str
::strength multiplier under value
:;aptitude
::all stats multiplier under assist
:;int
::intelligence multiplier under value
:;dex
::dexterity multiplier under value
:;sta
::stamina multiplier under value
:;wis
::wisdom multiplier under value
:;(*)
::these itemlink stats are ignored and itemid is used for this information
== Text Part ==
You can use colors in the text part.
== Item Link Hash Calculation ==
The item link hash value is effectively the low word (16-bits) of a 32-bit CRC.
The following is code posted by Valacar on the UK forums, and has been released to the public domain.
Original forum thread discussing hash calculation can be seen here: https://forum.runesofmagic.com/showthread.php?p=2368150#post2368150
Forum thread with posted code can be seen here: https://forum.runesofmagic.com/showthread.php?t=280594
-- Runes of Magic item link hash calculation code
-- Author: Valacar (aka Duppy of the Runes of Magic US Osha server)
-- Release Date: September 12th, 2010
-- Credit goes to Neil Richardson for the xor, lshift, and rshift function
-- which I slightly modified. The original code can be found at:
-- http://luamemcached.googlecode.com/svn/trunk/CRC32.lua
-- I could care less what anyone does with the code (i.e. it's public domain),
-- but I'd very much appreciate being given credit (to me Valacar) if you do
-- use the code in any way.
-- Exclusive OR
local function xor(a, b)
 local calc = 0
 for i = 32, 0, -1 do
 local val = 2 ^ i
 local aa = false
 local bb = false
 if a == 0 then
 calc = calc + b
 break
 end
 if b == 0 then
 calc = calc + a
 break
 end
 if a >= val then
 aa = true
 a = a - val
 end
 if b >= val then
 bb = true
 b = b - val
 end
 if not (aa and bb) and (aa or bb) then
 calc = calc + val
 end
 end
 return calc
end
-- binary shift left
local function lshift(num, left)
 local res = num * (2 ^ left)
 return res % (2 ^ 32)
end
-- binary shift right
local function rshift(num, right)
 right = right % 0x20
 local res = num / (2 ^ right)
 return math.floor(res)
end
-- get lower word of a 32-bit number
local function loword(num)
 return rshift(lshift(num, 16), 16)
end
-- get high word of a 32-bit number
local function hiword(num)
 return rshift(num, 16) % 2^16
end
-- multiply two 32-bit numbers, but returns only the low dword of the 64-bit result
local function mymul(num1, num2)
 local x = loword(num2) * num1
 local y = (hiword(num2) * num1) * 2^16
 local a = hiword(x) + hiword(y)
 local b = loword(x)
 return (a * 2^16) + b
end
--//////////////////////////////////////////////////////////////////
-- Calculates hash value of an item based on first 11 hex numbers of an item link
local function CalculateItemLinkHash(values)
 assert(type(values) == "string", "Must pass a string to CalculateItemLinkHash consisting of 11 hex values separated by a space.")
 local num = { values:match("^(%x+)%s+(%x+)%s+(%x+)%s+(%x+)%s+(%x+)%s+(%x+)%s+(%x+)%s+(%x+)%s+(%x+)%s+(%x+)%s+(%x+)$") }
 assert(#num == 11, "11 hex values required!")
 local sum = 0
 for s = 1, 11 do
 num[s] = tonumber(num[s], 16)
 sum = sum + num[s]
 end
 local a,b,c,d,e,x,i = sum,0,0,0,0,0,0
 repeat
 d = num[x+1]
 b = d
 b = b * x
 b = b % 2^32
 e = d
 e = rshift(e, i)
 i = i + 0x10
 x = x + 1
 e = e + a
 e = e % 2^32
 b = b + e
 b = b % 2^32
 b = xor(b, d)
 a = b
 until (i >= 0xB0)
 local j = 0
 repeat
 d = num[j+1]
 c = d + 1
 c = mymul(c, a)
 c = c % 2^32
 a = d
 a = mymul(a, c)
 a = a % 2^32
 a = rshift(a, 16)
 a = a + c
 j = j + 1
 a = xor(a, d)
 until (j >= 0x0B)
 hash = loword(a)
 return hash
end
== References ==
* http://rom.curse.com/downloads/rom-addons/details/itempreview.aspx
* http://forum.us.runesofmagic.com/showthread.php?t=30368
* https://forum.runesofmagic.com/showthread.php?t=280594
* https://forum.runesofmagic.com/showthread.php?p=2368150#post2368150