API:TomeGetOldWorldArmoryArmorSet
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns an armor set of the Tome of Knowledge Old World Armory with its pieces.
setData = TomeGetOldWorldArmoryArmorSet(armorSetId)
Arguments
- armorSetId
number– Armor set id, as in TomeGetOldWorldArmoryTOC. Only the low 16 bits are used.
Returns
- setData
table– The set's data, or nothing if the id is invalid, the set is locked, or the player's data is not available.
| Key | Type | Meaning |
|---|---|---|
id |
number |
Armor set id. |
name |
wstring |
Name of the set; empty if the name table is not loaded. |
pieces |
table |
Array of piece tables (see below). |
Each piece table in pieces:
| Key | Type | Meaning |
|---|---|---|
itemData |
table |
Item data table of the piece for the player. Missing when the client has no item data for the piece; the stock UI skips such pieces. |
unlocked |
boolean |
Whether the player has unlocked the piece. |
Details
- The piece item can differ between characters; the client picks it using the player's own data.
- Exactly one argument must be passed.
Errors
These are written to the UI log, and the function returns nothing.
Error in function call 'TomeGetOldWorldArmoryArmorSet': %d is not a valid armor set id.Error in function call 'TomeGetOldWorldArmoryArmorSet': %d is not unlocked.
Example
From default/ea_tomeofknowledge/source/tomewindow_oldworldarmory.lua:
local setData = TomeGetOldWorldArmoryArmorSet( armorSetId )
if not setData
...
for index, itemInfo in ipairs( setData.pieces )
do
if( not itemInfo.itemData )
...
LabelSetText( fullItemWindowName.."Name", itemInfo.itemData.name )
ButtonSetPressedFlag( fullItemWindowName.."CompletedBtn", itemInfo.unlocked )
