Overview
This template is used only within the Traveling merchant articles. It is a formatted cell template.
It is actually used to format output for the two or three adjacent cells that appear in the price range and chance (and brought) columns of the items bought and items sold tables.
When a merchant buys or sells a Resource, they do so at a random price. The game color codes these prices into five categories, ranging from very above average to very below average. The chance that a merchant will buy or sell a given resource itself is also random, and that probability is also displayed as part of this template's output.
For additional details regarding this class of template page, see {{F/C}} and {{F}}.
Colors and calculations
This template automatically colors the first price in red by default, coloring it instead in green if the item is sold by the merchant. In this way, unfavorable values are shown in red and favorable values in green. This direction of color coding is observed in all of the cells.
The probability that the merchant actually visits the settlement in a given year is calculated by the template thusly:
- probability = ( C1 + c2 + c3 + c4 + c5 ) / years
The sections of the probability bar (rendered in the chance column) are then sized accordingly, i.e. given a 50% chance that the merchant visited during a 30 year period and, when they did, they brought an item and offered it at a very low price a total of five times, that price will be reflected by a red section of the bar that is 17% of its total possible length.
Usage
{{F/C/ipr|p1|p2|p3|p4|p5|c1|c2|c3|c4|c5|years}} {{F/C/ipr|p1|p2|p3|p4|p5|c1|c2|c3|c4|c5|years|s=1|min|ave|max}}
- pX
- (required) The first five are the price parameters for each of the five colors, and are shown in the cell in the price range column.
- cX
- (required) The next five are the count parameters for each of the five colors.
- years
- (required) This is the number of in‑game years over which the data was collected.
- s=1
- (optional) This indicates that the item is being sold to the player, and that an additional "brought" cell must be rendered.
- min/ave/max
- (required when
s=1
) These are three values that are rendered in their respective color in the third cell.
Examples
For items that the merchant buys from you:
{{F/C/ipr|1|2|3|4|5|5|4|3|2|1|30}}
Item | Price range | Chance | Pairs with | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
example item |
|
|
example merchant |
For items that the merchant sells to you:
{{F/C/ipr|1|2|3|4|5|5|4|3|2|1|30|s=1|15|25|35}}
Item | Price range | Chance | Brought | Pairs with | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
example item |
|
|
|
example merchant |