3
edits
m (update color of math formulas from black to white) Tag: Reverted |
m (→Restocking: Fix broken Link) |
||
(One intermediate revision by one other user 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 | 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> | <math>\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}( \frac{RestockFrequency}{2}, RestockFrequency)</math> | ||
which substitutes to | which substitutes to | ||
<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> | <math>\text{num1} = \text{InGameTurn} - \text{LastRestockTick} \ge 6000</math> <math>\rightarrow</math> | ||
<math> | <math>\text{RestockCheck} = \frac { \text{71}}{6000} \times \text{num1} </math> | ||
<math> | <math>\rightarrow</math> | ||
If <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. |
edits