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!

Evolution Hiryu

Status
Not open for further replies.

daat99

Moderator
Staff member
Tannis said:
I added the line you told me to daat...not sure that I added it to the right place, but it didn't throw any errors. But, it didn't work either. I'm not sure I said it right before, but it's not that my hiryu is not doing any damage to other things, my hiryu is not taking any damage. I added a first stage hiryu and put it against the Dark Father, and it did not take even 1hp of damage. This is the script now and Ill put in bold where I added the new line.
Code:
    //////////////////////////////////
   //			           //
  //      Scripted by Raelis      //
 //		             	 //
//////////////////////////////////
using System;
using System.Collections; 
using Server.Mobiles;
using Server.Items;
using Server.Network; 
using Server.Targeting;
using Server.Gumps;

namespace Server.Mobiles
{
	[CorpseName( "a hiryu hatchling corpse" )]
	public class EvolutionHiryu : BaseCreature
	{
		
		public int m_Stage;
		public int m_KP;

		public bool m_S1;
		public bool m_S2;
		public bool m_S3;
		public bool m_S4;
		public bool m_S5;
		public bool m_S6;

		public bool S1
		{
			get{ return m_S1; }
			set{ m_S1 = value; }
		}
		public bool S2
		{
			get{ return m_S2; }
			set{ m_S2 = value; }
		}
		public bool S3
		{
			get{ return m_S3; }
			set{ m_S3 = value; }
		}
		public bool S4
		{
			get{ return m_S4; }
			set{ m_S4 = value; }
		}
		public bool S5
		{
			get{ return m_S5; }
			set{ m_S5 = value; }
		}
		public bool S6
		{
			get{ return m_S6; }
			set{ m_S6 = value; }
		}

		

		[CommandProperty( AccessLevel.GameMaster )]
		public int KP
		{
			get{ return m_KP; }
			set{ m_KP = value; }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int Stage
		{
			get{ return m_Stage; }
			set{ m_Stage = value; }
		}

		[Constructable]
		public EvolutionHiryu() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a hiryu hatchling";
			Body = 6;
			Hue = Utility.RandomList( 1157, 1175, 1172, 1171, 1170, 1169, 1168, 1167, 1166, 1165 );
			BaseSoundID = 0x4FD;
			Stage = 1;

			S1 = true;
			S2 = true;
			S3 = true;
			S4 = true;
			S5 = true;
			S6 = true;

			SetStr( 50, 65 );
			SetDex( 95, 105 );
			SetInt( 4, 9 );

			SetHits( 51, 69 );

			SetDamage( 11, 14 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 5 );

			SetSkill( SkillName.Tactics, 19.3, 34.0 );
			SetSkill( SkillName.Wrestling, 19.3, 34.0 );
			SetSkill( SkillName.Anatomy, 19.3, 34.0 );

			Fame = 300;
			Karma = -300;

			VirtualArmor = 0;

			ControlSlots = 4;
			

		}

		public EvolutionHiryu(Serial serial) : base(serial)
		{
		}
		
		public override void Damage( int amount, Mobile defender )
		
		{

			int kpgainmin, kpgainmax;

			if ( this.Stage == 1 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 10;
						kpgainmax = 5 + ( bc.HitsMax ) / 5;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 25000 )
				{
					if ( this.S1 == true )
					{
						this.S1 = false;
						int hits, va, mindamage, maxdamage;

						hits = ( this.HitsMax + 50 );

						va = ( this.VirtualArmor + 0 );

						mindamage = this.DamageMin + ( 10 );
						maxdamage = this.DamageMax + ( 10 );

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 5;
						this.BaseSoundID = 0x4FD;
						this.VirtualArmor = va;
						this.Stage = 2;

						this.SetDamageType( ResistanceType.Physical, 100 );

						this.SetResistance( ResistanceType.Physical, 20 );
						this.SetResistance( ResistanceType.Fire, 20 );
						this.SetResistance( ResistanceType.Cold, 20 );
						this.SetResistance( ResistanceType.Poison, 20 );
						this.SetResistance( ResistanceType.Energy, 20 );

						this.RawStr += 50;
						this.RawInt += 15;
						this.RawDex += 40;
					}
				}
			}

