Merchant Nodes:
A quick note: The terms “vendor” and
“merchant” are used interchangeably in this document.
Merchant nodes handle all
speech events for npcs that interact regularly with players. bankers,
stable masters, and all normal merchants are controlled under this
system. These NPCs WILL NOT interact with players if they are not
controlled by a merchant node.
Features:
Merchant nodes control all
vendor restocking, and will queue restock cycles so they do not happen
all at once. Thus distributing system load over a longer period of time.
Merchant nodes do all listening
for their linked merchants.. the merchants themselves no longer handle
speech events.. This results in lower overall CPU utilization and much
more user-friendly interaction for the players in game.
Only the closest NPC within line of sight (LOS) and no
greater than 4 tiles away from the player will receive the speech
event. So the player can always choose which NPC he wishes to interact
with by positioning himself closest to the NPC.
Vendors will keep items sold to them from players and will
alter the buy/sell price of those items to reflect quality and
condition. If a vendor does not sell the item after 2 restock cycles,
he will liquidate the items back into gold currency to use for
replenishing his stock and buying new goods..
Vendors have a limited amount of gold to work with. As a
vendor buys and sells goods, his pool of available gold will increase
or decrease. Players that sell a lot of items to NPCs will find that
the NPC cannot afford to purchase anymore items and may not be able to
afford to restock his normal stock of items.
Vendors spend their profit to restock their own regular
inventory. Once a vendor runs out of money, he must sell some of his
current stock before he can restock to normal levels..
When a vendor sells out of a particular item in a given
stock cycle, he will attempt to purchase an increased amount during his
next restock. This amount may increase up to 20 X his base value.. if a
vendor does not sell the elevated items, he will stop stocking them
until he reaches his base inventory
and then continue from that base..