Been trying to transfer some of my old Runuo server files to Servuo....
And having this work in a CommodityDeed...
Script:
C#:
using System;
using Server.Items;

namespace Server.Items
{
    public class GammaCrystalDust : Item, ICommodity
    {
        int ICommodity.DescriptionNumber { get { return LabelNumber; } }
        bool ICommodity.IsDeedable { get { return true; } }
        
        [Constructable]
        public GammaCrystalDust() : this(1)
        {
        }

        [Constructable]
        public GammaCrystalDust(int amount)
            : base(0x26b8)
        {
            Stackable = true;
            Amount = amount;
            Hue = 75;
               Name = "A Gamma Dust";
        Weight = 0.5;
        }
        public GammaCrystalDust(Serial serial) : base(serial)
        {
        }
        
        public override void AddNameProperty( ObjectPropertyList list )
        {
            if ( Amount > 1)
            {
                list.Add( Amount+ " Gamma Dust" );
            }
            else
            {               
                list.Add( "A Gamma Dust" );
            }
        }

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

            writer.Write((int) 0);
        }

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

            int version = reader.ReadInt();
        }
    }
}


Error:
C#:
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
 + AAAS/ACTIVE/Items/Crystal Mining Items/Gamma Crystal Dust.cs:
    CS0539: Line 8: 'GammaCrystalDust.DescriptionNumber' in explicit interface d
eclaration is not a member of interface
    CS0535: Line 6: 'GammaCrystalDust' does not implement interface member 'ICom
modity.Description'
Scripts: One or more scripts failed to compile or no script files were found.

Help! lol :-\
 
Hi !

If you look at current iCommodity interface, which can be found in /Script/Items/Consumables/CommunityDeed.cs :
Code:
    public interface ICommodity /* added IsDeedable prop so expansion-based deedables can determine true/false */
    {
        TextDefinition Description { get; }
        bool IsDeedable { get; }
    }

You can see that there is no more 'DescriptionNumber', but just a 'Description'.

Here's how I fixed my old scripts. Not sure if the way to go, but heh, it works ^^
Code:
TextDefinition ICommodity.Description { get { return LabelNumber; } }

Good luck !
Fixing this one will bring you tons of other "conversion errors".
A long and hard way, but it's very good XP (you'll reach next level of XP soon ^^ lol).
 
Back