Needing Help

Ishya

Well-Known Member
Apr 2, 2015
112
16
34
I was wondering if anyone would be willing to do a little one on one help with me. I want to add custom resources to my shard but I do not have the first clue as to how to go about this. Please and thank you!
I am running the latest Serve UO shard
 
Last edited:

bojangles2872

Well-Known Member
Jul 29, 2018
74
8
Adding custom resources is difficult but you need to make sure you add them in every place that already has resources. Basically you add the new ores in every place that already mentions the previous ores. I did a search of my files to find the word Valorite then added in the new ores to any file that had the Valorite keyword in them.
 

Ishya

Well-Known Member
Apr 2, 2015
112
16
34
OK cool thank you I will look into that as well. And great idea I would have never thought of that ha ha
 

FingersMcSteal

Well-Known Member
Sep 6, 2013
116
28
51
I found the best way to do it was start with the ResourceInfo.cs file first to see how things in there were setup and what they referenced...

C#:
namespace Server.Items
{
    public enum CraftResource
    {
        None = 0,
        Iron = 1,
        DullCopper,
        ShadowIron,
        Copper,
        Bronze,
        Gold,
        Silver,
        Agapite,
        Verite,
        Valorite,
        Uridium,
        Trillium,
        Titanium,
        Platinum,
        Zenite,
        Naquinite,
        Galvinite,
        Trilamide,
        Veramide,
        Zenlamide
Then down from that there was...

C#:
        public CraftAttributeInfo()
        {
        }