			else if ( this.Stage == 2 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 20;
						kpgainmax = 5 + ( bc.HitsMax ) / 10;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 75000 )
				{
					if ( this.S2 == true )
					{
						this.S2 = false;
						int hits, va, mindamage, maxdamage;

						hits = ( this.HitsMax + 20 );

						va = ( this.VirtualArmor + 0 );

						mindamage = this.DamageMin + ( 10 );
						maxdamage = this.DamageMax + ( 10 );

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 254;
						this.BaseSoundID = 0x4FD;
						this.VirtualArmor = va;
						this.Stage = 3;

						this.SetDamageType( ResistanceType.Physical, 100 );

						this.SetResistance( ResistanceType.Physical, 35 );
						this.SetResistance( ResistanceType.Fire, 35 );
						this.SetResistance( ResistanceType.Cold, 35 );
						this.SetResistance( ResistanceType.Poison, 35 );
						this.SetResistance( ResistanceType.Energy, 35 );

						this.RawStr += 20;
						this.RawInt += 20;
						this.RawDex += 30;
					}
				}
			}

			else if ( this.Stage == 3 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 30;
						kpgainmax = 5 + ( bc.HitsMax ) / 20;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 175000 )
				{
					if ( this.S3 == true )
					{
						this.S3 = false;
						int hits, va, mindamage, maxdamage;

						hits = ( this.HitsMax + 100 );

						va = ( this.VirtualArmor + 0 );

						mindamage = this.DamageMin + ( 10 );
						maxdamage = this.DamageMax + ( 10 );

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 0xF3;
						this.BaseSoundID = 0x4FD;
						this.VirtualArmor = va;
						this.Stage = 4;

						this.SetResistance( ResistanceType.Physical, 40 );
						this.SetResistance( ResistanceType.Fire, 40 );
						this.SetResistance( ResistanceType.Cold, 40 );
						this.SetResistance( ResistanceType.Poison, 40 );
						this.SetResistance( ResistanceType.Energy, 40 );

						this.RawStr += 90;
						this.RawInt += 20;
						this.RawDex += 40;
					}
				}
			}

			else if ( this.Stage == 4 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 50;
						kpgainmax = 5 + ( bc.HitsMax ) / 40;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 3750000 )
				{
					if ( this.S4 == true )
					{
						this.S4 = false;
						int hits, va, mindamage, maxdamage;

						hits = ( this.HitsMax + 200 );

						va = ( this.VirtualArmor + 30 );

						mindamage = this.DamageMin + ( 10 );
						maxdamage = this.DamageMax + ( 10 );

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 0xF3;
						this.BaseSoundID = 0x4FD;
						this.VirtualArmor = va;
						this.Stage = 5;

						this.SetDamageType( ResistanceType.Physical, 100 );
						
						SetResistance( ResistanceType.Physical, 61, 80 );
						SetResistance( ResistanceType.Fire, 61, 80 );
						SetResistance( ResistanceType.Cold, 44, 55 );
						SetResistance( ResistanceType.Poison, 60 );
						SetResistance( ResistanceType.Energy, 54, 60 );


						this.RawStr += 100;
						this.RawInt += 120;
						this.RawDex += 20;
					

						[b]base.Damage( amount, defender );[/b]

					}
				}
			}
		}


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

			writer.Write((int) 1);
                        writer.Write( m_S2 ); 
                        writer.Write( m_S3 ); 
                        writer.Write( m_S4 ); 
                        writer.Write( m_S5 ); 
                        writer.Write( m_S6 ); 
			writer.Write( (int) m_KP );
			writer.Write( (int) m_Stage );
		}

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
                        		m_S1 = reader.ReadBool(); 
                        		m_S2 = reader.ReadBool(); 
                        		m_S3 = reader.ReadBool(); 
                        		m_S4 = reader.ReadBool(); 
                        		m_S5 = reader.ReadBool(); 
                        		m_S6 = reader.ReadBool(); 
					m_KP = reader.ReadInt();
					m_Stage = reader.ReadInt();

					break;
				}
			}
		}
	}
}

I did however take out the loyalty timer without doing anything wrong hehe
Actually you put it in the wrong place so only stage 7 dragons will take damage.

You need it like this:
Code:
    //////////////////////////////////
   //			           //
  //      Scripted by Raelis      //
 //		             	 //
//////////////////////////////////
using System;
using System.Collections; 
using Server.Mobiles;
using Server.Items;
using Server.Network; 
using Server.Targeting;
using Server.Gumps;

namespace Server.Mobiles
{
	[CorpseName( "a hiryu hatchling corpse" )]
	public class EvolutionHiryu : BaseCreature
	{
		
		public int m_Stage;
		public int m_KP;

