Wouldnt the gender change deed work for gargoyles as well?
There is also the GenderChangeToken, should also behave how you want it?
 
Wouldnt the gender change deed work for gargoyles as well?
There is also the GenderChangeToken, should also behave how you want it?
Do you have a copy of the genderchange token? My issue was if a garg used the normal gender change deed it was acting like they were still male of female and could not wear the gear
 
Would look different I guess, but should work the same
this is what I have and then tried to make lol the garg one is what I tried to make but it really dont change the gender only the apperance of the paperdoll and person
 

Attachments

  • GargoyleGenderChangeDeed .cs
    3 KB · Views: 1
  • Gender Change Deed.cs
    2.9 KB · Views: 0
Well you never actually change the gender.

from.Female = true; for change to female
and
from.Female = false; for change to male
 
--------------------------------------------------------------------------------

ServUO - [ServUO - Ultima Online Emulation] Version 0.5, Build 6437.20990
Publish 54
Core: Optimizing for 4 64-bit processors
RandomImpl: CSPRandom (Software)
Core: Loading config...
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Custom/Loose scripts/GenderChangeToken.cs:
CS1002: Line 9: ; expected
CS1002: Line 10: ; expected
CS1002: Line 12: ; expected
CS1519: Line 12: Invalid token ')' in class, struct, or interface member dec
laration
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

What is wrong ?
 

Attachments

  • GenderChangeToken.cs
    6.8 KB · Views: 1
When I look at it, there is no error.

Therefor I guess, you may use an olter .Net Framework version in your ServUO Build (as it is also Publish 54)

So changing that back to an older C# Version, would look like this:

C#:
using Server.Gumps;
using Server.Mobiles;
using System;

namespace Server.Items
{
    public class GenderChangeToken : Item, IPromotionalToken
    {
        public override int LabelNumber { get { return 1070997; } }  // a promotional token
        public TextDefinition ItemName { get { return 1075252; } }  // gender change

        public Type GumpType { get { return typeof(GenderChangeConfirmGump); } }

        [Constructable]
        public GenderChangeToken()
            : base(0x2AAA)
        {
            LootType = LootType.Blessed;
        }

        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
            }
            else if (from.IsBodyMod || from.HueMod > 0 || !from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
            {
                from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
            }
            else if (from is PlayerMobile)
            {
                _HairID = 0;
                _BeardID = 0;

                from.CloseGump(typeof(GenderChangeConfirmGump));
                BaseGump.SendGump(new GenderChangeConfirmGump((PlayerMobile)from, this));
            }
        }

        private int _HairID;
        private int _BeardID;

        public void OnChangeHairstyle(Mobile from, bool facialHair, int itemID)
        {
            if (!IsChildOf(from.Backpack))
                return;

            if (from.IsBodyMod || from.HueMod > 0 || !from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
            {
                from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
            }
            else
            {
                if (facialHair)
                {
                    _BeardID = itemID;
                }
                else
                {
                    _HairID = itemID;
                }

                if (!from.Female || from.Race == Race.Elf || facialHair)
                {
                    EndGenderChange(from);
                }
                else
                {
                    from.SendGump(new ChangeHairstyleGump(!from.Female, from, null, 0, true, from.Race == Race.Gargoyle ? ChangeHairstyleEntry.BeardEntriesGargoyle : ChangeHairstyleEntry.BeardEntries, this));
                }
            }
        }

        public void OnFailedHairstyle(Mobile from, bool facialHair)
        {
            if (!IsChildOf(from.Backpack))
                return;

            if (facialHair)
            {
                EndGenderChange(from);
            }
            else
            {
                if (from.Female && from.Race != Race.Elf)
                {
                    from.SendGump(new ChangeHairstyleGump(!from.Female, from, null, 0, true, from.Race == Race.Gargoyle ? ChangeHairstyleEntry.BeardEntriesGargoyle : ChangeHairstyleEntry.BeardEntries, this));
                }
                else
                {
                    EndGenderChange(from);
                }
            }
        }

        private void EndGenderChange(Mobile from)
        {
            if (from.Female)
            {
                from.Body = from.Race.MaleBody;
                from.Female = false;
            }
            else
            {
                from.Body = from.Race.FemaleBody;
                from.Female = true;
            }

            if ((from.Female || from.Race == Race.Elf) && _BeardID != 0)
                _BeardID = 0;

            from.FacialHairItemID = _BeardID;
            from.HairItemID = _HairID;

            from.SendMessage("You are now a {0}.", from.Female ? "woman" : "man"); // TODO: Message?
            Delete();
        }

        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            list.Add(1070998, ItemName.ToString()); // Use this to redeem<br>Your ~1_PROMO~ : gender change
        }

