What triggers merchants to change their inventory?

So in the normal run of the game, it seems that the merchants always change their inventory when you come back to town. But if you leave town and come right back, they do not necessarily change.

To try and find out, I loaded up my Engineer, checked the Armorer and the Gem seller, walked out of town, and then waited 30 seconds before re-entering. I came in, checked their inventories, and left, which took about 20 seconds each time. That's a 50 second cycle, but I waited a full minute on my first town exit. The stated times include load screens (about 2 seconds in either direction; I started lap timers the moment load screens appeared).

It came to be that the gem seller changed just after 7 minutes and the armorer changed just before 8 minutes. In terms of time spent "outside" the town, gems reset at 4m45s minutes and armor reset at 5m45s.

I did nothing else beyond what was stated above. Just moved my character to change screens and clicked on the two merchants I was checking. This leads me to believe that time is the only factor in deciding when merchants reset, but can anyone continue this testing and determine an exact requirement?

Here is my data in an Excel spreadsheet. If anyone needs me to save it in an older Excel format, just let me know.


Recycled Steinin's answer:

Without looking at the game code it is hard to say. I did some experimentation and learned the following:

The reset time seems to be mostly dependent on time.

The items will not restock while you remain in town.

Teleporting back and forth repeatedly is not usually enough time to cause a restock.

The reset times appear to be separate for each merchant. I purchased an item from the blacksmith and then one from the gem seller some time apart (less than one minute). I then teleported in and out until the blacksmith reset. I then discovered that the gem seller had not reset.

Reset time is not dependent on number of loading screens. The merchants did not appear restock when I gated back to the dungeon right next to the stairs down, proceeded down one floor and teleported back immediately after arriving on the lower floor. The gem seller did restock if I waited about 3 minutes in the dungeon and then teleported back. The gem seller also restocked when I waited about 3 minutes in town, teleported to the dungeon and then back immediately.

After I examined these observations, I believe that the restock is primarily dependent on time. I believe the restock interval is less than 4 minutes but longer than 1 minute. The exact time is hard to establish using my method. My educated guess is that when you return to town, the game checks the time since last restock for each merchant and restocks if more time has passed than some set value. If the game restocks every x minutes while you are out of town is impossible to tell since you only get to see the latest restock.

Disclaimer: By teleporting I mean I used town scrolls. I tested all this on my level 51 vanquisher teleporting to and from the 42th floor of the shadow vault. I am using the following mods which affects Merchants: Better Balanced Sales Prices, Awful Arthur the fishmonger, Additional Gem Availability, Spell Dealer. None of their description say that they affect restock times.


The game will store a maximum of two town’s merchants at a time. This means if you are in the Minehead you can travel to the Imperial Camp, then Zeryphesh, then back to the Minehead, to reset the vendors in the Minehead.

From my experience I have found this to work on the four main towns, but not the Mapworks.

This is one way the vendors can reset.