I am looking to add custom containers to my shard can someone point me in the direction of a base script I can use or is this script here ok to use?
I am using the newest servUO repo!
 

Attachments

  • Container.zip
    4.8 KB · Views: 0
Code:
using Server;

namespace Server.Items
{
    public class CustomBox: Container
    {
        [Constructable]
        public CustomBox() : base(0x0000) //ItemID for the container goes here
        {
            Name = "Your Custom Name";
            Hue = 0; //Custom Hue?
        }

        public CustomBox(Serial serial) : base(serial)
        {
        }

        public override int DefaultGumpID 
        {
            get
            {
                return 0x0000; //GumpID goes here for when you open container 
            }
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            
            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        { 
            base.Deserialize(reader);
            
            int version = reader.ReadInt();
        }
    }
}

Edit to suit your needs and drop into your scripts folder, Plus there are many methods to override to suit your needs, look them up in Container.cs
 
Back