CODE |
using System; using Server; using Server.Items; using Server.Mobiles; namespace Server.Mobiles { [CorpseName( "a phantom steed corpse" )] public class PhantomSteed : BaseMount { public override WeaponAbility GetWeaponAbility() { switch ( Utility.Random( 10 ) ) { default: return null; case 0: return WeaponAbility.MortalStrike; case 1: return WeaponAbility.BleedAttack; } } [Constructable] public PhantomSteed() : this( "a phantom steed" ) { } [Constructable] public PhantomSteed( string name ) : base( name, 0x74, 0x3EA7, AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 ) { BaseSoundID = 0xA8; Hue = 2972; HueMod = 16385; SetStr( 700, 715 ); SetDex( 350, 405 ); SetInt( 350, 475 ); SetHits( 650, 670 ); SetDamage( 30, 35 ); SetDamageType( ResistanceType.Physical, 65 ); SetDamageType( ResistanceType.Fire, 45 ); SetDamageType( ResistanceType.Cold, 40 ); SetDamageType( ResistanceType.Poison, 30 ); SetDamageType( ResistanceType.Energy, 45 ); SetResistance( ResistanceType.Physical, 70 ); SetResistance( ResistanceType.Fire, 65 ); SetResistance( ResistanceType.Cold, 50 ); SetResistance( ResistanceType.Poison, 50 ); SetResistance( ResistanceType.Energy, 45 ); SetSkill( SkillName.EvalInt, 120.0, 130.0 ); SetSkill( SkillName.Magery, 100.0, 120.0 ); SetSkill( SkillName.MagicResist, 109.0, 115.0 ); SetSkill( SkillName.Tactics, 115.0, 125.0 ); SetSkill( SkillName.Wrestling, 100.0, 105.0 ); SetSkill( SkillName.Meditation, 110.0, 120.0 ); SetSkill( SkillName.Anatomy, 175.0, 200.0 ); Fame = 14000; Karma = -14000; VirtualArmor = 100; Tamable = true; ControlSlots = 4; MinTameSkill = 115.0; switch ( Utility.Random( 3 ) ) { case 0: { BodyValue = 116; ItemID = 16039; break; } case 1: { BodyValue = 178; ItemID = 16041; break; } case 2: { BodyValue = 179; ItemID = 16055; break; } } PackItem( new SulfurousAsh( Utility.RandomMinMax( 3, 5 ) ) ); } public override void GenerateLoot() { AddLoot( LootPack.Rich ); AddLoot( LootPack.LowScrolls ); AddLoot( LootPack.Potions ); // if ( 0.2 > Utility.RandomDouble() ) //PackItem( new SpiritOfTheRealms() ); } public override int GetAngerSound() { if ( !Controlled ) return 0x16A; return base.GetAngerSound(); } public override bool HasBreath{ get{ return true; } } // fire breath enabled public override int Meat{ get{ return 5; } } public override int Hides{ get{ return 10; } } public override HideType HideType{ get{ return HideType.Barbed; } } public override FoodType FavoriteFood{ get{ return FoodType.Meat; } } public override Poison PoisonImmune{ get{ return Poison.Lethal; } } //public override Poison HitPoison{ get{ return Poison.Lethal; } } public override int BreathFireDamage{ get{ return 0; } } public override int BreathColdDamage{ get{ return 100; } } public override int BreathEffectHue{ get{ return 0x480; } } //public override double WeaponAbilityChance{ get{ return 0.9; } } public override Poison HitPoison{ get{ return (0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly); } } public PhantomSteed( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); if ( BaseSoundID == 0x16A ) BaseSoundID = 0xA8; } } } |
CODE |
if(Rider != null) { Hue = blue; } else { Hue = ethy; } |
QUOTE (ArteGordon @ March 28, 2007 06:28 am) | ||
You could always just try reinstating the hue during deserialization. Something like this at the end of the Deserialize method
Also note that HueMod doesnt get serialized/deserialized, so if you wanted it to keep the value of HueMod = 16385; you would have to reassign that during deserialization as well. |
CODE |
if(Rider == null) HueMod = 16385; |
CODE |
using System; using Server; using Server.Items; using Server.Mobiles; namespace Server.Mobiles { [CorpseName( "a phantom steed corpse" )] public class PhantomSteed : BaseMount { public override WeaponAbility GetWeaponAbility() { switch ( Utility.Random( 10 ) ) { default: return null; case 0: return WeaponAbility.MortalStrike; case 1: return WeaponAbility.BleedAttack; } } [Constructable] public PhantomSteed() : this( "a phantom steed" ) { } [Constructable] public PhantomSteed( string name ) : base( name, 0x74, 0x3EA7, AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 ) { BaseSoundID = 0xA8; Hue = 2972; HueMod = 16385; SetStr( 700, 715 ); SetDex( 350, 405 ); SetInt( 350, 475 ); SetHits( 650, 670 ); SetDamage( 30, 35 ); SetDamageType( ResistanceType.Physical, 65 ); SetDamageType( ResistanceType.Fire, 45 ); SetDamageType( ResistanceType.Cold, 40 ); SetDamageType( ResistanceType.Poison, 30 ); SetDamageType( ResistanceType.Energy, 45 ); SetResistance( ResistanceType.Physical, 70 ); SetResistance( ResistanceType.Fire, 65 ); SetResistance( ResistanceType.Cold, 50 ); SetResistance( ResistanceType.Poison, 50 ); SetResistance( ResistanceType.Energy, 45 ); SetSkill( SkillName.EvalInt, 120.0, 130.0 ); SetSkill( SkillName.Magery, 100.0, 120.0 ); SetSkill( SkillName.MagicResist, 109.0, 115.0 ); SetSkill( SkillName.Tactics, 115.0, 125.0 ); SetSkill( SkillName.Wrestling, 100.0, 105.0 ); SetSkill( SkillName.Meditation, 110.0, 120.0 ); SetSkill( SkillName.Anatomy, 175.0, 200.0 ); Fame = 14000; Karma = -14000; VirtualArmor = 100; Tamable = true; ControlSlots = 4; MinTameSkill = 115.0; switch ( Utility.Random( 3 ) ) { case 0: { BodyValue = 116; ItemID = 16039; break; } case 1: { BodyValue = 178; ItemID = 16041; break; } case 2: { BodyValue = 179; ItemID = 16055; break; } } PackItem( new SulfurousAsh( Utility.RandomMinMax( 3, 5 ) ) ); } public override void GenerateLoot() { AddLoot( LootPack.Rich ); AddLoot( LootPack.LowScrolls ); AddLoot( LootPack.Potions ); // if ( 0.2 > Utility.RandomDouble() ) //PackItem( new SpiritOfTheRealms() ); } public override int GetAngerSound() { if ( !Controlled ) return 0x16A; return base.GetAngerSound(); } public override bool HasBreath{ get{ return true; } } // fire breath enabled public override int Meat{ get{ return 5; } } public override int Hides{ get{ return 10; } } public override HideType HideType{ get{ return HideType.Barbed; } } public override FoodType FavoriteFood{ get{ return FoodType.Meat; } } public override Poison PoisonImmune{ get{ return Poison.Lethal; } } //public override Poison HitPoison{ get{ return Poison.Lethal; } } public override int BreathFireDamage{ get{ return 0; } } public override int BreathColdDamage{ get{ return 100; } } public override int BreathEffectHue{ get{ return 0x480; } } //public override double WeaponAbilityChance{ get{ return 0.9; } } public override Poison HitPoison{ get{ return (0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly); } } public PhantomSteed( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); if(Rider == null) HueMod = 16385; } } } |
CODE |
if(Rider == null) HueMod = 16385; |
CODE |
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); HueMod = 16385; } |
QUOTE (ArteGordon @ March 29, 2007 02:08 am) | ||
have you tried just restoring the HueMod on deser?
|
CODE |
using System; using Server; using Server.Items; using Server.Mobiles; namespace Server.Mobiles { [CorpseName( "a phantom steed corpse" )] public class PhantomSteed : BaseMount { public override WeaponAbility GetWeaponAbility() { switch ( Utility.Random( 10 ) ) { default: return null; case 0: return WeaponAbility.MortalStrike; case 1: return WeaponAbility.BleedAttack; } } [Constructable] public PhantomSteed() : this( "a phantom steed" ) { } [Constructable] public PhantomSteed( string name ) : base( name, 0x74, 0x3EA7, AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 ) { BaseSoundID = 0xA8; Hue = 2972; HueMod = 16385; SetStr( 700, 715 ); SetDex( 350, 405 ); SetInt( 350, 475 ); SetHits( 650, 670 ); SetDamage( 30, 35 ); SetDamageType( ResistanceType.Physical, 65 ); SetDamageType( ResistanceType.Fire, 45 ); SetDamageType( ResistanceType.Cold, 40 ); SetDamageType( ResistanceType.Poison, 30 ); SetDamageType( ResistanceType.Energy, 45 ); SetResistance( ResistanceType.Physical, 70 ); SetResistance( ResistanceType.Fire, 65 ); SetResistance( ResistanceType.Cold, 50 ); SetResistance( ResistanceType.Poison, 50 ); SetResistance( ResistanceType.Energy, 45 ); SetSkill( SkillName.EvalInt, 120.0, 130.0 ); SetSkill( SkillName.Magery, 100.0, 120.0 ); SetSkill( SkillName.MagicResist, 109.0, 115.0 ); SetSkill( SkillName.Tactics, 115.0, 125.0 ); SetSkill( SkillName.Wrestling, 100.0, 105.0 ); SetSkill( SkillName.Meditation, 110.0, 120.0 ); SetSkill( SkillName.Anatomy, 175.0, 200.0 ); Fame = 14000; Karma = -14000; VirtualArmor = 100; Tamable = true; ControlSlots = 4; MinTameSkill = 115.0; switch ( Utility.Random( 3 ) ) { case 0: { BodyValue = 116; ItemID = 16039; break; } case 1: { BodyValue = 178; ItemID = 16041; break; } case 2: { BodyValue = 179; ItemID = 16055; break; } } PackItem( new SulfurousAsh( Utility.RandomMinMax( 3, 5 ) ) ); } public override void GenerateLoot() { AddLoot( LootPack.Rich ); AddLoot( LootPack.LowScrolls ); AddLoot( LootPack.Potions ); // if ( 0.2 > Utility.RandomDouble() ) //PackItem( new SpiritOfTheRealms() ); } public override int GetAngerSound() { if ( !Controlled ) return 0x16A; return base.GetAngerSound(); } public override bool HasBreath{ get{ return true; } } // fire breath enabled public override int Meat{ get{ return 5; } } public override int Hides{ get{ return 10; } } public override HideType HideType{ get{ return HideType.Barbed; } } public override FoodType FavoriteFood{ get{ return FoodType.Meat; } } public override Poison PoisonImmune{ get{ return Poison.Lethal; } } //public override Poison HitPoison{ get{ return Poison.Lethal; } } public override int BreathFireDamage{ get{ return 0; } } public override int BreathColdDamage{ get{ return 100; } } public override int BreathEffectHue{ get{ return 0x480; } } //public override double WeaponAbilityChance{ get{ return 0.9; } } public override Poison HitPoison{ get{ return (0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly); } } public PhantomSteed( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); //if(Rider == null) HueMod = 16385; } } } |
CODE |
if(Rider == null) |