Cervontose
Wanderer
[RunUO 2.0] Random Loot Resources
Hello everyone! This here is my first public release, so bear with me if there are any problems, or bad practices! I'm glad to finally see this working... It's been a dream of mine for quite some time.
This script is compatable with the latest RunUO 2.0 release (Final). It can be modified very easily to fit your shards resources even if you have custom ones!
I tried to comment what I did as best as I could... I hope I didn't forget anything!
EDIT
This script has been updated! I went away for a while and did not realize I made a few mistakes. I've fixed them, and balanced the chances a bit better.
I'd also like to thank runuo_user for updating and adding a common custom resource pack to this for your use!runuo_user's quick resource modification
Description
This system does the following to all lootpack based drops.
Items now will have a chance at being found to be crafted with resource types!
Wood items have a chance to drop with different wood resources.
Leather items have a chance to drop with different leather resources.
Metal items have a chance to drop with different resources.
In addition to this... Each dropped item has a small chance at being exceptional as well!
Installation
This script release modifies LootPack.cs
You can install this one of two ways.
1: Simple copy and replace your original LootPack.cs in your Scripts/Misc folder.
The attached file LootPack2.0 is compatible with the unmodified RunUo 2.0 Final release.
2:In Lootpack.cs you will find the following code.
After this, copy and paste this code below it.
Restart your shard, and happy hunting to your players... That is all that is needed... After a restart, everything will be golden to appear in loot from lootpack drops!
I would like to thank Lord_Greywolf for assisting me on how to define a few things in the scripts... Funny how you can miss things by such a tiny bit So, thank you very much!
Hello everyone! This here is my first public release, so bear with me if there are any problems, or bad practices! I'm glad to finally see this working... It's been a dream of mine for quite some time.
This script is compatable with the latest RunUO 2.0 release (Final). It can be modified very easily to fit your shards resources even if you have custom ones!
I tried to comment what I did as best as I could... I hope I didn't forget anything!
EDIT
This script has been updated! I went away for a while and did not realize I made a few mistakes. I've fixed them, and balanced the chances a bit better.
I'd also like to thank runuo_user for updating and adding a common custom resource pack to this for your use!runuo_user's quick resource modification
Description
This system does the following to all lootpack based drops.
Items now will have a chance at being found to be crafted with resource types!
Wood items have a chance to drop with different wood resources.
Leather items have a chance to drop with different leather resources.
Metal items have a chance to drop with different resources.
In addition to this... Each dropped item has a small chance at being exceptional as well!
Installation
This script release modifies LootPack.cs
You can install this one of two ways.
1: Simple copy and replace your original LootPack.cs in your Scripts/Misc folder.
The attached file LootPack2.0 is compatible with the unmodified RunUo 2.0 Final release.
2:In Lootpack.cs you will find the following code.
Code:
if ( item is BaseWeapon )
BaseRunicTool.ApplyAttributesTo( (BaseWeapon)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
else if ( item is BaseArmor )
BaseRunicTool.ApplyAttributesTo( (BaseArmor)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
else if ( item is BaseJewel )
BaseRunicTool.ApplyAttributesTo( (BaseJewel)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
else if ( item is BaseHat )
BaseRunicTool.ApplyAttributesTo( (BaseHat)item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
After this, copy and paste this code below it.
Code:
#region Items Resource/Exceptional Mutate
if ( item is BaseStaff || item is BaseRanged || item is Club ) // Check to see if item is made of wood - Staffs, Bows, and Club.
{
BaseWeapon woodweapon = (BaseWeapon)item; // Taking the created item, setting it as woodweapon itemtype to add modifiers.
int ww_chancewheel = Utility.Random( 600 ); // Random number for chance of woods to be mutated
if ( ww_chancewheel <= 12 ) //If the ww_chance number is generated as less then 12, continue with code in brackets.
{ woodweapon.Resource = CraftResource.Frostwood; // Taking created item that was type woodweapon and setting the resource to Woodtype
}else if ( ww_chancewheel <= 20 )
{ woodweapon.Resource = CraftResource.Bloodwood;
}else if ( ww_chancewheel <= 31 )
{ woodweapon.Resource = CraftResource.Heartwood;
}else if ( ww_chancewheel <= 47 )
{ woodweapon.Resource = CraftResource.YewWood;
}else if ( ww_chancewheel <= 78 )
{ woodweapon.Resource = CraftResource.AshWood;
}else if ( ww_chancewheel <= 121 )
{ woodweapon.Resource = CraftResource.OakWood;
}else // If the random number does not meet any of the above, it does this.
{ woodweapon.Resource = CraftResource.RegularWood;
}
if ( 0.25 > Utility.RandomDouble() ) // 25% chance for creating item which is exceptional
woodweapon.Quality = WeaponQuality.Exceptional;
}
else if ( item is BaseWeapon )
{
BaseWeapon metalweapon = (BaseWeapon)item;
int mw_chancewheel = Utility.Random( 600 );
if ( mw_chancewheel <= 12 )
{ metalweapon.Resource = CraftResource.Valorite;
}else if ( mw_chancewheel <= 20 )
{ metalweapon.Resource = CraftResource.Verite;
}else if ( mw_chancewheel <= 31 )
{ metalweapon.Resource = CraftResource.Agapite;
}else if ( mw_chancewheel <= 47 )
{ metalweapon.Resource = CraftResource.Gold;
}else if ( mw_chancewheel <= 78 )
{ metalweapon.Resource = CraftResource.Bronze;
}else if ( mw_chancewheel <= 121 )
{ metalweapon.Resource = CraftResource.Copper;
}else if ( mw_chancewheel <= 142 )
{ metalweapon.Resource = CraftResource.ShadowIron;
}else if ( mw_chancewheel <= 159 )
{ metalweapon.Resource = CraftResource.DullCopper;
}else
{ metalweapon.Resource = CraftResource.Iron;
}
if ( 0.25 > Utility.RandomDouble() )
metalweapon.Quality = WeaponQuality.Exceptional;
}
if ( item is BaseArmor )
{
BaseArmor armortype = (BaseArmor)item;
if ( armortype.Resource == CraftResource.Iron )
{
int ma_chancewheel = Utility.Random( 600 );
if ( ma_chancewheel <= 12 )
{ armortype.Resource = CraftResource.Valorite;
}else if ( ma_chancewheel <= 20 )
{ armortype.Resource = CraftResource.Verite;
}else if ( ma_chancewheel <= 31 )
{ armortype.Resource = CraftResource.Agapite;
}else if ( ma_chancewheel <= 47 )
{ armortype.Resource = CraftResource.Gold;
}else if ( ma_chancewheel <= 78 )
{ armortype.Resource = CraftResource.Bronze;
}else if ( ma_chancewheel <= 121 )
{ armortype.Resource = CraftResource.Copper;
}else if ( ma_chancewheel <= 142 )
{ armortype.Resource = CraftResource.ShadowIron;
}else if ( ma_chancewheel <= 159 )
{ armortype.Resource = CraftResource.DullCopper;
}else
{ armortype.Resource = CraftResource.Iron;
}
}
if ( armortype.Resource == CraftResource.RegularLeather )
{
int la_chancewheel = Utility.Random( 600 );
if ( la_chancewheel <= 12 )
{ armortype.Resource = CraftResource.BarbedLeather;
}else if ( la_chancewheel <= 47 )
{ armortype.Resource = CraftResource.HornedLeather;
}else if ( la_chancewheel <= 142 )
{ armortype.Resource = CraftResource.SpinedLeather;
}else
{ armortype.Resource = CraftResource.RegularLeather;
}
}
if ( armortype.Resource == CraftResource.RegularWood )
{
int wa_chancewheel = Utility.Random( 600 );
if ( wa_chancewheel <= 12 )
{ armortype.Resource = CraftResource.Frostwood;
}else if ( wa_chancewheel <= 20 )
{ armortype.Resource = CraftResource.Bloodwood;
}else if ( wa_chancewheel <= 31 )
{ armortype.Resource = CraftResource.Heartwood;
}else if ( wa_chancewheel <= 78 )
{ armortype.Resource = CraftResource.YewWood;
}else if ( wa_chancewheel <= 121 )
{ armortype.Resource = CraftResource.AshWood;
}else if ( wa_chancewheel <= 142 )
{ armortype.Resource = CraftResource.OakWood;
}else
{ armortype.Resource = CraftResource.RegularWood;
}
}
if ( 0.25 > Utility.RandomDouble() )
armortype.Quality = ArmorQuality.Exceptional;
#endregion
Restart your shard, and happy hunting to your players... That is all that is needed... After a restart, everything will be golden to appear in loot from lootpack drops!
I would like to thank Lord_Greywolf for assisting me on how to define a few things in the scripts... Funny how you can miss things by such a tiny bit So, thank you very much!