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!

[RunUO 2.0 RC1] Resources (Ore/Granite/Leather/Wood/Boards/Crystals/Powders)

FingersMcSteal

Sorceror
The original system was built up on RC1, thats the V12 files. The later version which was for SVN300 worked but did not have the BOD system changes made to it. There may be some incompatibility between RC2 type servers running that release, try the newer version.

From memory the BOD system was the part which slowed me down getting the new resources to work with the BOD system / BOD rewards and BOD books (changes to BOD book gumps etc etc), as well as changing the whole BOD system to run with the new resources it also needed changes made to the Docs.CS files too, thats the main file which creates the 2 web pages for the Smith & Tailor BOD tables, shows rewards etc etc... Not to mention is the file responsible for DOC's (or Documentation generation). So... as you can see... i wasn't wanting to spend the time on all that again :rolleyes:

The main goal at the time was to get the resource part into a SVN 300 type server, which the newer files do, however... no BOD system changes... sorry.

You could look into the older files and have a go at it tho, for me... i'd just try the newer version.
 

Stuart lil

Sorceror
I did what you told me, and the strangest thing appered, it all seems to point to the Commodity tho, anyone know why ?

Code:
Errors:
 + Items/Resources/Arrows/Arrow.cs:
    CS0535: Line 5: 'Server.Items.Arrow' does not implement interface member 'Se
rver.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Arrows/Bolt.cs:
    CS0535: Line 5: 'Server.Items.Bolt' does not implement interface member 'Ser
ver.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Arrows/Feather.cs:
    CS0535: Line 6: 'Server.Items.Feather' does not implement interface member '
Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Arrows/Shaft.cs:
    CS0535: Line 6: 'Server.Items.Shaft' does not implement interface member 'Se
rver.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/BatWing.cs:
    CS0535: Line 7: 'Server.Items.BatWing' does not implement interface member '
Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/BlackPearl.cs:
    CS0535: Line 7: 'Server.Items.BlackPearl' does not implement interface membe
r 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/Bloodmoss.cs:
    CS0535: Line 7: 'Server.Items.Bloodmoss' does not implement interface member
 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/DaemonBlood.cs:
    CS0535: Line 7: 'Server.Items.DaemonBlood' does not implement interface memb
er 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/DeadWood.cs:
    CS0535: Line 7: 'Server.Items.DeadWood' does not implement interface member
'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/Garlic.cs:
    CS0535: Line 7: 'Server.Items.Garlic' does not implement interface member 'S
erver.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/Ginseng.cs:
    CS0535: Line 7: 'Server.Items.Ginseng' does not implement interface member '
Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/GraveDust.cs:
    CS0535: Line 7: 'Server.Items.GraveDust' does not implement interface member
 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/MandrakeRoot.cs:
    CS0535: Line 7: 'Server.Items.MandrakeRoot' does not implement interface mem
ber 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/Nightshade.cs:
    CS0535: Line 7: 'Server.Items.Nightshade' does not implement interface membe
r 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/NoxCrystal.cs:
    CS0535: Line 7: 'Server.Items.NoxCrystal' does not implement interface membe
r 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/PigIron.cs:
    CS0535: Line 7: 'Server.Items.PigIron' does not implement interface member '
Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/SpidersSilk.cs:
    CS0535: Line 7: 'Server.Items.SpidersSilk' does not implement interface memb
er 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Resources/Reagents/SulfurousAsh.cs:
    CS0535: Line 7: 'Server.Items.SulfurousAsh' does not implement interface mem
ber 'Server.Items.ICommodity.DescriptionNumber'
 + Items/Skill Items/Lumberjack/Log.cs:
    CS0535: Line 7: 'Server.Items.Log' does not implement interface member 'Serv
er.Items.ICommodity.DescriptionNumber'
 + Items/Skill Items/Specialized/Sand.cs:
    CS0535: Line 7: 'Server.Items.Sand' does not implement interface member 'Ser
ver.Items.ICommodity.DescriptionNumber'

Peace =P
 

Melchior

Wanderer
I dont know exactly what you did (perhaps you installed a new version of CommodityDeed.cs) but al the files in your error list need to have a line (in blue) like the example (Arrorw.cs) here:
Code:
using System;

namespace Server.Items
{
	public class Arrow : Item, ICommodity
	{
		string ICommodity.Description
		{
			get
			{
				return String.Format( Amount == 1 ? "{0} arrow" : "{0} arrows", Amount );
			}
		}

[COLOR="DeepSkyBlue"]		int ICommodity.DescriptionNumber { get { return LabelNumber; } }[/COLOR]

		public override double DefaultWeight
		{
			get { return 0.1; }
		}

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

