API:GuildGetRewards
From RoR Wiki
UI Lua API · Guild functions
Version: WAR 1.4.8
Returns the list of rewards that guilds unlock as they gain guild ranks.
rewards = GuildGetRewards()
Arguments
None.
Returns
- rewards
table– Array of reward tables, indexed from 1. Empty if the client has no reward data.
Each reward table has these fields:
| Key | Type | Meaning |
|---|---|---|
rank |
number |
Guild rank the reward belongs to. |
tacticId |
number |
Tactic id. The stock UI treats -2 as "one reward plus a tactic point", -1 as no tactic, and -101 as the heraldry reward. |
realm |
number |
Realm of the reward. The stock UI adds an _ORDER suffix to the string id when it is 1.
|
sortOrder |
number |
Sort position among rewards of the same rank. The stock UI treats 0 as "not set". |
rewardNum |
number |
Reward number within the rank. The stock UI uses it to build the string id GUILD_RANK<rank>_REWARD<rewardNum>.
|
Details
- A comment in the stock UI describes the list as coming from a
.csvfile. - A new table is built on every call.
Errors
None.
Example
From default/ea_guildwindow/source/guildwindowtabrewards.lua:
local guildRewards = GuildGetRewards()
for k, v in ipairs(guildRewards) do
if(v.sortOrder == 0)
then
v.sortOrder = nil
end
if(v.tacticId == GuildWindowTabRewards.TACTICID_SINGLE_REWARD_AND_TACTIC)
then
AddSingleRewardAndTacticPoint(v.rank)
else
AddGuildRewardData(v.rank, v.tacticId, v.realm, v.sortOrder, v.rewardNum)
end
end
