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] Lucid's <<_Advanced Archery_>>

sabray1;678125 said:
The Advanced Archery system works well so far. :D Great Job on the scripts. :D The only part that doen't work for me is trying to apply a new stringer to the bow, (crashes shard). :( And when you click on the bow then click on any of the gears, it says "that is not a gear" :( Are the stringers and gears work in progress, or do I have something that is not happy?

Are you up to date?
 
sabray1;678202 said:
I downloaded the advanced archery system yesterday off of the first page. I belive it is Version [3.0.1] (d).

The gears don't work at this point in time. I haven't scripted them into the system yet. And if your shard is crashing you will have to post your crash in debug mode.
 

sabray1

Wanderer
Lucid Nagual;678213 said:
The gears don't work at this point in time. I haven't scripted them into the system yet. And if your shard is crashing you will have to post your crash in debug mode.

Thanks for the info on the gears.

Here is the debug crash report.

Server Crash Report
===================

RunUO Version 2.0, Build 2511.22471
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 4/27/2007 4:52:38 PM
Mobiles: 33743
Items: 829414
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.LucidNagual.MoreBaseRanged.ApplyString(Mobile from, BaseRanged rang, BaseRangedModule module) in d:\UO Server 2\TESTBEAD\SOT2Server\Scripts\Custom\Lucid's Systems\Advanced Archery\MoreBaseRanged.cs:line 482
at Server.Targeting.StringerTarget.CheckSkill(Mobile from, BaseRanged rang, BaseRangedModule module) in d:\UO Server 2\TESTBEAD\SOT2Server\Scripts\Custom\Lucid's Systems\Advanced Archery\Targeting\StringerTarget.cs:line 159
at Server.Targeting.StringerTarget.OnTarget(Mobile from, Object targeted) in d:\UO Server 2\TESTBEAD\SOT2Server\Scripts\Custom\Lucid's Systems\Advanced Archery\Targeting\StringerTarget.cs:line 109
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)



I think I have it figured out on the stringers. If the stringer is in the backpack it works fine. But if the stringer is on the ground it crashes the shard. Not always on the first string being attached to the bow but it does crash it if you try to attach it to the same bow twice in a row.

I think it just need a check to make sure the stringer is in the backpack.
 
sabray1;678233 said:
Thanks for the info on the gears.

Here is the debug crash report.

Server Crash Report
===================

RunUO Version 2.0, Build 2511.22471
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 4/27/2007 4:52:38 PM
Mobiles: 33743
Items: 829414
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.LucidNagual.MoreBaseRanged.ApplyString(Mobile from, BaseRanged rang, BaseRangedModule module) in d:\UO Server 2\TESTBEAD\SOT2Server\Scripts\Custom\Lucid's Systems\Advanced Archery\MoreBaseRanged.cs:line 482
at Server.Targeting.StringerTarget.CheckSkill(Mobile from, BaseRanged rang, BaseRangedModule module) in d:\UO Server 2\TESTBEAD\SOT2Server\Scripts\Custom\Lucid's Systems\Advanced Archery\Targeting\StringerTarget.cs:line 159
at Server.Targeting.StringerTarget.OnTarget(Mobile from, Object targeted) in d:\UO Server 2\TESTBEAD\SOT2Server\Scripts\Custom\Lucid's Systems\Advanced Archery\Targeting\StringerTarget.cs:line 109
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)



I think I have it figured out on the stringers. If the stringer is in the backpack it works fine. But if the stringer is on the ground it crashes the shard. Not always on the first string being attached to the bow but it does crash it if you try to attach it to the same bow twice in a row.

I think it just need a check to make sure the stringer is in the backpack.

Yeah. It looks like I haven't updated it yet. I have redone some of this.
 

Karmageddon

Sorceror
Lucid I have been working with sabray on this crash problem and I found the problem was with the AddString routine. This crash was only happening when the stringer was targeted outside the players backpack. This was due to this line of code:
Code:
Item item = from.Backpack.FindItemByType( typeof( BaseStringer ) );
In the AddString routine in your MoreBaseRanged.cs.

There was no check put into the OnTarget in the StringerTarget.cs to make sure the stringer targeted was in the players backpack to begin with. This StringerTarget.cs I am posting has this check scripted into it.
 

Attachments

  • StringerTarget.cs
    6.4 KB · Views: 46
Fletcher Scissors

I just installed the system and everything is working great no errors.. Only question I have is that when I call up the fletcher scissors they say barber scissors. I have also installed the Barber Program. Which I am sure that is why they are saying barber scissors. I have looked in the cs file and compared the 2 scripts which both are using the same item id number.. Is there any way to fix this can I use just the normal scissors to do the same thing? Havent tried it yet. Was just wondering. Ok just checked and they dont work on cutting hair. But might get confusing.
 

Rosey1

Wanderer
OK i'm having issues and I don't know what I'm doing:

