RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

How do i create this system?

StrikeRTM

Wanderer
Ok, so here are the buggy scripts and an new error i get now somehow. Well that type of doesnt want to work for me.
Code:
Scripts: Compiling C# scripts...failed (32 errors, 0 warnings)
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1041: (line 1015, column 27
) Identifier expected, 'typeof' is a keyword
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1002: (line 1015, column 48
) ; expected
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1525: (line 1015, column 48
) Invalid expression term ':'
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1002: (line 1015, column 50
) ; expected
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1041: (line 1016, column 27
) Identifier expected, 'typeof' is a keyword
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1002: (line 1016, column 45
) ; expected
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1525: (line 1016, column 45
) Invalid expression term ':'
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1002: (line 1016, column 47
) ; expected
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1041: (line 1017, column 27
) Identifier expected, 'typeof' is a keyword
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1002: (line 1017, column 46
) ; expected
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1525: (line 1017, column 46
) Invalid expression term ':'
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1002: (line 1017, column 48
) ; expected
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1041: (line 1018, column 27
) Identifier expected, 'typeof' is a keyword
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1002: (line 1018, column 51
) ; expected
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1525: (line 1018, column 51
) Invalid expression term ':'
 - Error: Scripts\Engines\Craft\Core\CraftItem.cs: CS1002: (line 1018, column 53
) ; expected
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1041: (line 2578, column 25) Id
entifier expected, 'typeof' is a keyword
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1002: (line 2578, column 46) ;
expected
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1525: (line 2578, column 46) In
valid expression term ':'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1002: (line 2578, column 51) ;
expected
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1041: (line 2579, column 25) Id
entifier expected, 'typeof' is a keyword
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1002: (line 2579, column 43) ;
expected
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1525: (line 2579, column 43) In
valid expression term ':'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1002: (line 2579, column 48) ;
expected
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1041: (line 2580, column 25) Id
entifier expected, 'typeof' is a keyword
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1002: (line 2580, column 44) ;
expected
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1525: (line 2580, column 44) In
valid expression term ':'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1002: (line 2580, column 49) ;
expected
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1041: (line 2581, column 25) Id
entifier expected, 'typeof' is a keyword
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1002: (line 2581, column 49) ;
expected
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1525: (line 2581, column 49) In
valid expression term ':'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS1002: (line 2581, column 54) ;
expected
 

Attachments

  • BaseWeapon.zip
    16.8 KB · Views: 5
  • CraftItem.zip
    8.2 KB · Views: 4

daat99

Moderator
Staff member
In baseweapon.cs switch statement around line 2578
Look at the previus lines and try to see what's wrong about it.
You wrote the switch value wrong.

You made the same error in craftitem.
 

StrikeRTM

Wanderer
daat99 said:
In baseweapon.cs switch statement around line 2578
Look at the previus lines and try to see what's wrong about it.
You wrote the switch value wrong.

You made the same error in craftitem.
How do i compare two different code lines and tell what's wrong?

And i dont knoe what does switch statement mean, it has got completly diferent name in my language.

I dont see anything wrong there.
 

daat99

Moderator
Staff member
This is part of your base weapon:
Code:
switch ( m_Resource )
{
	case CraftResource.DullCopper:		oreType = 1053108; break; // dull copper
	case CraftResource.ShadowIron:		oreType = 1053107; break; // shadow iron
	case CraftResource.Copper:			oreType = 1053106; break; // copper
	case CraftResource.Bronze:			oreType = 1053105; break; // bronze
	case CraftResource.Gold:			oreType = 1053104; break; // golden
	case CraftResource.Agapite:			oreType = 1053103; break; // agapite
	case CraftResource.Verite:			oreType = 1053102; break; // verite
	case CraftResource.Valorite:		oreType = 1053101; break; // valorite
	case CraftResource.SpinedLeather:	oreType = 1061118; break; // spined
	case CraftResource.HornedLeather:	oreType = 1061117; break; // horned
	case CraftResource.BarbedLeather:	oreType = 1061116; break; // barbed
	case CraftResource.RedScales:		oreType = 1060814; break; // red
	case CraftResource.YellowScales:	oreType = 1060818; break; // yellow
	case CraftResource.BlackScales:		oreType = 1060820; break; // black
	case CraftResource.GreenScales:		oreType = 1060819; break; // green
	case CraftResource.WhiteScales:		oreType = 1060821; break; // white
	case CraftResource.BlueScales:		oreType = 1060815; break; // blue
	case CraftResource.typeof( CherryBoard ):				oreType = "Cherrywood"; break; // Cherry
	case CraftResource.typeof( IceBoard ):				oreType = "Icewood"; break; // Ice
	case CraftResource.typeof( FireBoard ):				oreType = "Firewood"; break; // Fire
	case CraftResource.typeof( ElwenwoodBoard ):				oreType = "Elwenwood"; break; // Elwenwood
	default: oreType = 0; break;
}
you see something different in the last 4 lines ?
Fix that and your craftitem that have the same error.
 

daat99

Moderator
Staff member
btw.
Code:
switch ( m_Resource )
this line start an if statement.
the if statement is inside the { } after it.
 

StrikeRTM