		public bool m_S1;
		public bool m_S2;
		public bool m_S3;
		public bool m_S4;
		public bool m_S5;
		public bool m_S6;

		public bool S1
		{
			get{ return m_S1; }
			set{ m_S1 = value; }
		}
		public bool S2
		{
			get{ return m_S2; }
			set{ m_S2 = value; }
		}
		public bool S3
		{
			get{ return m_S3; }
			set{ m_S3 = value; }
		}
		public bool S4
		{
			get{ return m_S4; }
			set{ m_S4 = value; }
		}
		public bool S5
		{
			get{ return m_S5; }
			set{ m_S5 = value; }
		}
		public bool S6
		{
			get{ return m_S6; }
			set{ m_S6 = value; }
		}

		

		[CommandProperty( AccessLevel.GameMaster )]
		public int KP
		{
			get{ return m_KP; }
			set{ m_KP = value; }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public int Stage
		{
			get{ return m_Stage; }
			set{ m_Stage = value; }
		}

		[Constructable]
		public EvolutionHiryu() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a hiryu hatchling";
			Body = 6;
			Hue = Utility.RandomList( 1157, 1175, 1172, 1171, 1170, 1169, 1168, 1167, 1166, 1165 );
			BaseSoundID = 0x4FD;
			Stage = 1;

			S1 = true;
			S2 = true;
			S3 = true;
			S4 = true;
			S5 = true;
			S6 = true;

			SetStr( 50, 65 );
			SetDex( 95, 105 );
			SetInt( 4, 9 );

			SetHits( 51, 69 );

			SetDamage( 11, 14 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 5 );

			SetSkill( SkillName.Tactics, 19.3, 34.0 );
			SetSkill( SkillName.Wrestling, 19.3, 34.0 );
			SetSkill( SkillName.Anatomy, 19.3, 34.0 );

			Fame = 300;
			Karma = -300;

			VirtualArmor = 0;

			ControlSlots = 4;
			

		}

		public EvolutionHiryu(Serial serial) : base(serial)
		{
		}
		
		public override void Damage( int amount, Mobile defender )
		
		{

			int kpgainmin, kpgainmax;

			if ( this.Stage == 1 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 10;
						kpgainmax = 5 + ( bc.HitsMax ) / 5;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 25000 )
				{
					if ( this.S1 == true )
					{
						this.S1 = false;
						int hits, va, mindamage, maxdamage;

						hits = ( this.HitsMax + 50 );

						va = ( this.VirtualArmor + 0 );

						mindamage = this.DamageMin + ( 10 );
						maxdamage = this.DamageMax + ( 10 );

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 5;
						this.BaseSoundID = 0x4FD;
						this.VirtualArmor = va;
						this.Stage = 2;

						this.SetDamageType( ResistanceType.Physical, 100 );

						this.SetResistance( ResistanceType.Physical, 20 );
						this.SetResistance( ResistanceType.Fire, 20 );
						this.SetResistance( ResistanceType.Cold, 20 );
						this.SetResistance( ResistanceType.Poison, 20 );
						this.SetResistance( ResistanceType.Energy, 20 );

						this.RawStr += 50;
						this.RawInt += 15;
						this.RawDex += 40;
					}
				}
			}

			else if ( this.Stage == 2 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 20;
						kpgainmax = 5 + ( bc.HitsMax ) / 10;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 75000 )
				{
					if ( this.S2 == true )
					{
						this.S2 = false;
						int hits, va, mindamage, maxdamage;

						hits = ( this.HitsMax + 20 );

						va = ( this.VirtualArmor + 0 );

						mindamage = this.DamageMin + ( 10 );
						maxdamage = this.DamageMax + ( 10 );

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 254;
						this.BaseSoundID = 0x4FD;
						this.VirtualArmor = va;
						this.Stage = 3;

						this.SetDamageType( ResistanceType.Physical, 100 );

						this.SetResistance( ResistanceType.Physical, 35 );
						this.SetResistance( ResistanceType.Fire, 35 );
						this.SetResistance( ResistanceType.Cold, 35 );
						this.SetResistance( ResistanceType.Poison, 35 );
						this.SetResistance( ResistanceType.Energy, 35 );

						this.RawStr += 20;
						this.RawInt += 20;
						this.RawDex += 30;
					}
				}
			}

