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.

Tannis

Knight
Evolution Hiryu

I took Raelis' script for the Evolution Dragon, and made an Evolution Hiryu for my shard. Everything is loading fine, no errors or anything, but the one problem I'm having is that they will not take damage from anything. They aren't uber with tons of resists and tons of Virtual Armor, but just nothing hurts them. I've tried with my GM char, I've tried with a player char and nothing seems to work. Here's the script
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
	{
		

		private Timer m_PetLoyaltyTimer;
		private DateTime m_EndPetLoyalty;


		public DateTime EndPetLoyalty{ get{ return m_EndPetLoyalty; } set{ m_EndPetLoyalty = value; } }

		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;
			

			m_PetLoyaltyTimer = new PetLoyaltyTimer( this, TimeSpan.FromSeconds( 5.0 ) );
			m_PetLoyaltyTimer.Start();
			m_EndPetLoyalty = DateTime.Now + TimeSpan.FromSeconds( 5.0 );
		}

		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;
					}
				}
			}
		}


		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();

					m_EndPetLoyalty = reader.ReadDeltaTime();
					m_PetLoyaltyTimer = new PetLoyaltyTimer( this, m_EndPetLoyalty - DateTime.Now );
					m_PetLoyaltyTimer.Start();

					break;
				}
			}
		}
	}

	
	
	public class PetLoyaltyTimer : Timer
	{ 
		private EvolutionHiryu ed;

		public PetLoyaltyTimer( EvolutionHiryu owner, TimeSpan duration ) : base( duration ) 
		{ 
			Priority = TimerPriority.OneSecond;
			ed = owner;
		}

		protected override void OnTick() 
		{
			ed.Loyalty = PetLoyalty.WonderfullyHappy;

			PetLoyaltyTimer lt = new PetLoyaltyTimer( ed, TimeSpan.FromSeconds( 5.0 ) );
			lt.Start();
			ed.EndPetLoyalty = DateTime.Now + TimeSpan.FromSeconds( 5.0 );

			Stop();
		}
	}
}
Any hints?
 

daat99

Moderator
Staff member
Are you sure the:
Code:
public override void Damage( int amount, Mobile defender )
Is when it give damage and not when it takes damage ?

Try replacing it with on gave melee attack and see if it works (not perm just to check if that's the problem or not).
 

Tannis

Knight
I honestly have no clue what you mean by that heh. I looked in other scripts to see if there was anything like it but I didn't see anything. I also tried taking that line out completely since it's not in any other script, but after the 37 errors I got, I thought that might not be such a good idea.
 

daat99

Moderator
Staff member
Tannis said:
I honestly have no clue what you mean by that heh. I looked in other scripts to see if there was anything like it but I didn't see anything. I also tried taking that line out completely since it's not in any other script, but after the 37 errors I got, I thought that might not be such a good idea.
n\m I see the dna dragon have the same line so it isn't it.
 

Tannis

Knight
Lol yeah, I didn't change any of the complicated stuff that I didn't understand, I only swtiched "dragon" to "hiryu", and made them do less damage, the easy stuff hehe.
 

daat99

Moderator
Staff member
I'm totaly guessing but try changing this:
Code:
VirtualArmor = 0;
to this:
Code:
VirtualArmor = 1;
I have no idea if it'll work but I don't see anything wrong with it :(
 

Tannis

Knight
The reason its at 0 now is cause it wasn't taking damage when I had it higher, so I dropped it to see if that would work lol. I will try it again though just in case I maybe missed something.
 

daat99

Moderator
Staff member
Tannis said:
The reason its at 0 now is cause it wasn't taking damage when I had it higher, so I dropped it to see if that would work lol. I will try it again though just in case I maybe missed something.
Like I said it looks ok to me.
BTW why you have the timer at the end ?
I strongly suggest that you remove it, it'll cause major cpu stress if you plan that your players will have them and it serves no purpose whatsoever.
 

Tannis

Knight
Thanks for saying that :) I wanted to remove everything about the timer but I wasn't sure if I could take it out or not without messing it up.
 

daat99

Moderator
Staff member
Ok I find your problem.
Add this line:
Code:
base.Damage( amount, defender );
After all the cases in the damage section.
 

daat99

Moderator
Staff member
Tannis said:
Thanks for saying that :) I wanted to remove everything about the timer but I wasn't sure if I could take it out or not without messing it up.
You'll have to remove everything that's related to the timer as well.

P.S. the timer basically set that the pet won't go wild and loose loyalty.
You can do the same thing in the deserialization section.
Just add a line that set the loyalty end cicle to now+12 hours.
 

daat99

Moderator
Staff member
Allantois said:
Hey i fixed your problem
use OnGaveMeleeAttack instead of Damage
On gave melee attack will fix the problem but it'll cause another problem.
His problem was that he forgot to call the base damage section so it didn't do any damage.
 

daat99

Moderator
Staff member
Allantois said:
what problem does ongavemeleeattack produce???
I deleted my post btw cuz i saw that u had already fixed it
OnGaveMelee attack will make it check the evolving cicle only when it give melee attack while on damage will check it every time it deal damage (magic also).