Wanderer
Code:
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS0117: (line 2578, column 11) 'S
erver.Items.CraftResource' does not contain a definition for 'Cherry'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS0117: (line 2579, column 11) 'S
erver.Items.CraftResource' does not contain a definition for 'IceLog'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS0117: (line 2580, column 11) 'S
erver.Items.CraftResource' does not contain a definition for 'FireLog'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS0117: (line 2581, column 11) 'S
erver.Items.CraftResource' does not contain a definition for 'Elwenwood'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
Code:
					case CraftResource.DullCopper:		oreType = 1053108; break; // dull copper
					case CraftResource.ShadowIron:		oreType = 1053107; break; // shadow iron
					case CraftResource.Copper:			oreType = 1053106; break; // copper
					case CraftResource.Bronze:			oreType = 1053105; break; // bronze
					case CraftResource.Gold:			oreType = 1053104; break; // golden
					case CraftResource.Agapite:			oreType = 1053103; break; // agapite
					case CraftResource.Verite:			oreType = 1053102; break; // verite
					case CraftResource.Valorite:		oreType = 1053101; break; // valorite
					case CraftResource.SpinedLeather:	oreType = 1061118; break; // spined
					case CraftResource.HornedLeather:	oreType = 1061117; break; // horned
					case CraftResource.BarbedLeather:	oreType = 1061116; break; // barbed
					case CraftResource.RedScales:		oreType = 1060814; break; // red
					case CraftResource.YellowScales:	oreType = 1060818; break; // yellow
					case CraftResource.BlackScales:		oreType = 1060820; break; // black
					case CraftResource.GreenScales:		oreType = 1060819; break; // green
					case CraftResource.WhiteScales:		oreType = 1060821; break; // white
					case CraftResource.BlueScales:		oreType = 1060815; break; // blue
					case CraftResource.Cherry:				oreType = "Cherrywood"; break; // Cherry
					case CraftResource.Ice:				oreType = "Icewood"; break; // Ice
					case CraftResource.Fire:				oreType = "Firewood"; break; // Fire
					case CraftResource.Elwenwood:				oreType = "Elwenwood"; break; // Elwenwood
					default: oreType = 0; break;
Now and how do i make this error dissapear? jjarmis told me to put typeof in so that i woudldn't get this error.
 

daat99

Moderator
Staff member
I ment the item scripts.
Not sure but you might want to check oreinfo.cs and see if you have the logs there.
 

StrikeRTM

Wanderer
Code:
RunUO - [[url]www.runuo.com][/url] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (12 errors, 0 warnings)
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS0029: (line 2578, column 46) Ca
nnot implicitly convert type 'string' to 'int'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS0029: (line 2579, column 43) Ca
nnot implicitly convert type 'string' to 'int'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS0029: (line 2580, column 44) Ca
nnot implicitly convert type 'string' to 'int'
 - Error: Scripts\Items\Weapons\BaseWeapon.cs: CS0029: (line 2581, column 49) Ca
nnot implicitly convert type 'string' to 'int'
 - Error: Scripts\Misc\OreInfo.cs: CS0103: (line 285, column 32) The name 'Cherr
y' does not exist in the class or namespace 'Server.Items.CraftAttributeInfo'
 - Error: Scripts\Misc\OreInfo.cs: CS0103: (line 301, column 30) The name 'Fire'
 does not exist in the class or namespace 'Server.Items.CraftAttributeInfo'
 - Error: Scripts\Misc\OreInfo.cs: CS0103: (line 310, column 35) The name 'Elwen
wood' does not exist in the class or namespace 'Server.Items.CraftAttributeInfo'

 - Error: Scripts\Misc\OreInfo.cs: CS1525: (line 576, column 4) Invalid expressi
on term 'else'
 - Error: Scripts\Misc\OreInfo.cs: CS1002: (line 576, column 9) ; expected
 - Error: Scripts\Misc\OreInfo.cs: CS0117: (line 394, column 49) 'Server.Items.C
raftAttributeInfo' does not contain a definition for 'Cherry'
 - Error: Scripts\Misc\OreInfo.cs: CS0117: (line 396, column 46) 'Server.Items.C
raftAttributeInfo' does not contain a definition for 'Fire'
 - Error: Scripts\Misc\OreInfo.cs: CS0117: (line 397, column 52) 'Server.Items.C
raftAttributeInfo' does not contain a definition for 'Elwenwood'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
I seem to be getting some error that i do not understand.

Scripts are attached to the post.
 

Attachments

  • scripts.zip
    21.4 KB · Views: 3

daat99

Moderator
Staff member
You didn't changed everything that you was supposed to change in OreInfo.cs
I'm not going to download it but it's at the end of the file.
You have int variable (like in distro) and string (what you suppose to have after modifying).
Make sure you replace the int with the apropriate strings.

Please refer to the tutorial about custom ores on exactly how to acomplish that.
 

StrikeRTM

Wanderer
daat99 said:
You didn't changed everything that you was supposed to change in OreInfo.cs
I'm not going to download it but it's at the end of the file.
You have int variable (like in distro) and string (what you suppose to have after modifying).
Make sure you replace the int with the apropriate strings.

Please refer to the tutorial about custom ores on exactly how to acomplish that.
So i have to replace it with a string such as comes after ores, but is for woods?

I cannot seem to find the FAQ of creating custom ores, i've seen it around. Coudl you psot a link please if you know it?
 

StrikeRTM

Wanderer
Code:
using System;
using System.Collections;

namespace Server.Items
{
	public enum CraftResource
	{
		None = 0,
		Iron = 1,
		DullCopper,
		ShadowIron,
		Copper,
		Bronze,
		Gold,
		Agapite,
		Verite,
		Valorite,

