General discussions : Selling items with diminishing returns?
You should be logged in to post a new reply.
April 6, 2013, 1:53 pm
Posts: 14
As I was selling gold bars to the trader, I noticed the value of each successive bar was lower than the previous. This is also true for the iron armor. Can you only sell at the maximum value a certain number of times? Is there an algorithm determining the selling prices per item of the same type sold?
April 7, 2013, 11:49 pm
Posts: 346
Hi :),

You are right, the price of some of the items depend on the number of items you have bought/sold to the shopkeeper.

The more you buy them, the more expensive they are.
The more you sell them, the less expensive they are.

The price is determined by:

ceil( max( 1, basePrice + (numberOfBoughtItems - numberOfSoldItems) * X * taxes ) )

Where X varies from one object to another.
And Taxes is 1.0 when you buy an object and 0.7 when you sell it.

There are not limits on the number of objects you can sell. However, the selling price converges (and reaches) one coin.
You should be logged in to post a new reply.