Code:
 + Items/Weapons/Ranged/BaseRanged.cs:
    CS0246: Line 69: The type or namespace name 'ArrowType' could not be found (
are you missing a using directive or an assembly reference?)
    CS0246: Line 72: The type or namespace name 'BoltType' could not be found (a
re you missing a using directive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

my baseranged is

Code:
/*
    _________________________________
 -=(_)_______________________________)=-
   /   .   .   . ____  . ___      _/
  /~ /    /   / /     / /   )2006 /
 (~ (____(___/ (____ / /___/     (
  \ ----------------------------- \
   \    [email protected]    \
    \_     ===================      \
     \   -Owner of "The Conjuring"-  \
      \_     ===================     ~\
       )      Lucid's Mega Pack        )
      /~    The Mother Load v1.1     _/
    _/_______________________________/
 -=(_)_______________________________)=-

 */
using System;
using Server.Items;
using Server.Network;
using Server.Spells;
using Server.Mobiles;
using Server.Targeting;
using System.Collections;
using Server.Enums;
using Server.ACC.CM;
using Server.LucidNagual;


namespace Server.Items
{
	public abstract class BaseRanged : BaseMeleeWeapon
	{
		//--<<Advanced Archery Edit>>---------------------[Start 1/4]
		//SkillModule edit.
		private BaseRangedModule m_BaseRangedModule;
		
		[CommandProperty( AccessLevel.GameMaster )]
		public BaseRangedModule BaseRangedModule
		{
			get
			{
				BaseRangedModule existingModule = ( BaseRangedModule )CentralMemory.GetModule( this.Serial, typeof( BaseRangedModule ) );
				
				if ( existingModule == null )
				{
					BaseRangedModule module = new BaseRangedModule( this.Serial );
					CentralMemory.AppendModule( this.Serial, module, true );
					
					return ( m_BaseRangedModule = module as BaseRangedModule );
				}
				else
				{
					if ( m_BaseRangedModule != null )
						return m_BaseRangedModule;
					
					return ( m_BaseRangedModule = existingModule as BaseRangedModule );
				}
			}
		}
		//SkillModule edit.
		
		public static int PlayerFreezeTimer = 2; 
		public static int NPCFreezeTimer = 2; 		
		
		private bool m_IsLevelable;
		
		[CommandProperty( AccessLevel.GameMaster )]
		public ArrowType ArrowSelection	{ get { return m_BaseRangedModule.ArrowSelection; } set { m_BaseRangedModule.ArrowSelection = value; } }
		
		[CommandProperty( AccessLevel.GameMaster )]
		public BoltType BoltSelection { get { return m_BaseRangedModule.BoltSelection; } set { m_BaseRangedModule.BoltSelection = value; } }
		
		[CommandProperty( AccessLevel.GameMaster )]
		public StringStrength StringStrengthSelection { get { return m_BaseRangedModule.StringStrengthSelection; } set { m_BaseRangedModule.StringStrengthSelection = value; } }
		
		[CommandProperty( AccessLevel.GameMaster )]
		public PoundsPerPull PullWeightSelection { get { return m_BaseRangedModule.PullWeightSelection; } set { m_BaseRangedModule.PullWeightSelection = value; } }
		
		[CommandProperty( AccessLevel.GameMaster )]
		public bool HasBowString { get{ return m_BaseRangedModule.HasBowString; } set{ m_BaseRangedModule.HasBowString = value; } }		
		
		[CommandProperty( AccessLevel.GameMaster )]
		public bool IsLevelable { get{ return m_IsLevelable; } set{ m_IsLevelable = value; } }		
				
		
		private static Mobile m_Mobile;
		private static BaseRanged BRanged;
		
		public static TimeSpan StringWarningDelay = TimeSpan.FromSeconds( 10.0 );
		public static DateTime m_NextStringWarning;
		public static TimeSpan AmmoWarningDelay = TimeSpan.FromSeconds( 10.0 );
		public static DateTime m_NextAmmoWarning;
		//--<<Advanced Archery Edit>>---------------------[End 1/4]
		
		public abstract int EffectID{ get; }
		public abstract Type AmmoType{ get; }
		public abstract Item Ammo{ get; }
		
		public override int DefHitSound{ get{ return 0x234; } }
		public override int DefMissSound{ get{ return 0x238; } }
		
		public override SkillName DefSkill{ get{ return SkillName.Archery; } }
		public override WeaponType DefType{ get{ return WeaponType.Ranged; } }
		public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.ShootXBow; } }
		
		public override SkillName AccuracySkill{ get{ return SkillName.Archery; } }
		
		public BaseRanged( int itemID ) : base( itemID )
		{
		}
		
		public BaseRanged( Serial serial ) : base( serial )
		{
			BRanged = this;
		}
		
		public static void Initialize()
		{
			Mobile from = m_Mobile;
			//Mobile m = (Mobile)parent;
			//BaseWeapon weapon = m.Weapon as BaseWeapon;
		}
		
		public override TimeSpan OnSwing( Mobile attacker, Mobile defender )
		{
			WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );
			
			// Make sure we've been standing still for .25/.5/1 second depending on Era
			if ( DateTime.Now > ( attacker.LastMoveTime + TimeSpan.FromSeconds( Core.SE ? 0.25 : (Core.AOS ? 0.5 : 1.0) )) || (Core.AOS && WeaponAbility.GetCurrentAbility( attacker ) is MovingShot) )
			{
				bool canSwing = true;
				
				if ( Core.AOS )
				{
					canSwing = ( !attacker.Paralyzed && !attacker.Frozen );
					
					if ( canSwing )
					{
						Spell sp = attacker.Spell as Spell;
						
						canSwing = ( sp == null || !sp.IsCasting || !sp.BlocksMovement );
					}
				}
				
				if ( canSwing && attacker.HarmfulCheck( defender ) )
				{
					attacker.DisruptiveAction();
					attacker.Send( new Swing( 0, attacker, defender ) );
					
					if ( OnFired( attacker, defender ) )
					{
						if ( CheckHit( attacker, defender ) )
							OnHit( attacker, defender );
						else
							OnMiss( attacker, defender );
					}
				}
				
				attacker.RevealingAction();
				
				return GetDelay( attacker );
			}
			else
			{
				attacker.RevealingAction();
				
				return TimeSpan.FromSeconds( 0.25 );
			}
		}
		
		public override void OnHit( Mobile attacker, Mobile defender )
		{
			//--<<Advanced Archery Edit>>---------------------[Start 2/4]
			if ( attacker == null || defender == null )
				return;
			
			MoreBaseRanged.CustomAmmoCheck( attacker, defender, AmmoType );
			
			if ( Ammo == null )
				attacker.SendMessage( "You are out of arrows, or may have to choose a different type of arrow by double clicking the bow." );
			//--<<Advanced Archery Edit>>---------------------[End 2/4]
			
			if ( attacker.Player && !defender.Player && ( defender.Body.IsAnimal || defender.Body.IsMonster ) && 0.4 >= Utility.RandomDouble() )
				defender.AddToBackpack( Ammo );
			
			base.OnHit( attacker, defender );
		}
		
		public override void OnMiss( Mobile attacker, Mobile defender )
		{
			if ( attacker.Player && 0.4 >= Utility.RandomDouble() )
				Ammo.MoveToWorld( new Point3D( defender.X + Utility.RandomMinMax( -1, 1 ), defender.Y + Utility.RandomMinMax( -1, 1 ), defender.Z ), defender.Map );
			
			base.OnMiss( attacker, defender );
		}
		
		public virtual bool OnFired( Mobile attacker, Mobile defender )
		{
			//--<<Advanced Archery Edit>>---------------------[Start 3/4]
			PlayerMobile a_pm = attacker as PlayerMobile;
			Container pack = attacker.Backpack;
			BaseQuiver quiver = attacker.FindItemOnLayer( Layer.MiddleTorso ) as BaseQuiver;
			BaseRangedModule module = this.BaseRangedModule;

			if ( !module.HasBowString )
			{
				if ( DateTime.Now >= m_NextStringWarning )
				{
					m_NextStringWarning = DateTime.Now + StringWarningDelay;
					attacker.SendMessage( "You need a string to use this bow. See a local fletcher to apply the string." );
					return false;
				}
				else
					return false;
			}
			
			if ( Ammo == null )
			{
				if ( DateTime.Now >= m_NextAmmoWarning )
				{
					m_NextAmmoWarning = DateTime.Now + AmmoWarningDelay;
					attacker.SendMessage( "You are out of ammo." );
					return false;
				}
				else
					return false;
			}
			
			if( attacker.Player && quiver != null && quiver.LowerAmmoCost > Utility.Random( 100 ) )
			{
				attacker.MovingEffect( defender, EffectID, 18, 1, false, false );
				return true;
			}
			
			if( attacker.Player &&
			   ( quiver == null || !quiver.ConsumeTotal( AmmoType, 1 ) ) &&
			   (   pack == null ||   !pack.ConsumeTotal( AmmoType, 1 ) ) )
				return false;
			
			attacker.MovingEffect( defender, EffectID, 18, 1, false, false );
			return true;
			//--<<Advanced Archery Edit>>---------------------[End 3/4]
		}
		
		//--<<Advanced Archery Edit>>---------------------[Start 4/4]
		public override void OnDoubleClick( Mobile from )
		{
			BaseRangedModule module = this.BaseRangedModule;
			
			if ( IsChildOf( from.Backpack ) || Parent == from )
			{
				if ( module.HasBowString )
				{
					if ( this is Bow || this is CompositeBow || this is ElvenCompositeLongbow ||
					    this is MagicalShortbow || this is Yumi )
					{
						from.SendMessage( "Please choose which type of arrows you wish to use." );
						from.Target = new BowTarget( this );
					}
					
					if ( this is Crossbow || this is HeavyCrossbow || this is RepeatingCrossbow )
					{
						from.SendMessage( "Please choose which type of bolts you wish to use." );
						from.Target = new CrossbowTarget( this );
					}
				}
				else
				{
					from.SendMessage( "You must string your bow. Please select a bow stringer." );
					from.Target = new StringerTarget( this );
				}
			}
			
			else
				return;
		}
		
		/*public override void OnDelete()
		{
			BaseRangedModule module = this.BaseRangedModule;
			
			if ( module != null )
				module.Delete();
			
			base.OnDelete();
		}*/
		
		public override bool OnEquip( Mobile from )
		{
			m_Mobile = from;
			
			return true;
		}
		
		public override bool CanEquip( Mobile from )
		{
			BaseRangedModule module = this.BaseRangedModule;

			if ( from != null && !module.HasBowString )
			{
				from.SendMessage( "You cannot use that without a string." );
				return false;
			}
			
			base.CanEquip( from );
			
			return true;
		}
		
		public virtual Item AmmoArrowSelected()
		{
			BaseRangedModule module = this.BaseRangedModule;
			
			switch ( module.m_ArrowType )
			{
				case ArrowType.Normal:
					return new Arrow();
				case ArrowType.Poison:
					return new PoisonArrow();
				case ArrowType.Explosive:
					return new ExplosiveArrow();
				case ArrowType.ArmorPiercing:
					return new ArmorPiercingArrow();
				case ArrowType.Freeze:
					return new FreezeArrow();
				case ArrowType.Lightning:
					return new LightningArrow();
					
				default:
					return new Arrow();
			}
		}
		
		public virtual Type GetArrowSelected()
		{
			BaseRangedModule module = this.BaseRangedModule;
			
			switch ( module.m_ArrowType )
			{
				case ArrowType.Normal:
					return typeof( Arrow );
				case ArrowType.Poison:
					return typeof( PoisonArrow );
				case ArrowType.Explosive:
					return typeof( ExplosiveArrow );
				case ArrowType.ArmorPiercing:
					return typeof( ArmorPiercingArrow );
				case ArrowType.Freeze:
					return typeof( FreezeArrow );
				case ArrowType.Lightning:
					return typeof( LightningArrow );
					
				default:
					return typeof( Arrow );
			}
		}
		
		public virtual Item AmmoBoltSelected()
		{
			BaseRangedModule module = this.BaseRangedModule;
			
			switch ( module.m_BoltType )
			{
				case BoltType.Normal:
					return new Bolt();
				case BoltType.Poison:
					return new PoisonBolt();
				case BoltType.Explosive:
					return new ExplosiveBolt();
				case BoltType.ArmorPiercing:
					return new ArmorPiercingBolt();
				case BoltType.Freeze:
					return new FreezeBolt();
				case BoltType.Lightning:
					return new LightningBolt();
					
				default:
					return new Bolt();
			}
		}
		
		public virtual Type GetBoltSelected()
		{
			BaseRangedModule module = this.BaseRangedModule;
			
			switch ( module.m_BoltType )
			{
				case BoltType.Normal:
					return typeof( Bolt );
				case BoltType.Poison:
					return typeof( PoisonBolt );
				case BoltType.Explosive:
					return typeof( ExplosiveBolt );
				case BoltType.ArmorPiercing:
					return typeof( ArmorPiercingBolt );
				case BoltType.Freeze:
					return typeof( FreezeBolt );
				case BoltType.Lightning:
					return typeof( LightningBolt );
					
				default:
					return typeof( Bolt );
			}
		}
		
		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties(list);
			
			BaseRangedModule module = this.BaseRangedModule;
			
			if ( module != null )
			{
				ArrayList strings = new ArrayList();
				
				strings.Add( ( "---------------" ) );
				
				if ( this is Bow || this is CompositeBow || this is ElvenCompositeLongbow ||
				    this is MagicalShortbow || this is Yumi )
				{
					strings.Add( ( "Quiver Using: " + module.m_ArrowType ) );
				}
				
				if ( this is Crossbow || this is HeavyCrossbow || this is RepeatingCrossbow )
				{
					strings.Add( ( "Quiver Using: " + module.m_BoltType ) );
				}
				
				strings.Add( ( "lbs per Pull: " + module.m_PullWeight ) );
				strings.Add( ( "String Str: "  + module.m_Strength ) );
				
				string toAdd = "";
				int amount = strings.Count;
				int current = 1;
				
				foreach ( string str in strings )
				{
					toAdd += str;
					
					if ( current != amount )
						toAdd += "\n";
					
					++current;
				}
				
				if ( toAdd != "" )
					list.Add( 1070722, toAdd );
			}
			else
			{
				return;
			}
		}
		//--<<Advanced Archery Edit>>---------------------[End 4/4]
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 2 ); // version
		}
		
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
			switch ( version )
			{
				case 2:
				case 1:
					{
						break;
					}
				case 0:
					{
						/*m_EffectID =*/ reader.ReadInt();
						break;
					}
			}
			
			if ( version < 2 )
			{
				WeaponAttributes.MageWeapon = 0;
				WeaponAttributes.UseBestSkill = 0;
			}
		}
	}
}
 

