http://www.runuo.com/forums/custom-script-releases/79568-runuo-2-0-rc1-randomized-vendor-prices-amounts.html I never liked the fact that every vendor charges the exact same for a given item, pays the same for said item, and has the same quantity of that item for sale. I wanted some variation in all of the above to simulate a real economy a bit better. After a bit of mashing up code, I came up with the following changes. The result is that buy and sell prices, as well as the amounts, are randomized when the vendor is initially spawned. Each vendor therefore has his or her own pricing scale, meaning that you might want to shop around before purchasing or selling large quantities of items. It adds a bit more roleplay to the game. The system uses the default sb* files without changes. Originally I was editting every one of them heavily, but was pointed towards modifying the loading functions instead (thanks Lord_Greywolf and Sotho Tal Ker). The functions use the base amounts listed in the sb* files and randomize them as follows: Purchasing from vendor(set in GetRandBuyPriceFor()) Min. Price - 80% of listed price Max. Price 130% of listed price Selling to a vendor(set in GetRandSellPriceFor()) Min. Price - 70% of listed price Max. Price - 120% of listed price Amount of item vendor carries(set in GetRandAmountFor()) Min. Amount - 40% of listed amount Max. Amount - 160% of listed amount You can change the min and max values to whatever you prefer. The functions are weighted so that the majority of the time the values are roughly what's listed in the sb* files, with occasional values much higher or lower. Optionally, you can force the vendor to randomize these numbers every time they restock, rather than only when they're spawned, to better simulate the changing prices in a real economy. Three files are modified: genericbuy.cs, genericsell.cs, and optionally, basevendor.cs. These are all located in the .\scripts\mobiles\vendors\ folder. GenericBuy.cs Change: Code: public GenericBuyInfo( string name, Type type, int price, int amount, int itemID, int hue, object[] args ) { amount = 20; m_Type = type; m_Price = price; m_MaxAmount = m_Amount = amount; m_ItemID = itemID; m_Hue = hue; m_Args = args; if ( name == null ) m_Name = (1020000 + (itemID & 0x3FFF)).ToString(); else m_Name = name; }to Code: public GenericBuyInfo( string name, Type type, int price, int amount, int itemID, int hue, object[] args ) { //amount = 20; m_Type = type; m_Price = GetRandBuyPriceFor( price ); m_MaxAmount = m_Amount = GetRandBuyAmountFor( amount ); m_ItemID = itemID; m_Hue = hue; m_Args = args; if ( name == null ) m_Name = (1020000 + (itemID & 0x3FFF)).ToString(); else m_Name = name; }Just above the following: Code: public virtual void OnRestock() //may be public void OnRestock() { if ( m_Amount <= 0 ) {add this: Code: public static int GetRandBuyPriceFor( int itemPrice ) { int lowPrice = (int)( .8 * itemPrice ); int highPrice = (int)( 1.3 * itemPrice ); int price = 0; for ( int i = 1; i <= 3; i++ ) { price += Utility.RandomMinMax( lowPrice, highPrice ); } price /= 3; if ( price < 1 ) price = 1; return price; } public static int GetRandBuyAmountFor( int itemAmount ) { int lowAmount = (int)( .4 * itemAmount ); int highAmount = (int)( 1.6 * itemAmount ); int amount = 0; for ( int i = 1; i <= 3; i++ ) { amount += Utility.RandomMinMax( lowAmount, highAmount ); } amount /= 3; if ( amount < 1 ) amount = 1; return amount; }GenericSell.cs Change: Code: public void Add( Type type, int price ) { m_Table[type] = price; m_Types = null; }to Code: public void Add( Type type, int price ) { m_Table[type] = GetRandSellPriceFor( price ); m_Types = null; } public static int GetRandSellPriceFor( int itemPrice ) { int lowPrice = (int)( .7 * itemPrice ); int highPrice = (int)( 1.2 * itemPrice ); int price = 0; for ( int i = 1; i <= 3; i++ ) { price += Utility.RandomMinMax( lowPrice, highPrice ); } price /= 3; if ( price < 1 ) price = 1; return price; }Basevendor.cs (Optional, only if you want everything randomized upon every restock) Just below: Code: public virtual void Restock() { m_LastRestock = DateTime.Now;add this: Code: LoadSBInfo();I've attached copies of GenericBuy.cs and GenericSell.cs for those who have unmodified RunUO distros. If you've modified these files, either follow the above instructions or use WinMerge. I haven't included Basevendor.cs because the change is optional, it's one line, and many other packages also modify basevendor, so it's likely you'd need to manually make the change anyway.