Diesel

Member
CReagent.cs is giving me a problem with the newest ServUO repo

I am getting this error.

+ Customs/Lokai Systems/ACC Systems/Complete Spell System/-=+ 02 Changing/CReag
ent.cs:
CS0118: Line 11: 'Server.ACC.CSS.CReagent.SpringWater' is a 'property' but i
s used like a 'type'
CS0118: Line 12: 'Server.ACC.CSS.CReagent.DestroyingAngel' is a 'property' b
ut is used like a 'type'
CS0118: Line 13: 'Server.ACC.CSS.CReagent.PetrafiedWood' is a 'property' but
is used like a 'type'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

On this script


using System;
using Server;
using Server.Items;

namespace Server.ACC.CSS
{
public class CReagent
{
private static Type[] m_Types = new Type[4]
{
typeof( SpringWater ),
typeof( DestroyingAngel ),
typeof( PetrafiedWood ),
typeof( Kindling )
};


public static Type SpringWater
{
get{ return m_Types[0]; }
set{ m_Types[0] = value; }
}
public static Type DestroyingAngel
{
get{ return m_Types[1]; }
set{ m_Types[1] = value; }
}
public static Type PetrafiedWood
{
get{ return m_Types[2]; }
set{ m_Types[2] = value; }
}
public static Type Kindling
{
get{ return m_Types[3]; }
set{ m_Types[3] = value; }
}
}
}

I think the issue is in the colored section. Added the file as an upload. Any help is appreciated.
 

Attachments

  • CReagent.cs
    711 bytes · Views: 3
Are you missing the Reagents folder? It contains those 3 reagents. Here's a copypasta of them if it's missing.

Code:
using System;
using Server;

namespace Server.Items
{
    public class PetrifiedWood : BaseReagent, ICommodity
    {
        bool ICommodity.IsDeedable { get { return false; } }
     
        int ICommodity.DescriptionNumber { get { return LabelNumber; } }

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

        [Constructable]
        public PetrifiedWood( int amount ) : base( 0x97A, amount )
        {
            Hue = 0x46C;
            Name = "petrified wood";
        }

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

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

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

Code:
using System;
using Server;

namespace Server.Items
{
    public class DestroyingAngel : BaseReagent, ICommodity
    {
        bool ICommodity.IsDeedable { get { return false; } }

        int ICommodity.DescriptionNumber { get { return LabelNumber; } }

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

        [Constructable]
        public DestroyingAngel( int amount ) : base( 0xE1F, amount )
        {
            Hue = 0x290;
            Name = "destroying angel";
        }

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

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

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

Code:
using System;
using Server;

namespace Server.Items
{
    public class SpringWater : BaseReagent, ICommodity
    {
        bool ICommodity.IsDeedable { get { return false; } }

        int ICommodity.DescriptionNumber { get { return LabelNumber; } }

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

        [Constructable]
        public SpringWater( int amount ) : base( 0xE24, amount )
        {
            Hue = 0x47F;
            Name = "spring water";
        }

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

Oh, and change "PetrafiedWood" to "PetrifiedWood", or vice versa if you prefer.
 
That did it. I did have to match some spelling issues. It wanted PetrafiedWood with an A not PetrifiedWood with an I. So once I updated it through that script it ran fine. Thanks so much for pointing me in the right direction. I am posting my corrected PetrafiedWood.cs in case it helps someone else!
[doublepost=1492570885][/doublepost]Lol rereading your post I now see where you warned me about the spelling issues. Here I thought I was a little smart for figuring it out haha. But thanks again for helping me out.
 

Attachments

  • PetrafiedWood.cs
    789 bytes · Views: 9
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back