		RegularLeather = 101,
		SpinedLeather,
		HornedLeather,
		BarbedLeather,

		RedScales = 201,
		YellowScales,
		BlackScales,
		GreenScales,
		WhiteScales,
		BlueScales,

		Cherry = 301,
		Fire,
		Ice,
		Elwenwood,
	}

	public enum CraftResourceType
	{
		None,
		Metal,
		Leather,
		Scales,
		Wood
	}

	public class CraftAttributeInfo
	{
		private int m_WeaponFireDamage;
		private int m_WeaponColdDamage;
		private int m_WeaponPoisonDamage;
		private int m_WeaponEnergyDamage;
		private int m_WeaponDurability;
		private int m_WeaponLuck;
		private int m_WeaponGoldIncrease;
		private int m_WeaponLowerRequirements;

		private int m_ArmorPhysicalResist;
		private int m_ArmorFireResist;
		private int m_ArmorColdResist;
		private int m_ArmorPoisonResist;
		private int m_ArmorEnergyResist;
		private int m_ArmorDurability;
		private int m_ArmorLuck;
		private int m_ArmorGoldIncrease;
		private int m_ArmorLowerRequirements;

		private int m_RunicMinAttributes;
		private int m_RunicMaxAttributes;
		private int m_RunicMinIntensity;
		private int m_RunicMaxIntensity;

		public int WeaponFireDamage{ get{ return m_WeaponFireDamage; } set{ m_WeaponFireDamage = value; } }
		public int WeaponColdDamage{ get{ return m_WeaponColdDamage; } set{ m_WeaponColdDamage = value; } }
		public int WeaponPoisonDamage{ get{ return m_WeaponPoisonDamage; } set{ m_WeaponPoisonDamage = value; } }
		public int WeaponEnergyDamage{ get{ return m_WeaponEnergyDamage; } set{ m_WeaponEnergyDamage = value; } }
		public int WeaponDurability{ get{ return m_WeaponDurability; } set{ m_WeaponDurability = value; } }
		public int WeaponLuck{ get{ return m_WeaponLuck; } set{ m_WeaponLuck = value; } }
		public int WeaponGoldIncrease{ get{ return m_WeaponGoldIncrease; } set{ m_WeaponGoldIncrease = value; } }
		public int WeaponLowerRequirements{ get{ return m_WeaponLowerRequirements; } set{ m_WeaponLowerRequirements = value; } }

		public int ArmorPhysicalResist{ get{ return m_ArmorPhysicalResist; } set{ m_ArmorPhysicalResist = value; } }
		public int ArmorFireResist{ get{ return m_ArmorFireResist; } set{ m_ArmorFireResist = value; } }
		public int ArmorColdResist{ get{ return m_ArmorColdResist; } set{ m_ArmorColdResist = value; } }
		public int ArmorPoisonResist{ get{ return m_ArmorPoisonResist; } set{ m_ArmorPoisonResist = value; } }
		public int ArmorEnergyResist{ get{ return m_ArmorEnergyResist; } set{ m_ArmorEnergyResist = value; } }
		public int ArmorDurability{ get{ return m_ArmorDurability; } set{ m_ArmorDurability = value; } }
		public int ArmorLuck{ get{ return m_ArmorLuck; } set{ m_ArmorLuck = value; } }
		public int ArmorGoldIncrease{ get{ return m_ArmorGoldIncrease; } set{ m_ArmorGoldIncrease = value; } }
		public int ArmorLowerRequirements{ get{ return m_ArmorLowerRequirements; } set{ m_ArmorLowerRequirements = value; } }

		public int RunicMinAttributes{ get{ return m_RunicMinAttributes; } set{ m_RunicMinAttributes = value; } }
		public int RunicMaxAttributes{ get{ return m_RunicMaxAttributes; } set{ m_RunicMaxAttributes = value; } }
		public int RunicMinIntensity{ get{ return m_RunicMinIntensity; } set{ m_RunicMinIntensity = value; } }
		public int RunicMaxIntensity{ get{ return m_RunicMaxIntensity; } set{ m_RunicMaxIntensity = value; } }

		public CraftAttributeInfo()
		{
		}

		public static readonly CraftAttributeInfo Blank;
		public static readonly CraftAttributeInfo DullCopper, ShadowIron, Copper, Bronze, Golden, Agapite, Verite, Valorite, Blaze, Ice, Toxic, Electrum, Platinum;
		public static readonly CraftAttributeInfo Spined, Horned, Barbed, Polar, Synthetic, Daemonic, Shadow, Frost, Ethereal;
		public static readonly CraftAttributeInfo RedScales, YellowScales, BlackScales, GreenScales, WhiteScales, BlueScales, CopperScales, SilverScales, GoldScales;
		public static readonly CraftAttributeInfo Pine, Ash, Mohogany, Yew, Oak, Zircote, Ebony, Bamboo, PurpleHeart, Redwood, Petrified;

