For ServUO - need help with a script please help.

Feb 28, 2019
5
1
39
a simple script:
using System;
using Server.Network;
using Server.Items;
using Server.Mobiles;

namespace Server.Items
{


    public class UberSilvaniIdol : Item
    {
        bool isElf;

        [Constructable]
        public UberSilvaniIdol() : base(9654)
        {
            Movable = true;
            Name = "Über Silvani Idol";
            LootType = LootType.Cursed;
            Hue = 1153;
        }

        public UberSilvaniIdol(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();
        }

        public override void OnDoubleClick(Mobile from)
        {

            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendLocalizedMessage(500446); // That is too far away.
            }
            else
            {
                // Copy from here.
                if (from.BodyValue == 0x190 || from.BodyValue == 0x191 || from.BodyValue == 0x25D || from.BodyValue == 0x25E || from.BodyValue == 666 || from.BodyValue == 667)
                {
                    

                    from.BodyValue = 176;  // <-- This will be different in each script.
                    from.PlaySound(0x467);
                    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
                {


                    if (from.Race == Race.Human && !(from.Female))
                    {
                        from.BodyValue = 400; //Human male
                        from.PlaySound(0x467);
                        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 if (from.Race == Race.Human && (from.Female))
                    {
                        from.BodyValue = 401;  //Human Female
                        from.PlaySound(0x467);
                        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 if (from.Race == Race.Elf && !(from.Female))
                    {
                        from.BodyValue = 605;  //Elf male
                        from.PlaySound(0x467);
                        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 if (from.Race == Race.Elf && (from.Female))
                    {
                        from.BodyValue = 606;  //Elf Female
                        from.PlaySound(0x467);
                        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 if (from.Race == Race.Gargoyle && !(from.Female))
                    {
                        from.BodyValue = 666;  //Gargoyle Male
                        from.PlaySound(0x467);
                        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 if (from.Race == Race.Gargoyle && (from.Female))
                    {
                        from.BodyValue = 667;  //Gargoyle Female
                        from.PlaySound(0x467);
                        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);
                    }

                }
                //copy to here.
            }
        }
    }
}
Post automatically merged:

It is supposed to change a player's body value to some random creature, then change them back to the previous sex and race.
Thank you for the help in advance.!