			else if ( this.Stage == 3 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 30;
						kpgainmax = 5 + ( bc.HitsMax ) / 20;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 175000 )
				{
					if ( this.S3 == true )
					{
						this.S3 = false;
						int hits, va, mindamage, maxdamage;

						hits = ( this.HitsMax + 100 );

						va = ( this.VirtualArmor + 0 );

						mindamage = this.DamageMin + ( 10 );
						maxdamage = this.DamageMax + ( 10 );

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 0xF3;
						this.BaseSoundID = 0x4FD;
						this.VirtualArmor = va;
						this.Stage = 4;

						this.SetResistance( ResistanceType.Physical, 40 );
						this.SetResistance( ResistanceType.Fire, 40 );
						this.SetResistance( ResistanceType.Cold, 40 );
						this.SetResistance( ResistanceType.Poison, 40 );
						this.SetResistance( ResistanceType.Energy, 40 );

						this.RawStr += 90;
						this.RawInt += 20;
						this.RawDex += 40;
					}
				}
			}

			else if ( this.Stage == 4 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 50;
						kpgainmax = 5 + ( bc.HitsMax ) / 40;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 3750000 )
				{
					if ( this.S4 == true )
					{
						this.S4 = false;
						int hits, va, mindamage, maxdamage;

						hits = ( this.HitsMax + 200 );

						va = ( this.VirtualArmor + 30 );

						mindamage = this.DamageMin + ( 10 );
						maxdamage = this.DamageMax + ( 10 );

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 0xF3;
						this.BaseSoundID = 0x4FD;
						this.VirtualArmor = va;
						this.Stage = 5;

						this.SetDamageType( ResistanceType.Physical, 100 );
						
						SetResistance( ResistanceType.Physical, 61, 80 );
						SetResistance( ResistanceType.Fire, 61, 80 );
						SetResistance( ResistanceType.Cold, 44, 55 );
						SetResistance( ResistanceType.Poison, 60 );
						SetResistance( ResistanceType.Energy, 54, 60 );


						this.RawStr += 100;
						this.RawInt += 120;
						this.RawDex += 20;
					

					}
				}
			}
			[b]base.Damage( amount, defender );[/b]
		}


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

			writer.Write((int) 1);
                        writer.Write( m_S2 ); 
                        writer.Write( m_S3 ); 
                        writer.Write( m_S4 ); 
                        writer.Write( m_S5 ); 
                        writer.Write( m_S6 ); 
			writer.Write( (int) m_KP );
			writer.Write( (int) m_Stage );
		}

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
                        		m_S1 = reader.ReadBool(); 
                        		m_S2 = reader.ReadBool(); 
                        		m_S3 = reader.ReadBool(); 
                        		m_S4 = reader.ReadBool(); 
                        		m_S5 = reader.ReadBool(); 
                        		m_S6 = reader.ReadBool(); 
					m_KP = reader.ReadInt();
					m_Stage = reader.ReadInt();

					break;
				}
			}
		}
	}
}

However that's true that it'll calculate when the hiryu will take damage.
Personaly I'm using the dna dragons and not the evo dragons which handle it in the Damage section (you based yours on it as well).

If you base your script on OnGiveMeleeAttack then make sure you add duplicate on magic attacks also.

Allantois suggested that before and I explained to him what problem it'll cause.

You might not want it to evolve if it does magics tho (hiryus doesn't suppose to do magic attacks...) so it might be just the thing for you ;)
 

Tannis

Knight
Yep yep after reading a little about OnGiveMelee after I put that line in, I realized it would be ok to use cause my hiryus won't do magic :)

The one last question I had though was about making this a mount when it gets to the last stage. I tried converting all the "Creature" to "Mount" at its last evolution stage, I got no errors but it wouldn't let me mount it. Any suggestions?
 

Lysdexic

Sorceror
Be sure to edit bandage.cs:

Code:
public static SkillName GetPrimarySkill( Mobile m )
		{
			if ( !m.Player && (m.Body.IsMonster || m.Body.IsAnimal || m.Body == 0xF3) )
				return SkillName.Veterinary;
			else
				return SkillName.Healing;
		}

		public static SkillName GetSecondarySkill( Mobile m )
		{
			if ( !m.Player && (m.Body.IsMonster || m.Body.IsAnimal || m.Body == 0xF3) )
				return SkillName.AnimalLore;
			else
				return SkillName.Anatomy;
		}

and AnimalLore.cs:
Code:
if ( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea || c.Body == 0xF3 )

until the SE creatures are included in the core.

My friends shard that I script on the side for him uses that script, and I did the same thing :)
 