        public static readonly CraftAttributeInfo Blank;
        public static readonly CraftAttributeInfo DullCopper, ShadowIron, Copper, Bronze, Golden, Silver, Agapite, Verite, Valorite, Uridium, Trillium, Titanium, Platinum, Zenite, Naquinite, Galvinite, Trilamide, Veramide, Zenlamide;
Things like this tell you where you might also need to look...

C#:
    public class CraftResources
    {
        private static CraftResourceInfo[] m_MetalInfo = new CraftResourceInfo[]
            {
                new CraftResourceInfo( 0x000, 1053109,  "Iron",            CraftAttributeInfo.Blank,        CraftResource.Iron,                typeof( IronIngot ),        typeof( IronOre ),            typeof( Granite ) ),
                new CraftResourceInfo( 0x973, 1053108,  "Dull Copper",    CraftAttributeInfo.DullCopper,    CraftResource.DullCopper,        typeof( DullCopperIngot ),    typeof( DullCopperOre ),    typeof( DullCopperGranite ) ),
                new CraftResourceInfo( 0x966, 1053107,  "Shadow Iron",    CraftAttributeInfo.ShadowIron,    CraftResource.ShadowIron,        typeof( ShadowIronIngot ),    typeof( ShadowIronOre ),    typeof( ShadowIronGranite ) ),
                new CraftResourceInfo( 0x96D, 1053106,  "Copper",        CraftAttributeInfo.Copper,        CraftResource.Copper,            typeof( CopperIngot ),        typeof( CopperOre ),        typeof( CopperGranite ) ),
                new CraftResourceInfo( 0x972, 1053105,  "Bronze",        CraftAttributeInfo.Bronze,        CraftResource.Bronze,            typeof( BronzeIngot ),        typeof( BronzeOre ),        typeof( BronzeGranite ) ),
                new CraftResourceInfo( 0x8A5, 1053104,  "Gold",            CraftAttributeInfo.Golden,        CraftResource.Gold,                typeof( GoldIngot ),        typeof( GoldOre ),            typeof( GoldGranite ) ),
                new CraftResourceInfo( 0x835, 0,         "Silver",            CraftAttributeInfo.Silver,   CraftResource.Silver,        typeof( SilverIngot ),   typeof( SilverOre ),        typeof( SilverGranite ) ),
                new CraftResourceInfo( 0x979, 1053103, "Agapite",        CraftAttributeInfo.Agapite,        CraftResource.Agapite,            typeof( AgapiteIngot ),        typeof( AgapiteOre ),        typeof( AgapiteGranite ) ),
                new CraftResourceInfo( 0x89F, 1053102, "Verite",        CraftAttributeInfo.Verite,        CraftResource.Verite,            typeof( VeriteIngot ),        typeof( VeriteOre ),        typeof( VeriteGranite ) ),
                new CraftResourceInfo( 0x8AB, 1053101, "Valorite",        CraftAttributeInfo.Valorite,    CraftResource.Valorite,            typeof( ValoriteIngot ),    typeof( ValoriteOre ),        typeof( ValoriteGranite ) ),
                new CraftResourceInfo( 0x583, 0, "Uridium",                CraftAttributeInfo.Uridium,        CraftResource.Uridium,            typeof( UridiumIngot ),        typeof( UridiumOre ),        typeof( UridiumGranite ) ),
                new CraftResourceInfo( 0x91, 0, "Trillium",           CraftAttributeInfo.Trillium,    CraftResource.Trillium,            typeof( TrilliumIngot ),    typeof( TrilliumOre ),        typeof( TrilliumGranite ) ),
                new CraftResourceInfo( 0xBD, 0, "Titanium",                CraftAttributeInfo.Titanium,    CraftResource.Titanium,            typeof( TitaniumIngot ),    typeof( TitaniumOre ),        typeof( TitaniumGranite ) ),
                new CraftResourceInfo( 0x4D5, 0, "Platinum",           CraftAttributeInfo.Platinum,    CraftResource.Platinum,            typeof( PlatinumIngot ),    typeof( PlatinumOre ),        typeof( PlatinumGranite ) ),
                new CraftResourceInfo( 0xA4, 0, "Zenite",                CraftAttributeInfo.Zenite,        CraftResource.Zenite,            typeof( ZeniteIngot ),        typeof( ZeniteOre ),        typeof( ZeniteGranite ) ),
                new CraftResourceInfo( 0x2DD, 0, "Naquinite",            CraftAttributeInfo.Naquinite,   CraftResource.Naquinite,        typeof( NaquiniteIngot ),   typeof( NaquiniteOre ),        typeof( NaquiniteGranite ) ),
                new CraftResourceInfo( 0x849, 0, "Galvinite",            CraftAttributeInfo.Galvinite,   CraftResource.Galvinite,        typeof( GalviniteIngot ),   typeof( GalviniteOre ),        typeof( GalviniteGranite ) ),
                new CraftResourceInfo( 0x674, 0, "Trilamide",            CraftAttributeInfo.Trilamide,   CraftResource.Trilamide,        typeof( TrilamideIngot ),   typeof( TrilamideOre ),        typeof( TrilamideGranite ) ),
                new CraftResourceInfo( 0x11C, 0, "Veramide",            CraftAttributeInfo.Veramide,   CraftResource.Veramide,        typeof( VeramideIngot ),   typeof( VeramideOre ),        typeof( VeramideGranite ) ),
                new CraftResourceInfo( 0x47F, 0, "Zenlamide",            CraftAttributeInfo.Zenlamide,   CraftResource.Zenlamide,        typeof( ZenlamideIngot ),   typeof( ZenlamideOre ),        typeof( ZenlamideGranite ) ),
Then the fun started, as you can see in that 3rd bit of code you have the Ingot types, Ore types and also the granite for each resource so there in the ingot and ore.cs files so you need to make your new ores & ingots plus granite as well.

Theres quite a few files to alter but it can be done, i'll try to remember the list of files but it is a big-ish list.
Just remember it will take a little bit of time, things like craft system, havest system, basearmour.cs & baseweapon.cs need the changes as well since you craft weapons and armours from all of this.

I'll help when / where I can I don't mind.
Post automatically merged:

Some of the files to check...

ResourceInfo.cs
Ingots.cs
Ore.cs
Granite.cs

ProspectorsTool.cs

Mining.cs (To dig up your new ores)
Ore Elementals (need to be added for harvesting)

DefBlacksmithy.cs (New resources added here to allow crafting with them)
RunicHammer.cs

BaseArmour.cs
BaseWeapon.cs

CommodityDeed.cs (That one was a pain if I remember right)

I think that was it to add ores (metals) into the server.
 
Last edited:

Ishya

Well-Known Member
Apr 2, 2015
112
16
34
Thank you tons I will be working on all of this next week been battling an ongoing migraine so I have not been on the computer much.