Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetHeraldryBestOptions

From RoR Wiki

UI Lua API · Guild functions
Version: WAR 1.4.8

Returns the heraldry emblems, patterns and colours available for a race filter and banner shape.

options = GetHeraldryBestOptions(filterId, shape)

Arguments

filterId
number – Race filter. The stock heraldry editor uses 20 (all Destruction), 21 (Chaos), 22 (Dark Elf), 23 (Greenskin), 30 (all Order), 31 (Dwarf), 32 (Empire), 33 (High Elf).
shape
number – Banner shape. Only patterns for this shape are returned.

Returns

options
table – A table with three arrays, each indexed from 1.
Key Type Meaning
emblemList table Array of emblem ids (number).
patternList table Array of pattern ids (number) for the given shape.
colorList table Array of colour ids (number).

Details

  • Each "all" filter (20, 30) returns the union of the three race filters of that realm.
  • Any other filterId matches no race group.
  • The lists come from the client's heraldry data; the server is not contacted.
  • If there is no player object, or the Lua state is not available, the function returns nothing.
  • The function needs at least two arguments and only reads the last two.

Errors

None besides the generic Invalid Parameters message when an argument is not a number.

Example

From default/ea_guildwindow/source/heraldryeditor.lua:

HeraldryEditor.BestOptionsFiltered = GetHeraldryBestOptions(filterID, HeraldryEditor.CurrentShapeChoice)

HeraldryEditor.MaxPatternChoices = #HeraldryEditor.BestOptionsFiltered.patternList
HeraldryEditor.MaxEmblemChoices = #HeraldryEditor.BestOptionsFiltered.emblemList

See also