		static CraftAttributeInfo()
		{
			Blank = new CraftAttributeInfo();

			CraftAttributeInfo dullCopper = DullCopper = new CraftAttributeInfo();

			dullCopper.ArmorPhysicalResist = 6;
			dullCopper.ArmorDurability = 50;
			dullCopper.ArmorLowerRequirements = 20;
			dullCopper.WeaponDurability = 100;
			dullCopper.WeaponLowerRequirements = 50;
			dullCopper.RunicMinAttributes = 1;
			dullCopper.RunicMaxAttributes = 2;
			dullCopper.RunicMinIntensity = 10;
			dullCopper.RunicMaxIntensity = 35;

			CraftAttributeInfo shadowIron = ShadowIron = new CraftAttributeInfo();

			shadowIron.ArmorPhysicalResist = 2;
			shadowIron.ArmorFireResist = 1;
			shadowIron.ArmorEnergyResist = 5;
			shadowIron.ArmorDurability = 100;
			shadowIron.WeaponColdDamage = 20;
			shadowIron.WeaponDurability = 50;
			shadowIron.RunicMinAttributes = 2;
			shadowIron.RunicMaxAttributes = 2;
			shadowIron.RunicMinIntensity = 20;
			shadowIron.RunicMaxIntensity = 45;

			CraftAttributeInfo copper = Copper = new CraftAttributeInfo();

			copper.ArmorPhysicalResist = 1;
			copper.ArmorFireResist = 1;
			copper.ArmorPoisonResist = 5;
			copper.ArmorEnergyResist = 2;
			copper.WeaponPoisonDamage = 10;
			copper.WeaponEnergyDamage = 20;
			copper.RunicMinAttributes = 2;
			copper.RunicMaxAttributes = 3;
			copper.RunicMinIntensity = 25;
			copper.RunicMaxIntensity = 50;

			CraftAttributeInfo bronze = Bronze = new CraftAttributeInfo();

			bronze.ArmorPhysicalResist = 3;
			bronze.ArmorColdResist = 5;
			bronze.ArmorPoisonResist = 1;
			bronze.ArmorEnergyResist = 1;
			bronze.WeaponFireDamage = 40;
			bronze.RunicMinAttributes = 3;
			bronze.RunicMaxAttributes = 3;
			bronze.RunicMinIntensity = 30;
			bronze.RunicMaxIntensity = 65;

			CraftAttributeInfo golden = Golden = new CraftAttributeInfo();

			golden.ArmorPhysicalResist = 1;
			golden.ArmorFireResist = 1;
			golden.ArmorColdResist = 2;
			golden.ArmorEnergyResist = 2;
			golden.ArmorLuck = 40;
			golden.ArmorLowerRequirements = 30;
			golden.WeaponLuck = 40;
			golden.WeaponLowerRequirements = 50;
			golden.RunicMinAttributes = 3;
			golden.RunicMaxAttributes = 4;
			golden.RunicMinIntensity = 35;
			golden.RunicMaxIntensity = 75;

			CraftAttributeInfo agapite = Agapite = new CraftAttributeInfo();

			agapite.ArmorPhysicalResist = 2;
			agapite.ArmorFireResist = 3;
			agapite.ArmorColdResist = 2;
			agapite.ArmorPoisonResist = 2;
			agapite.ArmorEnergyResist = 2;
			agapite.WeaponColdDamage = 30;
			agapite.WeaponEnergyDamage = 20;
			agapite.RunicMinAttributes = 4;
			agapite.RunicMaxAttributes = 4;
			agapite.RunicMinIntensity = 40;
			agapite.RunicMaxIntensity = 80;

			CraftAttributeInfo verite = Verite = new CraftAttributeInfo();

			verite.ArmorPhysicalResist = 3;
			verite.ArmorFireResist = 3;
			verite.ArmorColdResist = 2;
			verite.ArmorPoisonResist = 3;
			verite.ArmorEnergyResist = 1;
			verite.WeaponPoisonDamage = 40;
			verite.WeaponEnergyDamage = 20;
			verite.RunicMinAttributes = 4;
			verite.RunicMaxAttributes = 5;
			verite.RunicMinIntensity = 45;
			verite.RunicMaxIntensity = 90;

			CraftAttributeInfo valorite = Valorite = new CraftAttributeInfo();

			valorite.ArmorPhysicalResist = 4;
			valorite.ArmorColdResist = 3;
			valorite.ArmorPoisonResist = 3;
			valorite.ArmorEnergyResist = 3;
			valorite.ArmorDurability = 50;
			valorite.WeaponFireDamage = 10;
			valorite.WeaponColdDamage = 20;
			valorite.WeaponPoisonDamage = 10;
			valorite.WeaponEnergyDamage = 20;
			valorite.RunicMinAttributes = 5;
			valorite.RunicMaxAttributes = 5;
			valorite.RunicMinIntensity = 50;
			valorite.RunicMaxIntensity = 100;

			CraftAttributeInfo spined = Spined = new CraftAttributeInfo();

			spined.ArmorPhysicalResist = 2;
			spined.ArmorFireResist = 2;
			spined.ArmorColdResist = 2;
			spined.ArmorPoisonResist = 2;
			spined.ArmorEnergyResist = 2;
			spined.RunicMinAttributes = 2;
			spined.RunicMaxAttributes = 2;
			spined.RunicMinIntensity = 10;
			spined.RunicMaxIntensity = 100;

			CraftAttributeInfo horned = Horned = new CraftAttributeInfo();

			horned.ArmorPhysicalResist = 4;
			horned.ArmorFireResist = 4;
			horned.ArmorColdResist = 4;
			horned.ArmorPoisonResist = 4;
			horned.ArmorEnergyResist = 4;
			horned.RunicMinAttributes = 2;
			horned.RunicMaxAttributes = 2;
			horned.RunicMinIntensity = 20;
			horned.RunicMaxIntensity = 100;

			CraftAttributeInfo barbed = Barbed = new CraftAttributeInfo();

			barbed.ArmorPhysicalResist = 6;
			barbed.ArmorFireResist = 6;
			barbed.ArmorColdResist = 6;
			barbed.ArmorPoisonResist = 6;
			barbed.ArmorEnergyResist = 6;
			barbed.RunicMinAttributes = 2;
			barbed.RunicMaxAttributes = 3;
			barbed.RunicMinIntensity = 30;
			barbed.RunicMaxIntensity = 100;
			
			CraftAttributeInfo red = RedScales = new CraftAttributeInfo();

			red.ArmorFireResist = 10;
			red.ArmorColdResist = -3;

			CraftAttributeInfo yellow = YellowScales = new CraftAttributeInfo();

			yellow.ArmorPhysicalResist = -3;
			yellow.ArmorLuck = 20;

			CraftAttributeInfo black = BlackScales = new CraftAttributeInfo();

			black.ArmorPhysicalResist = 10;
			black.ArmorEnergyResist = -3;

			CraftAttributeInfo green = GreenScales = new CraftAttributeInfo();

			green.ArmorFireResist = -3;
			green.ArmorPoisonResist = 10;

			CraftAttributeInfo white = WhiteScales = new CraftAttributeInfo();

			white.ArmorPhysicalResist = -3;
			white.ArmorColdResist = 10;

			CraftAttributeInfo blue = BlueScales = new CraftAttributeInfo();

			blue.ArmorPoisonResist = -3;
			blue.ArmorEnergyResist = 10;
			
			CraftAttributeInfo cherry = Cherry = new CraftAttributeInfo();

			cherry.WeaponDurability = 50;
			cherry.RunicMinAttributes = 1;
			cherry.RunicMaxAttributes = 2;
			cherry.RunicMinIntensity = 10;
			cherry.RunicMaxIntensity = 40;
			
			CraftAttributeInfo ice = Ice = new CraftAttributeInfo();

			ice.WeaponDurability = 50;
			ice.RunicMinAttributes = 1;
			ice.RunicMaxAttributes = 3;
			ice.RunicMinIntensity = 15;
			ice.RunicMaxIntensity = 50;

			CraftAttributeInfo fire = Fire = new CraftAttributeInfo();

			fire.WeaponDurability = 100;
			fire.WeaponLowerRequirements = 50;
			fire.RunicMinAttributes = 1;
			fire.RunicMaxAttributes = 4;
			fire.RunicMinIntensity = 20;
			fire.RunicMaxIntensity = 60;

			CraftAttributeInfo elwenwood = Elwenwood = new CraftAttributeInfo();

			elwenwood.WeaponDurability = 100;
			elwenwood.WeaponLowerRequirements = 50;
			elwenwood.RunicMinAttributes = 2;
			elwenwood.RunicMaxAttributes = 5;
			elwenwood.RunicMinIntensity = 30;
			elwenwood.RunicMaxIntensity = 70;

		}
	}

