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!

Weapon script

MentalSteel

Wanderer
then if i remove override it gives me this error: line 55, column 36 The name attacker does not exist in the class or namespace 'Server.Items.WolfFang'
 

V1RTU4L

Page
ok than edit it like this
Code:
    public override void OnDoubleClick(Mobile from )
		{
		 			     
            	         if ( this.wolf_created == false && from.Combatant!=null ) //Create Wolf
            	         {
            	            MakeWolf( from.Combatant );
                	        this.wolf_created = true;
              	         }
			return;
		}
 

MentalSteel

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

RunUO Version 1.0.0, Build 36918
Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.573
Time: 3/1/2005 10:54:58 PM
Mobiles: 14492
Items: 134187
Clients:
- Count: 1
+ 24.48.152.153: (account = r) (mobile = 0x930 'Lone Wolf')

Exception:
System.StackOverflowException: Exception of type System.StackOverflowException was thrown.
 

ArteGordon

Wanderer
you need to make the change that I mentioned, and you should probably derive it from something other than BaseSword, since you are missing a number of required overrides, like damage, speed, and skill. As it stands you have a sword that cant really do anything.
Try deriving it from the Kryss class instead of the BaseSword class. If you do that, remember to change your constructor to

Code:
public WolfFang() : base(  )
 

ArteGordon

Wanderer
oh, and you can go back to using the OnHit method if thats what you want it to do (spawn a wolf when it hits). All BaseArmor and BaseWeapon derived classes support OnHit.
 

MentalSteel

Wanderer
ok i redid it but now i get this: line 15 column 10 Attribute 'cammandproperty' is not valid on this declaration type. It is valid on 'property' declarations only.

this is my code so far:
Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;

namespace Server.Items
{
	public class WolfFang : Kryss
	{	
		public override int ArtifactRarity{ get{ return 100; } }
		public override int InitMinHits{ get{ return 255; } }
		public override int InitMaxHits{ get{ return 255; } }
               
	
        [CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
        private bool m_wolf_created;

	public bool wolf_created
        	{
			get{return m_wolf_created;}
			set{m_wolf_created = value;}
        	}


		[Constructable]
		public WolfFang() : base( 0x1401 )
		{
			Name = "Wolf Fang";
			ItemID = 0x1400;
			Hue = 1153;
			WeaponAttributes.HitDispel = 100;
			WeaponAttributes.HitLeechHits = 50;
			WeaponAttributes.SelfRepair = 1;
			Attributes.Luck = 16000;
			Attributes.WeaponDamage = 70;
		}
		
		#region Make Wolf
		public void MakeWolf( Mobile from )
        {
      	  WhiteWolf newwolf;
          newwolf = new WhiteWolf();
          newwolf.Map = from.Map;
          newwolf.Location = from.Location;
		  newwolf.Controled = true;
          newwolf.ControlMaster = from;
          newwolf.ControlOrder = OrderType.Attack;
		  from.BoltEffect( 0 );
	    }
		
		 #endregion
		
        public override void OnDoubleClick(Mobile from )
		{
		 			     
            	         if ( this.wolf_created == false && from.Combatant!=null ) //Create Wolf
            	         {
            	            MakeWolf( from.Combatant );
                	        this.wolf_created = true;
              	         }
			return;
		}
		
		public WolfFang( Serial serial ) : base( serial )
		{
		}

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

			writer.Write( (int) 0 );
		}
		
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
 

ArteGordon

Wanderer
change this

Code:
        [CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
        private bool m_wolf_created;

	public bool wolf_created

to this

Code:
	private bool m_wolf_created;

	[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
	public bool wolf_created
 

MentalSteel

Wanderer
ok now this line 8 cloumn 23 expected
Code:

Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;

namespace Server.Items
{
	public class WolfFang() : base(  )	
	{	
		public override int ArtifactRarity{ get{ return 100; } }
		public override int InitMinHits{ get{ return 255; } }
		public override int InitMaxHits{ get{ return 255; } }
               
        private bool m_wolf_created;
	
	[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
	public bool wolf_created
        	{
			get{return m_wolf_created;}
			set{m_wolf_created = value;}
        	}


		[Constructable]
		public WolfFang() : base( 0x1401 )
		{
			Name = "Wolf Fang";
			ItemID = 0x1400;
			Hue = 1153;
			WeaponAttributes.HitDispel = 100;
			WeaponAttributes.HitLeechHits = 50;
			WeaponAttributes.SelfRepair = 1;
			Attributes.Luck = 16000;
			Attributes.WeaponDamage = 70;
		}
		
		#region Make Wolf
		public void MakeWolf( Mobile from )
        {
      	  WhiteWolf newwolf;
          newwolf = new WhiteWolf();
          newwolf.Map = from.Map;
          newwolf.Location = from.Location;
		  newwolf.Controled = true;
          newwolf.ControlMaster = from;
          newwolf.ControlOrder = OrderType.Attack;
		  from.BoltEffect( 0 );
	    }
		
		 #endregion
		
        public override void OnDoubleClick(Mobile from )
		{
		 			     
            	         if ( this.wolf_created == false && from.Combatant!=null ) //Create Wolf
            	         {
            	            MakeWolf( from.Combatant );
                	        this.wolf_created = true;
              	         }
			return;
		}
		
		public WolfFang( Serial serial ) : base( serial )
		{
		}

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

			writer.Write( (int) 0 );
		}
		
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
 
Top