Resource icon

Wood crafting hue fix

Not exactly a script release, but a "fix" for a few. When using Carpentry or BowFletching, the colored wood hues never show up, making it sort of pointless to have them. Now they will and its easy. In DefCarpentry.cs & DefBowFletching.cs just add this
Code:
        private DefCarpentry() : base( 1, 1, 1.25 )// base( 1, 1, 3.0 )
        {
        }
        public override bool RetainsColorFrom(CraftItem item, Type type)
        {
            return true;
        }
Now, for the bows & crossbows that come out looking plain no matter what wood you use, I added this to both BaseWeapon & BaseArmor. Search those scripts for AddNameProperty & add this to the bottom of the list between BlueScales & default.
Code:
                case CraftResource.OakWood:         oreType = 1072533; break; // oak
                case CraftResource.AshWood:         oreType = 1072534; break; // ash
                case CraftResource.YewWood:         oreType = 1072535; break; // yew
                case CraftResource.Heartwood:       oreType = 1072536; break; // heartwood
                case CraftResource.Bloodwood:       oreType = 1072538; break; // bloodwood
                case CraftResource.Frostwood:       oreType = 1072539; break; // frostwood
Now, not only will your bows & crossbows craft in the wood hues, but will also show the wood type. And now for the final touch. Crafting lockable containers (wooden chests & such). In Scripts/Items/Containers open LockableContainers.cs & search for ICraftable Members (almost at the bottom). Then, make it look like so..
Code:
        public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
        {
            CraftContext context = craftSystem.GetContext(from);

            if (context != null && !context.DoNotColor)
            {
                Type resourceType = typeRes ?? craftItem.Resources.GetAt(0).ItemType;

                CraftResource res = CraftResources.GetFromType(resourceType);

                Hue = CraftResources.GetHue(res);
            }
            if ( from.CheckSkill( SkillName.Tinkering, -5.0, 15.0 ) )
Just 7 lines is all it takes to craft icy blue or bloody red wooden chests. :) That part of the coding is thanks to Vorspire.
ScreenHunter_69 May. 08 17.19.jpg
ScreenHunter_72 May. 09 08.37.jpg
ScreenHunter_74 May. 09 09.42.jpg
  • Like
Reactions: Lokai

Latest reviews

Nice catch guys! Thanks :)
Thanks the Containers was driving me nuts!