		[Constructable]
		public Arrow( int amount ) : base( 0xF3F )
		{
			Stackable = true;
			Amount = amount;
		}

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

FingersMcSteal

Sorceror
Code:
[COLOR=#00bfff]int ICommodity.DescriptionNumber { get { return LabelNumber; } }[/COLOR]

This was some of the changes that stopped the older version working, the way the resources were defined changed, the newer version of this release covered the changes tho and should work, although... no BOD system changes made.

The post further up refering to the Regents problem is something totally different to the release, both versions.

The resource package's i posted here DO NOT effect spell regents so what's causing those errors i couldn't say, rough guess from the error's and previous posts regarding this if i rememer right was someone had mixed the versions up when installing to a server.

Back track through the thread tho, it's cropped up before and the shard owner resolved his problem.

* EDIT *
From a few posts above...

The errors you have showing there that refer to the regents will have nothing to do with this resource release, this is only for things like the ore/leathers/woods etc... nothing to do with reg's.

Looking at the errors tho i 'think' you may have replaced slightly older server files than the version of the SVN you have there. Around SVN 300 runuo made a couple of changes to the Icommodity format for a few things.

I'm guessing you might be using files from just before these new changes were added to the SVN of the server you have. It will not work with mixed file versions.

The only suggestion i can make would be replace your Regent scripts back to see if that fix's those errors (which this release had nothing to do with) and the same with the Board.cs and see if that resolves some of the errors your getting, basically try one set of files then the other and see what happens but this will not work if theres a mixture of older scripts and newer. Looks like the servers new and trying to work with older versions of the files that are throwing the errors up.
 

Maverick2002

Wanderer
Wtf!?!

Code:
Errors:
 + Custom/NewResources/Bods&Runics/Vendors/Blacksmith.cs:
    CS0115: Line 125: 'Server.Mobiles.Blacksmith.OnSuccessfulBulkOrderRecieve(Server.Mobile)': no suitable  method found to override
 + Custom/NewResources/Bods&Runics/Vendors/Tailor.cs:
    CS0115: Line 74: 'Server.Mobiles.Tailor.OnSuccessfulBulkOrderRecieve(Server.Mobile)': no suitable method found to override

And this means???
What exactly?
 

FingersMcSteal

Sorceror
Well i'm guessing you gave the vendors some kind of bod they have a problem with, without you giving me 'some' idea of what you did (installed etc etc) i can't give you 'some' idea of how to fix it ;)
 

SoulzBaen

Wanderer
eeek!

ok, i'm a bit new at this. couldn't find the files to replace (using RC2) so i unzipped YaksResources.zip into the customs folder. got lots of errors when trying to run. can't seem to find the files that need to be relpaced.

Error:

RunUO - [www.runuo.com] Version 2.0, Build 3344.39098
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (38 errors, 0 warnings)
Errors:
+ Engines/Craft/DefBlacksmithy.cs:
CS0101: Line 57: The namespace 'Server.Engines.Craft' already contains a def
inition for 'DefBlacksmithy'
CS0102: Line 197: The type 'Server.Engines.Craft.DefBlacksmithy' already con
tains a definition for 'InternalTimer'
CS0101: Line 785: The namespace 'Server.Engines.Craft' already contains a de
finition for 'ForgeAttribute'
CS0101: Line 792: The namespace 'Server.Engines.Craft' already contains a de
finition for 'AnvilAttribute'
+ Engines/Craft/DefBowFletching.cs:
CS0101: Line 28: The namespace 'Server.Engines.Craft' already contains a def
inition for 'DefBowFletching'
+ Engines/Craft/DefCarpentry.cs:
CS0101: Line 39: The namespace 'Server.Engines.Craft' already contains a def
inition for 'DefCarpentry'
+ Engines/Craft/DefGlassblowing.cs:
CS0101: Line 7: The namespace 'Server.Engines.Craft' already contains a defi
nition for 'DefGlassblowing'
CS0102: Line 73: The type 'Server.Engines.Craft.DefGlassblowing' already con
tains a definition for 'InternalTimer'
+ Engines/Craft/DefMasonry.cs:
CS0101: Line 7: The namespace 'Server.Engines.Craft' already contains a defi
nition for 'DefMasonry'
CS0102: Line 69: The type 'Server.Engines.Craft.DefMasonry' already contains
a definition for 'InternalTimer'
+ Engines/Craft/DefTailoring.cs:
CS0101: Line 19: The namespace 'Server.Engines.Craft' already contains a def
inition for 'DefTailoring'
+ Engines/Craft/DefTinkering.cs:
CS0101: Line 22: The namespace 'Server.Engines.Craft' already contains a def
inition for 'DefTinkering'
CS0101: Line 464: The namespace 'Server.Engines.Craft' already contains a de
finition for 'TrapCraft'
CS0102: Line 517: The type 'Server.Engines.Craft.TrapCraft' already contains
a definition for 'ContainerTarget'
CS0101: Line 575: The namespace 'Server.Engines.Craft' already contains a de
finition for 'DartTrapCraft'
CS0101: Line 585: The namespace 'Server.Engines.Craft' already contains a de
finition for 'PoisonTrapCraft'
CS0101: Line 595: The namespace 'Server.Engines.Craft' already contains a de
finition for 'ExplosionTrapCraft'
+ Engines/Harvest/Fishing.cs:
CS0101: Line 11: The namespace 'Server.Engines.Harvest' already contains a d
efinition for 'Fishing'
CS0102: Line 112: The type 'Server.Engines.Harvest.Fishing' already contains
a definition for 'MutateEntry'
+ Engines/Harvest/Lumberjacking.cs:
CS0101: Line 7: The namespace 'Server.Engines.Harvest' already contains a de
finition for 'Lumberjacking'
+ Engines/Harvest/Mining.cs:
CS0101: Line 9: The namespace 'Server.Engines.Harvest' already contains a de
finition for 'Mining'
+ Items/Armor/BaseArmor.cs:
CS0101: Line 14: The namespace 'Server.Items' already contains a definition
for 'BaseArmor'
CS0102: Line 788: The type 'Server.Items.BaseArmor' already contains a defin
ition for 'SaveFlag'
+ Items/Deeds/CommodityDeed.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'ICommodity'
CS0101: Line 13: The namespace 'Server.Items' already contains a definition
for 'CommodityDeed'
CS0102: Line 176: The type 'Server.Items.CommodityDeed' already contains a d
efinition for 'InternalTarget'
+ Items/Resources/Blacksmithing/Ingots.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'BaseIngot'
CS0101: Line 132: The namespace 'Server.Items' already contains a definition
for 'IronIngot'
CS0101: Line 166: The namespace 'Server.Items' already contains a definition
for 'DullCopperIngot'
CS0101: Line 200: The namespace 'Server.Items' already contains a definition
for 'ShadowIronIngot'
CS0101: Line 234: The namespace 'Server.Items' already contains a definition
for 'CopperIngot'
CS0101: Line 268: The namespace 'Server.Items' already contains a definition
for 'BronzeIngot'
CS0101: Line 302: The namespace 'Server.Items' already contains a definition
for 'GoldIngot'
CS0101: Line 336: The namespace 'Server.Items' already contains a definition
for 'AgapiteIngot'
CS0101: Line 370: The namespace 'Server.Items' already contains a definition
for 'VeriteIngot'
CS0101: Line 404: The namespace 'Server.Items' already contains a definition
for 'ValoriteIngot'
+ Items/Resources/Blacksmithing/Ore.cs:
CS0101: Line 9: The namespace 'Server.Items' already contains a definition f
or 'BaseOre'
CS0102: Line 146: The type 'Server.Items.BaseOre' already contains a definit
ion for 'InternalTarget'
CS0101: Line 246: The namespace 'Server.Items' already contains a definition
for 'IronOre'
CS0101: Line 284: The namespace 'Server.Items' already contains a definition
for 'DullCopperOre'
CS0101: Line 322: The namespace 'Server.Items' already contains a definition
for 'ShadowIronOre'
CS0101: Line 360: The namespace 'Server.Items' already contains a definition
for 'CopperOre'
CS0101: Line 398: The namespace 'Server.Items' already contains a definition
for 'BronzeOre'
CS0101: Line 436: The namespace 'Server.Items' already contains a definition
for 'GoldOre'
CS0101: Line 474: The namespace 'Server.Items' already contains a definition
for 'AgapiteOre'
CS0101: Line 512: The namespace 'Server.Items' already contains a definition
for 'VeriteOre'
CS0101: Line 550: The namespace 'Server.Items' already contains a definition
for 'ValoriteOre'
+ Items/Resources/Blacksmithing/Scales.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'BaseScales'
CS0101: Line 78: The namespace 'Server.Items' already contains a definition
for 'RedScales'
CS0101: Line 111: The namespace 'Server.Items' already contains a definition
for 'YellowScales'
CS0101: Line 144: The namespace 'Server.Items' already contains a definition
for 'BlackScales'
CS0101: Line 177: The namespace 'Server.Items' already contains a definition
for 'GreenScales'
CS0101: Line 210: The namespace 'Server.Items' already contains a definition
for 'WhiteScales'
CS0101: Line 243: The namespace 'Server.Items' already contains a definition
for 'BlueScales'
+ Items/Resources/Masonry/Granite.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'BaseGranite'
CS0101: Line 77: The namespace 'Server.Items' already contains a definition
for 'Granite'
CS0101: Line 103: The namespace 'Server.Items' already contains a definition
for 'DullCopperGranite'
CS0101: Line 129: The namespace 'Server.Items' already contains a definition
for 'ShadowIronGranite'
CS0101: Line 155: The namespace 'Server.Items' already contains a definition
for 'CopperGranite'
CS0101: Line 181: The namespace 'Server.Items' already contains a definition
for 'BronzeGranite'
CS0101: Line 207: The namespace 'Server.Items' already contains a definition
for 'GoldGranite'
CS0101: Line 233: The namespace 'Server.Items' already contains a definition
for 'AgapiteGranite'
CS0101: Line 259: The namespace 'Server.Items' already contains a definition
for 'VeriteGranite'
CS0101: Line 285: The namespace 'Server.Items' already contains a definition
for 'ValoriteGranite'
+ Items/Resources/Tailor/BoltOfCloth.cs:
CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'BoltOfCloth'
+ Items/Resources/Tailor/Bone.cs:
CS0101: Line 6: The namespace 'Server.Items' already contains a definition f
or 'Bone'
+ Items/Resources/Tailor/Cloth.cs:
CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'Cloth'
+ Items/Resources/Tailor/Cotton.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'Cotton'
CS0102: Line 71: The type 'Server.Items.Cotton' already contains a definitio
n for 'PickWheelTarget'
+ Items/Resources/Tailor/Flax.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'Flax'
CS0102: Line 61: The type 'Server.Items.Flax' already contains a definition
for 'PickWheelTarget'
+ Items/Resources/Tailor/Hides.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'BaseHides'
CS0101: Line 114: The namespace 'Server.Items' already contains a definition
for 'Hides'
CS0101: Line 157: The namespace 'Server.Items' already contains a definition
for 'SpinedHides'
CS0101: Line 200: The namespace 'Server.Items' already contains a definition
for 'HornedHides'
CS0101: Line 243: The namespace 'Server.Items' already contains a definition
for 'BarbedHides'
+ Items/Resources/Tailor/Leathers.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'BaseLeather'
CS0101: Line 114: The namespace 'Server.Items' already contains a definition
for 'Leather'
CS0101: Line 148: The namespace 'Server.Items' already contains a definition
for 'SpinedLeather'
CS0101: Line 182: The namespace 'Server.Items' already contains a definition
for 'HornedLeather'
CS0101: Line 216: The namespace 'Server.Items' already contains a definition
for 'BarbedLeather'
+ Items/Resources/Tailor/UncutCloth.cs:
CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'UncutCloth'
+ Items/Resources/Tailor/Wool.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'Wool'
CS0102: Line 71: The type 'Server.Items.Wool' already contains a definition
for 'PickWheelTarget'
+ Items/Resources/Tailor/YarnsAndThreads.cs:
CS0101: Line 7: The namespace 'Server.Items' already contains a definition f
or 'BaseClothMaterial'
CS0102: Line 61: The type 'Server.Items.BaseClothMaterial' already contains
a definition for 'PickLoomTarget'
CS0101: Line 112: The namespace 'Server.Items' already contains a definition
for 'DarkYarn'
CS0101: Line 143: The namespace 'Server.Items' already contains a definition
for 'LightYarn'
CS0101: Line 174: The namespace 'Server.Items' already contains a definition
for 'LightYarnUnraveled'
CS0101: Line 205: The namespace 'Server.Items' already contains a definition
for 'SpoolOfThread'
+ Items/Skill Items/Carpenter Items/Board.cs:
CS0101: Line 6: The namespace 'Server.Items' already contains a definition f
or 'Board'
CS0101: Line 127: The namespace 'Server.Items' already contains a definition
for 'HeartwoodBoard'
CS0101: Line 161: The namespace 'Server.Items' already contains a definition
for 'BloodwoodBoard'
CS0101: Line 195: The namespace 'Server.Items' already contains a definition
for 'FrostwoodBoard'
CS0101: Line 229: The namespace 'Server.Items' already contains a definition
for 'OakBoard'
CS0101: Line 263: The namespace 'Server.Items' already contains a definition
for 'AshBoard'
CS0101: Line 297: The namespace 'Server.Items' already contains a definition
for 'YewBoard'
+ Items/Skill Items/Harvest Tools/ProspectorsTool.cs:
CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'ProspectorsTool'
CS0102: Line 162: The type 'Server.Items.ProspectorsTool' already contains a
definition for 'InternalTarget'
+ Items/Weapons/BaseWeapon.cs:
CS0101: Line 19: The namespace 'Server.Items' already contains a definition
for 'ISlayer'
CS0101: Line 25: The namespace 'Server.Items' already contains a definition
for 'BaseWeapon'
CS0102: Line 611: The type 'Server.Items.BaseWeapon' already contains a defi
nition for 'ResetEquipTimer'
CS0102: Line 2801: The type 'Server.Items.BaseWeapon' already contains a def
inition for 'SaveFlag'
CS0101: Line 4008: The namespace 'Server.Items' already contains a definitio
n for 'CheckSlayerResult'
+ Misc/ResourceInfo.cs:
CS0101: Line 6: The namespace 'Server.Items' already contains a definition f
or 'CraftResource'
CS0101: Line 40: The namespace 'Server.Items' already contains a definition
for 'CraftResourceType'
CS0101: Line 49: The namespace 'Server.Items' already contains a definition
for 'CraftAttributeInfo'
CS0101: Line 426: The namespace 'Server.Items' already contains a definition
for 'CraftResourceInfo'
CS0101: Line 456: The namespace 'Server.Items' already contains a definition
for 'CraftResources'
CS0101: Line 712: The namespace 'Server.Items' already contains a definition
for 'OreInfo'
+ Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs:
CS0101: Line 8: The namespace 'Server.Mobiles' already contains a definition
for 'AgapiteElemental'
+ Mobiles/Monsters/Ore Elementals/BronzeElemental.cs:
CS0101: Line 8: The namespace 'Server.Mobiles' already contains a definition
for 'BronzeElemental'
+ Mobiles/Monsters/Ore Elementals/CopperElemental.cs:
CS0101: Line 8: The namespace 'Server.Mobiles' already contains a definition
for 'CopperElemental'
+ Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs:
CS0101: Line 8: The namespace 'Server.Mobiles' already contains a definition
for 'DullCopperElemental'
+ Mobiles/Monsters/Ore Elementals/GoldenElemental.cs:
CS0101: Line 8: The namespace 'Server.Mobiles' already contains a definition
for 'GoldenElemental'
+ Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs:
CS0101: Line 8: The namespace 'Server.Mobiles' already contains a definition
for 'ShadowIronElemental'
+ Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs:
CS0101: Line 8: The namespace 'Server.Mobiles' already contains a definition
for 'ValoriteElemental'
+ Mobiles/Monsters/Ore Elementals/VeriteElemental.cs:
CS0101: Line 8: The namespace 'Server.Mobiles' already contains a definition
for 'VeriteElemental'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

FingersMcSteal

Sorceror
Do a file search for the .CS files, that should give you the file path to them all, delete the ones that you did not put into the custom folder.

Alot of the files i replaced / updated to use the new resources were scattered in various folders in the standard release of a server, if i remember the ZIP file you downloaded should have placed all of the new files into its own seperate directory, just a case of finding each duplicate and removing the original versions to correct the problem... and yeah i know it's a pain in the ass to do but once done it should work or at least reduce any errors you get.
 

SoulzBaen

Wanderer
yeah, thnx. i haven't done this much lately, the last time i worked on a server was before LBR. we did different scripting(they handled the scripts, i did in-game editing)
 

Kepchook

Wanderer
Hello there!

I get only one error and it tells me to add "}" to the line 1508 in BaseArmor.cs

I put many "///" to the line around 1508..

Thank you!! =)

PHP:
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
using Server.Engines.Craft;
using Server.Factions;
using AMA = Server.Items.ArmorMeditationAllowance;
using AMT = Server.Items.ArmorMaterialType;
using ABT = Server.Items.ArmorBodyType;

namespace Server.Items
{
	public abstract class BaseArmor : Item, IScissorable, IFactionItem, ICraftable, IWearableDurability
	{
		#region Factions
		private FactionItem m_FactionState;

		public FactionItem FactionItemState
		{
			get{ return m_FactionState; }
			set
			{
				m_FactionState = value;

				if ( m_FactionState == null )
					Hue = CraftResources.GetHue( Resource );

				LootType = ( m_FactionState == null ? LootType.Regular : LootType.Blessed );
			}
		}
		#endregion



		/* Armor internals work differently now (Jun 19 2003)
		 * 
		 * The attributes defined below default to -1.
		 * If the value is -1, the corresponding virtual 'Aos/Old' property is used.
		 * If not, the attribute value itself is used. Here's the list:
		 *  - ArmorBase
		 *  - StrBonus
		 *  - DexBonus
		 *  - IntBonus
		 *  - StrReq
		 *  - DexReq
		 *  - IntReq
		 *  - MeditationAllowance
		 */

		// Instance values. These values must are unique to each armor piece.
		private int m_MaxHitPoints;
		private int m_HitPoints;
		private Mobile m_Crafter;
		private ArmorQuality m_Quality;
		private ArmorDurabilityLevel m_Durability;
		private ArmorProtectionLevel m_Protection;
		private CraftResource m_Resource;
		private bool m_Identified, m_PlayerConstructed;
		private int m_PhysicalBonus, m_FireBonus, m_ColdBonus, m_PoisonBonus, m_EnergyBonus;

