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
Any hints?
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();
}
}
}