Adding custom resources

Asteria

Active Member
Sep 4, 2018
37
4
29
I am trying to add in custom resources. We are not using OWLTR since we decided a lot of things in that system we wouldn't need anyways. However, we did want custom materials of our own but I can't seem to figure out how to get the resource info to apply to the materials. We have successfully gotten it from lumberjacking, mining, and skinning. We have added in gargoyle's knife and a gargoyle's axe and those all seem fine. However, when we go to craft with the materials they do not get any attributes from the resource info that we had listed. I also cannot get any runic attributes on them when crafting with the custom materials (presumably because it doesn't seem to be attaching the material type to the material)

I was wondering if anyone had any suggestions on what we might be missing? I can't seem to figure it out, because it is getting the resource type in the props

See attached image


13495
 

Falkor

Well-Known Member
Apr 11, 2018
46
6
wpshard.com
Shard Name
Whispering Pines
You'll need to add your custom resources to ResourceInfo.cs. You'll be able to use the existing materials in that file to see how to format your new entries.

Add them at the top under "public enum CraftResource" and then about 1/3 of the way down in the CraftAttributeInfo is where you'll enter your desired traits for each material type.

I don't have an unaltered ServUO anymore so I'll paste a vital section from the OWLTR integration that will show you how to add your materials:

Code:
        public CraftAttributeInfo()
        {
        }

        public static readonly CraftAttributeInfo Blank;
        //daat99 OWLTR start - custom resource
        public static readonly CraftAttributeInfo DullCopper, ShadowIron, Copper, Bronze, Golden, Agapite, Verite, Valorite, Blaze, Ice, Toxic, Electrum, Platinum;
        public static readonly CraftAttributeInfo Spined, Horned, Barbed, Polar, Synthetic, BlazeL, Daemonic, Shadow, Frost, Ethereal;
        public static readonly CraftAttributeInfo RedScales, YellowScales, BlackScales, GreenScales, WhiteScales, BlueScales, CopperScales, SilverScales, GoldScales;
        public static readonly CraftAttributeInfo OakWood, AshWood, YewWood, Heartwood, Bloodwood, Frostwood, Ebony, Bamboo, PurpleHeart, Redwood, Petrified;
        //daat99 OWLTR end - custom resource
Adding your customs under the Blank entry seems to be the way to go. Just below that is the CraftAttributeInfo section and below the default entries you can add yours. Here's two from OWLTR to get the feel of the format:

Code:
           CraftAttributeInfo blaze = Blaze = new CraftAttributeInfo();

            blaze.ArmorPhysicalResist = Uber ? 5 : Utility.Random(6);
            blaze.ArmorFireResist = Uber ? 5 : Utility.Random(6);
            blaze.ArmorColdResist = Uber ? 5 : Utility.Random(6);
            blaze.ArmorPoisonResist = Uber ? 5 : Utility.Random(6);
            blaze.ArmorEnergyResist = Uber ? 5 : Utility.Random(6);
            blaze.ArmorDurability = 125;
            blaze.WeaponDurability = 125;
            blaze.ArmorLowerRequirements = 60;
            blaze.WeaponLowerRequirements = 60;
            blaze.WeaponFireDamage = 100;
            blaze.RunicMinAttributes = 4;
            blaze.RunicMaxAttributes = Uber ? 7 : 5;
            blaze.RunicMinIntensity = Uber ? 75 : 50;
            blaze.RunicMaxIntensity = Uber ? 100 : 75;

            CraftAttributeInfo ice = Ice = new CraftAttributeInfo();

            ice.ArmorPhysicalResist = Uber ? 5 : Utility.Random(6);
            ice.ArmorFireResist = Uber ? 5 : Utility.Random(6);
            ice.ArmorColdResist = Uber ? 5 : Utility.Random(6);
            ice.ArmorPoisonResist = Uber ? 5 : Utility.Random(6);
            ice.ArmorEnergyResist = Uber ? 6 : Utility.Random(7);
            ice.ArmorDurability = 150;
            ice.WeaponDurability = 150;
            ice.ArmorLowerRequirements = 70;
            ice.WeaponLowerRequirements = 70;
            ice.WeaponColdDamage = 100;
            ice.RunicMinAttributes = 5;
            ice.RunicMaxAttributes = Uber ? 8 : 5;
            ice.RunicMinIntensity = Uber ? 80 : 55;
            ice.RunicMaxIntensity = Uber ? 100 : 80;
Hopefully that's enough to get you in the right direction!
 
  • Like
Reactions: Asteria

Asteria

Active Member
Sep 4, 2018
37
4
29
yeah i had all of that already, thanks though. my issue was actually the stuff at the bottom of resource info had to be changed to be able to pull those attributes that i set in resource info to the item