/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\items\misc\staff\globalchangestone.cs
Lines of code: 484
***********************************************************/


using System;
using Server.Items;
using System.Collections;
using Server.Mobiles;
using Server.Targeting;

namespace Server.Items
{
	public class globalchangestone : Item
	{
		
		
	
		public override string DefaultName
		{
			get { return "Global Change Stone"; }
		}

		[Constructable]
		public globalchangestone() : base( 0xED4 )
		{
			Movable = false;
			Hue = 1150;
		}	
		

		public override void OnDoubleClick( Mobile from )
		{	
		if(from.AccessLevel<AccessLevel.Owner)
		{
		from.SendMessage("Only owner can invoke this");
		return;
		}
		
		
		from.Target = new InternalTarget( from );
		}
		
		
		

		public class InternalTarget : Target
		{
		

			public InternalTarget(Mobile mob) : base( 12, false, TargetFlags.None )
			{
			mob.SendMessage("Target an artifact to globally change");
			}

			protected override void OnTarget( Mobile from, object o )
			{
				if(from.AccessLevel<AccessLevel.Owner)
				{
				from.SendMessage("Only owner can invoke this");
				return;
				}			
			
				Map map = from.Map;
			
				int countmod=0;
			
				if ( o is Item )
				{
				Item tomoditem = o as Item;
			
				Type t = tomoditem.GetType();
				
				if(t==null || tomoditem==null)return;
			

					
					ArrayList items = new ArrayList();
					
					foreach ( Item i in World.Items.Values )
					{					
					Type t2 = i.GetType();
					
					//null checks (should never hit, but w/e better safe than sorry
					if(t2==null || i==null)continue;

					
						//add all that match into the array
						if(t==t2)
						{
						items.Add(i);
						countmod++;
						}
						
					}
					
					for(int i=0;i<items.Count;i++)
					{
					Item moditem = items[i] as Item;
					

					
					CopyProperties(moditem,tomoditem,true);
					}			
				
				from.SendMessage("{0} items have been changed.",countmod);
				}
				else if (o is BaseCreature)
				{				
				BaseCreature tomod = o as BaseCreature;
			
				Type t = tomod.GetType();
				
				if(t==null || tomod==null)return;
			

					
					ArrayList items = new ArrayList();
					
					foreach ( Mobile i in World.Mobiles.Values )
					{					
					Type t2 = i.GetType();
					
					//null checks (should never hit, but w/e better safe than sorry
					if(t2==null || i==null)continue;

					
						//add all that match into the array
						if(t==t2)
						{
						items.Add(i);
						countmod++;
						}
						
					}
					
					for(int i=0;i<items.Count;i++)
					{
					BaseCreature mod = items[i] as BaseCreature;						
										
         			//Note: This will only lower stats/resist that are too high, don't raise higher ones
					
					mod.ActiveSpeed = tomod.ActiveSpeed;
					mod.PassiveSpeed=tomod.PassiveSpeed;
					mod.AI = tomod.AI;
					mod.RangeFight=tomod.RangeFight;
										
					
					//damages
					mod.ChaosDamage=tomod.ChaosDamage;
					mod.PhysicalDamage=tomod.PhysicalDamage;
					mod.FireDamage=tomod.FireDamage;
					mod.ColdDamage=tomod.ColdDamage;
					mod.PoisonDamage=tomod.PoisonDamage;
					mod.EnergyDamage=tomod.EnergyDamage;
					
					//resists
					if(mod.PhysicalResistanceSeed>tomod.PhysicalResistanceSeed)mod.PhysicalResistanceSeed=tomod.PhysicalResistanceSeed;
					if(mod.FireResistSeed>tomod.FireResistSeed)mod.FireResistSeed=tomod.FireResistSeed;
					if(mod.ColdResistSeed>tomod.ColdResistSeed)mod.ColdResistSeed=tomod.ColdResistSeed;
					if(mod.PoisonResistSeed>tomod.PoisonResistSeed)mod.PoisonResistSeed=tomod.PoisonResistSeed;
					if(mod.EnergyResistSeed>tomod.EnergyResistSeed)mod.EnergyResistSeed=tomod.EnergyResistSeed;
					
					mod.DamageMin=tomod.DamageMin;
					mod.DamageMax=tomod.DamageMax;
					mod.ControlSlots=tomod.ControlSlots;
					mod.FightMode=tomod.FightMode;
					mod.MinTameSkill=tomod.MinTameSkill;
					mod.Tamable=tomod.Tamable;
					
					//stats
					if(mod.HitsMaxSeed>tomod.HitsMaxSeed)mod.HitsMaxSeed=tomod.HitsMaxSeed;
					if(mod.StamMaxSeed>tomod.StamMaxSeed)mod.StamMaxSeed=tomod.StamMaxSeed;
					if(mod.ManaMaxSeed>tomod.ManaMaxSeed)mod.ManaMaxSeed=tomod.ManaMaxSeed;
					
					if(mod.RawStr>tomod.RawStr)mod.RawStr=tomod.RawStr;
					if(mod.RawDex>tomod.RawDex)mod.RawDex=tomod.RawDex;
					if(mod.RawInt>tomod.RawInt)mod.RawStr=tomod.RawInt;
					
					}
					
					
				
				from.SendMessage("{0} mobs have been changed.",countmod);
				}
				
				
			}

