For a while I was having a problem with free items, so I made a simple solution (albeit not a perfect one) in SQL:
Code:
update items set cost = ( 10 * ( reclevel + hp + ac + mana + 100 ) ) where reclevel > 0;
That takes any item with a recommended level, adds the reclevel, hp, ac, and mana together, adds 100 to it (in case those values were zero) and multiplies that by 10. It actually gives a pretty fair price estimate.
To catch any other items from being free:
Code:
update items set cost = 1000 where cost = 0;
Easy as that. Not a perfect fix, but better than the players running around with freebies.
EDIT:
Okay, this one works for all items, skipping bags. Food will be pretty cheap, but for my world that doesn't bother me. It accounts for haste in a big way (about 100 platinum per 1%, so Flowing Black Silk Sash costs around 2000 platinum).
Code:
update items set cost = ( 100 * ( reclevel + reqlevel + ( hp * 10 ) + ( ac * 10 ) + ( mana * 10 ) + ( aagi * 10 ) + ( acha * 10 ) + ( asta * 10 ) + ( astr * 10 ) + ( adex * 10 ) + ( awis * 10 ) + 1 ) + ( hasteproclvl * 100000 ) ) where ( bagtype = 0 );
This will probably end up with some odd prices, but with this formula I've gotten Flowing Black Silk Sash to the price I intended, so the rest should even out. Note that cost is in copper pieces.
EDIT:
Now, for items with resists. The above formulas ignored them, but the next one is designed to be ran AFTER you run the updated version (the one with haste). The command line can only take so many characters so I had to make this one after. It assumes that each point of resistance is worth 10 platinum. (I'm trying to encourage hunting.)
Code:
update items set cost = ( cost + ( cr * 10000 ) + ( dr * 10000 ) + ( pr * 10000 ) + ( mr * 10000 ) + (fr * 10000 ) ) where ( bagtype = 0 ) and ( ( cr + dr + pr + mr + fr ) > 0 );
The very last part checks to see if there is actually any value in the resists. If not, it skips the item, since the above command already figured the cost.
EDIT:
I've put the commands into .sql format. You can get them
here.
EDIT:
As this stands, this will set your horse (and likely drogmor, haven't checked) prices to less than 2 gold.
EDIT:
Included in the file: it now fixes mount prices, back to relatively normal prices.