        public GenderChangeToken(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write(0);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }

    public class GenderChangeConfirmGump : BaseGump
    {
        public GenderChangeToken Token { get; private set; }

        public GenderChangeConfirmGump(PlayerMobile pm, GenderChangeToken token)
            : base(pm, 100, 100)
        {
            Token = token;
        }

        public override void AddGumpLayout()
        {
            AddBackground(0, 0, 291, 159, 9200);
            AddImageTiled(5, 5, 281, 20, 2702);
            AddImageTiled(5, 30, 281, 100, 2702);

            AddHtmlLocalized(8, 5, 279, 20, 1075249, 0x7FFF, false, false); // Change your character's gender.

            AddButton(5, 132, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(40, 132, 100, 20, 1011012, 0x7FFF, false, false); // CANCEL

            AddHtmlLocalized(8, 30, 279, 124, User.Female ? 1075254 : 1075253, 0x7FFF, false, false); // Click OK to change your gender to female. This change is permanent. Reversing this requires the purchase of an additional gender change token. For more details, <A HREF="http://www.uo.com/genderchange.html">visit our web site</A>.

            AddButton(126, 132, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(160, 132, 120, 20, User.Female ? 1075251 : 1075250, 0x7FFF, false, false); // Make me a woman!
        }

        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID == 1 && Token.IsChildOf(User.Backpack))
            {
                if (User.IsBodyMod || User.HueMod > 0 || !User.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
                {
                    User.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
                }
                else
                {
                    User.SendGump(new ChangeHairstyleGump(!User.Female, User, null, 0, false, GetHairstyleEntries(User), Token));
                }
            }
        }

        public static ChangeHairstyleEntry[] GetHairstyleEntries(Mobile m)
        {
            ChangeHairstyleEntry[] entries = ChangeHairstyleEntry.HairEntries;

            if (m.Race == Race.Elf)
                entries = ChangeHairstyleEntry.HairEntriesElf;
            else if (m.Race == Race.Gargoyle)
                entries = ChangeHairstyleEntry.HairEntriesGargoyle;

            return entries;
        }
    }
}
C#:
 
When I look at it, there is no error.

Therefor I guess, you may use an olter .Net Framework version in your ServUO Build (as it is also Publish 54)

So changing that back to an older C# Version, would look like this:

C#:
using Server.Gumps;
using Server.Mobiles;
using System;

namespace Server.Items
{
    public class GenderChangeToken : Item, IPromotionalToken
    {
        public override int LabelNumber { get { return 1070997; } }  // a promotional token
        public TextDefinition ItemName { get { return 1075252; } }  // gender change

        public Type GumpType { get { return typeof(GenderChangeConfirmGump); } }

        [Constructable]
        public GenderChangeToken()
            : base(0x2AAA)
        {
            LootType = LootType.Blessed;
        }

        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
            }
            else if (from.IsBodyMod || from.HueMod > 0 || !from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
            {
                from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
            }
            else if (from is PlayerMobile)
            {
                _HairID = 0;
                _BeardID = 0;

                from.CloseGump(typeof(GenderChangeConfirmGump));
                BaseGump.SendGump(new GenderChangeConfirmGump((PlayerMobile)from, this));
            }
        }

        private int _HairID;
        private int _BeardID;

        public void OnChangeHairstyle(Mobile from, bool facialHair, int itemID)
        {
            if (!IsChildOf(from.Backpack))
                return;

            if (from.IsBodyMod || from.HueMod > 0 || !from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
            {
                from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
            }
            else
            {
                if (facialHair)
                {
                    _BeardID = itemID;
                }
                else
                {
                    _HairID = itemID;
                }

                if (!from.Female || from.Race == Race.Elf || facialHair)
                {
                    EndGenderChange(from);
                }
                else
                {
                    from.SendGump(new ChangeHairstyleGump(!from.Female, from, null, 0, true, from.Race == Race.Gargoyle ? ChangeHairstyleEntry.BeardEntriesGargoyle : ChangeHairstyleEntry.BeardEntries, this));
                }
            }
        }

        public void OnFailedHairstyle(Mobile from, bool facialHair)
        {
            if (!IsChildOf(from.Backpack))
                return;

            if (facialHair)
            {
                EndGenderChange(from);
            }
            else
            {
                if (from.Female && from.Race != Race.Elf)
                {
                    from.SendGump(new ChangeHairstyleGump(!from.Female, from, null, 0, true, from.Race == Race.Gargoyle ? ChangeHairstyleEntry.BeardEntriesGargoyle : ChangeHairstyleEntry.BeardEntries, this));
                }
                else
                {
                    EndGenderChange(from);
                }
            }
        }

        private void EndGenderChange(Mobile from)
        {
            if (from.Female)
            {
                from.Body = from.Race.MaleBody;
                from.Female = false;
            }
            else
            {
                from.Body = from.Race.FemaleBody;
                from.Female = true;
            }

            if ((from.Female || from.Race == Race.Elf) && _BeardID != 0)
                _BeardID = 0;

            from.FacialHairItemID = _BeardID;
            from.HairItemID = _HairID;

            from.SendMessage("You are now a {0}.", from.Female ? "woman" : "man"); // TODO: Message?
            Delete();
        }

        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            list.Add(1070998, ItemName.ToString()); // Use this to redeem<br>Your ~1_PROMO~ : gender change
        }

