ExX

Member
I am working on updating the graverobbing system to work with the newest release of ServUO. I got all the errors out of the default system and now I am working on the custom reagents the system uses. I am encountering an error I haven't seen in my short time back. Any input on this and how to fix it? Here is the error:

+ Custom/Systems/GraveRobbing/Items/Bones.cs:
CS0539: Line 15: 'Bones.DescriptionNumber' in explicit interface declaration is not a member of interface
CS0535: Line 6: 'Bones' does not implement interface member 'ICommodity.Description'

Here is the script: (Line 6 and 15 are bolded and underlined.)

C#:
using System;
using Server.Items;

namespace Server.Items
{
    [B][U]public class Bones : Item, ICommodity[/U][/B]
    {
        public static int[] m_Bone = new int[]
        {
            6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932,
            6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6880, 6881, 6882, 6883,
            6884
        };

        [B][U]int ICommodity.DescriptionNumber { get { return LabelNumber; } }[/U][/B]
        bool ICommodity.IsDeedable { get { return true; } }

        [Constructable]
        public Bones() : this( 1 )
        {
        }

        [Constructable]
        public Bones( int amount ) : base( 1 )
        {
            ItemID = m_Bone[Utility.Random(m_Bone.Length)];
            Weight = 1;
            Stackable = true;
        }

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

        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();
        }
    }
}
 
Remove
, ICommodity[/U][/B]

Also Remove
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }


From the script i am not sure to my knowledge that you can even use those bones for Commodity deeds... Or even why you would i guess...

So what you are wanting it to look like would be.

C#:
using System;
using Server.Items;

namespace Server.Items
{
    [B][U]public class Bones : Item
    {
        public static int[] m_Bone = new int[]
        {
            6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932,
            6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6880, 6881, 6882, 6883,
            6884
        };

        [Constructable]
        public Bones() : this( 1 )
        {
        }

        [Constructable]
        public Bones( int amount ) : base( 1 )
        {
            ItemID = m_Bone[Utility.Random(m_Bone.Length)];
            Weight = 1;
            Stackable = true;
        }

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

        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();
        }
    }
}

Give that a shot like i said personally i would not have them Commodity deedable as they are deco correct?
 
  • Like
Reactions: ExX
Yea the bones are just for decoration. Thanks, I didn't even think to just take it out. Not sure why it was a commodity deeded item to begin with but oh well. Now the system works as intended. Thanks again Heamo!
 
Yea the bones are just for decoration. Thanks, I didn't even think to just take it out. Not sure why it was a commodity deeded item to begin with but oh well. Now the system works as intended. Thanks again Heamo!

Np i was happy to help yea i have no idea tbh... When it comes to some items they can not be used as a Commodity deed that i do know so i do not know why they would do that but meh haha.

Glad you got it working i figured that would do the trick!

Happy coding!
 
  • Like
Reactions: ExX

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back