	public class CraftResourceInfo
	{
		private int m_Hue;
		private int m_Number;
		private string m_Name;
		private CraftAttributeInfo m_AttributeInfo;
		private CraftResource m_Resource;
		private Type[] m_ResourceTypes;

		public int Hue{ get{ return m_Hue; } }
		public int Number{ get{ return m_Number; } }
		public string Name{ get{ return m_Name; } }
		public CraftAttributeInfo AttributeInfo{ get{ return m_AttributeInfo; } }
		public CraftResource Resource{ get{ return m_Resource; } }
		public Type[] ResourceTypes{ get{ return m_ResourceTypes; } }

		public CraftResourceInfo( int hue, int number, string name, CraftAttributeInfo attributeInfo, CraftResource resource, params Type[] resourceTypes )
		{
			m_Hue = hue;
			m_Number = number;
			m_Name = name;
			m_AttributeInfo = attributeInfo;
			m_Resource = resource;
			m_ResourceTypes = resourceTypes;

			for ( int i = 0; i < resourceTypes.Length; ++i )
				CraftResources.RegisterType( resourceTypes[i], resource );
		}
	}

	public class CraftResources
	{
		private static CraftResourceInfo[] m_MetalInfo = new CraftResourceInfo[]
			{
				new CraftResourceInfo( 0x000, 1053109,	"Iron",			CraftAttributeInfo.Blank,		CraftResource.Iron,				typeof( IronIngot ),		typeof( IronOre ),			typeof( Granite ) ),
				new CraftResourceInfo( 0x973, 1053108,	"Dull Copper",	CraftAttributeInfo.DullCopper,	CraftResource.DullCopper,		typeof( DullCopperIngot ),	typeof( DullCopperOre ),	typeof( DullCopperGranite ) ),
				new CraftResourceInfo( 0x966, 1053107,	"Shadow Iron",	CraftAttributeInfo.ShadowIron,	CraftResource.ShadowIron,		typeof( ShadowIronIngot ),	typeof( ShadowIronOre ),	typeof( ShadowIronGranite ) ),
				new CraftResourceInfo( 0x96D, 1053106,	"Copper",		CraftAttributeInfo.Copper,		CraftResource.Copper,			typeof( CopperIngot ),		typeof( CopperOre ),		typeof( CopperGranite ) ),
				new CraftResourceInfo( 0x972, 1053105,	"Bronze",		CraftAttributeInfo.Bronze,		CraftResource.Bronze,			typeof( BronzeIngot ),		typeof( BronzeOre ),		typeof( BronzeGranite ) ),
				new CraftResourceInfo( 0x8A5, 1053104,	"Gold",			CraftAttributeInfo.Golden,		CraftResource.Gold,				typeof( GoldIngot ),		typeof( GoldOre ),			typeof( GoldGranite ) ),
				new CraftResourceInfo( 0x979, 1053103,	"Agapite",		CraftAttributeInfo.Agapite,		CraftResource.Agapite,			typeof( AgapiteIngot ),		typeof( AgapiteOre ),		typeof( AgapiteGranite ) ),
				new CraftResourceInfo( 0x89F, 1053102,	"Verite",		CraftAttributeInfo.Verite,		CraftResource.Verite,			typeof( VeriteIngot ),		typeof( VeriteOre ),		typeof( VeriteGranite ) ),
				new CraftResourceInfo( 0x8AB, 1053101,	"Valorite",		CraftAttributeInfo.Valorite,	CraftResource.Valorite,			typeof( ValoriteIngot ),	typeof( ValoriteOre ),		typeof( ValoriteGranite ) ),
			};