		private AosAttributes m_AosAttributes;
		private AosArmorAttributes m_AosArmorAttributes;
		private AosSkillBonuses m_AosSkillBonuses;

		// Overridable values. These values are provided to override the defaults which get defined in the individual armor scripts.
		private int m_ArmorBase = -1;
		private int m_StrBonus = -1, m_DexBonus = -1, m_IntBonus = -1;
		private int m_StrReq = -1, m_DexReq = -1, m_IntReq = -1;
		private AMA m_Meditate = (AMA)(-1);


		public virtual bool AllowMaleWearer{ get{ return true; } }
		public virtual bool AllowFemaleWearer{ get{ return true; } }

		public abstract AMT MaterialType{ get; }

		public virtual int RevertArmorBase{ get{ return ArmorBase; } }
		public virtual int ArmorBase{ get{ return 0; } }

		public virtual AMA DefMedAllowance{ get{ return AMA.None; } }
		public virtual AMA AosMedAllowance{ get{ return DefMedAllowance; } }
		public virtual AMA OldMedAllowance{ get{ return DefMedAllowance; } }


		public virtual int AosStrBonus{ get{ return 0; } }
		public virtual int AosDexBonus{ get{ return 0; } }
		public virtual int AosIntBonus{ get{ return 0; } }
		public virtual int AosStrReq{ get{ return 0; } }
		public virtual int AosDexReq{ get{ return 0; } }
		public virtual int AosIntReq{ get{ return 0; } }


		public virtual int OldStrBonus{ get{ return 0; } }
		public virtual int OldDexBonus{ get{ return 0; } }
		public virtual int OldIntBonus{ get{ return 0; } }
		public virtual int OldStrReq{ get{ return 0; } }
		public virtual int OldDexReq{ get{ return 0; } }
		public virtual int OldIntReq{ get{ return 0; } }

		public virtual bool CanFortify{ get{ return true; } }

