using System; using Server.Network; using Server.Items; using Server.Mobiles; namespace Server.Items { public class BaseIdol : Item { protected int BodyValue; public BaseIdol() : base( 8428 ) { Movable = true; Name = "Base Idol"; LootType = LootType.Blessed; BodyValue = 0; } public BaseIdol( Serial serial ) : base( serial ) {} public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 1 ); // version writer.Write((int)BodyValue); } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch (version) { case 1: { BodyValue = reader.ReadInt(); break; } } } public override void OnDoubleClick( Mobile from ) { if ( !from.InRange( GetWorldLocation(), 2 ) ) { from.SendLocalizedMessage( 500446 ); // That is too far away. } else { if ( from.BodyValue == 0x190 || from.BodyValue == 0x191 ) { from.BodyValue = BodyValue; if (from.AccessLevel > AccessLevel.Player && from.Hidden ) return ; from.PlaySound( 471 ); Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( from.X, from.Y, from.Z - 7 ), from.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 ); } else { from.BodyValue = from.Female ? 0x191 : 0x190; if (from.AccessLevel > AccessLevel.Player && from.Hidden ) return ; from.PlaySound( 471 ); Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( from.X, from.Y, from.Z - 7 ), from.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 ); } } } } }