Virtual Player Vendor (PlayerVendor Bot)

Virtual Player Vendor (PlayerVendor Bot) 1.1

No permission to download
Virtual Player Vendor (PlayerVendor Bot)
A low-population/solo shard player vendor system by Gadget2013.

1592488708631.png


Version: 1.1

Out-of-the-box (drag and drop) compatible with: RunUO 2.2, RunUO 2.4.1, RunUO 2.6, RunUO 2.7 (build 28382), ServUO Publish 54, ServUO Publish 55.1, ServUO Publish 56.1, ServUO Publish 57.

Also potentially compatible with other versions of RunUO and ServUO, including customized shard code bases, but installing on a different version of a server or a heavily customized server will require a certain degree of manual intervention to install and integrate the system. The amount of work involved will depend on how different your server is from one of the reference implementations mentioned above when it comes to the player vendor code, the housing system, the AoS attributes implementation, and the SBInfo buy/sell lists.

For detailed information on installing, configuring, and using this system, including installing it on a customized server, please consult the included README file.

Mainly tested with the AoS rule set, but some rudimentary support for Pre-AoS rule sets has been implemented (to be improved in future releases).

This system is provided "as is", with no warranty of fitness for your needs and purposes or of potential compatibility with your code base. You are free to integrate this system in your shard if you feel the need, as well as to make alterations to the system to fit your shard as necessary. If you use this system in your shard, all I'm asking for is for you to give me credit for the original idea and implementation.

What is this system?