MoreBeer

Sorceror
Hey there tryin this out- but i got some errors.. any ideas?


Code:
RunUO - [www.runuo.com] Version 2.0, Build 2667.14548
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Misc/AOS.cs:
    CS1518: Line 271: Expected class, delegate, enum, interface, or struct
    CS1003: Line 271: Syntax error, ']' expected
    CS1518: Line 277: Expected class, delegate, enum, interface, or struct
    CS1518: Line 283: Expected class, delegate, enum, interface, or struct
    CS1518: Line 283: Expected class, delegate, enum, interface, or struct
    CS0116: Line 283: A namespace does not directly contain members such as fiel
ds or methods
    CS1518: Line 283: Expected class, delegate, enum, interface, or struct
    CS1022: Line 283: Type or namespace definition, or end-of-file expected
    CS0101: Line 282: The namespace 'Server' already contains a definition for '
?'
    CS0101: Line 283: The namespace 'Server' already contains a definition for '
?'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 
MoreBeer;689750 said:
Hey there tryin this out- but i got some errors.. any ideas?


Code:
RunUO - [www.runuo.com] Version 2.0, Build 2667.14548
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Misc/AOS.cs:
    CS1518: Line 271: Expected class, delegate, enum, interface, or struct
    CS1003: Line 271: Syntax error, ']' expected
    CS1518: Line 277: Expected class, delegate, enum, interface, or struct
    CS1518: Line 283: Expected class, delegate, enum, interface, or struct
    CS1518: Line 283: Expected class, delegate, enum, interface, or struct
    CS0116: Line 283: A namespace does not directly contain members such as fiel
ds or methods
    CS1518: Line 283: Expected class, delegate, enum, interface, or struct
    CS1022: Line 283: Type or namespace definition, or end-of-file expected
    CS0101: Line 282: The namespace 'Server' already contains a definition for '
?'
    CS0101: Line 283: The namespace 'Server' already contains a definition for '
?'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

Please post your AOS.cs in code tags. THX
 

rmacham

Sorceror
I am receiving errors which i will post in a minute, i did the aos and playermobile edits.

Here is my AOS Script:

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;

namespace Server
{
	public class AOS
	{
		public static void DisableStatInfluences()
		{
			for( int i = 0; i < SkillInfo.Table.Length; ++i )
			{
				SkillInfo info = SkillInfo.Table[i];

				info.StrScale = 0.0;
				info.DexScale = 0.0;
				info.IntScale = 0.0;
				info.StatTotal = 0.0;
			}
		}

		public static int Damage( Mobile m, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy )
		{
			return Damage( m, null, damage, ignoreArmor, phys, fire, cold, pois, nrgy );
		}

		public static int Damage( Mobile m, int damage, int phys, int fire, int cold, int pois, int nrgy )
		{
			return Damage( m, null, damage, phys, fire, cold, pois, nrgy );
		}

		public static int Damage( Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy )
		{
			return Damage( m, from, damage, false, phys, fire, cold, pois, nrgy, false );
		}

		public static int Damage( Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy )
		{
			return Damage( m, from, damage, ignoreArmor, phys, fire, cold, pois, nrgy, false );
		}

		public static int Damage( Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, bool keepAlive )
		{
			return Damage( m, from, damage, false, phys, fire, cold, pois, nrgy, keepAlive );
		}