		private static CraftResourceInfo[] m_ScaleInfo = new CraftResourceInfo[]
			{
				new CraftResourceInfo( 0x66D, 1053129,	"Red Scales",		CraftAttributeInfo.RedScales,		CraftResource.RedScales,		typeof( RedScales ) ),
				new CraftResourceInfo( 54,    1053130,	"Yellow Scales",	CraftAttributeInfo.YellowScales,	CraftResource.YellowScales,		typeof( YellowScales ) ),
				new CraftResourceInfo( 0x455, 1053131,	"Black Scales",		CraftAttributeInfo.BlackScales,		CraftResource.BlackScales,		typeof( BlackScales ) ),
				new CraftResourceInfo( 0x851, 1053132,	"Green Scales",		CraftAttributeInfo.GreenScales,		CraftResource.GreenScales,		typeof( GreenScales ) ),
				new CraftResourceInfo( 0x8FD, 1053133,	"White Scales",		CraftAttributeInfo.WhiteScales,		CraftResource.WhiteScales,		typeof( WhiteScales ) ),
				new CraftResourceInfo( 0x8B0, 1053134,	"Blue Scales",		CraftAttributeInfo.BlueScales,		CraftResource.BlueScales,		typeof( BlueScales ) ),
			};

		private static CraftResourceInfo[] m_LeatherInfo = new CraftResourceInfo[]
			{
				new CraftResourceInfo( 0x000, 1049353,		"Normal",		CraftAttributeInfo.Blank,			CraftResource.RegularLeather,	typeof( Leather ),			typeof( Hides ) ),
				new CraftResourceInfo( 0x283, 1049354,		"Spined",		CraftAttributeInfo.Spined,			CraftResource.SpinedLeather,	typeof( SpinedLeather ),	typeof( SpinedHides ) ),
				new CraftResourceInfo( 0x227, 1049355,		"Horned",		CraftAttributeInfo.Horned,			CraftResource.HornedLeather,	typeof( HornedLeather ),	typeof( HornedHides ) ),
				new CraftResourceInfo( 0x1C1, 1049356,		"Barbed",		CraftAttributeInfo.Barbed,			CraftResource.BarbedLeather,	typeof( BarbedLeather ),	typeof( BarbedHides ) ),
		};

		private static CraftResourceInfo[] m_AOSLeatherInfo = new CraftResourceInfo[]
			{
				new CraftResourceInfo( 0x000, 1049353,		"Normal",		CraftAttributeInfo.Blank,			CraftResource.RegularLeather,	typeof( Leather ),			typeof( Hides ) ),
				new CraftResourceInfo( 0x8AC, 1049354,		"Spined",		CraftAttributeInfo.Spined,			CraftResource.SpinedLeather,	typeof( SpinedLeather ),	typeof( SpinedHides ) ),
				new CraftResourceInfo( 0x845, 1049355, 		"Horned",		CraftAttributeInfo.Horned,			CraftResource.HornedLeather,	typeof( HornedLeather ),	typeof( HornedHides ) ),
				new CraftResourceInfo( 0x851, 1049356,		"Barbed",		CraftAttributeInfo.Barbed,			CraftResource.BarbedLeather,	typeof( BarbedLeather ),	typeof( BarbedHides ) ),
		};
		private static CraftResourceInfo[] m_WoodInfo = new CraftResourceInfo[]
			{
				new CraftResourceInfo( 1262, 0,	"Cherry",			CraftAttributeInfo.Cherry,		CraftResource.Cherry,			typeof( CherryLog ) ),
				new CraftResourceInfo( 961,  0,	"Ice",			CraftAttributeInfo.Ice,			CraftResource.Ice,			typeof( IceLog ) ),
				new CraftResourceInfo( 355,  0,	"Fire",		CraftAttributeInfo.Fire,	CraftResource.Fire,		typeof( FireLog ) ),
				new CraftResourceInfo( 1281, 0, "Elwenwood",			CraftAttributeInfo.Elwenwood,			CraftResource.Elwenwood,			typeof( ElwenwoodLog ) ),
		};

		/// <summary>
		/// Returns true if '<paramref name="resource"/>' is None, Iron, or RegularLeather. False if otherwise.
		/// </summary>
		public static bool IsStandard( CraftResource resource )
		{
			return ( resource == CraftResource.None || resource == CraftResource.Iron || resource == CraftResource.RegularLeather );
		}

