Merchants: Difference between revisions

68 bytes removed ,  17:06, 25 March 2022
m
no edit summary
m (update color of math formulas from black to white)
Tag: Reverted
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 4: Line 4:
== Restocking ==
== Restocking ==


Merchants do not keep their wares: they rotate their stock around every 5 to 8 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 8 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]].
Line 18: Line 18:
When the merchant is first created, LastRestock tick is set to
When the merchant is first created, LastRestock tick is set to


<math>\color{White}\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}( \frac{RestockFrequency}{2}, RestockFrequency)</math>
<math>\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}( \frac{RestockFrequency}{2}, RestockFrequency)</math>


which substitutes to
which substitutes to


<math>\color{White}\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}(3000, 6000)</math>
<math>\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}(3000, 6000)</math>


Every EndTurn, this is called:
Every EndTurn, this is called:
Line 28: Line 28:
If the current in game turn count-LastRestockTick is greater than RestockFrequency, LastRestockTick is set to equal the current GameTick.  
If the current in game turn count-LastRestockTick is greater than RestockFrequency, LastRestockTick is set to equal the current GameTick.  


<math>\color{White}\text{num1} = \text{InGameTurn} - \text{LastRestockTick} \ge 6000</math> <math>\color{White}\rightarrow</math>
<math>\text{num1} = \text{InGameTurn} - \text{LastRestockTick} \ge 6000</math> <math>\rightarrow</math>


<math>\color{White}\text{RestockCheck} = \frac { \text{71}}{6000} \times \text{num1} </math>
<math>\text{RestockCheck} = \frac { \text{71}}{6000} \times \text{num1} </math>
<math>\color{White}\rightarrow</math>
<math>\rightarrow</math>


If <math>\color{White}\text{RestockCheck} \ge 100</math> or <math>\color{White}\text{RestockCheck} \ge \text{Random}(1,100)</math>,
If <math>\text{RestockCheck} \ge 100</math> or <math>\text{RestockCheck} \ge \text{Random}(1,100)</math>,


the merchant will restock. This means that about 8450-8451 turns (a little more over an ingame week) after the last restock must pass in order to guarantee a restock. The earliest that a merchant can restock is 6,000 turns, with a 71% chance of restocking, or 9,000 turns at a 100% restock if this is the first time the merchant restocks.
the merchant will restock. This means that about 8450-8451 turns (a little more over an ingame week) after the last restock must pass in order to guarantee a restock. The earliest that a merchant can restock is 6,000 turns, with a 71% chance of restocking, or 9,000 turns at a 100% restock if this is the first time the merchant restocks.
Line 44: Line 44:
For more details about trade prices, refer to the [[commerce]] page.
For more details about trade prices, refer to the [[commerce]] page.


==References==
<references/>
{{Mechanics Navbox}}
[[Category:Mechanics]]
[[Category:Mechanics]]
==References==
2,158

edits