Merchants: Difference between revisions
Jump to navigation
Jump to search
(add note abt named merchants in villages) |
m (formatting; Template:Code Reference) |
||
Line 2: | Line 2: | ||
Merchants are NPCs that sell their goods and restock on a semi random basis. The first one the player will see will be {{favilink|Tam}}. For villages with procedurally generated named merchants, they will be {{qud text|&Wyellow}} and have a bonus +3 to [[Ego]]. | Merchants are NPCs that sell their goods and restock on a semi random basis. The first one the player will see will be {{favilink|Tam}}. For villages with procedurally generated named merchants, they will be {{qud text|&Wyellow}} and have a bonus +3 to [[Ego]]. | ||
==Restocking== | == Restocking == | ||
Merchants do not keep their wares: they rotate their stock around every 5 to 7 in game days(for more detailed math, view [[#In depth restocking formula]]). When a merchant restocks, their trading inventory is refreshed and new items will repopulate the inventory. These items will generally be of similar tier and type as the initial stock. | Merchants do not keep their wares: they rotate their stock around every 5 to 7 in game days(for more detailed math, view [[#In depth restocking formula]]). When a merchant restocks, their trading inventory is refreshed and new items will repopulate the inventory. These items will generally be of similar tier and type as the initial stock. | ||
For how the trading system works, check [[Commerce]]. | For how the trading system works, check [[Commerce]]. | ||
==Legendary Merchants== | == Legendary Merchants == | ||
Merchants have a chance of spawning Legendary Merchants, loyal to the [[Merchants' Guild]]. They live in their own lairs, and are always guarded by two random hired guards. All stock will contain the Maker's Mark of the Merchant, which is a random [[Modding: Code page 437|Code page 437]] character from 1-254 (in decimal) excluding all alphanumerics, &, ^, and white space. | |||
Merchants have a chance of spawning Legendary Merchants, loyal to the [[Merchants' Guild]]. They live in their own lairs, and are always guarded by two random hired guards. All stock will contain the Maker's Mark of the Merchant, which is a random [[Modding: Code page 437|Code page 437]] character from 1-254 (in decimal) excluding all alphanumerics, &, ^, and white space.{{Code Reference | namespace = XRL.World.ZoneBuilders | class = HeroMaker | method = MakeHero}} | |||
== In-depth Restocking Formula == | |||
Merchants restock randomly according to their Chance and Restock Frequency. LastRestockTick is the last ingameTick that they have refreshed their wares. Currently, Chance is specified as 71, and RestockFrequency is 5 ingame days, or 6,000 ticks. It calls [[Modding:Random Functions|<code>Stat.Random()</code>]] to find a random integer between half the restock frequency and the restock frequency:{{Code Reference | class = GenericInventoryRestocker}} | |||
Merchants restock randomly according to their Chance and Restock Frequency. LastRestockTick is the last ingameTick that they have refreshed their wares. Currently, Chance is specified as 71, and RestockFrequency is 5 ingame days, or 6,000 ticks. It calls [[Modding: Random Functions|Stat.Random()]] to find a random integer between half the restock frequency and the restock frequency: | |||
When the merchant is first created, LastRestock tick is set to | When the merchant is first created, LastRestock tick is set to |