		private static Hashtable m_TypeTable;

		/// <summary>
		/// Registers that '<paramref name="resourceType"/>' uses '<paramref name="resource"/>' so that it can later be queried by <see cref="CraftResources.GetFromType"/>
		/// </summary>
		public static void RegisterType( Type resourceType, CraftResource resource )
		{
			if ( m_TypeTable == null )
				m_TypeTable = new Hashtable();

			m_TypeTable[resourceType] = resource;
		}

		/// <summary>
		/// Returns the <see cref="CraftResource"/> value for which '<paramref name="resourceType"/>' uses -or- CraftResource.None if an unregistered type was specified.
		/// </summary>
		public static CraftResource GetFromType( Type resourceType )
		{
			if ( m_TypeTable == null )
				return CraftResource.None;

			object obj = m_TypeTable[resourceType];

			if ( !(obj is CraftResource) )
				return CraftResource.None;

			return (CraftResource)obj;
		}

		/// <summary>
		/// Returns a <see cref="CraftResourceInfo"/> instance describing '<paramref name="resource"/>' -or- null if an invalid resource was specified.
		/// </summary>
		public static CraftResourceInfo GetInfo( CraftResource resource )
		{
			CraftResourceInfo[] list = null;

			switch ( GetType( resource ) )
			{
				case CraftResourceType.Metal: list = m_MetalInfo; break;
				case CraftResourceType.Leather: list = Core.AOS ? m_AOSLeatherInfo : m_LeatherInfo; break;
				case CraftResourceType.Scales: list = m_ScaleInfo; break;
				case CraftResourceType.Wood: list = m_WoodInfo; break;
			}

			if ( list != null )
			{
				int index = GetIndex( resource );

				if ( index >= 0 && index < list.Length )
					return list[index];
			}

			return null;
		}

		/// <summary>
		/// Returns a <see cref="CraftResourceType"/> value indiciating the type of '<paramref name="resource"/>'.
		/// </summary>
		public static CraftResourceType GetType( CraftResource resource )
		{
			if ( resource >= CraftResource.Iron && resource <= CraftResource.Valorite )
				return CraftResourceType.Metal;

			if ( resource >= CraftResource.RegularLeather && resource <= CraftResource.BarbedLeather )
				return CraftResourceType.Leather;

			if ( resource >= CraftResource.RedScales && resource <= CraftResource.BlueScales )
				return CraftResourceType.Scales;

			if ( resource >= CraftResource.Cherry && resource <= CraftResource.Elwenwood )
				return CraftResourceType.Wood;

			return CraftResourceType.None;
		}

		/// <summary>
		/// Returns the first <see cref="CraftResource"/> in the series of resources for which '<paramref name="resource"/>' belongs.
		/// </summary>
		public static CraftResource GetStart( CraftResource resource )
		{
			switch ( GetType( resource ) )
			{
				case CraftResourceType.Metal: return CraftResource.Iron;
				case CraftResourceType.Leather: return CraftResource.RegularLeather;
				case CraftResourceType.Wood: return CraftResource.Cherry;
				case CraftResourceType.Scales: return CraftResource.RedScales;
			}

			return CraftResource.None;
		}

		/// <summary>
		/// Returns the index of '<paramref name="resource"/>' in the seriest of resources for which it belongs.
		/// </summary>
		public static int GetIndex( CraftResource resource )
		{
			CraftResource start = GetStart( resource );

			if ( start == CraftResource.None )
				return 0;

			return (int)(resource - start);
		}

		/// <summary>
		/// Returns the <see cref="CraftResourceInfo.Number"/> property of '<paramref name="resource"/>' -or- 0 if an invalid resource was specified.
		/// </summary>
		public static int GetLocalizationNumber( CraftResource resource )
		{
			CraftResourceInfo info = GetInfo( resource );

			return ( info == null ? 0 : info.Number );
		}

		/// <summary>
		/// Returns the <see cref="CraftResourceInfo.Hue"/> property of '<paramref name="resource"/>' -or- 0 if an invalid resource was specified.
		/// </summary>
		public static int GetHue( CraftResource resource )
		{
			CraftResourceInfo info = GetInfo( resource );

			return ( info == null ? 0 : info.Hue );
		}

		/// <summary>
		/// Returns the <see cref="CraftResourceInfo.Name"/> property of '<paramref name="resource"/>' -or- an empty string if the resource specified was invalid.
		/// </summary>
		public static string GetName( CraftResource resource )
		{
			CraftResourceInfo info = GetInfo( resource );

			return ( info == null ? String.Empty : info.Name );
		}