		public static int Damage( Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy, bool keepAlive )
		{
			if( m == null || m.Deleted || !m.Alive || damage <= 0 )
				return 0;

			if( phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0 )
				Mobiles.MeerMage.StopEffect( m, true );

			if( !Core.AOS )
			{
				m.Damage( damage, from );
				return damage;
			}

			Fix( ref phys );
			Fix( ref fire );
			Fix( ref cold );
			Fix( ref pois );
			Fix( ref nrgy );

			int totalDamage;

			if( !ignoreArmor )
			{
				// Armor Ignore on OSI ignores all defenses, not just physical.
				int resPhys = m.PhysicalResistance;
				int resFire = m.FireResistance;
				int resCold = m.ColdResistance;
				int resPois = m.PoisonResistance;
				int resNrgy = m.EnergyResistance;

				totalDamage  = damage * phys * (100 - resPhys);
				totalDamage += damage * fire * (100 - resFire);
				totalDamage += damage * cold * (100 - resCold);
				totalDamage += damage * pois * (100 - resPois);
				totalDamage += damage * nrgy * (100 - resNrgy);

				totalDamage /= 10000;

				if( totalDamage < 1 )
					totalDamage = 1;
			}
			else if( Core.ML && m is PlayerMobile && from is PlayerMobile )
			{
				totalDamage = Math.Min( damage, 35 );	//Direct Damage cap of 35
			}
			else
			{
				totalDamage = damage;
			}

			#region Dragon Barding
			if( (!Core.AOS || from == null || !from.Player) && m.Player && m.Mount is SwampDragon )
			{
				SwampDragon pet = m.Mount as SwampDragon;

				if( pet != null && pet.HasBarding )
				{
					int percent = (pet.BardingExceptional ? 20 : 10);
					int absorbed = Scale( totalDamage, percent );

					totalDamage -= absorbed;
					pet.BardingHP -= absorbed;

					if( pet.BardingHP < 0 )
					{
						pet.HasBarding = false;
						pet.BardingHP = 0;

						m.SendLocalizedMessage( 1053031 ); // Your dragon's barding has been destroyed!
					}
				}
			}
			#endregion

			if( keepAlive && totalDamage > m.Hits )
				totalDamage = m.Hits;

			if( from != null && !from.Deleted && from.Alive )
			{
				int reflectPhys = AosAttributes.GetValue( m, AosAttribute.ReflectPhysical );

				if( reflectPhys != 0 )
				{
					if( from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive )
					{
						from.FixedParticles( 0x376A, 20, 10, 0x2530, EffectLayer.Waist );
						from.PlaySound( 0x2F4 );
						m.SendAsciiMessage( "Your weapon cannot penetrate the creature's magical barrier" );
					}
					else
					{
						from.Damage( Scale( (damage * phys * (100 - (ignoreArmor ? 0 : m.PhysicalResistance))) / 10000, reflectPhys ), m );
					}
				}
			}

			m.Damage( totalDamage, from );
			return totalDamage;
		}

		public static void Fix( ref int val )
		{
			if( val < 0 )
				val = 0;
		}

		public static int Scale( int input, int percent )
		{
			return (input * percent) / 100;
		}
	}

	[Flags]
	public enum AosAttribute
	{
		RegenHits=0x00000001,
		RegenStam=0x00000002,
		RegenMana=0x00000004,
		DefendChance=0x00000008,
		AttackChance=0x00000010,
		BonusStr=0x00000020,
		BonusDex=0x00000040,
		BonusInt=0x00000080,
		BonusHits=0x00000100,
		BonusStam=0x00000200,
		BonusMana=0x00000400,
		WeaponDamage=0x00000800,
		WeaponSpeed=0x00001000,
		SpellDamage=0x00002000,
		CastRecovery=0x00004000,
		CastSpeed=0x00008000,
		LowerManaCost=0x00010000,
		LowerRegCost=0x00020000,
		ReflectPhysical=0x00040000,
		EnhancePotions=0x00080000,
		Luck=0x00100000,
		SpellChanneling=0x00200000,
		NightSight=0x00400000
	}

	public sealed class AosAttributes : BaseAttributes
	{
		public AosAttributes( Item owner )
			: base( owner )
		{
		}

		public AosAttributes( Item owner, GenericReader reader )
			: base( owner, reader )
		{
		}

