API:GetDatabaseItemData
From RoR Wiki
UI Lua API · Item functions
Version: WAR 1.4.8
Returns the data of an item by item id, from the client's item database.
item = GetDatabaseItemData(itemId)
Arguments
- itemId
number– Item id.
Returns
- item
table– An item data table, or nothing if the client has no entry for that id.
Details
- The item does not have to be in the player's possession. The table describes the client's stored record for the id, not a particular copy of the item.
- Exactly one argument must be passed.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
Opening a window for an item link clicked in chat, from default/ea_chatwindow/source/chathyperlinking.lua:
function EA_ChatWindow.CreateItemLinkWindow( itemId )
...
local itemData = GetDatabaseItemData( itemId )
if( not itemData )
then
-- Show an error message
return
end