Virtual Player Vendor is a configurable extension for the Player Vendor system in RunUO and ServUO servers, which implements the ability to sell items to virtual bot adventurers at randomly determined time intervals. This might be helpful on low-population shards or on solo shards where using player vendors is normally not viable or where their usefulness is highly limited. The general premise of using the Virtual Player Vendor is similar to the original RunUO/ServUO player vendor: a player would deploy the player vendor at his house using the employment contract, then stock him with items, defining prices and giving them optional descriptions if desired. At random time intervals, the player vendor will generate a number of virtual requests from "bot adventurers" who might be willing to buy the items. Each request will have a maximum price associated with it which defines how much that virtual adventurer would be willing to pay for the item at maximum. To generate this price, the system will take the base price of the item at a NPC vendor (using SBInfo lists), then consider the number and the quality of properties the item has such as its attributes and their intensities, its maximum durability, etc. and factor those in, then add some random fluctuation to the price within the defined ranges. Random SBInfo lists will be chosen at each sales iteration, thus, the item may either be valued appropriately or be valued at 1 gold as a base price (e.g. if a weapon is considered but the appropriate SBInfos weren't chosen randomly for the iteration), this simulates the fact that not all virtual bot adventurers may be equally interested in all the items they are potentially "looking" at. If the price set by the player for the item is less than or equal to the price in the virtual bot request, the item is sold and the player vendor receives the amount of gold specified by the player for the item. The player vendor will record the sale of the item and will remember, by default, up to 50 items sold last. The vendor can report the sales to the player (in the form "<name> bought the <item> for <X> gold") and will also respond to some additional keywords when spoken to (name, job, etc. - see below). The recent sales list can be cleared at will using the "new" keyword or some alternative keywords. Just like with a traditional player vendor, certain items can be given away for free by specifying the price of 0 gp, and containers can be used to organize the items (see below for instructions).

Using the system

Using the system as a player is straightforward. Once a player vendor is deployed at your house, its basic functionality should still work the same way as without the Virtual Player Vendor system: you can start stocking the vendor's inventory with items and assigning prices and descriptions to them if necessary, just as you normally would. The descriptions are only used for flavor when it comes to the Virtual Player Vendor system, but the vendor will advertise the items using your custom descriptions if the random advertisements are enabled in the system. If your server supports vendor search (e.g. a recent build of ServUO), items placed on player vendors supporting Virtual Player Vendor system should still be searchable via vendor search. All other player vendor functionality should also be intact and function as designed, for example, the ability to dress the player vendor via a paperdoll.

If the item has been placed on the vendor for a long time and it doesn't sell, it may be an indication of the fact that the item may be overpriced. Consider reducing the price of the item in that case. However, always keep in mind that it may also mean that the item simply hasn't found its virtual buyer yet, so be sure to give the item a good amount of time to sell in case you believe the price for the item is fair. If, during the course of the game, you find that it's too easy or too hard to sell items using the Virtual Player Vendor system for what you believe would be a fair price for the item, consider revising and updating the settings that determine the pricing of items (check the "Configuring the system" section in the README file for details).

If you sell several items at once in a stacking pile (e.g. bandages, potions, etc.), make sure you specify the total price for the entire stack, not the price for a single item. The whole stack will be sold at once, partial sales will not take place.

You can organize the items on your player vendor into containers (bags, chests, etc.). There are two ways to use containers in the Virtual Player Vendor system. The most common way would be to mark the container as being not for sale (by assigning only a description to it with no price or by assigning a negative price to it), and then to use the container to store items of a particular type or types for easier classification and reference by the player(s). Another, less obvious and more niche use, is to assign a price to the container, in which case all the items can be purchased as a batch by the virtual adventurer for the assigned price (if the total price for all the items is deemed fair).

Please note that if you use containers with the Virtual Player Vendor system, containers inside containers are not supported. If you put a container inside another container, anything within that inner container will not be considered for virtual bot sale by the system.

When the item sells, if you're in the immediate vicinity of the player vendor, he will announce the sale (virtual buyers have random names assigned to them), for example: Calder bought a Legendary Black Sword for 1000 gold. This information will be remembered (by default, up to 50 last sales are remembered by the player vendor), and you can ask the player vendor to report on the last sales that were performed. To do that, say the vendor's name followed by the word "report"/"recent"/"sales" and optionally the number of sales that you want the vendor to report. For example, if the vendor's name is Elbereth, saying "Elbereth report" will make the vendor report the last five sales made. Saying "Elbereth report 20" will make the vendor report the last twenty sales (if that many were made), be sure to check the Journal to see the full log since the overhead message will be too short to incorporate the entire list. If you say "Elbereth report 1", you will only see the last sale made. You can alternatively refer to the player vendor using the keyword "vendor", e.g.: "vendor report" - that will make the closest player vendor report to you.

An item can be given away for free. To do it, specify the price of 0 gold for the item. Generally, items like that will be taken off the vendor quite quickly, and an entry will be made in the list of sales specifying that the virtual adventurer has taken the item for free.

The price of 999 gp for the item is considered a special case. Items priced at 999 gp will not be sold to virtual bot adventurers. The reason for that is that this price is assigned automatically by the player vendor as soon as the item is placed in the vendor's inventory and remains set to 999 until you type a different price. If this price were treated normally, it would have been possible for a virtual bot sale to happen before the player is given enough time to type in the item price and description, which is generally undesirable for items that you would like to value higher than that.

If you would like to clear the list of remembered sales, you can use the keyword "new", "clear", "wipe", or "forget" after the vendor's name, for example: "Elbereth forget" or "Elbereth, make a new list".

The player vendor will also respond to some basic keywords for communication, mostly to provide the basic explanation of the operation of the system and to provide the minimal interaction with the player. The keywords supported out of the box are:

name - The player vendor will respond with his name.
job, work, profession, occupation, explain - the player vendor will briefly explain his job.
sell, item - The player vendor will explain what needs to be done to put an item up for sale.
price - The player vendor will briefly comment on pricing the item.
description - The player vendor will briefly comment on giving items a description.
free - The player vendor will briefly comment on giving away items for free.
bag, container, chest - The player vendor will briefly comment on how containers can be used with the system.
payment, charge - The player vendor will explain that he charges for his service.
coin, money, currency - The player vendor will explain that he takes gold for his services.
copper, jewel - The player vendor will say that only gold is accepted as currency.
hello, hail, greetings - The player vendor will greet the player.
goodbye, bye, farewell - The player vendor will say goodbye to the player.

If player vendor advertisements are enabled, the Virtual Player Vendor will advertise items put on it at certain intervals. These advertisements don't have any special function and are made purely for flavor and entertainment. If you don't want to see these advertisements (which also saves you a timer per player vendor), you can disable them in PlayerVendorBot.cs. If you use the advertisements, user-written item descriptions will be used when available, otherwise, item names will be used. Normally, the vendor will use item names and descriptions in random short phrases (e.g. "Hurry, hurry! <Item name> for sale!"). However, it's also possible to specify a full-line custom advertisement by prefixing the item description with the "at" sign (@), for example: "@Wonderful artifact sword only at our store!" (without quotation marks).

Caveats

- Due to the nature of the algorithm determining the maximum price of items for virtual bot adventurers, not all the items in Ultima Online can be properly valued by the system and thus sold through it. In particular, the pricing depends on the item of the given type being present in at least one of the NPC vendor sell lists (SBInfo lists) and on any additional attributes that the item may have that may be evaluated (most AoS and pre-AoS attributes are supported at this point for this purpose). If the item is missing from the NPC vendor sell lists and it doesn't have any additional AoS/Pre-AoS properties supported by the system, the Virtual Player Vendor will value an item like that at either 0 gold or at 1 gold.

- In the current implementation, only the virtual transactions go into the list of reported recent sales, human player-made purchases are not accounted in those lists. This functionality may be expanded in the future to account for human-made purchases as well.

- As of right now, the Virtual Player Vendor doesn't simulate any form of virtual economy to modify the price of the item depending on how rare the item is or how commonly an item like that is being bought/sold, although there are some ideas for a potential future implementation of an algorithm that would do something like that.

- Not all of the bundled versions of the systems for various servers and their revisions underwent extensive testing at this moment. In particular, RunUO 2.6, RunUO 2.7, ServUO 54, and ServUO 55.1 builds only received superficial testing at this point. If you encounter any issues with these implementations, you may report it as a bug.

- Virtual Player Vendor has been tested on a couple deployed RunUO 2.2 and ServUO 56.1 server code bases for a long time and has proven to run crashless if properly installed and set up. However, bugs are always possible. If you run into a crash on a sale, be sure to check the AoS intensity lists in PlayerVendorBot.cs for correspondence to the attribute lists on your server, especially if your server is heavily customized (see the "Installation" section in the README file). If you still experience a crash after revising and correcting those lists, please report this as a bug and include as detailed information as possible regarding the crash (and the stack trace that you receive).

Changelog

v1.1 (June 20, 2020):
- It is now possible to use the keyword "vendor" to refer to the player vendor, which helps in case you are running several player vendors and would like to have a key binding or a macro set up to address all of them regardless of the name. For example, you can use "vendor report" or "vendor new" instead of using the actual vendor's name now. If you have several player vendors set up, the one closest to you will respond to this request.
Author
Gadget2013
Downloads
145
Views
2,401
First release
Last update
Rating
5.00 star(s) 2 ratings

More resources from Gadget2013

Latest Updates

  1. Version 1.1

    - It is now possible to use the keyword "vendor" to refer to the player vendor, which helps in...
Back