P.S.
Next time it's better to leave the post in just in case someone will do a search and run into this thread in the future and won't understand what I told him to do ;)
 

Tannis

Knight
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
 

A_Li_N

Knight
IDK about the rest of you, but I'm sittin here looking at the Evo Dragon that is running on my shard and it has this :
Code:
		public override void OnGaveMeleeAttack( Mobile defender )
		{

where your
Code:
		public override void Damage( int amount, Mobile defender )
		
		{

is.

*Wishes he had time to re-write this whole system and balance it out some*

inside EvolutionDragon.cs :
Code:
		public override void OnGaveMeleeAttack( 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 + 500 );

						va = ( this.VirtualArmor + 10 );

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

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

						this.SetDamageType( ResistanceType.Physical, 100 );
						this.SetDamageType( ResistanceType.Fire, 25 );
						this.SetDamageType( ResistanceType.Cold, 25 );
						this.SetDamageType( ResistanceType.Poison, 25 );
						this.SetDamageType( ResistanceType.Energy, 25 );

						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 += 200;
						this.RawInt += 30;
						this.RawDex += 20;
					}
				}
			}

			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 + 50 );

						va = ( this.VirtualArmor + 5 );

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

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

						this.SetDamageType( ResistanceType.Physical, 100 );
						this.SetDamageType( ResistanceType.Fire, 25 );
						this.SetDamageType( ResistanceType.Cold, 25 );
						this.SetDamageType( ResistanceType.Poison, 25 );
						this.SetDamageType( ResistanceType.Energy, 25 );

						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 += 100;
						this.RawInt += 20;
						this.RawDex += 10;
					}
				}
			}

			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 + 60 );

						va = ( this.VirtualArmor + 5 );

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

						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = Utility.RandomList( 60, 61 );
						this.BaseSoundID = 362;
						this.VirtualArmor = va;
						this.Stage = 4;

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

						this.RawStr += 120;
						this.RawInt += 125;
						this.RawDex += 50;
					}
				}
			}

			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 + 60 );

						va = ( this.VirtualArmor + 15 );

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

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

						this.SetDamageType( ResistanceType.Physical, 100 );
						this.SetDamageType( ResistanceType.Fire, 50 );
						this.SetDamageType( ResistanceType.Cold, 50 );
						this.SetDamageType( ResistanceType.Poison, 50 );
						this.SetDamageType( ResistanceType.Energy, 50 );

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

						this.RawStr += 100;
						this.RawInt += 125;
						this.RawDex += 50;
					}
				}
			}

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

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

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

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

						hits = ( this.HitsMax + 65 );

						va = ( this.VirtualArmor + 5 );

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

						this.AllowMating = true;
						this.Warmode = false;
						this.Say( "*"+ this.Name +" evolves*");
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 46;
						this.VirtualArmor = va;
						this.Stage = 6;

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

						this.RawStr += 75;
						this.RawInt += 110;
						this.RawDex += 50;
					}
				}
			}

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

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

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

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

						hits = ( this.HitsMax + 65 );

						va = ( this.VirtualArmor + 5 );

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

						this.Warmode = false;
						this.Say( "*"+ this.Name +" is now an ancient dragon*");
						this.Title = "the Ancient Dragon";
						this.SetDamage( mindamage, maxdamage );
						this.SetHits( hits );
						this.BodyValue = 46;
						this.VirtualArmor = va;
						this.Stage = 7;

						this.SetDamageType( ResistanceType.Physical, 100 );
						this.SetDamageType( ResistanceType.Fire, 75 );
						this.SetDamageType( ResistanceType.Cold, 75 );
						this.SetDamageType( ResistanceType.Poison, 75 );
						this.SetDamageType( ResistanceType.Energy, 75 );

						this.RawStr += 100;
						this.RawInt += 125;
						this.RawDex += 50;
					}
				}
			}

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

					if ( bc.Controled != true )
					{
						kpgainmin = 5 + ( bc.Hits ) / 740;
						kpgainmax = 5 + ( bc.Hits ) / 660;

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

			base.OnGaveMeleeAttack( defender );
		}
 

A_Li_N

Knight
And just to let you all know what I believe to be true...
Damage( amount, from )
is actually what is called when the 'from' needs to be damaged. That's why it is 'Mobile defender'...The defender gets damaged 'amount' (or whatever that ends up being after all the base calls are done, clear back to Mobile) So when the Damage method for you hiryu is called is when you want it to get hurt, but you need to make sure it travels all the way through to where it actually does the damage...aka like daat99 said, need base.Damage( amount, defender );
But I don't think you actually want to be overriding it in this case...in the original EvoDragons, it wasn't touched.
 

Tannis

Knight
If you have Raelis' version of the Evo Drag, then I'm definitely missing that line. I didn't think I got rid of it cause I'm usually really careful about not taking out what I don't know about, but thank you for that line I'm gonna go put it in and check it out.
 

Tannis

Knight
You fixed it A Li N! I put your line in instead of the one I had in there for some reason, but I had to remove the line daat gave me to use because it gave errors. It's working great now! Thank you both for helping so much!
 
Status
Not open for further replies.
Top