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

ArteGordon

Wanderer
you need to derive your class from a kryss, like this

Code:
public class WolfFang : Kryss


and define your constructor as I already mentioned.
 

MentalSteel

Wanderer
ok all works but now i cant summon anything now message no nothing
Code:
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; } }
               
        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(  )
		{
			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
what do you mean you cant summon? And what message are you talking about?

The way you have it set up, when you double click on the sword and you are fighting something, it will summon a wolf that is controlled by whatever you are fighting.
 

MentalSteel

Wanderer
The like no usage or error message comes up and i dont want it to b controlled by wht im fighting. Also i mean i cant summon anything i 2x clikced on it and it doesnt spawn anything thats y im asking if u can just remake the script and post it.
 

MentalSteel

Wanderer
ok i take that back it does spawn but i want it to b controlled by the weilder. I do appreciate ll the help but for now im going to sleep later.
 

ArteGordon

Wanderer
no, look at how you are calling the MakeWolf method, and then look at how you are using the "from" argument that is passed to it within the method.

You are passing the players combat target as the argument to MakeWolf, so thats what gets assigned as the control master.

Code:
MakeWolf( from.Combatant );
 

MentalSteel

Wanderer
Alright the script works and i redid a little of it but now i want to make it so it spawns on double click all the time and not every 1 time the server restarts.

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

namespace Server.Items
{
	public class WolfFang : BaseSword	
	{	
		public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.ArmorIgnore; } }
		public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.InfectiousStrike; } }

		public override int AosStrengthReq{ get{ return 10; } }
		public override int AosMinDamage{ get{ return 10; } }
		public override int AosMaxDamage{ get{ return 12; } }
		public override int AosSpeed{ get{ return 53; } }

		public override int OldStrengthReq{ get{ return 10; } }
		public override int OldMinDamage{ get{ return 3; } }
		public override int OldMaxDamage{ get{ return 28; } }
		public override int OldSpeed{ get{ return 53; } }

		public override int DefHitSound{ get{ return 0x23C; } }
		public override int DefMissSound{ get{ return 0x238; } }

		public override int InitMinHits{ get{ return 31; } }
		public override int InitMaxHits{ get{ return 90; } }

		public override SkillName DefSkill{ get{ return SkillName.Fencing; } }
		public override WeaponType DefType{ get{ return WeaponType.Piercing; } }
		public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.Pierce1H; } }

		public override int ArtifactRarity{ get{ return 100; } }
               
        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( 0x1400 )
		{
			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 );
                	        this.wolf_created = false;
              	         }
			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