lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO Libraries

Category: LotRO LibrariesItem Links Decoding
Interface Information
Download
How do I install this? (FAQ)
Name: Item Links Decoding   Popular!
Author:
Date: 01-26-2014 08:16 AM
Size: 13.51 Kb
Version: 1.1
Rate File: 5 out of 5 with 3 votes  
Description
What is this ?

As per request as well as to whoever may find it useful, here is a collection of lua routines to 'decode' and extract useful information from item links in the LotRO chat.

See this thread for background information regarding the problem that spawned this: http://forums.lotro.com/showthread.p...th-missing-IDs

How to use

- Unzip the archive into a location of your choice
- Alter paths in '__init__.lua' to the correct location (since Turbine's 'import' does not handle relative paths, sadly)

In your project:
- Import the relevant folder (ie: import "myname.myplugin.ItemLinkDecode"; )

- Call DecodeLinkData( data, isLI ) on a string extracted from the chat. 'data' must be an encoded string from an item link, either from <ExamineIA:IAInfo:*> or <ExamineItemInstance:ItemInfo:*>

eg:
Code:
local data, name = string.match( chatLine, "<ExamineIA:IAInfo:(.-)>(%b[])<\\ExamineIA>" )
local result = ItemLinkDecode.DecodeLinkData( data, true);
or
Code:
local data, name = string.match( chatLine, "<ExamineItemInstance:ItemInfo:(.-)>(%b[])<\\ExamineItemInstance>"
local result = ItemLinkDecode.DecodeLinkData( data, false);
The function returns a table with the following fields:

itemIIDLow - instance item ID, least significant 32 bits
itemIIDHigh - instance item ID, most significant 32 bits
itemGID - generic item ID
itemCraftedBy - name of the crafter
itemBoundToLow - ID of player / account / placeholder ID to which the item is bound, least significant 32 bits
itemBoundToHigh - ID of player / account / placeholder ID to which the item is bound, most significant 32 bits
itemTrueLevel - true level of the item, can be > level to equip
itemName - name of the (crafted) item
itemLevel - level of the item (to equip)
itemUpgrades - number of upgrades (crystals)
itemWorth - worth of the item (in copper coins)
itemQuantity - number of items in stack (if relevant)
itemStorageInfo - where the item is stored (32bits, needs further decoding)
itemDye - color of the item
itemBindToAccount - whether the item binds to account
itemBindOnAcquire - whether the item binds on acquire
itemArmour - armour value of the item

liName - name of LI as named by the player (as opposed to crafted name)
liTitleID - ID to a LI title if applied
liLegacies - a table of legacies { { ID-1, rank-1 }, { ID-2, rank-2 } ... {ID-n, rank-n) }
liRelics - a table of relics { { ID-1, slot-1 }, { ID-2, slot-2 } .. {ID-n, slot-n} }, where 'slot' is a number between 1-4 refering to setting/gem/rune/crafted.
liStats - a table of stats { ID-1, ID-2, ... ID-n }
liPointsSpent - legendary points that have been spent
liPointsLeft - legendary points that are left to spend
liDPSRank - rank of the DPS legacy if a melee/ranged weapon
liDefaultLegacyID - ID of the 'default' legacy if not a melee/ranged weapon (Tactical Damage Rating, Tactical Healing Rating, Shield Use, etc)
liDefaultLegacyRank - rank of the afore mentioned 'default' legacy if not a melee/ranged weapon
liLevel - Level of the LI (1-70)
liMaxHit - max hit of melee damage range, in single precision floating point format (IEEE 754-2008) (represented as a 32 bits integer), for 'tactical' weapons (LM staff, minstrel weapon, RK stone).
- Min hit and dps can be computed thus:
- Min hit = 3/5 of max hit.
- DPS = (4/5 of max hit) / (attack duration of weapon) - attack duration is 2.5s for 2h, 1.9s for 1h


Code snippet using my plugin HereBeDragons to browse results from links posted to the chat:

Code:
import "myname.myplugin.ItemLinkDecode";
import "Equendil.LuaExplorer.DefaultBrowser";

local chatHook = function (sender, args)
	local LIData, name = string.match( args.Message, "<ExamineIA:IAInfo:(.*)>(%b[])<\\ExamineIA>" ); 
	if LIData ~= nil then
		local result = ItemLinkDecode.DecodeLinkData( LIData, true );
		Equendil.LuaExplorer.Explore( name, result );
		return;
	end
	
	local itemData, name = string.match( args.Message, "<ExamineItemInstance:ItemInfo:(.*)>(%b[])<\\ExamineItemInstance>" );
	if itemData ~= nil then
		local result = ItemLinkDecode.DecodeLinkData( itemData, false );
		Equendil.LuaExplorer.Explore( name, result );
	end
end

-- install the chat hook
if type(Turbine.Chat.Received) == "table" then
	table.insert( Turbine.Chat.Received, chatHook );
else
	local existingHook = Turbine.Chat.Received;
	Turbine.Chat.Received = { chatHook, existingHook };
end
Attribution

The implementation of the zlib inflate algorithm was written by David Manura. Check the license in "inflate.lua".

Feel free to copy, alter, use or re-distribute this package, crediting the author would be nice, however (("Equendil" @ http://www.lotrointerface.com/list.php?skinnerid=4226).
Archive List (Old Versions)
File Name
Version
Size
Author
Date
1
13.40 Kb
Equendil
06-30-2013 06:42 PM
File Statistics
User Rating:
5 out of 5 with 3 votes
Downloads: 12918
Views: 37352
Favorites: 6
Uploaded By:
 
Last Modified: N/A

View Pictures. Download Now! Post A Comment


Post A Reply
Author Comments Comment Options
Unread 08-18-2015, 08:23 AM  
Garan
The Undying
 
Garan's Avatar
Interface Author - Click to view interfaces

Forum posts: 340
File comments: 980
Uploads: 20
Quote:
Originally Posted by nico
is there a way to retrieve the real id (0x700377FB) from the first part of the shortcut ?

Thanks in advance.
Short answer: no

Long answer:
Items can have unique IDs and generic IDs. The first part of an item ID (before the comma) is the unique ID - this is a server ID plus a unique item ID which can be resolved on the server to uniquely identify instances of an item (typically items that can be dyed or have other unique properties). The generic ID is the part after the comma and (when available) is generic (undyed in the case of a Hauberk) for every instance of that item on every server. Oddly, when items have a unique ID assigned, the generic portion of the ID usually gets set to all zeros but there are cases where both parts of the ID are set. We've asked Turbine to always provide the generic ID so that we can identify the generic item type but they never responded.

Last edited by Garan : 08-18-2015 at 12:51 PM.
Garan is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 08-18-2015, 07:02 AM  
nico
The Wary

Forum posts: 1
File comments: 1
Uploads: 0
Hello,

It is different for the links with "Select:IID" (= shortcut)

For example, for "Hauberk of the Hammerhand", ID = 1879275515 (0x700377FB)
I get, from quickslot GetShortcut():GetData() :

* Arkenstone
0x03070003EE00D089,0x00000000

* Brandywine
0x03020005A139F4C8,0x00000000

From other tests, I can see that the first bytes are the server (Arkenstone = 0x0307)
but is there a way to retrieve the real id (0x700377FB) from the first part of the shortcut ?

Thanks in advance.
nico is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 02-02-2014, 03:08 PM  
Equendil
The Undying
Interface Author - Click to view interfaces

Forum posts: 52
File comments: 125
Uploads: 5
Thanks !

Reimplementing zlib in lua was a lot of fun Though I just grabbed someone else's code here, for decompression. Compression as used in my plugin LIP, on the other hand, well, that gave me a few headaches

Last edited by Equendil : 02-02-2014 at 03:09 PM.
Equendil is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 02-01-2014, 09:12 AM  
Thurallor
The Undying
 
Thurallor's Avatar
Interface Author - Click to view interfaces

Forum posts: 202
File comments: 456
Uploads: 20
You put zlib in a LOTRO plugin.

Audacity +10.

Nice work in the reverse engineering task overall.
Thurallor is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 01-27-2014, 04:57 AM  
Equendil
The Undying
Interface Author - Click to view interfaces

Forum posts: 52
File comments: 125
Uploads: 5
Previously 'Unknown' fields added:

itemDye - color of the item
itemBindToAccount - whether the item binds to account
itemBindOnAcquire - whether the item binds on acquire
itemArmour - armour value of the item

Thanks to "Xiv" & "bopozhej" & the nice folks of the Russian LotRO community.

Last edited by Equendil : 01-27-2014 at 04:58 AM.
Equendil is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 07-01-2013, 12:37 PM  
Equendil
The Undying
Interface Author - Click to view interfaces

Forum posts: 52
File comments: 125
Uploads: 5
Glad it does, I barely tested what I uploaded

Just an additional note: Decoding links involves a lot of nasty code since lua is not really suited to deal with data at the binary level. As much as possible, save link data from the chat and decode it later on user actions rather than on the fly. It could potentially make the game feel laggy otherwise in AOE situations with a lot of mobs are dropping loot.

That said, there isn't a lot of data to process, we're talking miliseconds here maybe.
Equendil is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 07-01-2013, 09:25 AM  
Galuhad
The Undying
 
Galuhad's Avatar
Interface Author - Click to view interfaces

Forum posts: 24
File comments: 170
Uploads: 20
Thank you Equendil

Edit: Have tried this to get the IDs from instanced items and it works perfectly.

Last edited by Galuhad : 07-01-2013 at 10:53 AM.
Galuhad is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 06-30-2013, 09:33 PM  
Equendil
The Undying
Interface Author - Click to view interfaces

Forum posts: 52
File comments: 125
Uploads: 5
I hope this will be useful to someone.

Please note that I messed up the paths in __init__.lua, "ItemDecode" should be "ItemLinkDecode". Having said that, you will have to alter paths anyway so they point to their real location within the plugin hierarchy.
Equendil is offline Report comment to moderator   Reply With Quote Reply With Quote
Post A Reply

 
Category Jump:
Search this Category:
 

All times are GMT -5. The time now is 04:12 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui