Hi there I was wondering if anyone had this deed? The humans have one lol
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 gearWouldnt the gender change deed work for gargoyles as well?
There is also the GenderChangeToken, should also behave how you want it?
yea it is a deed right?Maybe you already have it, it is in the repository.
ServUO/Scripts/Items/StoreBought/GenderChangeToken.cs at 05cdc8780ecd81a6abca0f5f14097c8e6bc4860f · ServUO/ServUO
An Ultima Online server emulator written in C# .NET - ServUO/ServUOgithub.com
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 personWould look different I guess, but should work the same
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;
}
}
}
ok did this and got this on line 7When 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#:
We use essential cookies to make this site work, and optional cookies to enhance your experience.