		public override void OnAfterDuped( Item newItem )
		{
			BaseArmor armor = newItem as BaseArmor;

			if ( armor == null )
				return;

			armor.m_AosAttributes = new AosAttributes( newItem, m_AosAttributes );
			armor.m_AosArmorAttributes = new AosArmorAttributes( newItem, m_AosArmorAttributes );
			armor.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses );
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public AMA MeditationAllowance
		{
			get{ return ( m_Meditate == (AMA)(-1) ? Core.AOS ? AosMedAllowance : OldMedAllowance : m_Meditate ); }
			set{ m_Meditate = value; }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int BaseArmorRating
		{
			get
			{
				if ( m_ArmorBase == -1 )
					return ArmorBase;
				else
					return m_ArmorBase;
			}
			set
			{ 
				m_ArmorBase = value; Invalidate(); 
			}
		}

		public double BaseArmorRatingScaled
		{
			get
			{
				return ( BaseArmorRating * ArmorScalar );
			}
		}

		public virtual double ArmorRating
		{
			get
			{
				int ar = BaseArmorRating;

				if ( m_Protection != ArmorProtectionLevel.Regular )
					ar += 10 + (5 * (int)m_Protection);

				switch ( m_Resource )
				{
                    case CraftResource.DullCopper: ar += 2; break;
                    case CraftResource.ShadowIron: ar += 4; break;
                    case CraftResource.Copper: ar += 6; break;
                    case CraftResource.Bronze: ar += 8; break;
                    case CraftResource.Gold: ar += 10; break;
                    case CraftResource.Silver: ar += 10; break;
                    case CraftResource.Agapite: ar += 12; break;
                    case CraftResource.Verite: ar += 14; break;
                    case CraftResource.Valorite: ar += 16; break;
                    case CraftResource.Uridium: ar += 17; break;
                    case CraftResource.Trillium: ar += 18; break;
                    case CraftResource.Titanium: ar += 19; break;
                    case CraftResource.Platinum: ar += 20; break;
                    case CraftResource.Zenite: ar += 21; break;
                    case CraftResource.Naquinite: ar += 22; break;
                    case CraftResource.Galvinite: ar += 22; break;
                    case CraftResource.Trilamide: ar += 22; break;
                    case CraftResource.Veramide: ar += 22; break;
                    case CraftResource.Zenlamide: ar += 22; break;

                    case CraftResource.SpinedLeather: ar += 10; break;
                    case CraftResource.HornedLeather: ar += 13; break;
                    case CraftResource.BarbedLeather: ar += 16; break;
                    case CraftResource.RibbedLeather: ar += 16; break;
                    case CraftResource.DreadLeather: ar += 16; break;
                    case CraftResource.EtheralLeather: ar += 16; break;

                    case CraftResource.Amazonite: ar += 22; break;
                    case CraftResource.Amber: ar += 22; break;
                    case CraftResource.Amethyst: ar += 22; break;
                    case CraftResource.Aragonite: ar += 22; break;
                    case CraftResource.Bixbite: ar += 22; break;
                    case CraftResource.BloodStone: ar += 22; break;
                    case CraftResource.Calcite: ar += 22; break;
                    case CraftResource.GoldStone: ar += 22; break;
                    case CraftResource.Labradorite: ar += 22; break;
                    case CraftResource.Moldavite: ar += 22; break;
                    case CraftResource.Morganite: ar += 22; break;
                    case CraftResource.Quartz: ar += 22; break;
                    case CraftResource.Rhodonite: ar += 22; break;
                    case CraftResource.Ruby: ar += 22; break;
                    case CraftResource.Sapphire: ar += 22; break;
                    case CraftResource.Sugilite: ar += 22; break;
                    case CraftResource.Tanzanite: ar += 22; break;
                    case CraftResource.Turquoise: ar += 22; break;
                    case CraftResource.Varisite: ar += 22; break;
				}

				ar += -8 + (8 * (int)m_Quality);
				return ScaleArmorByDurability( ar );
			}
		}

		public double ArmorRatingScaled
		{
			get
			{
				return ( ArmorRating * ArmorScalar );
			}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int StrBonus
		{
			get{ return ( m_StrBonus == -1 ? Core.AOS ? AosStrBonus : OldStrBonus : m_StrBonus ); }
			set{ m_StrBonus = value; InvalidateProperties(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int DexBonus
		{
			get{ return ( m_DexBonus == -1 ? Core.AOS ? AosDexBonus : OldDexBonus : m_DexBonus ); }
			set{ m_DexBonus = value; InvalidateProperties(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int IntBonus
		{
			get{ return ( m_IntBonus == -1 ? Core.AOS ? AosIntBonus : OldIntBonus : m_IntBonus ); }
			set{ m_IntBonus = value; InvalidateProperties(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int StrRequirement
		{
			get{ return ( m_StrReq == -1 ? Core.AOS ? AosStrReq : OldStrReq : m_StrReq ); }
			set{ m_StrReq = value; InvalidateProperties(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int DexRequirement
		{
			get{ return ( m_DexReq == -1 ? Core.AOS ? AosDexReq : OldDexReq : m_DexReq ); }
			set{ m_DexReq = value; InvalidateProperties(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int IntRequirement
		{
			get{ return ( m_IntReq == -1 ? Core.AOS ? AosIntReq : OldIntReq : m_IntReq ); }
			set{ m_IntReq = value; InvalidateProperties(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public bool Identified
		{
			get{ return m_Identified; }
			set{ m_Identified = value; InvalidateProperties(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public bool PlayerConstructed
		{
			get{ return m_PlayerConstructed; }
			set{ m_PlayerConstructed = value; }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public CraftResource Resource
		{
			get
			{
				return m_Resource;
			}
			set
			{
				if ( m_Resource != value )
				{
					UnscaleDurability();

					m_Resource = value;
					Hue = CraftResources.GetHue( m_Resource );

					Invalidate();
					InvalidateProperties();

					if ( Parent is Mobile )
						((Mobile)Parent).UpdateResistances();

					ScaleDurability();
				}
			}
		}

		public virtual double ArmorScalar
		{
			get
			{
				int pos = (int)BodyPosition;

				if ( pos >= 0 && pos < m_ArmorScalars.Length )
					return m_ArmorScalars[pos];

				return 1.0;
			}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int MaxHitPoints
		{
			get{ return m_MaxHitPoints; }
			set{ m_MaxHitPoints = value; InvalidateProperties(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitPoints
		{
			get 
			{
				return m_HitPoints;
			}
			set 
			{
				if ( value != m_HitPoints && MaxHitPoints > 0 )
				{
					m_HitPoints = value;

					if ( m_HitPoints < 0 )
						Delete();
					else if ( m_HitPoints > MaxHitPoints )
						m_HitPoints = MaxHitPoints;

					InvalidateProperties();
				}
			}
		}


		[CommandProperty( AccessLevel.GameMaster )]
		public Mobile Crafter
		{
			get{ return m_Crafter; }
			set{ m_Crafter = value; InvalidateProperties(); }
		}

		
		[CommandProperty( AccessLevel.GameMaster )]
		public ArmorQuality Quality
		{
			get{ return m_Quality; }
			set{ UnscaleDurability(); m_Quality = value; Invalidate(); InvalidateProperties(); ScaleDurability(); }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public ArmorDurabilityLevel Durability
		{
			get{ return m_Durability; }
			set{ UnscaleDurability(); m_Durability = value; ScaleDurability(); InvalidateProperties(); }
		}

		public virtual int ArtifactRarity
		{
			get{ return 0; }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public ArmorProtectionLevel ProtectionLevel
		{
			get
			{
				return m_Protection;
			}
			set
			{
				if ( m_Protection != value )
				{
					m_Protection = value;

					Invalidate();
					InvalidateProperties();

					if ( Parent is Mobile )
						((Mobile)Parent).UpdateResistances();
				}
			}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public AosAttributes Attributes
		{
			get{ return m_AosAttributes; }
			set{}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public AosArmorAttributes ArmorAttributes
		{
			get{ return m_AosArmorAttributes; }
			set{}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public AosSkillBonuses SkillBonuses
		{
			get{ return m_AosSkillBonuses; }
			set{}
		}

		public int ComputeStatReq( StatType type )
		{
			int v;

			if ( type == StatType.Str )
				v = StrRequirement;
			else if ( type == StatType.Dex )
				v = DexRequirement;
			else
				v = IntRequirement;

			return AOS.Scale( v, 100 - GetLowerStatReq() );
		}

		public int ComputeStatBonus( StatType type )
		{
			if ( type == StatType.Str )
				return StrBonus + Attributes.BonusStr;
			else if ( type == StatType.Dex )
				return DexBonus + Attributes.BonusDex;
			else
				return IntBonus + Attributes.BonusInt;
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int PhysicalBonus{ get{ return m_PhysicalBonus; } set{ m_PhysicalBonus = value; InvalidateProperties(); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int FireBonus{ get{ return m_FireBonus; } set{ m_FireBonus = value; InvalidateProperties(); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int ColdBonus{ get{ return m_ColdBonus; } set{ m_ColdBonus = value; InvalidateProperties(); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int PoisonBonus{ get{ return m_PoisonBonus; } set{ m_PoisonBonus = value; InvalidateProperties(); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int EnergyBonus{ get{ return m_EnergyBonus; } set{ m_EnergyBonus = value; InvalidateProperties(); } }

		public virtual int BasePhysicalResistance{ get{ return 0; } }
		public virtual int BaseFireResistance{ get{ return 0; } }
		public virtual int BaseColdResistance{ get{ return 0; } }
		public virtual int BasePoisonResistance{ get{ return 0; } }
		public virtual int BaseEnergyResistance{ get{ return 0; } }

		public override int PhysicalResistance{ get{ return BasePhysicalResistance + GetProtOffset() + GetResourceAttrs().ArmorPhysicalResist + m_PhysicalBonus; } }
		public override int FireResistance{ get{ return BaseFireResistance + GetProtOffset() + GetResourceAttrs().ArmorFireResist + m_FireBonus; } }
		public override int ColdResistance{ get{ return BaseColdResistance + GetProtOffset() + GetResourceAttrs().ArmorColdResist + m_ColdBonus; } }
		public override int PoisonResistance{ get{ return BasePoisonResistance + GetProtOffset() + GetResourceAttrs().ArmorPoisonResist + m_PoisonBonus; } }
		public override int EnergyResistance{ get{ return BaseEnergyResistance + GetProtOffset() + GetResourceAttrs().ArmorEnergyResist + m_EnergyBonus; } }

		public virtual int InitMinHits{ get{ return 0; } }
		public virtual int InitMaxHits{ get{ return 0; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public ArmorBodyType BodyPosition
		{
			get
			{
				switch ( this.Layer )
				{
					default:
					case Layer.Neck:		return ArmorBodyType.Gorget;
					case Layer.TwoHanded:	return ArmorBodyType.Shield;
					case Layer.Gloves:		return ArmorBodyType.Gloves;
					case Layer.Helm:		return ArmorBodyType.Helmet;
					case Layer.Arms:		return ArmorBodyType.Arms;

					case Layer.InnerLegs:
					case Layer.OuterLegs:
					case Layer.Pants:		return ArmorBodyType.Legs;

					case Layer.InnerTorso:
					case Layer.OuterTorso:
					case Layer.Shirt:		return ArmorBodyType.Chest;
				}
			}
		}

		public void DistributeBonuses( int amount )
		{
			for ( int i = 0; i < amount; ++i )
			{
				switch ( Utility.Random( 5 ) )
				{
					case 0: ++m_PhysicalBonus; break;
					case 1: ++m_FireBonus; break;
					case 2: ++m_ColdBonus; break;
					case 3: ++m_PoisonBonus; break;
					case 4: ++m_EnergyBonus; break;
				}
			}

			InvalidateProperties();
		}

		public CraftAttributeInfo GetResourceAttrs()
		{
			CraftResourceInfo info = CraftResources.GetInfo( m_Resource );

			if ( info == null )
				return CraftAttributeInfo.Blank;

			return info.AttributeInfo;
		}

		public int GetProtOffset()
		{
			switch ( m_Protection )
			{
				case ArmorProtectionLevel.Guarding: return 1;
				case ArmorProtectionLevel.Hardening: return 2;
				case ArmorProtectionLevel.Fortification: return 3;
				case ArmorProtectionLevel.Invulnerability: return 4;
			}

			return 0;
		}

		public void UnscaleDurability()
		{
			int scale = 100 + GetDurabilityBonus();

			m_HitPoints = ((m_HitPoints * 100) + (scale - 1)) / scale;
			m_MaxHitPoints = ((m_MaxHitPoints * 100) + (scale - 1)) / scale;
			InvalidateProperties();
		}

		public void ScaleDurability()
		{
			int scale = 100 + GetDurabilityBonus();

			m_HitPoints = ((m_HitPoints * scale) + 99) / 100;
			m_MaxHitPoints = ((m_MaxHitPoints * scale) + 99) / 100;
			InvalidateProperties();
		}

		public int GetDurabilityBonus()
		{
			int bonus = 0;

			if ( m_Quality == ArmorQuality.Exceptional )
				bonus += 20;

			switch ( m_Durability )
			{
				case ArmorDurabilityLevel.Durable: bonus += 20; break;
				case ArmorDurabilityLevel.Substantial: bonus += 50; break;
				case ArmorDurabilityLevel.Massive: bonus += 70; break;
				case ArmorDurabilityLevel.Fortified: bonus += 100; break;
				case ArmorDurabilityLevel.Indestructible: bonus += 120; break;
			}

			if ( Core.AOS )
			{
				bonus += m_AosArmorAttributes.DurabilityBonus;

				CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource );
				CraftAttributeInfo attrInfo = null;

				if ( resInfo != null )
					attrInfo = resInfo.AttributeInfo;

				if ( attrInfo != null )
					bonus += attrInfo.ArmorDurability;
			}

			return bonus;
		}

		public bool Scissor( Mobile from, Scissors scissors )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 502437 ); // Items you wish to cut must be in your backpack.
				return false;
			}

			if ( Ethics.Ethic.IsImbued( this ) )
			{
				from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
				return false;
			}

			CraftSystem system = DefTailoring.CraftSystem;

			CraftItem item = system.CraftItems.SearchFor( GetType() );

			if ( item != null && item.Ressources.Count == 1 && item.Ressources.GetAt( 0 ).Amount >= 2 )
			{
				try
				{
					Item res = (Item)Activator.CreateInstance( CraftResources.GetInfo( m_Resource ).ResourceTypes[0] );

					ScissorHelper( from, res, m_PlayerConstructed ? (item.Ressources.GetAt( 0 ).Amount / 2) : 1 );
					return true;
				}
				catch
				{
				}
			}

			from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
			return false;
		}

		private static double[] m_ArmorScalars = { 0.07, 0.07, 0.14, 0.15, 0.22, 0.35 };

		public static double[] ArmorScalars
		{
			get
			{
				return m_ArmorScalars;
			}
			set
			{
				m_ArmorScalars = value;
			}
		}

		public static void ValidateMobile( Mobile m )
		{
			for ( int i = m.Items.Count - 1; i >= 0; --i )
			{
				if ( i >= m.Items.Count )
					continue;

				Item item = m.Items[i];

				if ( item is BaseArmor )
				{
					BaseArmor armor = (BaseArmor)item;

					if( armor.RequiredRace != null && m.Race != armor.RequiredRace )
					{
						if( armor.RequiredRace == Race.Elf )
							m.SendLocalizedMessage( 1072203 ); // Only Elves may use this.
						else
							m.SendMessage( "Only {0} may use this.", armor.RequiredRace.PluralName );

						m.AddToBackpack( armor );
					}
					else if ( !armor.AllowMaleWearer && !m.Female && m.AccessLevel < AccessLevel.GameMaster )
					{
						if ( armor.AllowFemaleWearer )
							m.SendLocalizedMessage( 1010388 ); // Only females can wear this.
						else
							m.SendMessage( "You may not wear this." );

						m.AddToBackpack( armor );
					}
					else if ( !armor.AllowFemaleWearer && m.Female && m.AccessLevel < AccessLevel.GameMaster )
					{
						if ( armor.AllowMaleWearer )
							m.SendLocalizedMessage( 1063343 ); // Only males can wear this.
						else
							m.SendMessage( "You may not wear this." );

						m.AddToBackpack( armor );
					}
				}
			}
		}

		public int GetLowerStatReq()
		{
			if ( !Core.AOS )
				return 0;

			int v = m_AosArmorAttributes.LowerStatReq;

			CraftResourceInfo info = CraftResources.GetInfo( m_Resource );

			if ( info != null )
			{
				CraftAttributeInfo attrInfo = info.AttributeInfo;

				if ( attrInfo != null )
					v += attrInfo.ArmorLowerRequirements;
			}

			if ( v > 100 )
				v = 100;

			return v;
		}

		public override void OnAdded( object parent )
		{
			if ( parent is Mobile )
			{
				Mobile from = (Mobile)parent;

				if ( Core.AOS )
					m_AosSkillBonuses.AddTo( from );

				from.Delta( MobileDelta.Armor ); // Tell them armor rating has changed
			}
		}

		public virtual double ScaleArmorByDurability( double armor )
		{
			int scale = 100;

			if ( m_MaxHitPoints > 0 && m_HitPoints < m_MaxHitPoints )
				scale = 50 + ((50 * m_HitPoints) / m_MaxHitPoints);

			return ( armor * scale ) / 100;
		}

		protected void Invalidate()
		{
			if ( Parent is Mobile )
				((Mobile)Parent).Delta( MobileDelta.Armor ); // Tell them armor rating has changed
		}

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

		private static void SetSaveFlag( ref SaveFlag flags, SaveFlag toSet, bool setIf )
		{
			if ( setIf )
				flags |= toSet;
		}

		private static bool GetSaveFlag( SaveFlag flags, SaveFlag toGet )
		{
			return ( (flags & toGet) != 0 );
		}

		[Flags]
		private enum SaveFlag
		{
			None				= 0x00000000,
			Attributes			= 0x00000001,
			ArmorAttributes		= 0x00000002,
			PhysicalBonus		= 0x00000004,
			FireBonus			= 0x00000008,
			ColdBonus			= 0x00000010,
			PoisonBonus			= 0x00000020,
			EnergyBonus			= 0x00000040,
			Identified			= 0x00000080,
			MaxHitPoints		= 0x00000100,
			HitPoints			= 0x00000200,
			Crafter				= 0x00000400,
			Quality				= 0x00000800,
			Durability			= 0x00001000,
			Protection			= 0x00002000,
			Resource			= 0x00004000,
			BaseArmor			= 0x00008000,
			StrBonus			= 0x00010000,
			DexBonus			= 0x00020000,
			IntBonus			= 0x00040000,
			StrReq				= 0x00080000,
			DexReq				= 0x00100000,
			IntReq				= 0x00200000,
			MedAllowance		= 0x00400000,
			SkillBonuses		= 0x00800000,
			PlayerConstructed	= 0x01000000
		}

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

			writer.Write( (int) 7 ); // version

			SaveFlag flags = SaveFlag.None;

			SetSaveFlag( ref flags, SaveFlag.Attributes,		!m_AosAttributes.IsEmpty );
			SetSaveFlag( ref flags, SaveFlag.ArmorAttributes,	!m_AosArmorAttributes.IsEmpty );
			SetSaveFlag( ref flags, SaveFlag.PhysicalBonus,		m_PhysicalBonus != 0 );
			SetSaveFlag( ref flags, SaveFlag.FireBonus,			m_FireBonus != 0 );
			SetSaveFlag( ref flags, SaveFlag.ColdBonus,			m_ColdBonus != 0 );
			SetSaveFlag( ref flags, SaveFlag.PoisonBonus,		m_PoisonBonus != 0 );
			SetSaveFlag( ref flags, SaveFlag.EnergyBonus,		m_EnergyBonus != 0 );
			SetSaveFlag( ref flags, SaveFlag.Identified,		m_Identified != false );
			SetSaveFlag( ref flags, SaveFlag.MaxHitPoints,		m_MaxHitPoints != 0 );
			SetSaveFlag( ref flags, SaveFlag.HitPoints,			m_HitPoints != 0 );
			SetSaveFlag( ref flags, SaveFlag.Crafter,			m_Crafter != null );
			SetSaveFlag( ref flags, SaveFlag.Quality,			m_Quality != ArmorQuality.Regular );
			SetSaveFlag( ref flags, SaveFlag.Durability,		m_Durability != ArmorDurabilityLevel.Regular );
			SetSaveFlag( ref flags, SaveFlag.Protection,		m_Protection != ArmorProtectionLevel.Regular );
			SetSaveFlag( ref flags, SaveFlag.Resource,			m_Resource != DefaultResource );
			SetSaveFlag( ref flags, SaveFlag.BaseArmor,			m_ArmorBase != -1 );
			SetSaveFlag( ref flags, SaveFlag.StrBonus,			m_StrBonus != -1 );
			SetSaveFlag( ref flags, SaveFlag.DexBonus,			m_DexBonus != -1 );
			SetSaveFlag( ref flags, SaveFlag.IntBonus,			m_IntBonus != -1 );
			SetSaveFlag( ref flags, SaveFlag.StrReq,			m_StrReq != -1 );
			SetSaveFlag( ref flags, SaveFlag.DexReq,			m_DexReq != -1 );
			SetSaveFlag( ref flags, SaveFlag.IntReq,			m_IntReq != -1 );
			SetSaveFlag( ref flags, SaveFlag.MedAllowance,		m_Meditate != (AMA)(-1) );
			SetSaveFlag( ref flags, SaveFlag.SkillBonuses,		!m_AosSkillBonuses.IsEmpty );
			SetSaveFlag( ref flags, SaveFlag.PlayerConstructed,	m_PlayerConstructed != false );

			writer.WriteEncodedInt( (int) flags );

			if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
				m_AosAttributes.Serialize( writer );

			if ( GetSaveFlag( flags, SaveFlag.ArmorAttributes ) )
				m_AosArmorAttributes.Serialize( writer );

			if ( GetSaveFlag( flags, SaveFlag.PhysicalBonus ) )
				writer.WriteEncodedInt( (int) m_PhysicalBonus );

			if ( GetSaveFlag( flags, SaveFlag.FireBonus ) )
				writer.WriteEncodedInt( (int) m_FireBonus );

			if ( GetSaveFlag( flags, SaveFlag.ColdBonus ) )
				writer.WriteEncodedInt( (int) m_ColdBonus );

			if ( GetSaveFlag( flags, SaveFlag.PoisonBonus ) )
				writer.WriteEncodedInt( (int) m_PoisonBonus );

			if ( GetSaveFlag( flags, SaveFlag.EnergyBonus ) )
				writer.WriteEncodedInt( (int) m_EnergyBonus );

			if ( GetSaveFlag( flags, SaveFlag.MaxHitPoints ) )
				writer.WriteEncodedInt( (int) m_MaxHitPoints );

			if ( GetSaveFlag( flags, SaveFlag.HitPoints ) )
				writer.WriteEncodedInt( (int) m_HitPoints );

			if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
				writer.Write( (Mobile) m_Crafter );

			if ( GetSaveFlag( flags, SaveFlag.Quality ) )
				writer.WriteEncodedInt( (int) m_Quality );

			if ( GetSaveFlag( flags, SaveFlag.Durability ) )
				writer.WriteEncodedInt( (int) m_Durability );

			if ( GetSaveFlag( flags, SaveFlag.Protection ) )
				writer.WriteEncodedInt( (int) m_Protection );

			if ( GetSaveFlag( flags, SaveFlag.Resource ) )
				writer.WriteEncodedInt( (int) m_Resource );

			if ( GetSaveFlag( flags, SaveFlag.BaseArmor ) )
				writer.WriteEncodedInt( (int) m_ArmorBase );

			if ( GetSaveFlag( flags, SaveFlag.StrBonus ) )
				writer.WriteEncodedInt( (int) m_StrBonus );

			if ( GetSaveFlag( flags, SaveFlag.DexBonus ) )
				writer.WriteEncodedInt( (int) m_DexBonus );

			if ( GetSaveFlag( flags, SaveFlag.IntBonus ) )
				writer.WriteEncodedInt( (int) m_IntBonus );

			if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
				writer.WriteEncodedInt( (int) m_StrReq );

			if ( GetSaveFlag( flags, SaveFlag.DexReq ) )
				writer.WriteEncodedInt( (int) m_DexReq );

			if ( GetSaveFlag( flags, SaveFlag.IntReq ) )
				writer.WriteEncodedInt( (int) m_IntReq );

			if ( GetSaveFlag( flags, SaveFlag.MedAllowance ) )
				writer.WriteEncodedInt( (int) m_Meditate );

			if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
				m_AosSkillBonuses.Serialize( writer );
		}

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 7:
				case 6:
				case 5:
				{
					SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
						m_AosAttributes = new AosAttributes( this, reader );
					else
						m_AosAttributes = new AosAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.ArmorAttributes ) )
						m_AosArmorAttributes = new AosArmorAttributes( this, reader );
					else
						m_AosArmorAttributes = new AosArmorAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.PhysicalBonus ) )
						m_PhysicalBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.FireBonus ) )
						m_FireBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.ColdBonus ) )
						m_ColdBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.PoisonBonus ) )
						m_PoisonBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.EnergyBonus ) )
						m_EnergyBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.Identified ) )
						m_Identified = ( version >= 7 || reader.ReadBool() );

					if ( GetSaveFlag( flags, SaveFlag.MaxHitPoints ) )
						m_MaxHitPoints = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.HitPoints ) )
						m_HitPoints = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
						m_Crafter = reader.ReadMobile();

					if ( GetSaveFlag( flags, SaveFlag.Quality ) )
						m_Quality = (ArmorQuality)reader.ReadEncodedInt();
					else
						m_Quality = ArmorQuality.Regular;

					if ( version == 5 && m_Quality == ArmorQuality.Low )
						m_Quality = ArmorQuality.Regular;

					if ( GetSaveFlag( flags, SaveFlag.Durability ) )
					{
						m_Durability = (ArmorDurabilityLevel)reader.ReadEncodedInt();

						if ( m_Durability > ArmorDurabilityLevel.Indestructible )
							m_Durability = ArmorDurabilityLevel.Durable;
					}

					if ( GetSaveFlag( flags, SaveFlag.Protection ) )
					{
						m_Protection = (ArmorProtectionLevel)reader.ReadEncodedInt();

						if ( m_Protection > ArmorProtectionLevel.Invulnerability )
							m_Protection = ArmorProtectionLevel.Defense;
					}

					if ( GetSaveFlag( flags, SaveFlag.Resource ) )
						m_Resource = (CraftResource)reader.ReadEncodedInt();
					else
						m_Resource = DefaultResource;

					if ( m_Resource == CraftResource.None )
						m_Resource = DefaultResource;

					if ( GetSaveFlag( flags, SaveFlag.BaseArmor ) )
						m_ArmorBase = reader.ReadEncodedInt();
					else
						m_ArmorBase = -1;

					if ( GetSaveFlag( flags, SaveFlag.StrBonus ) )
						m_StrBonus = reader.ReadEncodedInt();
					else
						m_StrBonus = -1;

					if ( GetSaveFlag( flags, SaveFlag.DexBonus ) )
						m_DexBonus = reader.ReadEncodedInt();
					else
						m_DexBonus = -1;

					if ( GetSaveFlag( flags, SaveFlag.IntBonus ) )
						m_IntBonus = reader.ReadEncodedInt();
					else
						m_IntBonus = -1;

					if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
						m_StrReq = reader.ReadEncodedInt();
					else
						m_StrReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.DexReq ) )
						m_DexReq = reader.ReadEncodedInt();
					else
						m_DexReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.IntReq ) )
						m_IntReq = reader.ReadEncodedInt();
					else
						m_IntReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.MedAllowance ) )
						m_Meditate = (AMA)reader.ReadEncodedInt();
					else
						m_Meditate = (AMA)(-1);

					if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
						m_AosSkillBonuses = new AosSkillBonuses( this, reader );

					if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
						m_PlayerConstructed = true;

					break;
				}
				case 4:
				{
					m_AosAttributes = new AosAttributes( this, reader );
					m_AosArmorAttributes = new AosArmorAttributes( this, reader );
					goto case 3;
				}
				case 3:
				{
					m_PhysicalBonus = reader.ReadInt();
					m_FireBonus = reader.ReadInt();
					m_ColdBonus = reader.ReadInt();
					m_PoisonBonus = reader.ReadInt();
					m_EnergyBonus = reader.ReadInt();
					goto case 2;
				}
				case 2:
				case 1:
				{
					m_Identified = reader.ReadBool();
					goto case 0;
				}
				case 0:
				{
					m_ArmorBase = reader.ReadInt();
					m_MaxHitPoints = reader.ReadInt();
					m_HitPoints = reader.ReadInt();
					m_Crafter = reader.ReadMobile();
					m_Quality = (ArmorQuality)reader.ReadInt();
					m_Durability = (ArmorDurabilityLevel)reader.ReadInt();
					m_Protection = (ArmorProtectionLevel)reader.ReadInt();

					AMT mat = (AMT)reader.ReadInt();

					if ( m_ArmorBase == RevertArmorBase )
						m_ArmorBase = -1;

					/*m_BodyPos = (ArmorBodyType)*/reader.ReadInt();

					if ( version < 4 )
					{
						m_AosAttributes = new AosAttributes( this );
						m_AosArmorAttributes = new AosArmorAttributes( this );
					}

					if ( version < 3 && m_Quality == ArmorQuality.Exceptional )
						DistributeBonuses( 6 );

					if ( version >= 2 )
					{
						m_Resource = (CraftResource)reader.ReadInt();
					}
					else
					{
						OreInfo info;

						switch ( reader.ReadInt() )
						{
							default:
                            case 0: info = OreInfo.Iron; break;
                            case 1: info = OreInfo.DullCopper; break;
                            case 2: info = OreInfo.ShadowIron; break;
                            case 3: info = OreInfo.Copper; break;
                            case 4: info = OreInfo.Bronze; break;
                            case 5: info = OreInfo.Gold; break;
                            case 6: info = OreInfo.Silver; break;
                            case 7: info = OreInfo.Agapite; break;
                            case 8: info = OreInfo.Verite; break;
                            case 9: info = OreInfo.Valorite; break;
                            case 10: info = OreInfo.Uridium; break;
                            case 11: info = OreInfo.Trillium; break;
                            case 12: info = OreInfo.Titanium; break;
                            case 13: info = OreInfo.Platinum; break;
                            case 14: info = OreInfo.Zenite; break;
                            case 15: info = OreInfo.Naquinite; break;
                            case 16: info = OreInfo.Galvinite; break;
                            case 17: info = OreInfo.Trilamide; break;
                            case 18: info = OreInfo.Veramide; break;
                            case 19: info = OreInfo.Zenlamide; break;
						}

						m_Resource = CraftResources.GetFromOreInfo( info, mat );
					}

					m_StrBonus = reader.ReadInt();
					m_DexBonus = reader.ReadInt();
					m_IntBonus = reader.ReadInt();
					m_StrReq = reader.ReadInt();
					m_DexReq = reader.ReadInt();
					m_IntReq = reader.ReadInt();

					if ( m_StrBonus == OldStrBonus )
						m_StrBonus = -1;

					if ( m_DexBonus == OldDexBonus )
						m_DexBonus = -1;

					if ( m_IntBonus == OldIntBonus )
						m_IntBonus = -1;

					if ( m_StrReq == OldStrReq )
						m_StrReq = -1;

					if ( m_DexReq == OldDexReq )
						m_DexReq = -1;

					if ( m_IntReq == OldIntReq )
						m_IntReq = -1;

					m_Meditate = (AMA)reader.ReadInt();

					if ( m_Meditate == OldMedAllowance )
						m_Meditate = (AMA)(-1);

					if ( m_Resource == CraftResource.None )
					{
						if ( mat == ArmorMaterialType.Studded || mat == ArmorMaterialType.Leather )
							m_Resource = CraftResource.RegularLeather;
						else if ( mat == ArmorMaterialType.Spined )
							m_Resource = CraftResource.SpinedLeather;
						else if ( mat == ArmorMaterialType.Horned )
							m_Resource = CraftResource.HornedLeather;
						else if ( mat == ArmorMaterialType.Barbed )
							m_Resource = CraftResource.BarbedLeather;
						else
							m_Resource = CraftResource.Iron;
					}

					if ( m_MaxHitPoints == 0 && m_HitPoints == 0 )
						m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

					break;
				}
			}

			if ( m_AosSkillBonuses == null )
				m_AosSkillBonuses = new AosSkillBonuses( this );

			if ( Core.AOS && Parent is Mobile )
				m_AosSkillBonuses.AddTo( (Mobile)Parent );

			int strBonus = ComputeStatBonus( StatType.Str );
			int dexBonus = ComputeStatBonus( StatType.Dex );
			int intBonus = ComputeStatBonus( StatType.Int );

			if ( Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
			{
				Mobile m = (Mobile)Parent;

				string modName = Serial.ToString();

				if ( strBonus != 0 )
					m.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

				if ( dexBonus != 0 )
					m.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

				if ( intBonus != 0 )
					m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
			}

			if ( Parent is Mobile )
				((Mobile)Parent).CheckStatTimers();

			if ( version < 7 )
				m_PlayerConstructed = true; // we don't know, so, assume it's crafted
		}

		public virtual CraftResource DefaultResource{ get{ return CraftResource.Iron; } }

		public BaseArmor( int itemID ) :  base( itemID )
		{
			m_Quality = ArmorQuality.Regular;
			m_Durability = ArmorDurabilityLevel.Regular;
			m_Crafter = null;

			m_Resource = DefaultResource;
			Hue = CraftResources.GetHue( m_Resource );

			m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

			this.Layer = (Layer)ItemData.Quality;

			m_AosAttributes = new AosAttributes( this );
			m_AosArmorAttributes = new AosArmorAttributes( this );
			m_AosSkillBonuses = new AosSkillBonuses( this );
		}

		public override bool AllowSecureTrade( Mobile from, Mobile to, Mobile newOwner, bool accepted )
		{
			if ( !Ethics.Ethic.CheckTrade( from, to, newOwner, this ) )
				return false;

			return base.AllowSecureTrade( from, to, newOwner, accepted );
		}

		public virtual Race RequiredRace { get { return null; } }

		public override bool CanEquip( Mobile from )
		{
			if( !Ethics.Ethic.CheckEquip( from, this ) )
				return false;

			if( from.AccessLevel < AccessLevel.GameMaster )
			{
				if( RequiredRace != null && from.Race != RequiredRace )
				{
					if( RequiredRace == Race.Elf )
						from.SendLocalizedMessage( 1072203 ); // Only Elves may use this.
					else
						from.SendMessage( "Only {0} may use this.", RequiredRace.PluralName );

					return false;
				}
				else if( !AllowMaleWearer && !from.Female )
				{
					if( AllowFemaleWearer )
						from.SendLocalizedMessage( 1010388 ); // Only females can wear this.
					else
						from.SendMessage( "You may not wear this." );

					return false;
				}
				else if( !AllowFemaleWearer && from.Female )
				{
					if( AllowMaleWearer )
						from.SendLocalizedMessage( 1063343 ); // Only males can wear this.
					else
						from.SendMessage( "You may not wear this." );

					return false;
				}
				else
				{
					int strBonus = ComputeStatBonus( StatType.Str ), strReq = ComputeStatReq( StatType.Str );
					int dexBonus = ComputeStatBonus( StatType.Dex ), dexReq = ComputeStatReq( StatType.Dex );
					int intBonus = ComputeStatBonus( StatType.Int ), intReq = ComputeStatReq( StatType.Int );

					if( from.Dex < dexReq || (from.Dex + dexBonus) < 1 )
					{
						from.SendLocalizedMessage( 502077 ); // You do not have enough dexterity to equip this item.
						return false;
					}
					else if( from.Str < strReq || (from.Str + strBonus) < 1 )
					{
						from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
						return false;
					}
					else if( from.Int < intReq || (from.Int + intBonus) < 1 )
					{
						from.SendMessage( "You are not smart enough to equip that." );
						return false;
					}
				}
			}

	// XmlAttachment check for CanEquip
	if(!Server.Engines.XmlSpawner2.XmlAttach.CheckCanEquip(this, from))
	{
        	return false;
	} else
	{

		return base.CanEquip( from );
	}
		}

		public override bool CheckPropertyConfliction( Mobile m )
		{
			if ( base.CheckPropertyConfliction( m ) )
				return true;

			if ( Layer == Layer.Pants )
				return ( m.FindItemOnLayer( Layer.InnerLegs ) != null );

			if ( Layer == Layer.Shirt )
				return ( m.FindItemOnLayer( Layer.InnerTorso ) != null );

			return false;
		}

		public override bool OnEquip( Mobile from )
		{
			from.CheckStatTimers();

			int strBonus = ComputeStatBonus( StatType.Str );
			int dexBonus = ComputeStatBonus( StatType.Dex );
			int intBonus = ComputeStatBonus( StatType.Int );

			if ( strBonus != 0 || dexBonus != 0 || intBonus != 0 )
			{
				string modName = this.Serial.ToString();

				if ( strBonus != 0 )
					from.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

				if ( dexBonus != 0 )
					from.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

				if ( intBonus != 0 )
					from.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
			}

			
	// XmlAttachment check for OnEquip
        Server.Engines.XmlSpawner2.XmlAttach.CheckOnEquip(this, from);

	return base.OnEquip( from );
		}

		public override void OnRemoved( object parent )
		{
			if ( parent is Mobile )
			{
				Mobile m = (Mobile)parent;
				string modName = this.Serial.ToString();

				m.RemoveStatMod( modName + "Str" );
				m.RemoveStatMod( modName + "Dex" );
				m.RemoveStatMod( modName + "Int" );

				if ( Core.AOS )
					m_AosSkillBonuses.Remove();

				((Mobile)parent).Delta( MobileDelta.Armor ); // Tell them armor rating has changed
				m.CheckStatTimers();
			}

	// XmlAttachment check for OnRemoved
	Server.Engines.XmlSpawner2.XmlAttach.CheckOnRemoved(this, parent);

	base.OnRemoved( parent );
		}

		public virtual int OnHit( BaseWeapon weapon, int damageTaken )
		{
			double HalfAr = ArmorRating / 2.0;
			int Absorbed = (int)(HalfAr + HalfAr*Utility.RandomDouble());

			damageTaken -= Absorbed;
			if ( damageTaken < 0 ) 
				damageTaken = 0;

			if ( Absorbed < 2 )
				Absorbed = 2;

			if ( 25 > Utility.Random( 100 ) ) // 25% chance to lower durability
			{
				if ( Core.AOS && m_AosArmorAttributes.SelfRepair > Utility.Random( 10 ) )
				{
					HitPoints += 2;
				}
				else
				{
					int wear;

					if ( weapon.Type == WeaponType.Bashing )
						wear = Absorbed / 2;
					else
						wear = Utility.Random( 2 );

					if ( wear > 0 && m_MaxHitPoints > 0 )
					{
						if ( m_HitPoints >= wear )
						{
							HitPoints -= wear;
							wear = 0;
						}
						else
						{
							wear -= HitPoints;
							HitPoints = 0;
						}

						if ( wear > 0 )
						{
							if ( m_MaxHitPoints > wear )
							{
								MaxHitPoints -= wear;

								if ( Parent is Mobile )
									((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
							}
							else
							{
								Delete();
							}
						}
					}
				}
			}

			return damageTaken;
		}

		private string GetNameString()
		{
			string name = this.Name;

			if ( name == null )
				name = String.Format( "#{0}", LabelNumber );

			return name;
		}

		[Hue, CommandProperty( AccessLevel.GameMaster )]
		public override int Hue
		{
			get{ return base.Hue; }
			set{ base.Hue = value; InvalidateProperties(); }
		}

		public override void AddNameProperty( ObjectPropertyList list )
		{
			string oreType;

            if (Hue == 0)
            {
                oreType = "";
            }
            else
            {
			switch ( m_Resource )
			{
                    case CraftResource.DullCopper: oreType = "Dull Copper"; break; // dull copper
                    case CraftResource.ShadowIron: oreType = "Shadow Iron"; break; // shadow iron
                    case CraftResource.Copper: oreType = "Copper"; break; // copper
                    case CraftResource.Bronze: oreType = "Bronze"; break; // bronze
                    case CraftResource.Gold: oreType = "Gold"; break; // golden
                    case CraftResource.Silver: oreType = "Silver"; break; // Silver
                    case CraftResource.Agapite: oreType = "Agapite"; break; // agapite
                    case CraftResource.Verite: oreType = "Verite"; break; // verite
                    case CraftResource.Valorite: oreType = "Valorite"; break; // valorite
                    case CraftResource.Uridium: oreType = "Uridium"; break; // Uridium
                    case CraftResource.Trillium: oreType = "Trillium"; break; // Trillium
                    case CraftResource.Titanium: oreType = "Titanium"; break; // Titanium
                    case CraftResource.Platinum: oreType = "Platinum"; break; // Platinum
                    case CraftResource.Zenite: oreType = "Zenite"; break; // Zenite
                    case CraftResource.Naquinite: oreType = "Naquinite"; break; // Naquinite
                    case CraftResource.Galvinite: oreType = "Galvinite"; break; // Galvinite
                    case CraftResource.Trilamide: oreType = "Trilamide"; break; // Trilamide
                    case CraftResource.Veramide: oreType = "Veramide"; break; // Veramide
                    case CraftResource.Zenlamide: oreType = "Zenlamide"; break; // Zenlamide

                    case CraftResource.SpinedLeather: oreType = "Spined"; break; // spined
                    case CraftResource.HornedLeather: oreType = "Horned"; break; // horned
                    case CraftResource.BarbedLeather: oreType = "Barbed"; break; // barbed
                    case CraftResource.RibbedLeather: oreType = "Ribbed"; break; // Ribbed
                    case CraftResource.DreadLeather: oreType = "Dread"; break; // Dread
                    case CraftResource.EtheralLeather: oreType = "Etheral"; break; // Etheral

                    case CraftResource.RedScales: oreType = "Red"; break; // red
                    case CraftResource.YellowScales: oreType = "Yellow"; break; // yellow
                    case CraftResource.BlackScales: oreType = "Black"; break; // black
                    case CraftResource.GreenScales: oreType = "Green"; break; // green
                    case CraftResource.WhiteScales: oreType = "White"; break; // white
                    case CraftResource.BlueScales: oreType = "Blue"; break; // blue

                    case CraftResource.Amazonite: oreType = "Amazonite"; break;
                    case CraftResource.Amber: oreType = "Amber"; break;
                    case CraftResource.Amethyst: oreType = "Amethyst"; break;
                    case CraftResource.Aragonite: oreType = "Aragonite"; break;
                    case CraftResource.Bixbite: oreType = "Bixbite"; break;
                    case CraftResource.BloodStone: oreType = "BloodStone"; break;
                    case CraftResource.Calcite: oreType = "Calcite"; break;
                    case CraftResource.GoldStone: oreType = "GoldStone"; break;
                    case CraftResource.Labradorite: oreType = "Labradorite"; break;
                    case CraftResource.Moldavite: oreType = "Moldavite"; break;
                    case CraftResource.Morganite: oreType = "Morganite"; break;
                    case CraftResource.Quartz: oreType = "Quartz"; break;
                    case CraftResource.Rhodonite: oreType = "Rhodonite"; break;
                    case CraftResource.Ruby: oreType = "Ruby"; break;
                    case CraftResource.Sapphire: oreType = "Sapphire"; break;
                    case CraftResource.Sugilite: oreType = "Sugilite"; break;
                    case CraftResource.Tanzanite: oreType = "Tanzanite"; break;
                    case CraftResource.Turquoise: oreType = "Turquoise"; break;
                    case CraftResource.Varisite: oreType = "Varisite"; break;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			}

			if ( m_Quality == ArmorQuality.Exceptional )
			{
				if ( oreType != 0 )
					list.Add( 1053100, "#{0}\t{1}", oreType, GetNameString() ); // exceptional ~1_oretype~ ~2_armortype~
				else
					list.Add( 1050040, GetNameString() ); // exceptional ~1_ITEMNAME~
			}
			else
			{
				if ( oreType != 0 )
					list.Add( 1053099, "#{0}\t{1}", oreType, GetNameString() ); // ~1_oretype~ ~2_armortype~
				else if ( Name == null )
					list.Add( LabelNumber );
				else
					list.Add( Name );
			}
		}

		public override bool AllowEquipedCast( Mobile from )
		{
			if ( base.AllowEquipedCast( from ) )
				return true;

			return ( m_AosAttributes.SpellChanneling != 0 );
		}

		public virtual int GetLuckBonus()
		{
			CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource );

			if ( resInfo == null )
				return 0;

			CraftAttributeInfo attrInfo = resInfo.AttributeInfo;

			if ( attrInfo == null )
				return 0;

			return attrInfo.ArmorLuck;
		}

		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );

			if ( m_Crafter != null )
				list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~

			#region Factions
			if ( m_FactionState != null )
				list.Add( 1041350 ); // faction item
			#endregion

			if( RequiredRace == Race.Elf )
				list.Add( 1075086 ); // Elves Only

			m_AosSkillBonuses.GetProperties( list );

			int prop;

			if ( (prop = ArtifactRarity) > 0 )
				list.Add( 1061078, prop.ToString() ); // artifact rarity ~1_val~

			if ( (prop = m_AosAttributes.WeaponDamage) != 0 )
				list.Add( 1060401, prop.ToString() ); // damage increase ~1_val~%

			if ( (prop = m_AosAttributes.DefendChance) != 0 )
				list.Add( 1060408, prop.ToString() ); // defense chance increase ~1_val~%

			if ( (prop = m_AosAttributes.BonusDex) != 0 )
				list.Add( 1060409, prop.ToString() ); // dexterity bonus ~1_val~

			if ( (prop = m_AosAttributes.EnhancePotions) != 0 )
				list.Add( 1060411, prop.ToString() ); // enhance potions ~1_val~%

			if ( (prop = m_AosAttributes.CastRecovery) != 0 )
				list.Add( 1060412, prop.ToString() ); // faster cast recovery ~1_val~

			if ( (prop = m_AosAttributes.CastSpeed) != 0 )
				list.Add( 1060413, prop.ToString() ); // faster casting ~1_val~

			if ( (prop = m_AosAttributes.AttackChance) != 0 )
				list.Add( 1060415, prop.ToString() ); // hit chance increase ~1_val~%

			if ( (prop = m_AosAttributes.BonusHits) != 0 )
				list.Add( 1060431, prop.ToString() ); // hit point increase ~1_val~

			if ( (prop = m_AosAttributes.BonusInt) != 0 )
				list.Add( 1060432, prop.ToString() ); // intelligence bonus ~1_val~

			if ( (prop = m_AosAttributes.LowerManaCost) != 0 )
				list.Add( 1060433, prop.ToString() ); // lower mana cost ~1_val~%

			if ( (prop = m_AosAttributes.LowerRegCost) != 0 )
				list.Add( 1060434, prop.ToString() ); // lower reagent cost ~1_val~%

			if ( (prop = GetLowerStatReq()) != 0 )
				list.Add( 1060435, prop.ToString() ); // lower requirements ~1_val~%

			if ( (prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0 )
				list.Add( 1060436, prop.ToString() ); // luck ~1_val~

			if ( (prop = m_AosArmorAttributes.MageArmor) != 0 )
				list.Add( 1060437 ); // mage armor

			if ( (prop = m_AosAttributes.BonusMana) != 0 )
				list.Add( 1060439, prop.ToString() ); // mana increase ~1_val~

			if ( (prop = m_AosAttributes.RegenMana) != 0 )
				list.Add( 1060440, prop.ToString() ); // mana regeneration ~1_val~

			if ( (prop = m_AosAttributes.NightSight) != 0 )
				list.Add( 1060441 ); // night sight

			if ( (prop = m_AosAttributes.ReflectPhysical) != 0 )
				list.Add( 1060442, prop.ToString() ); // reflect physical damage ~1_val~%

			if ( (prop = m_AosAttributes.RegenStam) != 0 )
				list.Add( 1060443, prop.ToString() ); // stamina regeneration ~1_val~

			if ( (prop = m_AosAttributes.RegenHits) != 0 )
				list.Add( 1060444, prop.ToString() ); // hit point regeneration ~1_val~

			if ( (prop = m_AosArmorAttributes.SelfRepair) != 0 )
				list.Add( 1060450, prop.ToString() ); // self repair ~1_val~

			if ( (prop = m_AosAttributes.SpellChanneling) != 0 )
				list.Add( 1060482 ); // spell channeling

			if ( (prop = m_AosAttributes.SpellDamage) != 0 )
				list.Add( 1060483, prop.ToString() ); // spell damage increase ~1_val~%

			if ( (prop = m_AosAttributes.BonusStam) != 0 )
				list.Add( 1060484, prop.ToString() ); // stamina increase ~1_val~

			if ( (prop = m_AosAttributes.BonusStr) != 0 )
				list.Add( 1060485, prop.ToString() ); // strength bonus ~1_val~

			if ( (prop = m_AosAttributes.WeaponSpeed) != 0 )
				list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~%

			base.AddResistanceProperties( list );

			if ( (prop = GetDurabilityBonus()) > 0 )
				list.Add( 1060410, prop.ToString() ); // durability ~1_val~%

			if ( (prop = ComputeStatReq( StatType.Str )) > 0 )
				list.Add( 1061170, prop.ToString() ); // strength requirement ~1_val~

	if ( m_HitPoints > 0 && m_MaxHitPoints > 0 )
		list.Add( 1060639, "{0}\t{1}", m_HitPoints, m_MaxHitPoints ); // durability ~1_val~ / ~2_val~
			
	// mod to display attachment properties
	Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);

		}

		public override void OnSingleClick( Mobile from )
		{
			List<EquipInfoAttribute> attrs = new List<EquipInfoAttribute>();

			if ( DisplayLootType )
			{
				if ( LootType == LootType.Blessed )
					attrs.Add( new EquipInfoAttribute( 1038021 ) ); // blessed
				else if ( LootType == LootType.Cursed )
					attrs.Add( new EquipInfoAttribute( 1049643 ) ); // cursed
			}

			#region Factions
			if ( m_FactionState != null )
				attrs.Add( new EquipInfoAttribute( 1041350 ) ); // faction item
			#endregion

			if ( m_Quality == ArmorQuality.Exceptional )
				attrs.Add( new EquipInfoAttribute( 1018305 - (int)m_Quality ) );

			if ( m_Identified || from.AccessLevel >= AccessLevel.GameMaster)
			{
				if ( m_Durability != ArmorDurabilityLevel.Regular )
					attrs.Add( new EquipInfoAttribute( 1038000 + (int)m_Durability ) );

				if ( m_Protection > ArmorProtectionLevel.Regular && m_Protection <= ArmorProtectionLevel.Invulnerability )
					attrs.Add( new EquipInfoAttribute( 1038005 + (int)m_Protection ) );
			}
			else if ( m_Durability != ArmorDurabilityLevel.Regular || (m_Protection > ArmorProtectionLevel.Regular && m_Protection <= ArmorProtectionLevel.Invulnerability) )
				attrs.Add( new EquipInfoAttribute( 1038000 ) ); // Unidentified

			int number;

			if ( Name == null )
			{
				number = LabelNumber;
			}
			else
			{
				this.LabelTo( from, Name );
				number = 1041000;
			}

			if ( attrs.Count == 0 && Crafter == null && Name != null )
				return;

			EquipmentInfo eqInfo = new EquipmentInfo( number, m_Crafter, false, attrs.ToArray() );

			from.Send( new DisplayEquipmentInfo( this, eqInfo ) );
		}

		#region ICraftable Members

		public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
		{
			Quality = (ArmorQuality)quality;

			if ( makersMark )
				Crafter = from;

			Type resourceType = typeRes;

			if ( resourceType == null )
				resourceType = craftItem.Ressources.GetAt( 0 ).ItemType;

			Resource = CraftResources.GetFromType( resourceType );
			PlayerConstructed = true;

			CraftContext context = craftSystem.GetContext( from );

			if ( context != null && context.DoNotColor )
				Hue = 0;

			if( Quality == ArmorQuality.Exceptional )
			{
				DistributeBonuses( (tool is BaseRunicTool ? 6 : Core.SE ? 15 : 14) ); // Not sure since when, but right now 15 points are added, not 14.

				if( Core.ML && !(this is BaseShield) )
				{
					int bonus = (int)(from.Skills.ArmsLore.Value / 20);

					for( int i = 0; i < bonus; i++ )
					{
						switch( Utility.Random( 5 ) )
						{
							case 0: m_PhysicalBonus++;	break;
							case 1: m_FireBonus++;		break;
							case 2: m_ColdBonus++;		break;
							case 3: m_EnergyBonus++;	break;
							case 4: m_PoisonBonus++;	break;
						}
					}

					from.CheckSkill( SkillName.ArmsLore, 0, 100 );
				}
			}

			if ( Core.AOS && tool is BaseRunicTool )
				((BaseRunicTool)tool).ApplyAttributesTo( this );

			return quality;
		}

		#endregion
	}
}
 

FingersMcSteal

Sorceror
From what i can tell...

Code:
[FONT=Courier New][COLOR=#007700]else 
            { 
            switch ( [/COLOR][COLOR=#0000bb]m_Resource [/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) 
            { 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]DullCopper[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Dull Copper"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// dull copper 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]ShadowIron[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Shadow Iron"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// shadow iron 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Copper[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Copper"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// copper 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Bronze[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Bronze"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// bronze 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Gold[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Gold"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// golden 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Silver[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Silver"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Silver 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Agapite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Agapite"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// agapite 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Verite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Verite"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// verite 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Valorite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Valorite"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// valorite 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Uridium[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Uridium"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Uridium 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Trillium[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Trillium"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Trillium 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Titanium[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Titanium"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Titanium 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Platinum[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Platinum"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Platinum 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Zenite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Zenite"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Zenite 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Naquinite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Naquinite"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Naquinite 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Galvinite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Galvinite"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Galvinite 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Trilamide[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Trilamide"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Trilamide 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Veramide[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Veramide"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Veramide 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Zenlamide[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Zenlamide"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Zenlamide 

                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]SpinedLeather[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Spined"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// spined 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]HornedLeather[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Horned"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// horned 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]BarbedLeather[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Barbed"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// barbed 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]RibbedLeather[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Ribbed"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Ribbed 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]DreadLeather[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Dread"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Dread 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]EtheralLeather[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Etheral"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// Etheral 

                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]RedScales[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Red"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// red 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]YellowScales[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Yellow"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// yellow 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]BlackScales[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Black"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// black 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]GreenScales[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Green"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// green 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]WhiteScales[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"White"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// white 
                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]BlueScales[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Blue"[/COLOR][COLOR=#007700]; break; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// blue 

                    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Amazonite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Amazonite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Amber[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Amber"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Amethyst[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Amethyst"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Aragonite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Aragonite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Bixbite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Bixbite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]BloodStone[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"BloodStone"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Calcite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Calcite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]GoldStone[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"GoldStone"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Labradorite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Labradorite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Moldavite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Moldavite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Morganite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Morganite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Quartz[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Quartz"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Rhodonite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Rhodonite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Ruby[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Ruby"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Sapphire[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Sapphire"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Sugilite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Sugilite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Tanzanite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Tanzanite"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Turquoise[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Turquoise"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; break; 
                    case [/COLOR][COLOR=#0000bb]CraftResource[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]Varisite[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]oreType [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"Varisite"[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]; break; 
[/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
            [/COLOR][COLOR=#007700]}[/COLOR][/FONT]

ADD } after the above to compleate the ELSE section.
 

Kepchook

Wanderer
Well... I did this of course =)
But when I add a } then it wants one more }. When I add it once more then I get lots of errors of others scripts..
 

Hammerhand

Knight
Code:
                    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
                }

                if (m_Quality == ArmorQuality.Exceptional)
                {
                    if (oreType != 0)
                        list.Add(1053100, "#{0}\t{1}", oreType, GetNameString()); // exceptional ~1_oretype~ ~2_armortype~ 
                    else
                        list.Add(1050040, GetNameString()); // exceptional ~1_ITEMNAME~ 
                }
                else
                {
                    if (oreType != 0)
                        list.Add(1053099, "#{0}\t{1}", oreType, GetNameString()); // ~1_oretype~ ~2_armortype~ 
                    else if (Name == null)
                        list.Add(LabelNumber);
                    else
                        list.Add(Name);
                }
            }
        }  [COLOR="Red"]<< add it here[/COLOR] This is line # 1509
 

seanandre

Sorceror
I'm trying to get this system to work on RunUO 2.0 Final. But I get these errors:

Code:
 + Commands/HelpInfo.cs:
    CS0122: Line 11: 'Server.Commands.Docs.DocCommandEntry' is inaccessible due
to its protection level
    CS0122: Line 12: 'Server.Commands.Docs.CommandEntrySorter' is inaccessible d
ue to its protection level
    CS0051: Line 239: Inconsistent accessibility: parameter type 'System.Collect
ions.Generic.List<Server.Commands.Docs.DocCommandEntry>' is less accessible than
 method 'Server.Commands.HelpInfo.CommandListGump.CommandListGump(int, Server.Mo
bile, System.Collections.Generic.List<Server.Commands.Docs.DocCommandEntry>)'
    CS0051: Line 364: Inconsistent accessibility: parameter type 'Server.Command
s.Docs.DocCommandEntry' is less accessible than method 'Server.Commands.HelpInfo
.CommandInfoGump.CommandInfoGump(Server.Commands.Docs.DocCommandEntry)'
    CS0051: Line 369: Inconsistent accessibility: parameter type 'Server.Command
s.Docs.DocCommandEntry' is less accessible than method 'Server.Commands.HelpInfo
.CommandInfoGump.CommandInfoGump(Server.Commands.Docs.DocCommandEntry, int, int)
'
    CS0053: Line 22: Inconsistent accessibility: property type 'System.Collectio
ns.Generic.Dictionary<string,Server.Commands.Docs.DocCommandEntry>' is less acce
ssible than property 'Server.Commands.HelpInfo.HelpInfos'
    CS0053: Line 23: Inconsistent accessibility: property type 'System.Collectio
ns.Generic.List<Server.Commands.Docs.DocCommandEntry>' is less accessible than p
roperty 'Server.Commands.HelpInfo.SortedHelpInfo'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

Any reason why this is happening?

Sean
 

FingersMcSteal

Sorceror
The error your getting is not for one of these resource files i've posted here, and remember that the latest version in this thread is also only for SVN 300 or lower shards. RC2 final may have had a few changes which could have broke it but i'll have a dig into the help file that is giving the error your getting.

*** EDIT ***

If i remember when i created this i also changed the Docs.CS file so it would generate the correct BOD table files for the Blacksmith & Tailor rewards. Seems with the Final version theres some kind of a change been done to (i'm guessing) the Docs.cs file somewhere along the way. If you replaced the Docs.cs file with the one in this release then thats probably the cause in the helpinfo.cs file in the final version giving the error.

Put the Docs.cs from the RC2 Final back into the script directory of your shard and try that, when you generate documentation for your shard you won't have BOD rewards for the extra resources thats all.
 

seanandre

Sorceror
Okay, I downloaded the 11th version and threw it in my RunUO 2.0 Final server, after deleting all the duplicates and leaving my original Docs.cs file in there, I now get the following errors:

Code:
Errors:
 + NewResources/BaseWeapon.cs:
    CS0535: Line 23: 'Server.Items.BaseWeapon' does not implement interface memb
er 'Server.Items.IDurability.CanFortify'
 + NewResources/BaseArmor.cs:
    CS0535: Line 13: 'Server.Items.BaseArmor' does not implement interface membe
r 'Server.Items.IDurability.CanFortify'
 + Items/Champion Artifacts/Shared/BraveKnightOfTheBritannia.cs:
    CS0115: Line 13: 'Server.Items.BraveKnightOfTheBritannia.CanFortify': no sui
table method found to override
 + Items/Champion Artifacts/Shared/GuantletsOfAnger.cs:
    CS0115: Line 19: 'Server.Items.GuantletsOfAnger.CanFortify': no suitable met
hod found to override
 + Items/Champion Artifacts/Shared/OblivionsNeedle.cs:
    CS0115: Line 13: 'Server.Items.OblivionsNeedle.CanFortify': no suitable meth
od found to override
 + Items/Champion Artifacts/Shared/RoyalGuardSurvivalKnife.cs:
    CS0115: Line 13: 'Server.Items.RoyalGuardSurvivalKnife.CanFortify': no suita
ble method found to override
 + Items/Champion Artifacts/Unique/Calm.cs:
    CS0115: Line 13: 'Server.Items.Calm.CanFortify': no suitable method found to
 override
 + Items/Champion Artifacts/Unique/FangOfRactus.cs:
    CS0115: Line 13: 'Server.Items.FangOfRactus.CanFortify': no suitable method
found to override
 + Items/Champion Artifacts/Unique/GladiatorsCollar.cs:
    CS0115: Line 19: 'Server.Items.GladiatorsCollar.CanFortify': no suitable met
hod found to override
 + Items/Champion Artifacts/Unique/OrcChieftainHelm.cs:
    CS0115: Line 19: 'Server.Items.OrcChieftainHelm.CanFortify': no suitable met
hod found to override
 + Items/Champion Artifacts/Unique/Pacify.cs:
    CS0115: Line 13: 'Server.Items.Pacify.CanFortify': no suitable method found
to override
 + Items/Champion Artifacts/Unique/Quell.cs:
    CS0115: Line 13: 'Server.Items.Quell.CanFortify': no suitable method found t
o override
 + Items/Champion Artifacts/Unique/ShroudOfDeceit.cs:
    CS0115: Line 19: 'Server.Items.ShroudOfDeciet.CanFortify': no suitable metho
d found to override
 + Items/Champion Artifacts/Unique/Subdue.cs:
    CS0115: Line 13: 'Server.Items.Subdue.CanFortify': no suitable method found
to override
 + NewResources/Bods&Runics/Vendors/Blacksmith.cs:
    CS0115: Line 125: 'Server.Mobiles.Blacksmith.OnSuccessfulBulkOrderRecieve(Se
rver.Mobile)': no suitable method found to override
 + NewResources/Bods&Runics/Vendors/Tailor.cs:
    CS0115: Line 74: 'Server.Mobiles.Tailor.OnSuccessfulBulkOrderRecieve(Server.
Mobile)': no suitable method found to override
 + NewResources/Crystal/Crystals.cs:
    CS0535: Line 6: 'Server.Items.BaseCrystal' does not implement interface memb
er 'Server.Items.ICommodity.DescriptionNumber'
 + NewResources/Powder/Powders.cs:
    CS0535: Line 6: 'Server.Items.BasePowder' does not implement interface membe
r 'Server.Items.ICommodity.DescriptionNumber'
 + NewResources/Board.cs:
    CS0535: Line 6: 'Server.Items.BaseBoards' does not implement interface membe
r 'Server.Items.ICommodity.DescriptionNumber'
 + NewResources/Granite.cs:
    CS0535: Line 7: 'Server.Items.BaseGranite' does not implement interface memb
er 'Server.Items.ICommodity.DescriptionNumber'
 + NewResources/Hides.cs:
    CS0535: Line 7: 'Server.Items.BaseHides' does not implement interface member
 'Server.Items.ICommodity.DescriptionNumber'
 + NewResources/Ingots.cs:
    CS0535: Line 7: 'Server.Items.BaseIngot' does not implement interface member
 'Server.Items.ICommodity.DescriptionNumber'
 + NewResources/Leathers.cs:
    CS0535: Line 7: 'Server.Items.BaseLeather' does not implement interface memb
er 'Server.Items.ICommodity.DescriptionNumber'
 + NewResources/Log.cs:
    CS0535: Line 7: 'Server.Items.BaseLog' does not implement interface member '
Server.Items.ICommodity.DescriptionNumber'
 + NewResources/Ore.cs:
    CS0535: Line 9: 'Server.Items.BaseOre' does not implement interface member '
Server.Items.ICommodity.DescriptionNumber'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

I never did figure out in all of the resource systems we have tried on 2.0 Final that weren't for 2.0 Final, why in the he** most of the errors have to do with "Does not impliment interface member". That's annoying. Because we have a lot of RC1 and RC2 scripts on our 2.0 Final server including Nerun's Distro and they're not givng us any trouble. Heck we're even using the SVN version of Xanthos Evo System and the only problem that gave us was something in the Mercenary file about "AnkhNorth" which had to be changed to "AnkSouth" or something.

Really hope you can help us get this working.

Thanks,
Sean
 

FingersMcSteal

Sorceror
Ok, looking at that list of errors from SVN 300 through to the RC2 Final release theres been alot of changes.

The short answer here is... unfortuantly this resource release is not going to work 'out the box' on RC2 Final version of the server, like i've mentioned before it was originally done for an older version of the server, there were updates done but that was over a year ago and it only covered up to SVN 300.

Probably not the answer your looking for i know.

You probably have 2 options here that i can think of, first is you try and make the changes to the RC2 Final files yourself and create a new resource system for RC2 Final, or... i install RC2 final version of the servers files and start from scratch and re-make this system to run on RC2 Final.

I have work on the go right now with regards to running ListUO.Com and the client launching app i'm working on so unfortuantly i'm not going to be able to spend alot of time looking into making a compleate new RC2 Final version of this resource system. Sorry i can't be more helpful right now.
 
I got your system in Runuo Final.. along with Zantos, knives Chat, The bigges pain is Fsats Taming. And I did it the newbie way.. I threw in both 12th and yaks lol... started shard and then Well you know the rest lol.. But I did get it in. Now wether things are right or not I havent finished testing.
 

seanandre

Sorceror
Well I'm thinking about starting over with the latest SVN with Calendor2K's Mondain's Legacy. I'm going to try installing this system on that. Hopefully it'll work, who knows. I have no idea where to get the SVN version this script is asking for that would help, and I'm worried as to whether or not everything would be compatible with eachother, cause I'm trying to get this system, and FS Animal Taming System Gen2 to work toegether along with Nerun's Distro, and Calendor2K's Mondain's Legacy plus the latest SVN already has Nerun's Distro in it, so there's no need to fix all that.

Only problem is, my wife, my kids and I will have to start our characters all over again, which we don't want to do, but what choice do we have? I've racked my brain with all this and I'm about to give up and stick with the server we have without a resource system or a taming system. Boring, but alteast everything is working together so far.

Sean
 
Top