Tannis

Knight
Thanks Lysdexic, I got that done in a different thread with the help of Rift :) It was a pain though trying to figure out where Vet would go.
 

Lysdexic

Sorceror
I just made the evolution hiryu a totally different mobile with basemount, then, at the last level it adds the new hiryu, matches the skills/stats etc and deletes the old one. Worked much simpler IMO.
 

Tannis

Knight
I've been working on making it ridable all day and I can't get it lol. Lysdexic, how did you do what you said? I'm not sure how to go about that.
 

daat99

Moderator
Staff member
Take a look at the beetle script.
It have a section specified as the rideable section.
 

Tannis

Knight
I understand how to make a single animal a mount, and I do have a hiryu that is mountable already. I just can't get the last stage of the Evo Hiryu to be mountable. I have tried changing the last stage of the script from BaseCreature to BaseMount and didn't get any errors, but it didn't work either. I tried calling the whole script a BaseMount and not BaseCreature but got lots of errors.
 

daat99

Moderator
Staff member
Tannis said:
I understand how to make a single animal a mount, and I do have a hiryu that is mountable already. I just can't get the last stage of the Evo Hiryu to be mountable. I have tried changing the last stage of the script from BaseCreature to BaseMount and didn't get any errors, but it didn't work either. I tried calling the whole script a BaseMount and not BaseCreature but got lots of errors.
You need to make a new animal for stage 7 hiryu and not the same evo that you have for stages 1-6.
 

Tannis

Knight
I have a script for a hiryu, but how do I put it in so that it will give me the ridable and delete the other? I don't really know what you mean by adding another animal for the last stage sorry :( I'm not very good at this at all.
 

daat99

Moderator
Staff member
I saw only 4 stages but look at this:
Code:
if ( this.KP >= 3750000 )
{
if ( this.S4 == true )
{
this.S4 = false;
int hits, va, mindamage, maxdamage;

hits = ( this.HitsMax + 200 );

va = ( this.VirtualArmor + 30 );

mindamage = this.DamageMin + ( 10 );
maxdamage = this.DamageMax + ( 10 );

this.Warmode = false;
this.Say( "*"+ this.Name +" evolves*");
this.SetDamage( mindamage, maxdamage );
this.SetHits( hits );
this.BodyValue = 0xF3;
this.BaseSoundID = 0x4FD;
this.VirtualArmor = va;
this.Stage = 5;

this.SetDamageType( ResistanceType.Physical, 100 );

SetResistance( ResistanceType.Physical, 61, 80 );
SetResistance( ResistanceType.Fire, 61, 80 );
SetResistance( ResistanceType.Cold, 44, 55 );
SetResistance( ResistanceType.Poison, 60 );
SetResistance( ResistanceType.Energy, 54, 60 );


this.RawStr += 100;
this.RawInt += 120;
this.RawDex += 20;


}
This code set the hiryu to stage 5.
Instead of setting your old hyriu to stage 5 you create a new hiryu that's mountable and set the new hiryu stats to the current hiryu stats.
Then you delete the old hyriu and that's it.
Check how the hyriu is created from the egg to learn how to make a new hiryu.
 

Tannis

Knight
I tried doing it your way and whittled down the errors but there's a few I can't get rid of. I'll just post the part I messed with:
Code:
			else if ( this.Stage == 4 )
			{
				if ( defender is BaseCreature )
				{
					BaseCreature bc = (BaseCreature)defender;

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.HitsMax ) / 50;
						kpgainmax = 5 + ( bc.HitsMax ) / 40;

						this.KP += Utility.RandomList( kpgainmin, kpgainmax );
					}
				}

				if ( this.KP >= 3750000 )
				{
					if ( this.S4 == true )
					{
						
						this.Delete();
					
						Hiryu1 hiryu1 = new Hiryu1();

         					hiryu1.Map = defender.Map; 
         					hiryu1.Location = defender.Location; 

					if ( from is Mobile ) 
						{
							Mobile m = ( Mobile ) from;	
						
							hiryu.ControlMaster = from;
							hiryu.IsBonded = true;

						}
					}
				}
			}
		}

