Resource icon

Backpack Increase Max Weight / Item Deeds 2018-02-17

No permission to download
These are two deeds that I created for Diesel and are included in his server release: https://www.servuo.com/archive/full-servuo-server-land-of-archon.965/

The increase item count deed will work without any edits.

The increase max weight requires edits to:
Scripts\Items\Containers\Container.cs

Find the backpack class and make these edits:
PLEASE NOTE IF NOT DONE CORRECTLY ANY EXISTING PLAYER BACKPACKS MAY BE DELETED

Code:
public class Backpack : BaseContainer, IDyable
    {
        // Deed Edit Start
        private int _NewMaxWeight;
       
        [CommandProperty(AccessLevel.GameMaster)]
        public int NewMaxWeight
        {
            get
            {
                return _NewMaxWeight;
            }
            set
            {
                if( _NewMaxWeight == null || _NewMaxWeight <= 550 )
                    _NewMaxWeight = 550;
                   
                _NewMaxWeight = value;
               
                InvalidateProperties();
            }
        }
        // Deed Edit End

        [Constructable]
        public Backpack()
            : base(0xE75)
        {
            this.Layer = Layer.Backpack;
            this.Weight = 3.0;
           
            _NewMaxWeight = 550; // Deed Edit
        }

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

        public override int DefaultMaxWeight
        {
            get
            {
                if (Core.ML)
                {
                    Mobile m = this.ParentEntity as Mobile;
                    // Deed Edit
                    if (m != null && m.Player && m.Backpack == this)
                    {
                        return _NewMaxWeight;
                    }
                    else
                    {
                        return base.DefaultMaxWeight;
                    }
                }
                else
                {
                    return base.DefaultMaxWeight;
                }
            }
        }
       
        public bool Dye(Mobile from, DyeTub sender)
        {
            if (this.Deleted)
                return false;

            this.Hue = sender.DyedHue;

            return true;
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)2); // version
           
            writer.Write( (int)_NewMaxWeight); // Deed Edit
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
           
             _NewMaxWeight = reader.ReadInt(); // added to increase backpack

            if ( _NewMaxWeight == null || _NewMaxWeight < 550 ) // added to increase backpack
                 _NewMaxWeight = 550; // added to increase backpack

            if (version == 0 && this.ItemID == 0x9B2)
                this.ItemID = 0xE75;
        }
    }
Author
zerodowned
Downloads
129
Views
1,894
First release
Last update
Rating
0.00 star(s) 0 ratings
Back