		public static int GetValue( Mobile m, AosAttribute attribute )
		{
			if( !Core.AOS )
				return 0;

			List<Item> items = m.Items;
			int value = 0;

			for( int i = 0; i < items.Count; ++i )
			{
				Item obj = items[i];

				if( obj is BaseWeapon )
				{
					AosAttributes attrs = ((BaseWeapon)obj).Attributes;

					if( attrs != null )
						value += attrs[attribute];

					if( attribute == AosAttribute.Luck )
						value += ((BaseWeapon)obj).GetLuckBonus();
				}
				else if( obj is BaseArmor )
				{
					AosAttributes attrs = ((BaseArmor)obj).Attributes;

					if( attrs != null )
						value += attrs[attribute];

					if( attribute == AosAttribute.Luck )
						value += ((BaseArmor)obj).GetLuckBonus();
				}
				else if( obj is BaseJewel )
				{
					AosAttributes attrs = ((BaseJewel)obj).Attributes;

					if( attrs != null )
						value += attrs[attribute];
				}
				else if( obj is BaseClothing )
				{
					AosAttributes attrs = ((BaseClothing)obj).Attributes;

					if( attrs != null )
						value += attrs[attribute];
				}
				else if( obj is Spellbook )
				{
					AosAttributes attrs = ((Spellbook)obj).Attributes;

					if( attrs != null )
						value += attrs[attribute];
					
				else if ( obj is BaseQuiver ) { AosAttributes attrs = ((BaseQuiver)obj).Attributes;
 
                  if( attrs !=       null ) value += attrs[attribute];
				}
			}

			return value;
		}

		public int this[AosAttribute attribute]
		{
			get { return GetValue( (int)attribute ); }
			set { SetValue( (int)attribute, value ); }
		}

		public override string ToString()
		{
			return "...";
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int RegenHits { get { return this[AosAttribute.RegenHits]; } set { this[AosAttribute.RegenHits] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int RegenStam { get { return this[AosAttribute.RegenStam]; } set { this[AosAttribute.RegenStam] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int RegenMana { get { return this[AosAttribute.RegenMana]; } set { this[AosAttribute.RegenMana] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int DefendChance { get { return this[AosAttribute.DefendChance]; } set { this[AosAttribute.DefendChance] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int AttackChance { get { return this[AosAttribute.AttackChance]; } set { this[AosAttribute.AttackChance] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int BonusStr { get { return this[AosAttribute.BonusStr]; } set { this[AosAttribute.BonusStr] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int BonusDex { get { return this[AosAttribute.BonusDex]; } set { this[AosAttribute.BonusDex] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int BonusInt { get { return this[AosAttribute.BonusInt]; } set { this[AosAttribute.BonusInt] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int BonusHits { get { return this[AosAttribute.BonusHits]; } set { this[AosAttribute.BonusHits] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int BonusStam { get { return this[AosAttribute.BonusStam]; } set { this[AosAttribute.BonusStam] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int BonusMana { get { return this[AosAttribute.BonusMana]; } set { this[AosAttribute.BonusMana] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int WeaponDamage { get { return this[AosAttribute.WeaponDamage]; } set { this[AosAttribute.WeaponDamage] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int WeaponSpeed { get { return this[AosAttribute.WeaponSpeed]; } set { this[AosAttribute.WeaponSpeed] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int SpellDamage { get { return this[AosAttribute.SpellDamage]; } set { this[AosAttribute.SpellDamage] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int CastRecovery { get { return this[AosAttribute.CastRecovery]; } set { this[AosAttribute.CastRecovery] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int CastSpeed { get { return this[AosAttribute.CastSpeed]; } set { this[AosAttribute.CastSpeed] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int LowerManaCost { get { return this[AosAttribute.LowerManaCost]; } set { this[AosAttribute.LowerManaCost] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int LowerRegCost { get { return this[AosAttribute.LowerRegCost]; } set { this[AosAttribute.LowerRegCost] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int ReflectPhysical { get { return this[AosAttribute.ReflectPhysical]; } set { this[AosAttribute.ReflectPhysical] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int EnhancePotions { get { return this[AosAttribute.EnhancePotions]; } set { this[AosAttribute.EnhancePotions] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int Luck { get { return this[AosAttribute.Luck]; } set { this[AosAttribute.Luck] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int SpellChanneling { get { return this[AosAttribute.SpellChanneling]; } set { this[AosAttribute.SpellChanneling] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int NightSight { get { return this[AosAttribute.NightSight]; } set { this[AosAttribute.NightSight] = value; } }
	}

	[Flags]
	public enum AosWeaponAttribute
	{
		LowerStatReq=0x00000001,
		SelfRepair=0x00000002,
		HitLeechHits=0x00000004,
		HitLeechStam=0x00000008,
		HitLeechMana=0x00000010,
		HitLowerAttack=0x00000020,
		HitLowerDefend=0x00000040,
		HitMagicArrow=0x00000080,
		HitHarm=0x00000100,
		HitFireball=0x00000200,
		HitLightning=0x00000400,
		HitDispel=0x00000800,
		HitColdArea=0x00001000,
		HitFireArea=0x00002000,
		HitPoisonArea=0x00004000,
		HitEnergyArea=0x00008000,
		HitPhysicalArea=0x00010000,
		ResistPhysicalBonus=0x00020000,
		ResistFireBonus=0x00040000,
		ResistColdBonus=0x00080000,
		ResistPoisonBonus=0x00100000,
		ResistEnergyBonus=0x00200000,
		UseBestSkill=0x00400000,
		MageWeapon=0x00800000,
		DurabilityBonus=0x01000000
	}

	public sealed class AosWeaponAttributes : BaseAttributes
	{
		public AosWeaponAttributes( Item owner )
			: base( owner )
		{
		}

		public AosWeaponAttributes( Item owner, GenericReader reader )
			: base( owner, reader )
		{
		}

		public static int GetValue( Mobile m, AosWeaponAttribute attribute )
		{
			if( !Core.AOS )
				return 0;

			List<Item> items = m.Items;
			int value = 0;

			for( int i = 0; i < items.Count; ++i )
			{
				Item obj = items[i];

				if( obj is BaseWeapon )
				{
					AosWeaponAttributes attrs = ((BaseWeapon)obj).WeaponAttributes;

					if( attrs != null )
						value += attrs[attribute];
				}
			}

			return value;
		}

		public int this[AosWeaponAttribute attribute]
		{
			get { return GetValue( (int)attribute ); }
			set { SetValue( (int)attribute, value ); }
		}

		public override string ToString()
		{
			return "...";
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int LowerStatReq { get { return this[AosWeaponAttribute.LowerStatReq]; } set { this[AosWeaponAttribute.LowerStatReq] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int SelfRepair { get { return this[AosWeaponAttribute.SelfRepair]; } set { this[AosWeaponAttribute.SelfRepair] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitLeechHits { get { return this[AosWeaponAttribute.HitLeechHits]; } set { this[AosWeaponAttribute.HitLeechHits] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitLeechStam { get { return this[AosWeaponAttribute.HitLeechStam]; } set { this[AosWeaponAttribute.HitLeechStam] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitLeechMana { get { return this[AosWeaponAttribute.HitLeechMana]; } set { this[AosWeaponAttribute.HitLeechMana] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitLowerAttack { get { return this[AosWeaponAttribute.HitLowerAttack]; } set { this[AosWeaponAttribute.HitLowerAttack] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitLowerDefend { get { return this[AosWeaponAttribute.HitLowerDefend]; } set { this[AosWeaponAttribute.HitLowerDefend] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitMagicArrow { get { return this[AosWeaponAttribute.HitMagicArrow]; } set { this[AosWeaponAttribute.HitMagicArrow] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitHarm { get { return this[AosWeaponAttribute.HitHarm]; } set { this[AosWeaponAttribute.HitHarm] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitFireball { get { return this[AosWeaponAttribute.HitFireball]; } set { this[AosWeaponAttribute.HitFireball] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitLightning { get { return this[AosWeaponAttribute.HitLightning]; } set { this[AosWeaponAttribute.HitLightning] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitDispel { get { return this[AosWeaponAttribute.HitDispel]; } set { this[AosWeaponAttribute.HitDispel] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitColdArea { get { return this[AosWeaponAttribute.HitColdArea]; } set { this[AosWeaponAttribute.HitColdArea] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitFireArea { get { return this[AosWeaponAttribute.HitFireArea]; } set { this[AosWeaponAttribute.HitFireArea] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitPoisonArea { get { return this[AosWeaponAttribute.HitPoisonArea]; } set { this[AosWeaponAttribute.HitPoisonArea] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitEnergyArea { get { return this[AosWeaponAttribute.HitEnergyArea]; } set { this[AosWeaponAttribute.HitEnergyArea] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int HitPhysicalArea { get { return this[AosWeaponAttribute.HitPhysicalArea]; } set { this[AosWeaponAttribute.HitPhysicalArea] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int ResistPhysicalBonus { get { return this[AosWeaponAttribute.ResistPhysicalBonus]; } set { this[AosWeaponAttribute.ResistPhysicalBonus] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int ResistFireBonus { get { return this[AosWeaponAttribute.ResistFireBonus]; } set { this[AosWeaponAttribute.ResistFireBonus] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int ResistColdBonus { get { return this[AosWeaponAttribute.ResistColdBonus]; } set { this[AosWeaponAttribute.ResistColdBonus] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int ResistPoisonBonus { get { return this[AosWeaponAttribute.ResistPoisonBonus]; } set { this[AosWeaponAttribute.ResistPoisonBonus] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int ResistEnergyBonus { get { return this[AosWeaponAttribute.ResistEnergyBonus]; } set { this[AosWeaponAttribute.ResistEnergyBonus] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int UseBestSkill { get { return this[AosWeaponAttribute.UseBestSkill]; } set { this[AosWeaponAttribute.UseBestSkill] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int MageWeapon { get { return this[AosWeaponAttribute.MageWeapon]; } set { this[AosWeaponAttribute.MageWeapon] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int DurabilityBonus { get { return this[AosWeaponAttribute.DurabilityBonus]; } set { this[AosWeaponAttribute.DurabilityBonus] = value; } }
	}

	[Flags]
	public enum AosArmorAttribute
	{
		LowerStatReq=0x00000001,
		SelfRepair=0x00000002,
		MageArmor=0x00000004,
		DurabilityBonus=0x00000008
	}

	public sealed class AosArmorAttributes : BaseAttributes
	{
		public AosArmorAttributes( Item owner )
			: base( owner )
		{
		}

		public AosArmorAttributes( Item owner, GenericReader reader )
			: base( owner, reader )
		{
		}

		public static int GetValue( Mobile m, AosArmorAttribute attribute )
		{
			if( !Core.AOS )
				return 0;

			List<Item> items = m.Items;
			int value = 0;

			for( int i = 0; i < items.Count; ++i )
			{
				Item obj = items[i];

				if( obj is BaseArmor )
				{
					AosArmorAttributes attrs = ((BaseArmor)obj).ArmorAttributes;

					if( attrs != null )
						value += attrs[attribute];
				}
				else if( obj is BaseClothing )
				{
					AosArmorAttributes attrs = ((BaseClothing)obj).ClothingAttributes;

					if( attrs != null )
						value += attrs[attribute];
				}
			}

			return value;
		}

		public int this[AosArmorAttribute attribute]
		{
			get { return GetValue( (int)attribute ); }
			set { SetValue( (int)attribute, value ); }
		}

		public override string ToString()
		{
			return "...";
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int LowerStatReq { get { return this[AosArmorAttribute.LowerStatReq]; } set { this[AosArmorAttribute.LowerStatReq] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int SelfRepair { get { return this[AosArmorAttribute.SelfRepair]; } set { this[AosArmorAttribute.SelfRepair] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int MageArmor { get { return this[AosArmorAttribute.MageArmor]; } set { this[AosArmorAttribute.MageArmor] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int DurabilityBonus { get { return this[AosArmorAttribute.DurabilityBonus]; } set { this[AosArmorAttribute.DurabilityBonus] = value; } }
	}

	public sealed class AosSkillBonuses : BaseAttributes
	{
		private ArrayList m_Mods;

		public AosSkillBonuses( Item owner )
			: base( owner )
		{
		}

		public AosSkillBonuses( Item owner, GenericReader reader )
			: base( owner, reader )
		{
		}

		public void GetProperties( ObjectPropertyList list )
		{
			for( int i = 0; i < 5; ++i )
			{
				SkillName skill;
				double bonus;

				if( !GetValues( i, out skill, out bonus ) )
					continue;

				list.Add( 1060451 + i, "#{0}\t{1}", 1044060 + (int)skill, bonus );
			}
		}

		public void AddTo( Mobile m )
		{
			Remove();

			for( int i = 0; i < 5; ++i )
			{
				SkillName skill;
				double bonus;

				if( !GetValues( i, out skill, out bonus ) )
					continue;

				if( m_Mods == null )
					m_Mods = new ArrayList();

				SkillMod sk = new DefaultSkillMod( skill, true, bonus );
				sk.ObeyCap = true;
				m.AddSkillMod( sk );
				m_Mods.Add( sk );
			}
		}

		public void Remove()
		{
			if( m_Mods == null )
				return;

			for( int i = 0; i < m_Mods.Count; ++i )
				((SkillMod)m_Mods[i]).Remove();

			m_Mods = null;
		}

		public bool GetValues( int index, out SkillName skill, out double bonus )
		{
			int v = GetValue( 1 << index );
			int vSkill = 0;
			int vBonus = 0;

			for( int i = 0; i < 16; ++i )
			{
				vSkill <<= 1;
				vSkill |= (v & 1);
				v >>= 1;

				vBonus <<= 1;
				vBonus |= (v & 1);
				v >>= 1;
			}

			skill = (SkillName)vSkill;
			bonus = (double)vBonus / 10;

			return (bonus != 0);
		}

		public void SetValues( int index, SkillName skill, double bonus )
		{
			int v = 0;
			int vSkill = (int)skill;
			int vBonus = (int)(bonus * 10);

			for( int i = 0; i < 16; ++i )
			{
				v <<= 1;
				v |= (vBonus & 1);
				vBonus >>= 1;

				v <<= 1;
				v |= (vSkill & 1);
				vSkill >>= 1;
			}

			SetValue( 1 << index, v );
		}

		public SkillName GetSkill( int index )
		{
			SkillName skill;
			double bonus;

			GetValues( index, out skill, out bonus );

			return skill;
		}

		public void SetSkill( int index, SkillName skill )
		{
			SetValues( index, skill, GetBonus( index ) );
		}

		public double GetBonus( int index )
		{
			SkillName skill;
			double bonus;

			GetValues( index, out skill, out bonus );

			return bonus;
		}

		public void SetBonus( int index, double bonus )
		{
			SetValues( index, GetSkill( index ), bonus );
		}

		public override string ToString()
		{
			return "...";
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public double Skill_1_Value { get { return GetBonus( 0 ); } set { SetBonus( 0, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public SkillName Skill_1_Name { get { return GetSkill( 0 ); } set { SetSkill( 0, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public double Skill_2_Value { get { return GetBonus( 1 ); } set { SetBonus( 1, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public SkillName Skill_2_Name { get { return GetSkill( 1 ); } set { SetSkill( 1, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public double Skill_3_Value { get { return GetBonus( 2 ); } set { SetBonus( 2, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public SkillName Skill_3_Name { get { return GetSkill( 2 ); } set { SetSkill( 2, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public double Skill_4_Value { get { return GetBonus( 3 ); } set { SetBonus( 3, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public SkillName Skill_4_Name { get { return GetSkill( 3 ); } set { SetSkill( 3, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public double Skill_5_Value { get { return GetBonus( 4 ); } set { SetBonus( 4, value ); } }

		[CommandProperty( AccessLevel.GameMaster )]
		public SkillName Skill_5_Name { get { return GetSkill( 4 ); } set { SetSkill( 4, value ); } }
	}

	[Flags]
	public enum AosElementAttribute
	{
		Physical=0x00000001,
		Fire=0x00000002,
		Cold=0x00000004,
		Poison=0x00000008,
		Energy=0x00000010
	}

	public sealed class AosElementAttributes : BaseAttributes
	{
		public AosElementAttributes( Item owner )
			: base( owner )
		{
		}

		public AosElementAttributes( Item owner, GenericReader reader )
			: base( owner, reader )
		{
		}

		public int this[AosElementAttribute attribute]
		{
			get { return GetValue( (int)attribute ); }
			set { SetValue( (int)attribute, value ); }
		}

		public override string ToString()
		{
			return "...";
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int Physical { get { return this[AosElementAttribute.Physical]; } set { this[AosElementAttribute.Physical] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int Fire { get { return this[AosElementAttribute.Fire]; } set { this[AosElementAttribute.Fire] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int Cold { get { return this[AosElementAttribute.Cold]; } set { this[AosElementAttribute.Cold] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int Poison { get { return this[AosElementAttribute.Poison]; } set { this[AosElementAttribute.Poison] = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public int Energy { get { return this[AosElementAttribute.Energy]; } set { this[AosElementAttribute.Energy] = value; } }
	}

	[PropertyObject]
	public abstract class BaseAttributes
	{
		private Item m_Owner;
		private uint m_Names;
		private int[] m_Values;

		private static int[] m_Empty = new int[0];

		public bool IsEmpty { get { return (m_Names == 0); } }
		public Item Owner { get { return m_Owner; } }

		public BaseAttributes( Item owner )
		{
			m_Owner = owner;
			m_Values = m_Empty;
		}

		public BaseAttributes( Item owner, GenericReader reader )
		{
			m_Owner = owner;

			int version = reader.ReadByte();

			switch( version )
			{
				case 1:
				{
					m_Names = reader.ReadUInt();
					m_Values = new int[reader.ReadEncodedInt()];

					for( int i = 0; i < m_Values.Length; ++i )
						m_Values[i] = reader.ReadEncodedInt();

					break;
				}
				case 0:
				{
					m_Names = reader.ReadUInt();
					m_Values = new int[reader.ReadInt()];

					for( int i = 0; i < m_Values.Length; ++i )
						m_Values[i] = reader.ReadInt();

					break;
				}
			}
		}

		public void Serialize( GenericWriter writer )
		{
			writer.Write( (byte)1 ); // version;

			writer.Write( (uint)m_Names );
			writer.WriteEncodedInt( (int)m_Values.Length );

			for( int i = 0; i < m_Values.Length; ++i )
				writer.WriteEncodedInt( (int)m_Values[i] );
		}

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

			uint mask = (uint)bitmask;

			if( (m_Names & mask) == 0 )
				return 0;

			int index = GetIndex( mask );

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

			return 0;
		}

		public void SetValue( int bitmask, int value )
		{
			if( (bitmask == (int)AosWeaponAttribute.DurabilityBonus) && (this is AosWeaponAttributes) )
			{
				if( m_Owner is BaseWeapon )
					((BaseWeapon)m_Owner).UnscaleDurability();
			}
			else if( (bitmask == (int)AosArmorAttribute.DurabilityBonus) && (this is AosArmorAttributes) )
			{
				if( m_Owner is BaseArmor )
					((BaseArmor)m_Owner).UnscaleDurability();
			}

			uint mask = (uint)bitmask;

			if( value != 0 )
			{
				if( (m_Names & mask) != 0 )
				{
					int index = GetIndex( mask );

					if( index >= 0 && index < m_Values.Length )
						m_Values[index] = value;
				}
				else
				{
					int index = GetIndex( mask );

					if( index >= 0 && index <= m_Values.Length )
					{
						int[] old = m_Values;
						m_Values = new int[old.Length + 1];

						for( int i = 0; i < index; ++i )
							m_Values[i] = old[i];

						m_Values[index] = value;

						for( int i = index; i < old.Length; ++i )
							m_Values[i + 1] = old[i];

						m_Names |= mask;
					}
				}
			}
			else if( (m_Names & mask) != 0 )
			{
				int index = GetIndex( mask );

				if( index >= 0 && index < m_Values.Length )
				{
					m_Names &= ~mask;

					if( m_Values.Length == 1 )
					{
						m_Values = m_Empty;
					}
					else
					{
						int[] old = m_Values;
						m_Values = new int[old.Length - 1];

						for( int i = 0; i < index; ++i )
							m_Values[i] = old[i];

						for( int i = index + 1; i < old.Length; ++i )
							m_Values[i - 1] = old[i];
					}
				}
			}

			if( (bitmask == (int)AosWeaponAttribute.DurabilityBonus) && (this is AosWeaponAttributes) )
			{
				if( m_Owner is BaseWeapon )
					((BaseWeapon)m_Owner).ScaleDurability();
			}
			else if( (bitmask == (int)AosArmorAttribute.DurabilityBonus) && (this is AosArmorAttributes) )
			{
				if( m_Owner is BaseArmor )
					((BaseArmor)m_Owner).ScaleDurability();
			}

			if( m_Owner.Parent is Mobile )
			{
				Mobile m = (Mobile)m_Owner.Parent;

				m.CheckStatTimers();
				m.UpdateResistances();
				m.Delta( MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana );

				if( this is AosSkillBonuses )
				{
					((AosSkillBonuses)this).Remove();
					((AosSkillBonuses)this).AddTo( m );
				}
			}

			m_Owner.InvalidateProperties();
		}

		private int GetIndex( uint mask )
		{
			int index = 0;
			uint ourNames = m_Names;
			uint currentBit = 1;

			while( currentBit != mask )
			{
				if( (ourNames & currentBit) != 0 )
					++index;

				if( currentBit == 0x80000000 )
					return -1;

				currentBit <<= 1;
			}

			return index;
		}
	}
}


Here are my errors:
Code:
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (9 errors, 0 warnings)
Errors:
 + Items/Weapons/ML Weapons/ElvenCompositeLongbow.cs:
    CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'ElvenCompositeLongbow'
 + Items/Weapons/ML Weapons/MagicalShortbow.cs:
    CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'MagicalShortbow'
 + Items/Weapons/Ranged/BaseRanged.cs:
    CS0101: Line 9: The namespace 'Server.Items' already contains a definition f
or 'BaseRanged'
 + Items/Weapons/Ranged/Bow.cs:
    CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'Bow'
 + Items/Weapons/Ranged/CompositeBow.cs:
    CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'CompositeBow'
 + Items/Weapons/Ranged/Crossbow.cs:
    CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'Crossbow'
 + Items/Weapons/Ranged/HeavyCrossbow.cs:
    CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'HeavyCrossbow'
 + Items/Weapons/Ranged/RepeatingCrossbow.cs:
    CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'RepeatingCrossbow'
 + Items/Weapons/SE Weapons/Yumi.cs:
    CS0101: Line 8: The namespace 'Server.Items' already contains a definition f
or 'Yumi'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
Errors:
 + Custom/Systems/Advanced Archery/Scripts/Customs/Lucid's Systems/Modules/BaseR
angedModule.cs:
    CS0246: Line 35: The type or namespace name 'Module' could not be found (are
 you missing a using directive or an assembly reference?)
    CS0246: Line 119: The type or namespace name 'Module' could not be found (ar
e you missing a using directive or an assembly reference?)
 + Custom/Systems/Advanced Archery/Scripts/Customs/Lucid's Systems/Modules/Playe
rModule.cs:
    CS0246: Line 50: The type or namespace name 'Module' could not be found (are
 you missing a using directive or an assembly reference?)
    CS0246: Line 700: The type or namespace name 'Module' could not be found (ar
e you missing a using directive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Misc/AOS.cs:
    CS1513: Line 264: } expected
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Misc/AOS.cs:
    CS1513: Line 264: } expected
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

Soultaker

Sorceror
I have an Error with StringerTarget.cs

I am currently stuck on an error involving StringerTarget.cs
If anybody could point me in the right direction it would be greatly appreciated. I can't quite seem to get past this one :)

I have also tried Post # 286
and used the new StringerTarget.cs file when i was trying to bypass a previous error. i think thats what fixed it ... whew was alotta crazy stuff!

Code:
[SIZE=2]RunUO - [www.runuo.com] Version 2.0, Build 2357.32527[/SIZE]
[SIZE=2]Core: Running on .NET Framework Version 2.0.50727[/SIZE]
[SIZE=2]Core: Optimizing for 2 processors[/SIZE]
[SIZE=2]Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)[/SIZE]
[SIZE=2]Errors:[/SIZE]
[SIZE=2]+ Customs/Custom-Advanced Archery v3.0.1e v2.0 - Lucid Nagual/Advanced Archery/[/SIZE]
[SIZE=2]Scripts/Customs/Lucid's Systems/Advanced Archery/Targeting/StringerTarget.cs:[/SIZE]
[SIZE=2]CS0117: Line 150: 'Server.LucidNagual.MoreBaseRanged' does not contain a def[/SIZE]
[SIZE=2]inition for 'ApplyString'[/SIZE]
[SIZE=2]CS0117: Line 155: 'Server.LucidNagual.MoreBaseRanged' does not contain a def[/SIZE]
[SIZE=2]inition for 'ApplyString'[/SIZE]
[SIZE=2]CS0117: Line 160: 'Server.LucidNagual.MoreBaseRanged' does not contain a def[/SIZE]
[SIZE=2]inition for 'ApplyString'[/SIZE]
[SIZE=2]CS0117: Line 165: 'Server.LucidNagual.MoreBaseRanged' does not contain a def[/SIZE]
[SIZE=2]inition for 'ApplyString'[/SIZE]
[SIZE=2]Scripts: One or more scripts failed to compile or no script files were found.[/SIZE]
[SIZE=2]- Press return to exit, or R to try again.[/SIZE]

Thanks Again in Advance!
Soultaker
 

Boulder

Sorceror
Error Baseranged modual

here is the error
Code:
RunUO - [www.runuo.com] Version 2.0, Build 2641.13846
Core: Running on .NET Framework Version 2.0.50727
Core: Running with arguments: -debug
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Customs/Lucid's Systems/Modules/BaseRangedModule.cs:
    CS0104: Line 50: 'BoltType' is an ambiguous reference between 'Server.Items.
BoltType' and 'Server.Enums.BoltType'
    CS0104: Line 51: 'ArrowType' is an ambiguous reference between 'Server.Items
.ArrowType' and 'Server.Enums.ArrowType'
    CS0104: Line 62: 'ArrowType' is an ambiguous reference between 'Server.Items
.ArrowType' and 'Server.Enums.ArrowType'
    CS0104: Line 65: 'BoltType' is an ambiguous reference between 'Server.Items.
BoltType' and 'Server.Enums.BoltType'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
heres the script
Code:
/*[ Lucid Nagual ]--------------------------------------------[ ...:||[ 2007 ]||:.. ]

    _________________________________
 -=(_)_______________________________)=-
   /   .   .   . ____  . ___      _/
  /~ /    /   / /     / /   )2007 /
 (~ (____(___/ (____ / /___/     (
  \ ----------------------------- \
   \    [email protected]    \
    \_     ===================      \
     \   -Owner of "The Conjuring"-  \
      \_     ===================     ~\
       )      Lucid's Mega Pack        )
      /~    The Mother Load v1.1     _/
    _/_______________________________/
 -=(_)_______________________________)=-

 */
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.Targeting;
using Server.Mobiles;
using Server.Network;
using Server.Items;
using Server.Commands;
using Server.Enums;
//using Server.Saves;


namespace Server.ACC.CM
{
	public class BaseRangedModule : Module
	{
		public static void Initialize()
		{
			CommandSystem.Register( "GetRanged", AccessLevel.GameMaster, new CommandEventHandler( GetRanged ) );
			//CommandSystem.Register( "MyBOD", AccessLevel.Player, new CommandEventHandler( MyBOD_OnCommand ) );
		}
		
		public override string Name(){ return "BaseRanged Module"; }
		
		public bool m_HasBowString = false;
		
		public Serial m_Serial;
		public BaseRanged m_Ranged;
		
		public BoltType m_BoltType;
		public ArrowType m_ArrowType;
		public StringStrength m_Strength;
		public PoundsPerPull m_PullWeight;
		
		public Serial WeaponSerial { get { return m_Serial; } }
		public BaseRanged RangedWeapon { get { return m_Ranged; } }
		
		[CommandProperty( AccessLevel.GameMaster )]
		public bool HasBowString { get{ return m_HasBowString; } set{ m_HasBowString = value; } }
		
		[CommandProperty(AccessLevel.GameMaster)]
		public ArrowType ArrowSelection	{ get { return m_ArrowType; } set { m_ArrowType = value; } }
		
		[CommandProperty(AccessLevel.GameMaster)]
		public BoltType BoltSelection { get { return m_BoltType; } set { m_BoltType = value; } }
		
		[CommandProperty(AccessLevel.GameMaster)]
		public StringStrength StringStrengthSelection { get { return m_Strength; } set { m_Strength = value; } }
		
		[CommandProperty(AccessLevel.GameMaster)]
		public PoundsPerPull PullWeightSelection { get { return m_PullWeight; } set { m_PullWeight = value; } }
		
		public BaseRangedModule( Serial serial  ) : base( serial )
		{
			HasBowString = true;
			StringStrengthSelection = StringStrength.VeryWeak;
			PullWeightSelection = PoundsPerPull.Fourty;
		}
		
		private static void GetRanged( CommandEventArgs e )
		{
			BaseRangedModule module = ( BaseRangedModule )CentralMemory.GetModule( e.Mobile.Serial, typeof( BaseRangedModule ) );
			
			if ( module != null || module.m_Ranged != null )
				e.Mobile.Target = new InternalTarget( module, module.m_Ranged );
			
			else
				e.Mobile.SendMessage( "The module or module ranged info does not exist." );
		}
		
		/*		private static void MyBOD_OnCommand( CommandEventArgs e )
		{
			BaseRangedModule bod_mod = ( BaseRangedModule )CentralMemory.GetModule( e.Mobile.Serial, typeof( BaseRangedModule ) );
			
			if( bod_mod == null )
			{
				CentralMemory.AppendModule( e.Mobile.Serial, new BaseRangedModule( e.Mobile.Serial ), true );
				e.Mobile.SendMessage( "Please try again" );
			}
			else
			{
				//Next BOD times.
				e.Mobile.SendMessage( "Time til next smithy BOD:    {0}", bod_mod.m_NextSmithBulkOrder );
				e.Mobile.SendMessage( "Time til next tailor BOD:    {0}", bod_mod.m_NextTailorBulkOrder );
				e.Mobile.SendMessage( "Time til next carpenter BOD: {0}", bod_mod.m_NextCarpenterBulkOrder );
				e.Mobile.SendMessage( "Time til next fletcher BOD:  {0}", bod_mod.m_NextFletcherBulkOrder );
				e.Mobile.SendMessage( "Time til next taming BOD:    {0}", bod_mod.m_NextTamingBulkOrder );
				e.Mobile.SendMessage( "Time til next tinker BOD:    {0}", bod_mod.m_NextTinkerBulkOrder );
				return;
			}
		}*/
		
		/*		public void InvalidateRangedWeapons()
		{
			if( RangedWeapon != null )
				RangedWeapon.InvalidateProperties();
		}*/
		
		public override void Append( Module mod, bool negatively )
		{
		}
		
		//System.Diagnostics.Process.Start("iexplorer.exe");
		
		
		private class InternalTarget : Target
		{
			private BaseRangedModule br_mod;
			private BaseRanged m_Ranged;
			
			public InternalTarget( BaseRangedModule mod, BaseRanged ranged ) : base( 1, false, TargetFlags.None )
			{
				br_mod = mod;
				m_Ranged = ranged;
			}
			
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted is PlayerMobile )
				{
					PlayerMobile pm = ( PlayerMobile )targeted;
					BaseRangedModule module = ( BaseRangedModule )CentralMemory.GetModule( m_Ranged.Serial, typeof( BaseRangedModule ) );
					
					if ( module != null )
						from.SendGump( new PropertiesGump( from, module ) );
					else
					{
						from.SendMessage( "This player does not have a module. A new one has been created." );
						CentralMemory.AppendModule( m_Ranged.Serial, new BaseRangedModule( m_Ranged.Serial ), true );
					}
				}
				else
					from.SendMessage("Can Only Target PLAYERS!");
			}
		}
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int)1 ); // version
			
			//--<< Version 2 >>---------------------------//
			/*			writer.Write( ( int )DefaultMaxLevel );
			writer.Write( ( int )MaxLevelsCap );
			writer.Write( ( bool )EnableExpCap );
			writer.Write( ( bool )DisplayExpProp );
			writer.Write( ( int )PointsPerLevel );
			writer.Write( ( bool )DoubleArtifactCost );
			writer.Write( ( bool )BlacksmithOnly );
			writer.Write( ( double )BlacksmithSkillRequired );
			writer.Write( ( bool )RewardBlacksmith );
			writer.Write( ( int )BlacksmithRewardAmt );
			writer.Write( ( int )m_Experience );
			writer.Write( ( int )m_Level );
			writer.Write( ( int )m_Points );
			writer.Write( ( int )m_MaxLevel );*/
			//--<< Version 2 >>---------------------------//
			
			//--<< Version 1 >>---------------------------//
			writer.Write( m_Serial );
			writer.Write( m_Ranged );
			//--<< Version 1 >>---------------------------//
			
			//--<< Version 0 >>---------------------------//
			writer.Write( ( bool )m_HasBowString );
			writer.WriteEncodedInt(( int )m_Strength );
			writer.WriteEncodedInt(( int )m_PullWeight );
			writer.WriteEncodedInt(( int )m_ArrowType );
			writer.WriteEncodedInt(( int )m_BoltType );
			//--<< Version 0 >>---------------------------//
		}
		
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
			switch ( version )
			{
					/*	case 2:
					{
						DefaultMaxLevel = reader.ReadInt();
						MaxLevelsCap = reader.ReadInt();
						EnableExpCap = reader.ReadBool();
						DisplayExpProp = reader.ReadBool();
						PointsPerLevel = reader.ReadInt();
						DoubleArtifactCost = reader.ReadBool();
						BlacksmithOnly = reader.ReadBool();
						BlacksmithSkillRequired = reader.ReadDouble();
						RewardBlacksmith = reader.ReadBool();
						BlacksmithRewardAmt = reader.ReadInt();
						m_Experience = reader.ReadInt();
						m_Level = reader.ReadInt();
						m_Points = reader.ReadInt();
						m_MaxLevel = reader.ReadInt();
						goto case 1;
					}*/
				case 1:
					{
						m_Serial = reader.ReadInt();
						m_Ranged = reader.ReadItem() as BaseRanged;
						goto case 0;
					}
				case 0:
					{
						m_HasBowString = reader.ReadBool();
						m_Strength = ( StringStrength )reader.ReadEncodedInt();
						m_PullWeight = ( PoundsPerPull )reader.ReadEncodedInt();
						m_ArrowType = ( ArrowType )reader.ReadEncodedInt();
						m_BoltType = ( BoltType )reader.ReadEncodedInt();
						break;
					}
			}
		}
	}
}
please help
 
Top