CODE |
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 dragon hatchling corpse" )] public class EvolutionDragon : BaseCreature { private Timer m_BreatheTimer; private DateTime m_EndBreathe; //private Timer m_MatingTimer; //private DateTime m_EndMating; private Timer m_PetLoyaltyTimer; private DateTime m_EndPetLoyalty; //public DateTime EndMating{ get{ return m_EndMating; } set{ m_EndMating = value; } } public DateTime EndPetLoyalty{ get{ return m_EndPetLoyalty; } set{ m_EndPetLoyalty = value; } } public int m_Stage; public int m_KP; //public bool m_AllowMating; //public bool m_HasEgg; //public bool m_Pregnant; 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 bool AllowMating //{ // get{ return m_AllowMating; } // set{ m_AllowMating = value; } //} //[CommandProperty( AccessLevel.GameMaster )] //public bool HasEgg //{ // get{ return m_HasEgg; } // set{ m_HasEgg = value; } //} //[CommandProperty( AccessLevel.GameMaster )] //public bool Pregnant //{ // get{ return m_Pregnant; } // set{ m_Pregnant = 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 EvolutionDragon() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 ) { Female = Utility.RandomBool(); Name = "a dragon hatchling"; Body = 52; Hue = Utility.RandomList( 1157, 1175, 1172, 1171, 1170, 1169, 1168, 1167, 1166, 1165, 1260, 1153 ); BaseSoundID = 0xDB; Stage = 1; S1 = true; S2 = true; S3 = true; S4 = true; S5 = true; S6 = true; SetStr( 296, 325 ); SetDex( 56, 75 ); SetInt( 76, 96 ); SetHits( 200, 250 ); SetDamage( 11, 17 ); SetDamageType( ResistanceType.Physical, 100 ); SetResistance( ResistanceType.Physical, 15 ); SetSkill( SkillName.Magery, 49.1, 60.0 ); SetSkill( SkillName.Meditation, 40.1, 60.0 ); SetSkill( SkillName.EvalInt, 40.1, 60.0 ); SetSkill( SkillName.MagicResist, 100.5, 110.0 ); SetSkill( SkillName.Tactics, 59.3, 60.0 ); SetSkill( SkillName.Wrestling, 68.3, 69.0 ); SetSkill( SkillName.Anatomy, 69.3, 100.0 ); Fame = 300; Karma = -300; VirtualArmor = 30; ControlSlots = 3; m_PetLoyaltyTimer = new PetLoyaltyTimer( this, TimeSpan.FromSeconds( 5.0 ) ); m_PetLoyaltyTimer.Start(); m_EndPetLoyalty = DateTime.Now + TimeSpan.FromSeconds( 5.0 ); } public EvolutionDragon(Serial serial) : base(serial) { } public override Poison PoisonImmune{ get{ return Poison.Lethal; } } 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.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 10; kpgainmax = 5 + ( bc.HitsMax ) / 5; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 5000 ) { 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.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 20; kpgainmax = 5 + ( bc.HitsMax ) / 10; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 10000 ) { if ( this.S2 == true ) { this.S2 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 100 ); 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 = 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, 30 ); this.SetResistance( ResistanceType.Fire, 30 ); this.SetResistance( ResistanceType.Cold, 30 ); this.SetResistance( ResistanceType.Poison, 30 ); this.SetResistance( ResistanceType.Energy, 30 ); this.RawStr += 100; this.RawInt += 20; this.RawDex += 10; } } } else if ( this.Stage == 3 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 30; kpgainmax = 5 + ( bc.HitsMax ) / 20; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 15000 ) { if ( this.S3 == true ) { this.S3 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 100 ); 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 = Utility.RandomList( 60, 61 ); this.BaseSoundID = 362; 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 += 100; this.RawInt += 120; this.RawDex += 10; } } } else if ( this.Stage == 4 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 50; kpgainmax = 5 + ( bc.HitsMax ) / 40; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 35000 ) { if ( this.S4 == true ) { this.S4 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 100 ); va = ( this.VirtualArmor + 10 ); 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, 50 ); this.SetResistance( ResistanceType.Fire, 50 ); this.SetResistance( ResistanceType.Cold, 50 ); this.SetResistance( ResistanceType.Poison, 50 ); this.SetResistance( ResistanceType.Energy, 50 ); this.RawStr += 100; this.RawInt += 120; this.RawDex += 20; } } } else if ( this.Stage == 5 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 160; kpgainmax = 5 + ( bc.HitsMax ) / 100; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 150000 ) { if ( this.S5 == true ) { this.S5 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 100 ); va = ( this.VirtualArmor + 100 ); 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, 70 ); this.SetResistance( ResistanceType.Fire, 65 ); this.SetResistance( ResistanceType.Cold, 65 ); this.SetResistance( ResistanceType.Poison, 65 ); this.SetResistance( ResistanceType.Energy, 65 ); this.RawStr += 100; this.RawInt += 120; this.RawDex += 20; } } } else if ( this.Stage == 6 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 540; kpgainmax = 5 + ( bc.HitsMax ) / 480; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 250000 ) { if ( this.S6 == true ) { this.S6 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 350 ); va = ( this.VirtualArmor + 100 ); mindamage = this.DamageMin + ( 25 ); maxdamage = this.DamageMax + ( 25 ); 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 = 172; this.VirtualArmor = va; this.Stage = 7; this.SetDamageType( ResistanceType.Physical, 100 ); this.SetDamageType( ResistanceType.Fire, 55 ); this.SetDamageType( ResistanceType.Cold, 55 ); this.SetDamageType( ResistanceType.Poison, 55 ); this.SetDamageType( ResistanceType.Energy, 55 ); this.RawStr += 125; this.RawInt += 125; this.RawDex += 35; } } } else if ( this.Stage == 7 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.Hits ) / 740; kpgainmax = 5 + ( bc.Hits ) / 660; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } } base.Damage( amount, defender ); } public override void OnGaveMeleeAttack( Mobile defender ) { int kpgainmin, kpgainmax; if ( this.Stage == 1 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 10; kpgainmax = 5 + ( bc.HitsMax ) / 5; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 5000 ) { 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.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 20; kpgainmax = 5 + ( bc.HitsMax ) / 10; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 10000 ) { if ( this.S2 == true ) { this.S2 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 100 ); 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 = 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, 30 ); this.SetResistance( ResistanceType.Fire, 30 ); this.SetResistance( ResistanceType.Cold, 30 ); this.SetResistance( ResistanceType.Poison, 30 ); this.SetResistance( ResistanceType.Energy, 30 ); this.RawStr += 100; this.RawInt += 20; this.RawDex += 10; } } } else if ( this.Stage == 3 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 30; kpgainmax = 5 + ( bc.HitsMax ) / 20; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 15000 ) { if ( this.S3 == true ) { this.S3 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 100 ); 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 = Utility.RandomList( 60, 61 ); this.BaseSoundID = 362; 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 += 100; this.RawInt += 120; this.RawDex += 10; } } } else if ( this.Stage == 4 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 50; kpgainmax = 5 + ( bc.HitsMax ) / 40; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 35000 ) { if ( this.S4 == true ) { this.S4 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 100 ); va = ( this.VirtualArmor + 10 ); 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, 50 ); this.SetResistance( ResistanceType.Fire, 50 ); this.SetResistance( ResistanceType.Cold, 50 ); this.SetResistance( ResistanceType.Poison, 50 ); this.SetResistance( ResistanceType.Energy, 50 ); this.RawStr += 100; this.RawInt += 120; this.RawDex += 20; } } } else if ( this.Stage == 5 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 160; kpgainmax = 5 + ( bc.HitsMax ) / 100; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 150000 ) { if ( this.S5 == true ) { this.S5 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 100 ); va = ( this.VirtualArmor + 100 ); mindamage = this.DamageMin + ( 10 ); maxdamage = this.DamageMax + ( 10 ); //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, 70 ); this.SetResistance( ResistanceType.Fire, 65 ); this.SetResistance( ResistanceType.Cold, 65 ); this.SetResistance( ResistanceType.Poison, 65 ); this.SetResistance( ResistanceType.Energy, 65 ); this.RawStr += 100; this.RawInt += 120; this.RawDex += 20; } } } else if ( this.Stage == 6 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.HitsMax ) / 540; kpgainmax = 5 + ( bc.HitsMax ) / 480; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } if ( this.KP >= 250000 ) { if ( this.S6 == true ) { this.S6 = false; int hits, va, mindamage, maxdamage; hits = ( this.HitsMax + 350 ); va = ( this.VirtualArmor + 100 ); mindamage = this.DamageMin + ( 25 ); maxdamage = this.DamageMax + ( 25 ); 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 = 172; this.VirtualArmor = va; this.Stage = 7; this.SetDamageType( ResistanceType.Physical, 100 ); this.SetDamageType( ResistanceType.Fire, 55 ); this.SetDamageType( ResistanceType.Cold, 55 ); this.SetDamageType( ResistanceType.Poison, 55 ); this.SetDamageType( ResistanceType.Energy, 55 ); this.RawStr += 125; this.RawInt += 125; this.RawDex += 35; } } } else if ( this.Stage == 7 ) { if ( defender is BaseCreature ) { BaseCreature bc = (BaseCreature)defender; if ( bc.Controlled != true ) { kpgainmin = 5 + ( bc.Hits ) / 740; kpgainmax = 5 + ( bc.Hits ) / 660; this.KP += Utility.RandomList( kpgainmin, kpgainmax ); } } } base.OnGaveMeleeAttack( defender ); } public override bool OnDragDrop( Mobile from, Item dropped ) { PlayerMobile player = from as PlayerMobile; if ( player != null ) { if ( dropped is DragonDust ) { DragonDust dust = ( DragonDust )dropped; int amount = ( dust.Amount * 10 ); this.PlaySound( 665 ); this.KP += amount; dust.Delete(); this.Say( "*"+ this.Name +" absorbs the dragon dust*" ); return false; } else { } } return base.OnDragDrop( from, dropped ); } public override void OnDoubleClick( Mobile from ) { if ( this.Controlled == true && this.ControlMaster == from ) { //from.SendMessage( "DNA dragon you need tools to dna it." ); // from.BeginTarget( -1, false, TargetFlags.Harmful, new TargetCallback( MatingTarget_Callback ) ); } //else //{ // from.SendMessage( "target a DNA dragon you need tools to dna it!" ); //} } // } // } private DateTime m_NextBreathe; public override void OnActionCombat() { Mobile combatant = Combatant; if ( combatant == null || combatant.Deleted || combatant.Map != Map || !InRange( combatant, 12 ) || !CanBeHarmful( combatant ) || !InLOS( combatant ) ) return; if ( DateTime.Now >= m_NextBreathe ) { Breathe( combatant ); m_NextBreathe = DateTime.Now + TimeSpan.FromSeconds( 12.0 + (3.0 * Utility.RandomDouble()) ); // 12-15 seconds } } public void Breathe( Mobile m ) { DoHarmful( m ); m_BreatheTimer = new BreatheTimer( m, this, this, TimeSpan.FromSeconds( 1.0 ) ); m_BreatheTimer.Start(); m_EndBreathe = DateTime.Now + TimeSpan.FromSeconds( 1.0 ); this.Frozen = true; if ( this.Stage == 1 ) { this.MovingParticles( m, 0x1FA8, 1, 0, false, true, ( this.Hue - 1 ), 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0 ); } else if ( this.Stage == 2 ) { this.MovingParticles( m, 0x1FA9, 1, 0, false, true, ( this.Hue - 1 ), 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0 ); } else if ( this.Stage == 3 ) { this.MovingParticles( m, 0x1FAB, 1, 0, false, true, ( this.Hue - 1 ), 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0 ); } else if ( this.Stage == 4 ) { this.MovingParticles( m, 0x1FBC, 1, 0, false, true, ( this.Hue - 1 ), 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0 ); } else if ( this.Stage == 5 ) { this.MovingParticles( m, 0x1FBD, 1, 0, false, true, ( this.Hue - 1 ), 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0 ); } else if ( this.Stage == 6 ) { this.MovingParticles( m, 0x1FBF, 1, 0, false, true, ( this.Hue - 1 ), 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0 ); } else if ( this.Stage == 7 ) { this.MovingParticles( m, 0x1FBE, 1, 0, false, true, ( this.Hue - 1 ), 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0 ); } else { this.PublicOverheadMessage( MessageType.Regular, this.SpeechHue, true, "Please call a GM if you are getting this message, they will fix the breathe, thank you :)", false ); } } private class BreatheTimer : Timer { private EvolutionDragon ed; private Mobile m_Mobile, m_From; public BreatheTimer( Mobile m, EvolutionDragon owner, Mobile from, TimeSpan duration ) : base( duration ) { ed = owner; m_Mobile = m; m_From = from; Priority = TimerPriority.TwoFiftyMS; } protected override void OnTick() { int damagemin = ed.Hits / 20; int damagemax = ed.Hits / 25; ed.Frozen = false; m_Mobile.PlaySound( 0x11D ); AOS.Damage( m_Mobile, m_From, Utility.RandomMinMax( damagemin, damagemax ), 0, 100, 0, 0, 0 ); Stop(); } } public override void Serialize(GenericWriter writer) { base.Serialize(writer); writer.Write((int) 1); // writer.Write( m_AllowMating ); // writer.Write( m_HasEgg ); // writer.Write( m_Pregnant ); writer.Write( m_S1 ); 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 ); // writer.WriteDeltaTime( m_EndMating ); writer.WriteDeltaTime( m_EndBreathe ); writer.WriteDeltaTime( m_EndPetLoyalty ); } public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch ( version ) { case 1: { // m_AllowMating = reader.ReadBool(); //// m_HasEgg = reader.ReadBool(); // m_Pregnant = reader.ReadBool(); 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_EndMating = reader.ReadDeltaTime(); //m_MatingTimer = new MatingTimer( this, m_EndMating - DateTime.Now ); //m_MatingTimer.Start(); m_EndBreathe = reader.ReadDeltaTime(); m_BreatheTimer = new BreatheTimer( this, this, this, m_EndBreathe - DateTime.Now ); m_BreatheTimer.Start(); m_EndPetLoyalty = reader.ReadDeltaTime(); m_PetLoyaltyTimer = new PetLoyaltyTimer( this, m_EndPetLoyalty - DateTime.Now ); m_PetLoyaltyTimer.Start(); break; } case 0: { TimeSpan durationbreathe = TimeSpan.FromSeconds( 1.0 ); TimeSpan durationmating = TimeSpan.FromDays( 3.0 ); TimeSpan durationloyalty = TimeSpan.FromSeconds( 5.0 ); m_BreatheTimer = new BreatheTimer( this, this, this, durationbreathe ); m_BreatheTimer.Start(); m_EndBreathe = DateTime.Now + durationbreathe; //m_MatingTimer = new MatingTimer( this, durationmating ); //m_MatingTimer.Start(); //m_EndMating = DateTime.Now + durationmating; m_PetLoyaltyTimer = new PetLoyaltyTimer( this, durationloyalty ); m_PetLoyaltyTimer.Start(); m_EndPetLoyalty = DateTime.Now + durationloyalty; break; } } } } public class PetLoyaltyTimer : Timer { private EvolutionDragon ed; public PetLoyaltyTimer( EvolutionDragon owner, TimeSpan duration ) : base( duration ) { Priority = TimerPriority.OneSecond; ed = owner; } protected override void OnTick() { if ( Core.SE ) ed.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy //ed.Loyalty = PetLoyalty.WonderfullyHappy; PetLoyaltyTimer lt = new PetLoyaltyTimer( ed, TimeSpan.FromSeconds( 5.0 ) ); lt.Start(); ed.EndPetLoyalty = DateTime.Now + TimeSpan.FromSeconds( 5.0 ); Stop(); } } } //} |