RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Making Large BOD's cumulative

Skarth

Wanderer
Making Large BOD's cumulative

I tested this on RunUO 1.0.0. Not sure if it will work on other versions.

I wouldn't feel right if I didn't give credit to Thraxus for this idea (not sure if it's his original thought or not, but I got it from him). I played on his server last year and before he upgraded his BOD system to a really advanced and awesome system, this was how it was done on his server (a server I highly recommend btw if you're looking for a good one).

DESCRIPTION

This will allow you to add completed Small BOD's (SBOD's) of different amounts to Large BOD's (LBOD's). They still must be the same item, material, and if exceptional LBOD, then exceptional SBOD.....as normal.

For instance, you can use 2 SBOD's with amount of 10 and combine them both into a LBOD with amount of 20 in order to fill the LBOD. This takes out the frustration when you need one last +20 SBOD to complete the LBOD and you end up getting a +10 or +15.

Or you can also add a +20 SBOD into a +15 LBOD to complete that portion of the LBOD. If this occurs, then the LBOD will show that the necessary 15 have been filled, and the SBOD's NEW amount will be +5 (completed), which can be used later to either cumulatively fill another LBOD, or can simply be turned in for a reward.

TO DO THIS:

Open your LargeBOD.cs. Find these lines in the "public void EndCombine" section....

Code:
else if ( m_AmountMax != small.AmountMax )
					{
						from.SendLocalizedMessage( 1045163 ); // The two orders have different requested amounts and cannot be combined.
					}

.....and delete them. This will allow any amount of SBOD to be filled into the LBOD.

In order to get a "return" on the SBOD in case the SBOD amount is larger than the LBOD amount, then add this code into this section......

Code:
else if ( entry.Amount + small.AmountCur > m_AmountMax )
					{	
						small.AmountCur = ( small.AmountCur - ( m_AmountMax - entry.Amount ) );
						small.AmountMax = ( small.AmountCur );	

						entry.Amount = m_AmountMax;					
												
						from.SendLocalizedMessage( 1045165 ); // The orders have been combined.

						from.SendGump( new LargeBODGump( from, this ) );

						if ( !Complete )
							BeginCombine( from );
					}

That will turn the SBOD's current amount AND max amount into the difference. (eg, if you combine a +20 SBOD into a +10 LBOD, then 10 of the SBOD amount will be placed into the LBOD to complete that item, and your 20 SBOD will change into a 10 SBOD).

This worked for me. I think it will help shards with a smaller player base and take some of the frustration out of Large BOD completions. If you use it and run into any problems, please let me know......
 

Shadow1980

Wanderer
Your code didnt take into accoun (as example) that an LBOD 20 could be filled with a 10 SBOD and could then get another 15 or 20. Currently this will end up as 25 or 30.

To fix this, change this code

Code:
						else
						{
						entry.Amount += small.AmountCur;
						small.Delete();

						from.SendLocalizedMessage( 1045165 ); // The orders have been combined.

						from.SendGump( new LargeBODGump( from, this ) );

						if ( !Complete )
							BeginCombine( from );
						}

to this

Code:
					else
					{
						if ( entry.Amount + small.AmountCur > m_AmountMax )
						{
						small.AmountCur = small.AmountCur - (m_AmountMax - entry.Amount);
						small.AmountMax = ( small.AmountCur ); 
						entry.Amount = m_AmountMax;

						from.SendLocalizedMessage( 1045165 ); // The orders have been combined.

						from.SendGump( new LargeBODGump( from, this ) );

						if ( !Complete )
							BeginCombine( from );
						}
						else
						{
						entry.Amount += small.AmountCur;
						small.Delete();

						from.SendLocalizedMessage( 1045165 ); // The orders have been combined.

						from.SendGump( new LargeBODGump( from, this ) );

						if ( !Complete )
							BeginCombine( from );
						}
					}
 

Skarth

Wanderer
Aye, I just figured that one out this afternoon. It's the same code as mine (with Murzin's help) but in a different spot. I just used the "else if" argument, you did it within the final "else" argument. Either way should work.

But my original post is now updated. Thanks for posting a fix as well Shadow1980.
 
Top