How to make Large BODs give all the Smalls to fill it
Different take on BODs
I usually play on small shards where trading BODs is very hard, if not impossible. It always seemed odd for an NPC to give you an order that you would likely never be able to fill without creating dozens of accounts and hundreds of characters. This is the answer! Any time you get a Large BOD from the smith, you automatically get all the small BODs to fill it. This has NOT been tested in a production environment. If you are going to use this on a production shard, you will probably want to ensure you don't have any automated BOD grabber accounts on your shard. This is designed for the players who like crafting and filling BODs enough to do it manually. This is just the smithy files, but the others should be pretty easy using this as a base.
This code does 2 major things:
1: It scales Large BOD quality based on skill.
2: dumps all the small bods in the player's backpack alongside the large bod when it's accepted.
In order to keep it as simple as possible, I used the small bod creation as a guide. That means your large quality should be equal to your small quality at any given skill. I did add in a little boost for skill levels over 70.1. At 120 skill, all bods are 20/exceptional.
Here are the mods:
First, the additional code needed in LargeSmithBod.cs
Second, the code needed in SmallSmithBOD.cs
next, the code change (additional code in RED) in LargeBODAcceptGump.cs: NOTE! you'll notice that it's possible to get the large, but not have enough room in your pack for the smalls.
Finally, the code change (in RED) needed in Blacksmith.cs and Weaponsmith.cs
And finally, a little bonus: This little sub, added to LargeSmithBOD.cs lets admins create large BODs of any type they like in-game with the command "[add largesmithbod metal amount exceptional number" where number is the integer that matches the switch list below.
i.e.
[add largesmithbod valorite 20 exceptional 1
will add a large plate valorite 20 exceptional bod. Much easier than creating a random one and editing the props.
This is my very first code submission, and I welcome any questions, comments, or advice!
Thanks,
Flitwick
Different take on BODs
I usually play on small shards where trading BODs is very hard, if not impossible. It always seemed odd for an NPC to give you an order that you would likely never be able to fill without creating dozens of accounts and hundreds of characters. This is the answer! Any time you get a Large BOD from the smith, you automatically get all the small BODs to fill it. This has NOT been tested in a production environment. If you are going to use this on a production shard, you will probably want to ensure you don't have any automated BOD grabber accounts on your shard. This is designed for the players who like crafting and filling BODs enough to do it manually. This is just the smithy files, but the others should be pretty easy using this as a base.
This code does 2 major things:
1: It scales Large BOD quality based on skill.
2: dumps all the small bods in the player's backpack alongside the large bod when it's accepted.
In order to keep it as simple as possible, I used the small bod creation as a guide. That means your large quality should be equal to your small quality at any given skill. I did add in a little boost for skill levels over 70.1. At 120 skill, all bods are 20/exceptional.
Here are the mods:
First, the additional code needed in LargeSmithBod.cs
Code:
public static LargeSmithBOD CreateRandomFor( Mobile m )
{
LargeBulkEntry[] entries;
bool useMaterials = true;
LargeBOD m_Owner = null;
int rand = Utility.Random( 8 );
switch ( rand )
{
default:
case 0: entries = LargeBulkEntry.ConvertEntries( m_Owner, LargeBulkEntry.LargeRing ); break;
case 1: entries = LargeBulkEntry.ConvertEntries( m_Owner, LargeBulkEntry.LargePlate ); break;
case 2: entries = LargeBulkEntry.ConvertEntries( m_Owner, LargeBulkEntry.LargeChain ); break;
case 3: entries = LargeBulkEntry.ConvertEntries( m_Owner, LargeBulkEntry.LargeAxes ); break;
case 4: entries = LargeBulkEntry.ConvertEntries( m_Owner, LargeBulkEntry.LargeFencing ); break;
case 5: entries = LargeBulkEntry.ConvertEntries( m_Owner, LargeBulkEntry.LargeMaces ); break;
case 6: entries = LargeBulkEntry.ConvertEntries( m_Owner, LargeBulkEntry.LargePolearms ); break;
case 7: entries = LargeBulkEntry.ConvertEntries( m_Owner, LargeBulkEntry.LargeSwords ); break;
}
if( rand > 2 && rand < 8 )
useMaterials = false;
double theirSkill = m.Skills[SkillName.Blacksmith].Base;
int amountMax;
if ( theirSkill >= 120.0 )
amountMax = Utility.RandomList( 20, 20, 20, 20 );
else if ( theirSkill >= 100.1 )
amountMax = Utility.RandomList( 15, 20, 20, 20 );
else if ( theirSkill >= 70.1 )
amountMax = Utility.RandomList( 10, 15, 20, 20 );
else if ( theirSkill >= 50.1 )
amountMax = Utility.RandomList( 10, 15, 15, 20 );
else
amountMax = Utility.RandomList( 10, 10, 15, 20 );
BulkMaterialType material = BulkMaterialType.None;
if ( useMaterials && theirSkill >= 70.1 )
{
for ( int i = 0; i < 20; ++i )
{
BulkMaterialType check = GetRandomMaterial( BulkMaterialType.DullCopper, m_BlacksmithMaterialChances );
double skillReq = 0.0;
switch ( check )
{
case BulkMaterialType.DullCopper: skillReq = 65.0; break;
case BulkMaterialType.ShadowIron: skillReq = 70.0; break;
case BulkMaterialType.Copper: skillReq = 75.0; break;
case BulkMaterialType.Bronze: skillReq = 80.0; break;
case BulkMaterialType.Gold: skillReq = 85.0; break;
case BulkMaterialType.Agapite: skillReq = 90.0; break;
case BulkMaterialType.Verite: skillReq = 95.0; break;
case BulkMaterialType.Valorite: skillReq = 100.0; break;
case BulkMaterialType.Spined: skillReq = 65.0; break;
case BulkMaterialType.Horned: skillReq = 80.0; break;
case BulkMaterialType.Barbed: skillReq = 99.0; break;
}
if ( theirSkill >= skillReq )
{
material = check;
break;
}
}
}
double excChance = 0.0;
if ( theirSkill >= 70.1 )
excChance = (theirSkill + 80.0) / 200.0;
bool reqExceptional = ( excChance > Utility.RandomDouble() );
return new LargeSmithBOD( amountMax, reqExceptional, material, entries );
}
Second, the code needed in SmallSmithBOD.cs
Code:
[Constructable]
public SmallSmithBOD( BulkMaterialType material, int amountMax, bool reqExceptional, LargeBulkEntry entry )
{
int hue = 0x44E;
this.Hue = hue;
this.AmountMax = amountMax;
this.Type = entry.Details.Type;
this.Number = entry.Details.Number;
this.Graphic = entry.Details.Graphic;
this.RequireExceptional = reqExceptional;
this.Material = material;
}
next, the code change (additional code in RED) in LargeBODAcceptGump.cs: NOTE! you'll notice that it's possible to get the large, but not have enough room in your pack for the smalls.
Code:
if ( m_From.PlaceInBackpack( m_Deed ) )
[COLOR="Red"]{
for (int i = 0; i < m_Deed.Entries.Length; ++i )
{
m_From.PlaceInBackpack ( new SmallSmithBOD( m_Deed.Material, m_Deed.AmountMax, m_Deed.RequireExceptional, m_Deed.Entries[i] ) );
}[/COLOR]
m_From.SendLocalizedMessage( 1045152 ); // The bulk order deed has been placed in your backpack.
[COLOR="Red"]}[/COLOR]
Finally, the code change (in RED) needed in Blacksmith.cs and Weaponsmith.cs
Code:
if ( theirSkill >= 70.1 && ((theirSkill) / 120.0) > Utility.RandomDouble() )
[COLOR="Red"]return LargeSmithBOD.CreateRandomFor( from );[/COLOR]
return SmallSmithBOD.CreateRandomFor( from );
And finally, a little bonus: This little sub, added to LargeSmithBOD.cs lets admins create large BODs of any type they like in-game with the command "[add largesmithbod metal amount exceptional number" where number is the integer that matches the switch list below.
i.e.
[add largesmithbod valorite 20 exceptional 1
will add a large plate valorite 20 exceptional bod. Much easier than creating a random one and editing the props.
Code:
[Constructable]
public LargeSmithBOD ( BulkMaterialType material, int amountMax, bool reqExceptional, int bodtype )
{
LargeBulkEntry[] entries;
switch ( bodtype )
{
default:
case 0: entries = LargeBulkEntry.ConvertEntries( this, LargeBulkEntry.LargeRing ); break;
case 1: entries = LargeBulkEntry.ConvertEntries( this, LargeBulkEntry.LargePlate ); break;
case 2: entries = LargeBulkEntry.ConvertEntries( this, LargeBulkEntry.LargeChain ); break;
case 3: entries = LargeBulkEntry.ConvertEntries( this, LargeBulkEntry.LargeAxes ); break;
case 4: entries = LargeBulkEntry.ConvertEntries( this, LargeBulkEntry.LargeFencing ); break;
case 5: entries = LargeBulkEntry.ConvertEntries( this, LargeBulkEntry.LargeMaces ); break;
case 6: entries = LargeBulkEntry.ConvertEntries( this, LargeBulkEntry.LargePolearms ); break;
case 7: entries = LargeBulkEntry.ConvertEntries( this, LargeBulkEntry.LargeSwords ); break;
}
int hue = 0x44E;
this.Hue = hue;
this.AmountMax = amountMax;
this.Entries = entries;
this.RequireExceptional = reqExceptional;
this.Material = material;
}
This is my very first code submission, and I welcome any questions, comments, or advice!
Thanks,
Flitwick