		/// <summary>
		/// Returns the <see cref="CraftResource"/> value which represents '<paramref name="info"/>' -or- CraftResource.None if unable to convert.
		/// </summary>
		public static CraftResource GetFromOreInfo( OreInfo info )
		{
			if ( info.Name.IndexOf( "Spined" ) >= 0 )
				return CraftResource.SpinedLeather;
			else if ( info.Name.IndexOf( "Horned" ) >= 0 )
				return CraftResource.HornedLeather;
			else if ( info.Name.IndexOf( "Barbed" ) >= 0 )
				return CraftResource.BarbedLeather;
			else if ( info.Name.IndexOf( "Leather" ) >= 0 )
				return CraftResource.RegularLeather;

			if ( info.Level == 0 )
				return CraftResource.Iron;
			else if ( info.Level == 1 )
				return CraftResource.DullCopper;
			else if ( info.Level == 2 )
				return CraftResource.ShadowIron;
			else if ( info.Level == 3 )
				return CraftResource.Copper;
			else if ( info.Level == 4 )
				return CraftResource.Bronze;
			else if ( info.Level == 5 )
				return CraftResource.Gold;
			else if ( info.Level == 6 )
				return CraftResource.Agapite;
			else if ( info.Level == 7 )
				return CraftResource.Verite;
			else if ( info.Level == 8 )
				return CraftResource.Valorite;
			else if ( info.Level == 9 )

			else if ( info.Level == 301 )
				return CraftResource.Cherry;
			else if ( info.Level == 302 )
				return CraftResource.Ice;
			else if ( info.Level == 303 )
				return CraftResource.Fire;
			else if ( info.Level == 304 )
				return CraftResource.Elwenwood;
			else if ( info.Level == 305 )
						
			return CraftResource.None;
		}

		/// <summary>
		/// Returns the <see cref="CraftResource"/> value which represents '<paramref name="info"/>', using '<paramref name="material"/>' to help resolve leather OreInfo instances.
		/// </summary>
		public static CraftResource GetFromOreInfo( OreInfo info, ArmorMaterialType material )
		{
			if ( material == ArmorMaterialType.Studded || material == ArmorMaterialType.Leather || material == ArmorMaterialType.Spined ||
				material == ArmorMaterialType.Horned || material == ArmorMaterialType.Barbed )
			{
				if ( info.Level == 0 )
					return CraftResource.RegularLeather;
				else if ( info.Level == 1 )
					return CraftResource.SpinedLeather;
				else if ( info.Level == 2 )
					return CraftResource.HornedLeather;
				else if ( info.Level == 3 )
					return CraftResource.BarbedLeather;
				else if ( info.Level == 4 )

				return CraftResource.None;
			}

			return GetFromOreInfo( info );
		}
	}

	// NOTE: This class is only for compatability with very old RunUO versions.
	// No changes to it should be required for custom resources.
	public class OreInfo
	{
		public static readonly OreInfo Iron			= new OreInfo( 0, 0x000, "Iron" );
		public static readonly OreInfo DullCopper	= new OreInfo( 1, 0x973, "Dull Copper" );
		public static readonly OreInfo ShadowIron	= new OreInfo( 2, 0x966, "Shadow Iron" );
		public static readonly OreInfo Copper		= new OreInfo( 3, 0x96D, "Copper" );
		public static readonly OreInfo Bronze		= new OreInfo( 4, 0x972, "Bronze" );
		public static readonly OreInfo Gold			= new OreInfo( 5, 0x8A5, "Gold" );
		public static readonly OreInfo Agapite		= new OreInfo( 6, 0x979, "Agapite" );
		public static readonly OreInfo Verite		= new OreInfo( 7, 0x89F, "Verite" );
		public static readonly OreInfo Valorite		= new OreInfo( 8, 0x8AB, "Valorite" );
		public static readonly OreInfo Cherry		= new OreInfo( 301, 1262, "Cherry" );
		public static readonly OreInfo Ice			= new OreInfo( 302, 961, "Ice" );
		public static readonly OreInfo Fire	 	    = new OreInfo( 303, 355, "Fire" );
		public static readonly OreInfo Elwenwood   	= new OreInfo( 304, 1281, "Elwenwood" );

		private int m_Level;
		private int m_Hue;
		private string m_Name;

		public OreInfo( int level, int hue, string name )
		{
			m_Level = level;
			m_Hue = hue;
			m_Name = name;
		}

		public int Level
		{
			get
			{
				return m_Level;
			}
		}

		public int Hue
		{
			get
			{
				return m_Hue;
			}
		}

		public string Name
		{
			get
			{
				return m_Name;
			}
		}
	}
}
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (8 errors, 0 warnings)
 - Error: Scripts\Misc\OreInfo.cs: CS0103: (line 285, column 32) The name 'Cherr
y' does not exist in the class or namespace 'Server.Items.CraftAttributeInfo'
 - Error: Scripts\Misc\OreInfo.cs: CS0103: (line 301, column 30) The name 'Fire'
 does not exist in the class or namespace 'Server.Items.CraftAttributeInfo'
 - Error: Scripts\Misc\OreInfo.cs: CS0103: (line 310, column 35) The name 'Elwen
wood' does not exist in the class or namespace 'Server.Items.CraftAttributeInfo'

 - Error: Scripts\Misc\OreInfo.cs: CS1525: (line 576, column 4) Invalid expressi
on term 'else'
 - Error: Scripts\Misc\OreInfo.cs: CS1002: (line 576, column 9) ; expected
 - Error: Scripts\Misc\OreInfo.cs: CS0117: (line 394, column 49) 'Server.Items.C
raftAttributeInfo' does not contain a definition for 'Cherry'
 - Error: Scripts\Misc\OreInfo.cs: CS0117: (line 396, column 46) 'Server.Items.C
raftAttributeInfo' does not contain a definition for 'Fire'
 - Error: Scripts\Misc\OreInfo.cs: CS0117: (line 397, column 52) 'Server.Items.C
raftAttributeInfo' does not contain a definition for 'Elwenwood'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
I managed to fix baseweapon.cs but ore info is about where it was last time.
 
Top