RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Resource icon

Swap ItemID based upon gender 1.0

No permission to download
This is an example of how to take two ItemID’s with different gumps and make a male/female item that will swap based upon gender.

This script example is great if you have wearable artwork that is not setup to swap in the mul files.

Code:
using System;
using Server.Items;
using Server.Mobiles;
 
namespace Server.Items
{
    [Flipable]
    public class ClothingSwap_MF : BaseOuterTorso
    {
 
            public override int InitMinHits { get { return 10; } }
            public override int InitMaxHits { get { return 20; } }
 
        [Constructable]
        public ClothingSwap_MF() : this( 0 )
        {
        }
 
        [Constructable]
        public ClothingSwap_MF( int hue ) : base( 0x7E28, hue )    //Male, default
        {
            Name = "Clothing Swaper Test";
            Weight = 3.0;
        }
 
        public override bool OnEquip(Mobile from)
        {
            if( from.Female )
            {
                this.ItemID = 0x74A6;    //Female, set to
                return true;
            }
            else
            {
                this.ItemID = 0x7E28;    //Male, set to
                return true;
            }
        }
 
        public override void OnRemoved( Object o )
        {
            if ( ItemID == 0x74A6 )        //IF Female
            {
                this.ItemID = 0x7E28;    //Change back to, Male default
            }
        }
 
        public ClothingSwap_MF( 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();
        }
    }
}
  • Like
Reactions: KISOR
Author
Nockar
Downloads
15
Views
417
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Nockar

Top