        public GenderChangeToken(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write(0);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }

    public class GenderChangeConfirmGump : BaseGump
    {
        public GenderChangeToken Token { get; private set; }

        public GenderChangeConfirmGump(PlayerMobile pm, GenderChangeToken token)
            : base(pm, 100, 100)
        {
            Token = token;
        }

        public override void AddGumpLayout()
        {
            AddBackground(0, 0, 291, 159, 9200);
            AddImageTiled(5, 5, 281, 20, 2702);
            AddImageTiled(5, 30, 281, 100, 2702);

            AddHtmlLocalized(8, 5, 279, 20, 1075249, 0x7FFF, false, false); // Change your character's gender.

            AddButton(5, 132, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(40, 132, 100, 20, 1011012, 0x7FFF, false, false); // CANCEL

            AddHtmlLocalized(8, 30, 279, 124, User.Female ? 1075254 : 1075253, 0x7FFF, false, false); // Click OK to change your gender to female. This change is permanent. Reversing this requires the purchase of an additional gender change token. For more details, <A HREF="http://www.uo.com/genderchange.html">visit our web site</A>.

            AddButton(126, 132, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(160, 132, 120, 20, User.Female ? 1075251 : 1075250, 0x7FFF, false, false); // Make me a woman!
        }

        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID == 1 && Token.IsChildOf(User.Backpack))
            {
                if (User.IsBodyMod || User.HueMod > 0 || !User.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
                {
                    User.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
                }
                else
                {
                    User.SendGump(new ChangeHairstyleGump(!User.Female, User, null, 0, false, GetHairstyleEntries(User), Token));
                }
            }
        }

        public static ChangeHairstyleEntry[] GetHairstyleEntries(Mobile m)
        {
            ChangeHairstyleEntry[] entries = ChangeHairstyleEntry.HairEntries;

            if (m.Race == Race.Elf)
                entries = ChangeHairstyleEntry.HairEntriesElf;
            else if (m.Race == Race.Gargoyle)
                entries = ChangeHairstyleEntry.HairEntriesGargoyle;

            return entries;
        }
    }
}
C#:
ok did this and got this on line 7
--------------------------------------------------------------------------------

ServUO - [ServUO - Ultima Online Emulation] Version 0.5, Build 6437.20990
Publish 54
Core: Optimizing for 4 64-bit processors
RandomImpl: CSPRandom (Software)
Core: Loading config...
Scripts: Compiling C# scripts...Failed with: 1 errors, 6 warnings
Warnings:
+ Custom/Loose scripts/Stripper.cs:
CS0105: Line 11: The using directive for 'Server.Misc' appeared previously i
n this namespace
+ Items/Tools/ProspectorsTool.cs:
CS0105: Line 4: The using directive for 'Server.Engines.Harvest' appeared pr
eviously in this namespace
+ Quests/2Quest of the Months/Feb.Quest/Sara/EvilCupid1.cs:
CS0105: Line 9: The using directive for 'Server.Items' appeared previously i
n this namespace
+ Quests/2Quest of the Months/Jan.July.Quest/Baby Quest/Mother.cs:
CS0105: Line 8: The using directive for 'Server.ContextMenus' appeared previ
ously in this namespace
+ Quests/SaturnQuest/Mobiles & Quest Items/NebulasRing.cs:
CS0105: Line 6: The using directive for 'System' appeared previously in this
namespace
+ Quests/[ServUO.com]-GraniteFurnessAddon.cs:
CS0105: Line 2: The using directive for 'System' appeared previously in this
namespace
Errors:
+ Custom/Loose scripts/GenderChangeToken.cs:
CS0246: Line 7: The type or namespace name 'IPromotionalToken' could not be
found (are you missing a using directive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

Attachments

  • GenderChangeToken.cs
    6.9 KB · Views: 2
Well you sure are running a version from befor they included the Token, so in this chase. I am sure you can just remove IPromotionalToken from the script
 
Back