Template:StoreTraderGold: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
(Fix the math.)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#cargo_store:_table = trader_gold}}</includeonly><noinclude>
<includeonly><onlyinclude>{{#expr:  
{{#cargo_declare:
<!-- Each gold pile is 4-9 coins. -->
_table = trader_gold
{{#if:{{{upper|}}}
|level = Integer. The level of the trader.
| 9
|wealth = String (allowed values=poor,modest,wealthy,extremelyrich). The wealth level of the trader.
| 4
|gold_min = Integer. The lower bound of the trader's gold.
|gold_max = Integer. The upper bound of the trader's gold.
}}
}}


Simple template to store data in the gold table.
*
<!-- ST_Gold_Trader_Part range -->
{{#af_get:{{#af_list:0|5|6|7|8|9|10|11|12|13|14|15|16}}|{{{1}}} }}


level = Integer. The level of the trader.
*
 
{{#switch: {{{2}}}
|poor = {{#if:{{{upper|}}}|4|3}}
|modest = {{#if:{{{upper|}}}|8|6}}
|normal = {{#if:{{{upper|}}}|15|10}}
|wealthy = {{#if:{{{upper|}}}|27|22}}
|extremelyrich = {{#if:{{{upper|}}}|60|60}}
}}
 
}}</onlyinclude></includeonly><noinclude>
 
Looks up trader gold value. Accomplishes this by looking their number of gold piles in two very cursed embedded arrays (one for lower, one for upper). Finally, multiply depending on the trader's wealth.
 
This is a very elementary template and should probably not be used directly.
 
param 1 = The level of the trader.
 
param 2 = (allowed values=poor,modest,wealthy,extremelyrich). The wealth level of the trader.
 
upper = Whether to get the upper amount of gold. If empty, will get lower amount.
 
Examples:
* lv1 Poor trader should have {{StoreTraderGold|1|poor}} ~ {{StoreTraderGold|1|poor|upper=true}} gold.
** lv3 Poor trader would have {{StoreTraderGold|3|poor}} ~ {{StoreTraderGold|3|poor|upper=true}} gold.
* lv5 Normal trader should have {{StoreTraderGold|5|normal}} ~ {{StoreTraderGold|5|normal|upper=true}} gold.
* lv12 Extremely Rich trader should have {{StoreTraderGold|12|extremelyrich}} ~ {{StoreTraderGold|12|extremelyrich|upper=true}} gold.


wealth = String (allowed values=poor,modest,wealthy,extremelyrich). The wealth level of the trader.


gold_min = Integer. The lower bound of the trader's gold.


gold_max = Integer. The upper bound of the trader's gold.
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 17:59, 18 September 2023


Looks up trader gold value. Accomplishes this by looking their number of gold piles in two very cursed embedded arrays (one for lower, one for upper). Finally, multiply depending on the trader's wealth.

This is a very elementary template and should probably not be used directly.

param 1 = The level of the trader.

param 2 = (allowed values=poor,modest,wealthy,extremelyrich). The wealth level of the trader.

upper = Whether to get the upper amount of gold. If empty, will get lower amount.

Examples:

  • lv1 Poor trader should have 60 ~ 180 gold.
    • lv3 Poor trader would have 84 ~ 252 gold.
  • lv5 Normal trader should have 360 ~ 1215 gold.
  • lv12 Extremely Rich trader should have 3840 ~ 8640 gold.