Actually you put it in the wrong place so only stage 7 dragons will take damage.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
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