And here are the errors
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (6 errors, 11 warnings)
 - Error: Scripts\MYCUSTOMSHIT\Evo Hiryu\EvolutionHiryu.cs: CS1501: (line 308, c
olumn 23) No overload for method 'Hiryu1' takes '0' arguments
 - Error: Scripts\MYCUSTOMSHIT\Evo Hiryu\EvolutionHiryu.cs: CS0103: (line 313, c
olumn 11) The name 'from' does not exist in the class or namespace 'Server.Mobil
es.EvolutionHiryu'
 - Error: Scripts\MYCUSTOMSHIT\Evo Hiryu\EvolutionHiryu.cs: CS0103: (line 315, c
olumn 30) The name 'from' does not exist in the class or namespace 'Server.Mobil
es.EvolutionHiryu'
 - Error: Scripts\MYCUSTOMSHIT\Evo Hiryu\EvolutionHiryu.cs: CS0120: (line 317, c
olumn 8) An object reference is required for the nonstatic field, method, or pro
perty 'Server.Mobiles.BaseCreature.ControlMaster'
 - Error: Scripts\MYCUSTOMSHIT\Evo Hiryu\EvolutionHiryu.cs: CS0103: (line 317, c
olumn 30) The name 'from' does not exist in the class or namespace 'Server.Mobil
es.EvolutionHiryu'
 - Error: Scripts\MYCUSTOMSHIT\Evo Hiryu\EvolutionHiryu.cs: CS0120: (line 318, c
olumn 8) An object reference is required for the nonstatic field, method, or pro
perty 'Server.Mobiles.BaseCreature.IsBonded'
I tried calling the mobile a couple different ways and got the same errors, and Mobile isn't called anything anywhere else in the script that I could see.
 

daat99

Moderator
Staff member
try something like this:
Code:
if ( this.KP >= 3750000 )
{
if ( this.S4 == true )
{

[color=red]//this.Delete();[/color]

Hiryu1 hiryu1 = new Hiryu1();

         hiryu1.Map = defender.Map; 
         hiryu1.Location = defender.Location; 

if (this.ControlMaster != null)
hiryu.ControlMaster = this.ControlMaster;
if (this.IsBonded = true)
hiryu.IsBonded = true;

this.Delete();
}
}
}
 

Tannis

Knight
No errors after I changed the name of my "Hiryu1" script, and put in what you told me to. The only problem I'm having now is that when it evolves to stage 5 it adds the hiryu, but it is not bonded or tame. When I say "a hiryu obey" on my GM char, it comes to me and is bonded.
 

daat99

Moderator
Staff member
This 2 lines should make him transfer ownership:
Code:
if (this.ControlMaster != null)
   hiryu.ControlMaster = this.ControlMaster;
However it might be control slot problem.
You should try saving the control master of the hiryu to a variable, delete it and then create the second and set the control master to what you stored in the variable.
I don't know how to do it atm but you should try ronins fs animal taming system, I think he did it there.
 

Tannis

Knight
Yeah, I'm trying to figure out how to get it so that Mobile is called something, because I'm pretty sure the "this" refers to the hiryu all throughout the script. I tried adding an OnAdded method but it gave me so many errors that confused the heck out of me I put it back the way it was. I will go look at that script though.
 

daat99

Moderator
Staff member
Tannis said:
Yeah, I'm trying to figure out how to get it so that Mobile is called something, because I'm pretty sure the "this" refers to the hiryu all throughout the script. I tried adding an OnAdded method but it gave me so many errors that confused the heck out of me I put it back the way it was. I will go look at that script though.
"this" refers to the current item\mobile.
In your case the stages 1-5 hiryu.
Then you added this line:
Code:
Hiryu1 hiryu1 = new Hiryu1();
In this line you set a new hiryu and called it hiryu1.
So now you can use "this" to refer to the old hiryu and hiryu1 to refer to the new 1.
 

Tannis

Knight
For some reason, it didn't like my "Hiryu1", and gave me errors even after I fixed what you told me to so now I have
Code:
hiryu hiryu = new hiryu();
And that made all the errors stop, just have to fix the controller thing now.
 

Tannis

Knight
Ok, I tried something new. When I had this block of code in
Code:
if (this.ControlMaster != null)
hiryu.ControlMaster = this.ControlMaster;
if (this.IsBonded = true)
hiryu.IsBonded = true;
The old hiryu would get deleted and a new one would spawn, but it would be grey and untame. So I put this in instead
Code:
if (this.Controled = true)
hiryu.Controled = true;
if (this.IsBonded = true)
hiryu.IsBonded = true;

this.Delete();
Now when it adds the new hiryu, it is blue and bonded, just not to me. Still, it looks sort of like a step in the right direction :)
 
Status
Not open for further replies.
Top