Difference between revisions of "Merchants"
(Created page with "{{As Of Patch|2.0.185.1}} Merchants are NPCs that sell their goods and restock on a semi random basis. ==Restocking== Merchants restock randomly according to their Chance and...") |
m (→Restocking) |
||
Line 10: | Line 10: | ||
which substitutes to |
which substitutes to |
||
− | <math>\text{LastRestockTick} = \text{TickOnCreation} + \text{ |
+ | <math>\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}(3000, 6000)</math> |
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. |
||
Line 19: | Line 19: | ||
<math>\rightarrow</math> |
<math>\rightarrow</math> |
||
− | If <math>\text{RestockCheck} \ge 100</math> or <math>\text{RestockCheck} \ge \text{ |
+ | 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. |
Revision as of 17:33, 24 July 2019
This information is reliable as of patch 2.0.185.1. If this is no longer the current patch, you can help by updating it. |
Merchants are NPCs that sell their goods and restock on a semi random basis.
Restocking
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 Stat.Random() to find a random integer between half the restock frequency and the restock frequency:^{[1]}
When the merchant is first created, LastRestock tick is set to
which substitutes to
If the current in game turn count-LastRestockTick is greater than RestockFrequency, LastRestockTick is set to equal the current GameTick.
If or ,
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.
If a merchant is holding a quest item, they will not destroy the quest item during restock. any other item that contains the tag norestock
will also not be restocked. Merchants that are following the player do not restock, and if the player is also a merchant via Domination, they will not restock.
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 Code page 437 character from 1-254 (in decimal) excluding all alphanumerics, &, ^, and white space.^{[2]}