			protected override void OnTargetFinish( Mobile from )
			{
				
			}
		}		
		
		
		public static void CopyProperties(Item dest,Item src,bool skiphue)
		{
			
			//base item props
			if(src is Item && dest is Item)
			{
				dest.ItemID=src.ItemID;
				dest.Layer=src.Layer;
				dest.Name=src.Name;
				dest.Weight=src.Weight;
				if(!skiphue)dest.Hue=src.Hue;
			}
			
			
			//ARMOR					
			if(src is BaseArmor && dest is BaseArmor)
			{
			BaseArmor mod = dest as BaseArmor;
			BaseArmor tomod = src as BaseArmor;
			

			//armor attributes
			mod.ArmorAttributes.DurabilityBonus=tomod.ArmorAttributes.DurabilityBonus;
			mod.ArmorAttributes.LowerStatReq=tomod.ArmorAttributes.LowerStatReq;
			mod.ArmorAttributes.MageArmor=tomod.ArmorAttributes.MageArmor;
			mod.ArmorAttributes.SelfRepair=tomod.ArmorAttributes.SelfRepair;
			
			//AOS attributes
			mod.Attributes.AttackChance=tomod.Attributes.AttackChance;
			mod.Attributes.BonusDex=tomod.Attributes.BonusDex;
			mod.Attributes.BonusHits=tomod.Attributes.BonusHits;
			mod.Attributes.BonusInt=tomod.Attributes.BonusInt;
			mod.Attributes.BonusMana=tomod.Attributes.BonusMana;
			mod.Attributes.BonusStam=tomod.Attributes.BonusStam;
			mod.Attributes.BonusStr=tomod.Attributes.BonusStr;
			mod.Attributes.CastRecovery=tomod.Attributes.CastRecovery;
			mod.Attributes.CastSpeed=tomod.Attributes.CastSpeed;
			mod.Attributes.DefendChance=tomod.Attributes.DefendChance;
			mod.Attributes.EnhancePotions=tomod.Attributes.EnhancePotions;
			mod.Attributes.LowerAmmoCost=tomod.Attributes.LowerAmmoCost;
			mod.Attributes.LowerManaCost=tomod.Attributes.LowerManaCost;
			mod.Attributes.LowerRegCost=tomod.Attributes.LowerRegCost;
			mod.Attributes.NightSight=tomod.Attributes.NightSight;
			mod.Attributes.ReflectPhysical=tomod.Attributes.ReflectPhysical;
			mod.Attributes.RegenHits=tomod.Attributes.RegenHits;
			mod.Attributes.RegenMana=tomod.Attributes.RegenMana;
			mod.Attributes.RegenStam=tomod.Attributes.RegenStam;
			mod.Attributes.SpellChanneling=tomod.Attributes.SpellChanneling;
			mod.Attributes.SpellDamage=tomod.Attributes.SpellDamage;
			mod.Attributes.WeaponDamage=tomod.Attributes.WeaponDamage;
			mod.Attributes.DamageModifier=tomod.Attributes.DamageModifier;			
			mod.Attributes.WeaponSpeed=tomod.Attributes.WeaponSpeed;
			
			//skill bonuses
			mod.SkillBonuses.Skill_1_Name=tomod.SkillBonuses.Skill_1_Name;
			mod.SkillBonuses.Skill_2_Name=tomod.SkillBonuses.Skill_2_Name;
			mod.SkillBonuses.Skill_3_Name=tomod.SkillBonuses.Skill_3_Name;
			mod.SkillBonuses.Skill_4_Name=tomod.SkillBonuses.Skill_4_Name;
			mod.SkillBonuses.Skill_5_Name=tomod.SkillBonuses.Skill_5_Name;
			mod.SkillBonuses.Skill_1_Value=tomod.SkillBonuses.Skill_1_Value;
			mod.SkillBonuses.Skill_2_Value=tomod.SkillBonuses.Skill_2_Value;
			mod.SkillBonuses.Skill_3_Value=tomod.SkillBonuses.Skill_3_Value;
			mod.SkillBonuses.Skill_4_Value=tomod.SkillBonuses.Skill_4_Value;
			mod.SkillBonuses.Skill_5_Value=tomod.SkillBonuses.Skill_5_Value;
			
			
			//resist bonuses
			mod.ColdBonus=tomod.ColdBonus;
			mod.EnergyBonus=tomod.EnergyBonus;
			mod.FireBonus=tomod.FireBonus;
			mod.PhysicalBonus=tomod.PhysicalBonus;
			mod.PoisonBonus=tomod.PoisonBonus;
			
			
			
			//misc
			mod.BaseArmorRating=tomod.BaseArmorRating;
			mod.DexRequirement=tomod.DexRequirement;
			mod.IntRequirement=tomod.IntRequirement;
			mod.StrRequirement=tomod.StrRequirement;
			mod.MaxHitPoints=tomod.MaxHitPoints;
			}
			
			//CLOTHING
			
			if(src is BaseClothing && dest is BaseClothing)
			{
			BaseClothing mod = dest as BaseClothing;
			BaseClothing tomod = src as BaseClothing;

			//clothingattributes
			mod.ClothingAttributes.DurabilityBonus=tomod.ClothingAttributes.DurabilityBonus;
			mod.ClothingAttributes.LowerStatReq=tomod.ClothingAttributes.LowerStatReq;
			mod.ClothingAttributes.MageArmor=tomod.ClothingAttributes.MageArmor;
			mod.ClothingAttributes.SelfRepair=tomod.ClothingAttributes.SelfRepair;
			
			//AOS attributes
			mod.Attributes.AttackChance=tomod.Attributes.AttackChance;
			mod.Attributes.BonusDex=tomod.Attributes.BonusDex;
			mod.Attributes.BonusHits=tomod.Attributes.BonusHits;
			mod.Attributes.BonusInt=tomod.Attributes.BonusInt;
			mod.Attributes.BonusMana=tomod.Attributes.BonusMana;
			mod.Attributes.BonusStam=tomod.Attributes.BonusStam;
			mod.Attributes.BonusStr=tomod.Attributes.BonusStr;
			mod.Attributes.CastRecovery=tomod.Attributes.CastRecovery;
			mod.Attributes.CastSpeed=tomod.Attributes.CastSpeed;
			mod.Attributes.DefendChance=tomod.Attributes.DefendChance;
			mod.Attributes.EnhancePotions=tomod.Attributes.EnhancePotions;
			mod.Attributes.LowerAmmoCost=tomod.Attributes.LowerAmmoCost;
			mod.Attributes.LowerManaCost=tomod.Attributes.LowerManaCost;
			mod.Attributes.LowerRegCost=tomod.Attributes.LowerRegCost;
			mod.Attributes.NightSight=tomod.Attributes.NightSight;
			mod.Attributes.ReflectPhysical=tomod.Attributes.ReflectPhysical;
			mod.Attributes.RegenHits=tomod.Attributes.RegenHits;
			mod.Attributes.RegenMana=tomod.Attributes.RegenMana;
			mod.Attributes.RegenStam=tomod.Attributes.RegenStam;
			mod.Attributes.SpellChanneling=tomod.Attributes.SpellChanneling;
			mod.Attributes.SpellDamage=tomod.Attributes.SpellDamage;
			mod.Attributes.WeaponDamage=tomod.Attributes.WeaponDamage;
			mod.Attributes.DamageModifier=tomod.Attributes.DamageModifier;			
			mod.Attributes.WeaponSpeed=tomod.Attributes.WeaponSpeed;
			
			//skill bonuses
			mod.SkillBonuses.Skill_1_Name=tomod.SkillBonuses.Skill_1_Name;
			mod.SkillBonuses.Skill_2_Name=tomod.SkillBonuses.Skill_2_Name;
			mod.SkillBonuses.Skill_3_Name=tomod.SkillBonuses.Skill_3_Name;
			mod.SkillBonuses.Skill_4_Name=tomod.SkillBonuses.Skill_4_Name;
			mod.SkillBonuses.Skill_5_Name=tomod.SkillBonuses.Skill_5_Name;
			mod.SkillBonuses.Skill_1_Value=tomod.SkillBonuses.Skill_1_Value;
			mod.SkillBonuses.Skill_2_Value=tomod.SkillBonuses.Skill_2_Value;
			mod.SkillBonuses.Skill_3_Value=tomod.SkillBonuses.Skill_3_Value;
			mod.SkillBonuses.Skill_4_Value=tomod.SkillBonuses.Skill_4_Value;
			mod.SkillBonuses.Skill_5_Value=tomod.SkillBonuses.Skill_5_Value;
			
			
			//resists
			mod.Resistances.Cold=tomod.Resistances.Cold;
			mod.Resistances.Energy=tomod.Resistances.Energy;
			mod.Resistances.Fire=tomod.Resistances.Fire;
			mod.Resistances.Physical=tomod.Resistances.Physical;
			mod.Resistances.Poison=tomod.Resistances.Poison;
			

			
			//misc
			mod.StrRequirement=tomod.StrRequirement;
			mod.MaxHitPoints=tomod.MaxHitPoints;
			}					
			
			
			//WEAPON
			
			if(src is BaseWeapon && dest is BaseWeapon)
			{
			BaseWeapon mod = dest as BaseWeapon;
			BaseWeapon tomod = src as BaseWeapon;
			

			//weapon attributes
			mod.WeaponAttributes.Balanced=tomod.WeaponAttributes.Balanced;					
			mod.WeaponAttributes.DurabilityBonus=tomod.WeaponAttributes.DurabilityBonus;
			mod.WeaponAttributes.HitColdArea=tomod.WeaponAttributes.HitColdArea;
			mod.WeaponAttributes.HitDispel=tomod.WeaponAttributes.HitDispel;
			mod.WeaponAttributes.HitEnergyArea=tomod.WeaponAttributes.HitEnergyArea;
			mod.WeaponAttributes.HitFireArea=tomod.WeaponAttributes.HitFireArea;
			mod.WeaponAttributes.HitFireball=tomod.WeaponAttributes.HitFireball;
			mod.WeaponAttributes.HitHarm=tomod.WeaponAttributes.HitHarm;
			mod.WeaponAttributes.HitLeechHits=tomod.WeaponAttributes.HitLeechHits;
			mod.WeaponAttributes.HitLeechStam=tomod.WeaponAttributes.HitLeechStam;
			mod.WeaponAttributes.HitLightning=tomod.WeaponAttributes.HitLightning;
			mod.WeaponAttributes.HitLowerAttack=tomod.WeaponAttributes.HitLowerAttack;
			mod.WeaponAttributes.HitLowerDefend=tomod.WeaponAttributes.HitLowerDefend;
			mod.WeaponAttributes.HitMagicArrow=tomod.WeaponAttributes.HitMagicArrow;
			mod.WeaponAttributes.HitPhysicalArea=tomod.WeaponAttributes.HitPhysicalArea;
			mod.WeaponAttributes.HitPoisonArea=tomod.WeaponAttributes.HitPoisonArea;
			mod.WeaponAttributes.LowerStatReq=tomod.WeaponAttributes.LowerStatReq;
			mod.WeaponAttributes.MageWeapon=tomod.WeaponAttributes.MageWeapon;
			mod.WeaponAttributes.ResistColdBonus=tomod.WeaponAttributes.ResistColdBonus;
			mod.WeaponAttributes.ResistEnergyBonus=tomod.WeaponAttributes.ResistEnergyBonus;
			mod.WeaponAttributes.ResistPhysicalBonus=tomod.WeaponAttributes.ResistPhysicalBonus;
			mod.WeaponAttributes.ResistPoisonBonus=tomod.WeaponAttributes.ResistPoisonBonus;
			mod.WeaponAttributes.ResistFireBonus=tomod.WeaponAttributes.ResistFireBonus;
			mod.WeaponAttributes.SelfRepair=tomod.WeaponAttributes.SelfRepair;
			mod.WeaponAttributes.UseBestSkill=tomod.WeaponAttributes.UseBestSkill;
			mod.WeaponAttributes.Velocity=tomod.WeaponAttributes.Velocity;
			
			
			
			//Elemental Damages
			mod.AosElementDamages.Chaos=tomod.AosElementDamages.Chaos;
			mod.AosElementDamages.Direct=tomod.AosElementDamages.Direct;			
			mod.AosElementDamages.Cold=tomod.AosElementDamages.Cold;
			mod.AosElementDamages.Energy=tomod.AosElementDamages.Energy;
			mod.AosElementDamages.Fire=tomod.AosElementDamages.Fire;
			mod.AosElementDamages.Physical=tomod.AosElementDamages.Physical;
			mod.AosElementDamages.Poison=tomod.AosElementDamages.Poison;					

			
			//AOS attributes
			mod.Attributes.AttackChance=tomod.Attributes.AttackChance;
			mod.Attributes.BonusDex=tomod.Attributes.BonusDex;
			mod.Attributes.BonusHits=tomod.Attributes.BonusHits;
			mod.Attributes.BonusInt=tomod.Attributes.BonusInt;
			mod.Attributes.BonusMana=tomod.Attributes.BonusMana;
			mod.Attributes.BonusStam=tomod.Attributes.BonusStam;
			mod.Attributes.BonusStr=tomod.Attributes.BonusStr;
			mod.Attributes.CastRecovery=tomod.Attributes.CastRecovery;
			mod.Attributes.CastSpeed=tomod.Attributes.CastSpeed;
			mod.Attributes.DefendChance=tomod.Attributes.DefendChance;
			mod.Attributes.EnhancePotions=tomod.Attributes.EnhancePotions;
			mod.Attributes.LowerAmmoCost=tomod.Attributes.LowerAmmoCost;
			mod.Attributes.LowerManaCost=tomod.Attributes.LowerManaCost;
			mod.Attributes.LowerRegCost=tomod.Attributes.LowerRegCost;
			mod.Attributes.NightSight=tomod.Attributes.NightSight;
			mod.Attributes.ReflectPhysical=tomod.Attributes.ReflectPhysical;
			mod.Attributes.RegenHits=tomod.Attributes.RegenHits;
			mod.Attributes.RegenMana=tomod.Attributes.RegenMana;
			mod.Attributes.RegenStam=tomod.Attributes.RegenStam;
			mod.Attributes.SpellChanneling=tomod.Attributes.SpellChanneling;
			mod.Attributes.SpellDamage=tomod.Attributes.SpellDamage;
			mod.Attributes.WeaponDamage=tomod.Attributes.WeaponDamage;
			mod.Attributes.DamageModifier=tomod.Attributes.DamageModifier;			
			mod.Attributes.WeaponSpeed=tomod.Attributes.WeaponSpeed;
			
			//skill bonuses
			mod.SkillBonuses.Skill_1_Name=tomod.SkillBonuses.Skill_1_Name;
			mod.SkillBonuses.Skill_2_Name=tomod.SkillBonuses.Skill_2_Name;
			mod.SkillBonuses.Skill_3_Name=tomod.SkillBonuses.Skill_3_Name;
			mod.SkillBonuses.Skill_4_Name=tomod.SkillBonuses.Skill_4_Name;
			mod.SkillBonuses.Skill_5_Name=tomod.SkillBonuses.Skill_5_Name;
			mod.SkillBonuses.Skill_1_Value=tomod.SkillBonuses.Skill_1_Value;
			mod.SkillBonuses.Skill_2_Value=tomod.SkillBonuses.Skill_2_Value;
			mod.SkillBonuses.Skill_3_Value=tomod.SkillBonuses.Skill_3_Value;
			mod.SkillBonuses.Skill_4_Value=tomod.SkillBonuses.Skill_4_Value;
			mod.SkillBonuses.Skill_5_Value=tomod.SkillBonuses.Skill_5_Value;
			
			

			
			//misc
			mod.DexRequirement=tomod.DexRequirement;
			mod.IntRequirement=tomod.IntRequirement;
			mod.StrRequirement=tomod.StrRequirement;
			mod.MaxHitPoints=tomod.MaxHitPoints;
			mod.Animation=tomod.Animation;
			mod.HitSound=tomod.HitSound;
			mod.MissSound=tomod.MissSound;
			mod.MaxDamage=tomod.MaxDamage;
			mod.MinDamage=tomod.MinDamage;
			mod.Poison=tomod.Poison;
			mod.PoisonCharges=tomod.PoisonCharges;
			mod.Skill=tomod.Skill;
			mod.Slayer=tomod.Slayer;
			mod.Slayer2=tomod.Slayer2;
			mod.Type=tomod.Type;
			}					
			
			
			//JEWLERY
			
			if(src is BaseJewel && dest is BaseJewel)
			{
			BaseJewel mod = dest as BaseJewel;
			BaseJewel tomod = src as BaseJewel;
			
			//AOS attributes
			mod.Attributes.AttackChance=tomod.Attributes.AttackChance;
			mod.Attributes.BonusDex=tomod.Attributes.BonusDex;
			mod.Attributes.BonusHits=tomod.Attributes.BonusHits;
			mod.Attributes.BonusInt=tomod.Attributes.BonusInt;
			mod.Attributes.BonusMana=tomod.Attributes.BonusMana;
			mod.Attributes.BonusStam=tomod.Attributes.BonusStam;
			mod.Attributes.BonusStr=tomod.Attributes.BonusStr;
			mod.Attributes.CastRecovery=tomod.Attributes.CastRecovery;
			mod.Attributes.CastSpeed=tomod.Attributes.CastSpeed;
			mod.Attributes.DefendChance=tomod.Attributes.DefendChance;
			mod.Attributes.EnhancePotions=tomod.Attributes.EnhancePotions;
			mod.Attributes.LowerAmmoCost=tomod.Attributes.LowerAmmoCost;
			mod.Attributes.LowerManaCost=tomod.Attributes.LowerManaCost;
			mod.Attributes.LowerRegCost=tomod.Attributes.LowerRegCost;
			mod.Attributes.NightSight=tomod.Attributes.NightSight;
			mod.Attributes.ReflectPhysical=tomod.Attributes.ReflectPhysical;
			mod.Attributes.RegenHits=tomod.Attributes.RegenHits;
			mod.Attributes.RegenMana=tomod.Attributes.RegenMana;
			mod.Attributes.RegenStam=tomod.Attributes.RegenStam;
			mod.Attributes.SpellChanneling=tomod.Attributes.SpellChanneling;
			mod.Attributes.SpellDamage=tomod.Attributes.SpellDamage;
			mod.Attributes.WeaponDamage=tomod.Attributes.WeaponDamage;
			mod.Attributes.DamageModifier=tomod.Attributes.DamageModifier;			
			mod.Attributes.WeaponSpeed=tomod.Attributes.WeaponSpeed;
			
			//skill bonuses
			mod.SkillBonuses.Skill_1_Name=tomod.SkillBonuses.Skill_1_Name;
			mod.SkillBonuses.Skill_2_Name=tomod.SkillBonuses.Skill_2_Name;
			mod.SkillBonuses.Skill_3_Name=tomod.SkillBonuses.Skill_3_Name;
			mod.SkillBonuses.Skill_4_Name=tomod.SkillBonuses.Skill_4_Name;
			mod.SkillBonuses.Skill_5_Name=tomod.SkillBonuses.Skill_5_Name;
			mod.SkillBonuses.Skill_1_Value=tomod.SkillBonuses.Skill_1_Value;
			mod.SkillBonuses.Skill_2_Value=tomod.SkillBonuses.Skill_2_Value;
			mod.SkillBonuses.Skill_3_Value=tomod.SkillBonuses.Skill_3_Value;
			mod.SkillBonuses.Skill_4_Value=tomod.SkillBonuses.Skill_4_Value;
			mod.SkillBonuses.Skill_5_Value=tomod.SkillBonuses.Skill_5_Value;

			//resists
			mod.Resistances.Cold=tomod.Resistances.Cold;
			mod.Resistances.Energy=tomod.Resistances.Energy;
			mod.Resistances.Fire=tomod.Resistances.Fire;
			mod.Resistances.Physical=tomod.Resistances.Physical;
			mod.Resistances.Poison=tomod.Resistances.Poison;	
			}	


			//QUIVER
			
			if(src is Quiver && dest is Quiver)
			{
			Quiver mod = dest as Quiver;
			Quiver tomod = src as Quiver;
			
			//Elemental Damages
			mod.AosElementDamages.Chaos=tomod.AosElementDamages.Chaos;
			mod.AosElementDamages.Direct=tomod.AosElementDamages.Direct;			
			mod.AosElementDamages.Cold=tomod.AosElementDamages.Cold;
			mod.AosElementDamages.Energy=tomod.AosElementDamages.Energy;
			mod.AosElementDamages.Fire=tomod.AosElementDamages.Fire;
			mod.AosElementDamages.Physical=tomod.AosElementDamages.Physical;
			mod.AosElementDamages.Poison=tomod.AosElementDamages.Poison;	
			
			
			mod.MaxArrows=tomod.MaxArrows;
			mod.MaxBolts=tomod.MaxBolts;
			mod.WeightReduction=tomod.WeightReduction;
			}
			
			
			//TALISMAN
			
			if(src is BaseTalisman && dest is BaseTalisman)
			{
			BaseTalisman mod = dest as BaseTalisman;
			BaseTalisman tomod = src as BaseTalisman;
			
			//AOS attributes
			mod.Attributes.AttackChance=tomod.Attributes.AttackChance;
			mod.Attributes.BonusDex=tomod.Attributes.BonusDex;
			mod.Attributes.BonusHits=tomod.Attributes.BonusHits;
			mod.Attributes.BonusInt=tomod.Attributes.BonusInt;
			mod.Attributes.BonusMana=tomod.Attributes.BonusMana;
			mod.Attributes.BonusStam=tomod.Attributes.BonusStam;
			mod.Attributes.BonusStr=tomod.Attributes.BonusStr;
			mod.Attributes.CastRecovery=tomod.Attributes.CastRecovery;
			mod.Attributes.CastSpeed=tomod.Attributes.CastSpeed;
			mod.Attributes.DefendChance=tomod.Attributes.DefendChance;
			mod.Attributes.EnhancePotions=tomod.Attributes.EnhancePotions;
			mod.Attributes.LowerAmmoCost=tomod.Attributes.LowerAmmoCost;
			mod.Attributes.LowerManaCost=tomod.Attributes.LowerManaCost;
			mod.Attributes.LowerRegCost=tomod.Attributes.LowerRegCost;
			mod.Attributes.NightSight=tomod.Attributes.NightSight;
			mod.Attributes.ReflectPhysical=tomod.Attributes.ReflectPhysical;
			mod.Attributes.RegenHits=tomod.Attributes.RegenHits;
			mod.Attributes.RegenMana=tomod.Attributes.RegenMana;
			mod.Attributes.RegenStam=tomod.Attributes.RegenStam;
			mod.Attributes.SpellChanneling=tomod.Attributes.SpellChanneling;
			mod.Attributes.SpellDamage=tomod.Attributes.SpellDamage;
			mod.Attributes.WeaponDamage=tomod.Attributes.WeaponDamage;
			mod.Attributes.DamageModifier=tomod.Attributes.DamageModifier;			
			mod.Attributes.WeaponSpeed=tomod.Attributes.WeaponSpeed;
			
			//skill bonuses
			mod.SkillBonuses.Skill_1_Name=tomod.SkillBonuses.Skill_1_Name;
			mod.SkillBonuses.Skill_2_Name=tomod.SkillBonuses.Skill_2_Name;
			mod.SkillBonuses.Skill_3_Name=tomod.SkillBonuses.Skill_3_Name;
			mod.SkillBonuses.Skill_4_Name=tomod.SkillBonuses.Skill_4_Name;
			mod.SkillBonuses.Skill_5_Name=tomod.SkillBonuses.Skill_5_Name;
			mod.SkillBonuses.Skill_1_Value=tomod.SkillBonuses.Skill_1_Value;
			mod.SkillBonuses.Skill_2_Value=tomod.SkillBonuses.Skill_2_Value;
			mod.SkillBonuses.Skill_3_Value=tomod.SkillBonuses.Skill_3_Value;
			mod.SkillBonuses.Skill_4_Value=tomod.SkillBonuses.Skill_4_Value;
			mod.SkillBonuses.Skill_5_Value=tomod.SkillBonuses.Skill_5_Value;

		/*	//resists
			mod.Resistances.Cold=tomod.Resistances.Cold;
			mod.Resistances.Energy=tomod.Resistances.Energy;
			mod.Resistances.Fire=tomod.Resistances.Fire;
			mod.Resistances.Physical=tomod.Resistances.Physical;
			mod.Resistances.Poison=tomod.Resistances.Poison;	*/
			
			mod.KarmaLoss=tomod.KarmaLoss;
			mod.Slayer=tomod.Slayer;
			mod.Slayer2=tomod.Slayer2;
			
			mod.Removal=tomod.Removal;
			mod.Protection=tomod.Protection;
			mod.Killer=tomod.Killer;
			mod.MaxChargeTime=tomod.MaxChargeTime;
			mod.MaxCharges=tomod.MaxCharges;
			mod.Blessed=tomod.Blessed;					
			}			


			//SPELLBOOK
			
			if(src is Spellbook && dest is Spellbook)
			{
			Spellbook mod = dest as Spellbook;
			Spellbook tomod = src as Spellbook;
			
			//AOS attributes
			mod.Attributes.AttackChance=tomod.Attributes.AttackChance;
			mod.Attributes.BonusDex=tomod.Attributes.BonusDex;
			mod.Attributes.BonusHits=tomod.Attributes.BonusHits;
			mod.Attributes.BonusInt=tomod.Attributes.BonusInt;
			mod.Attributes.BonusMana=tomod.Attributes.BonusMana;
			mod.Attributes.BonusStam=tomod.Attributes.BonusStam;
			mod.Attributes.BonusStr=tomod.Attributes.BonusStr;
			mod.Attributes.CastRecovery=tomod.Attributes.CastRecovery;
			mod.Attributes.CastSpeed=tomod.Attributes.CastSpeed;
			mod.Attributes.DefendChance=tomod.Attributes.DefendChance;
			mod.Attributes.EnhancePotions=tomod.Attributes.EnhancePotions;
			mod.Attributes.LowerAmmoCost=tomod.Attributes.LowerAmmoCost;
			mod.Attributes.LowerManaCost=tomod.Attributes.LowerManaCost;
			mod.Attributes.LowerRegCost=tomod.Attributes.LowerRegCost;
			mod.Attributes.NightSight=tomod.Attributes.NightSight;
			mod.Attributes.ReflectPhysical=tomod.Attributes.ReflectPhysical;
			mod.Attributes.RegenHits=tomod.Attributes.RegenHits;
			mod.Attributes.RegenMana=tomod.Attributes.RegenMana;
			mod.Attributes.RegenStam=tomod.Attributes.RegenStam;
			mod.Attributes.SpellChanneling=tomod.Attributes.SpellChanneling;
			mod.Attributes.SpellDamage=tomod.Attributes.SpellDamage;
			mod.Attributes.WeaponDamage=tomod.Attributes.WeaponDamage;
			mod.Attributes.DamageModifier=tomod.Attributes.DamageModifier;
			mod.Attributes.WeaponSpeed=tomod.Attributes.WeaponSpeed;
			
			//skill bonuses
			mod.SkillBonuses.Skill_1_Name=tomod.SkillBonuses.Skill_1_Name;
			mod.SkillBonuses.Skill_2_Name=tomod.SkillBonuses.Skill_2_Name;
			mod.SkillBonuses.Skill_3_Name=tomod.SkillBonuses.Skill_3_Name;
			mod.SkillBonuses.Skill_4_Name=tomod.SkillBonuses.Skill_4_Name;
			mod.SkillBonuses.Skill_5_Name=tomod.SkillBonuses.Skill_5_Name;
			mod.SkillBonuses.Skill_1_Value=tomod.SkillBonuses.Skill_1_Value;
			mod.SkillBonuses.Skill_2_Value=tomod.SkillBonuses.Skill_2_Value;
			mod.SkillBonuses.Skill_3_Value=tomod.SkillBonuses.Skill_3_Value;
			mod.SkillBonuses.Skill_4_Value=tomod.SkillBonuses.Skill_4_Value;
			mod.SkillBonuses.Skill_5_Value=tomod.SkillBonuses.Skill_5_Value;
			
			mod.Slayer=tomod.Slayer;
			mod.Slayer2=tomod.Slayer2;
			}		
		
		}
		
		
		
		

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