SphereCommunity
Price of items sold by a vendor - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Price of items sold by a vendor (/Thread-Price-of-items-sold-by-a-vendor)



Price of items sold by a vendor - karma - 02-07-2016 10:09 PM

This is addressed to devs: how is the price of an item determined?
At a first glance it seems to be calculated from the quality, is also the value involved?


RE: Price of items sold by a vendor - Abuelox - 02-13-2016 07:04 PM

From my point of view, I think that putting the Value of each item you sell will also depending on its quality, will have to try every "quality" as you cut that price
Sorry my English.


RE: Price of items sold by a vendor - Coruja - 02-14-2016 03:58 PM

I think it just use the formula: item value + vendormarkup%
(vendormarkup is 15% by default, unless you change it manually using VENDORMARKUP on every vendor or TAG.VENDORMARKUP on region)

so using an item with VALUE=100 as example, the vendor will sell this item for 115gp (100+15) and buy it for 85gp (100-15)


RE: Price of items sold by a vendor - ForesteR - 02-15-2016 02:41 AM

ty for explain!


RE: Price of items sold by a vendor - karma - 02-16-2016 10:06 PM

Can you point me where in the source the VALUE item property is stored?
The price of the transaction is correct, you pay the correct value, but in the shop list the price isn't correct. For example, if i sell a cake on different vendors the price shown will be one time 40, another 42, 45, etc, but i will always pay 38 gp. Of course i have not set any VENDORMARKUP.


RE: Price of items sold by a vendor - Coruja - 02-17-2016 01:49 AM

both buy/sell codes are on these same lines
https://github.com/Sphereserver/Source/blob/d561360af34a8dc97b56ea0312861b47ac5fb1c9/src/graysvr/CClientEvent.cpp#L991

it seems that "buy" command is only using vendormarkup and "sell" is using item quality + vendormarkup


RE: Price of items sold by a vendor - karma - 02-17-2016 07:27 PM

Solved, thanks ^^


RE: Price of items sold by a vendor - Khaos - 02-19-2016 12:00 AM

Well it is more than that: Okay. Everything Coruja said is exactly right, but what is being left out is that if there is no value set to an item that Sphere will calculate item value based on value of every item in the RESOURCES= Property.

If you want items to sell at a normal price, set your tag.vendormarkup with a value of -15. You can then override this on each vendor and set the tag to those vendors. I keep tossing around editing the source to add in more code handling for the value itself. It used to be value=<1_val>,<2_val> with 1 being for buy value and 2 for sell value. Which is what I think should truly be done, because even EA, sell values are 50% of item cost and they increment/decreases prices based on sales that day on that vendor. It is actually interesting how they handled their commerce. Another thought was to avoid two values per item and just edit tag.vendormarkup into two tags. Tag.vendorbuymarkup and tag.vendorsellmarkup. This would give more control over buy/sell prices.

Personally I like both ends of it. Like you could charge 100,000 gp for an item and have it only sell back for 1gp. Which is the most precise control. But the tag idea would be more for a mass control versus individual. Maybe both would be ideal.