I was wanting to make this change because the standard 10 item limit in most vendor shops was not appealing to me, so to go about this I had to modify the halfQuantity which I've got working. The only issue I seem to be having is the vendor restocking itself. I can manually restock by [restock or [Global restock but other than that, it's still broken. Any help would be much appreciated :)

C#:
        public void OnRestock()
        {
            if ( m_Amount <= 0 )
            {
                /*
                    Core.ML using this vendor system is undefined behavior, so being
                    as it lends itself to an abusable exploit to cause ingame havok
                    and the stackable items are not found to be over 20 items, this is
                    changed until there is a better solution.
                */

                object Obj_Disp = GetDisplayEntity();

                if( Core.ML && Obj_Disp is Item && !( Obj_Disp as Item ).Stackable )
                {
                    m_MaxAmount = Math.Min( 20, m_MaxAmount );
                }
                else
                {
                    m_MaxAmount = Math.Min( 20000, m_MaxAmount * 1 );
                }
            }
            else
            {
                /* NOTE: According to UO.com, the quantity is halved if the item does not reach 0
                 * Here we implement differently: the quantity is halved only if less than half
                 * of the maximum quantity was bought. That is, if more than half is sold, then
                 * there's clearly a demand and we should not cut down on the stock.
                 */

                int halfQuantity = m_MaxAmount;

                if ( halfQuantity >= 20001 )
                    halfQuantity = 20000;
                else if ( halfQuantity > 20 )
                    halfQuantity /= 1;

                if ( m_Amount >= halfQuantity )
                    m_MaxAmount = halfQuantity;
                    halfQuantity /= 1;
Post automatically merged:

Post automatically merged:

line 38-40 is a typo
Post automatically merged:

To put it simply, all I'm looking for is the vendors to maintain the item amounts that I have set for them in the designated SBshops. I don't want for it to x2 increase if there's a high demand nor /2 if there's is no demand.
Post automatically merged:

Nvm, I think I found an alternative path that isn't quite what I'm looking for but it will do. I mimicked the original settings but instead of vendors starting with a 10 count I changed it to 100 and remodified the cap to 5k. Here's my settings to save any the hassle who's looking to do the same.
C#:
        public void OnRestock()
        {
            if ( m_Amount <= 0 )
            {
                /*
                    Core.ML using this vendor system is undefined behavior, so being
                    as it lends itself to an abusable exploit to cause ingame havok
                    and the stackable items are not found to be over 20 items, this is
                    changed until there is a better solution.
                */

                object Obj_Disp = GetDisplayEntity();

                if( Core.ML && Obj_Disp is Item && !( Obj_Disp as Item ).Stackable )
                {
                    m_MaxAmount = Math.Min( 200, m_MaxAmount );
                }
                else
                {
                    m_MaxAmount = Math.Min( 5000, m_MaxAmount * 2 );
                }
            }
            else
            {
                /* NOTE: According to UO.com, the quantity is halved if the item does not reach 0
                 * Here we implement differently: the quantity is halved only if less than half
                 * of the maximum quantity was bought. That is, if more than half is sold, then
                 * there's clearly a demand and we should not cut down on the stock.
                 */

                int halfQuantity = m_MaxAmount;

                if ( halfQuantity >= 5000 )
                    halfQuantity = 2500;
                else if ( halfQuantity > 200 )
                    halfQuantity /= 2;

                if ( m_Amount >= halfQuantity )
                    m_MaxAmount = halfQuantity;
 
Last edited:
Back