fix: Removes BodyValue and fixes modifying Body and BodyMod in props gump. (#743)

* Removes BodyValue
* Removes BodyPicker gump
* Fixes setting Body and BodyMod in props gump
* Props will now look for an `implicit cast` in order to find a way to allow you to modify values with the props gump.
* Fixed `[self set body 0x190` so it works too.
This commit is contained in:
Kamron Batman 2021-08-28 22:56:00 -07:00 committed by GitHub
parent 244fc6a136
commit bf20800382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 175 additions and 1477 deletions

View file

@ -9,11 +9,6 @@ namespace Server
{
}
[AttributeUsage(AttributeTargets.Property)]
public class BodyAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class PropertyObjectAttribute : Attribute
{

View file

@ -1051,6 +1051,11 @@ namespace Server
}
}
public void MoveToWorld(WorldLocation worldLocation)
{
MoveToWorld(worldLocation.Location, worldLocation.Map);
}
/// <summary>
/// Moves the Item to a given <paramref name="location" /> and <paramref name="map" />.
/// </summary>
@ -2306,18 +2311,12 @@ namespace Server
doubled = false;
if (m_Amount <= 1)
itemID = m_Amount switch
{
itemID = coinBase;
}
else if (m_Amount <= 5)
{
itemID = coinBase + 1;
}
else // m_Amount > 5
{
itemID = coinBase + 2;
}
<= 1 => coinBase,
<= 5 => coinBase + 1,
_ => coinBase + 2
};
}
var bounds = ItemBounds.Table[itemID & 0x3FFF];

View file

@ -14,7 +14,8 @@ namespace Server
Equipment
}
public readonly struct Body : IEquatable<object>, IEquatable<Body>, IEquatable<int>
[Parsable]
public readonly struct Body : IEquatable<object>, IEquatable<Body>, IEquatable<int>, IComparable<int>, IComparable<Body>
{
private static readonly BodyType[] m_Types = Array.Empty<BodyType>();
@ -70,38 +71,13 @@ namespace Server
&& BodyID != 695
&& BodyID != 970;
public bool IsGargoyle => BodyID == 666
|| BodyID == 667
|| BodyID == 694
|| BodyID == 695;
public bool IsGargoyle => BodyID is 666 or 667 or 694 or 695;
public bool IsMale => BodyID == 183
|| BodyID == 185
|| BodyID == 400
|| BodyID == 402
|| BodyID == 605
|| BodyID == 607
|| BodyID == 666
|| BodyID == 694
|| BodyID == 750;
public bool IsMale => BodyID is 183 or 185 or 400 or 402 or 605 or 607 or 666 or 694 or 750;
public bool IsFemale => BodyID == 184
|| BodyID == 186
|| BodyID == 401
|| BodyID == 403
|| BodyID == 606
|| BodyID == 608
|| BodyID == 667
|| BodyID == 695
|| BodyID == 751;
public bool IsFemale => BodyID is 184 or 186 or 401 or 403 or 606 or 608 or 667 or 695 or 751;
public bool IsGhost => BodyID == 402
|| BodyID == 403
|| BodyID == 607
|| BodyID == 608
|| BodyID == 694
|| BodyID == 695
|| BodyID == 970;
public bool IsGhost => BodyID is 402 or 403 or 607 or 608 or 694 or 695 or 970;
public bool IsMonster => BodyID >= 0
&& BodyID < m_Types.Length
@ -151,5 +127,11 @@ namespace Server
public static bool operator <(Body l, Body r) => l.BodyID < r.BodyID;
public static bool operator <=(Body l, Body r) => l.BodyID <= r.BodyID;
public int CompareTo(Body other) => BodyID.CompareTo(other.BodyID);
public int CompareTo(int other) => BodyID.CompareTo(other);
public static Body Parse(string value) => Utility.ToInt32(value);
}
}

View file

@ -1702,7 +1702,6 @@ namespace Server
}
}
[Body]
[CommandProperty(AccessLevel.GameMaster)]
public Body Body
{
@ -1721,14 +1720,6 @@ namespace Server
}
}
[Body]
[CommandProperty(AccessLevel.GameMaster)]
public int BodyValue
{
get => Body.BodyID;
set => Body = value;
}
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
public Point3D LogoutLocation { get; set; }

View file

@ -119,7 +119,7 @@ namespace Server.Network
else if (entity is Mobile mobile)
{
type = 1;
gfx = mobile.BodyValue;
gfx = mobile.Body;
hue = mobile.Hue;
flags = mobile.GetPacketFlags(true);
}

View file

@ -13,7 +13,7 @@ namespace Server.Factions
Frozen = true;
CantWalk = true;
Female = false;
BodyValue = 400;
Body = 400;
Name = NameList.RandomName("male");
RangeHome = 0;

View file

@ -101,7 +101,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Apprentice Necromancer";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83FD;
HairItemID = 0x2048;
HairHue = 0x463;
@ -146,7 +146,7 @@ namespace Server.Engines.MLQuests.Definitions
public Frederic()
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
BodyValue = 0x1A;
Body = 0x1A;
Hue = 0x455;
Frozen = true;
@ -184,7 +184,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Alchemist";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -226,7 +226,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Blacksmith";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x8409;
FacialHairItemID = 0x2041;
FacialHairHue = 0x45E;

View file

@ -75,7 +75,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the student";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -119,7 +119,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the cook";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -171,7 +171,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the student";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -114,7 +114,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Architect's Daughter";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -2013,7 +2013,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the guard";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2079,7 +2079,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the guard";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2146,7 +2146,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the guard";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2211,7 +2211,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the soil nurturer";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2277,7 +2277,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2342,7 +2342,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the arcanist";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2405,7 +2405,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the arborist";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2476,7 +2476,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the arborist";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2539,7 +2539,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the expeditionist";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2616,7 +2616,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2675,7 +2675,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2738,7 +2738,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the soil nurturer";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2799,7 +2799,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the expeditionist";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2875,7 +2875,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the expeditionist";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -2958,7 +2958,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the guard";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3025,7 +3025,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the grape tender";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3094,7 +3094,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the grape tender";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3156,7 +3156,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the trinket weaver";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3225,7 +3225,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the trinket weaver";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3288,7 +3288,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the bark weaver";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3350,7 +3350,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the bark weaver";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3399,7 +3399,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the bowcrafter";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3471,7 +3471,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the bowcrafter";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3533,7 +3533,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the metal weaver";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3602,7 +3602,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the metal weaver";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3666,7 +3666,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the cloth weaver";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3729,7 +3729,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the cloth weaver";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3791,7 +3791,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the expeditionist";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3854,7 +3854,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the expeditionist";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3915,7 +3915,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -3959,7 +3959,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4016,7 +4016,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4059,7 +4059,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4107,7 +4107,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4152,7 +4152,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4197,7 +4197,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the healer";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4240,7 +4240,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the healer";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4283,7 +4283,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the thaumaturgist";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4327,7 +4327,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the arcanist";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4377,7 +4377,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the keeper of tradition";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4420,7 +4420,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the arborist";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4472,7 +4472,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the arborist";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4528,7 +4528,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the keeper of tradition";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4579,7 +4579,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the keeper of tradition";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4643,7 +4643,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the thaumaturgist";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4698,7 +4698,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4752,7 +4752,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the keeper of tradition";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -4807,7 +4807,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the keeper of tradition";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -281,7 +281,7 @@ namespace Server.Engines.MLQuests.Definitions
public Enigma()
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
BodyValue = 788;
Body = 788;
BaseSoundID = 0x3EE;
InitStats(100, 100, 25);

View file

@ -61,7 +61,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Beggar";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -104,7 +104,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Noble";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -233,7 +233,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the trader";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -283,7 +283,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the tinker";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -33,7 +33,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Fierce";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -201,7 +201,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Mistress of Admissions";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -247,7 +247,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Mayor";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -304,7 +304,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the necromancer";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = 0x83E8;
InitStats(100, 100, 25);

View file

@ -648,7 +648,7 @@ namespace Server.Engines.MLQuests.Definitions
public Aelorn()
{
Title = "the Chivalry Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203C;
HairHue = 0x47D;
@ -713,7 +713,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Wrestling Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203D;
HairHue = 0x455;
@ -772,7 +772,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Mace Fighting Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203C;
HairHue = 0x455;
@ -849,7 +849,7 @@ namespace Server.Engines.MLQuests.Definitions
public Robyn()
{
Title = "the Archery Instructor";
BodyValue = 0x191;
Body = 0x191;
Hue = 0x83EA;
HairItemID = 0x203C;
HairHue = 0x47D;
@ -932,7 +932,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Fencer Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203C;
HairHue = 0x455;
@ -1016,7 +1016,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Tactics Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203B;
HairHue = 0x44E;
@ -1081,7 +1081,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Swordsmanship Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83FA;
HairItemID = 0x203C;
HairHue = 0x8A7;
@ -1142,7 +1142,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Parrying Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x8374;
HairItemID = 0;
@ -1223,7 +1223,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Resisting Spells Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203D;
HairHue = 0x457;
@ -1279,7 +1279,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Meditation Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83F5;
HairItemID = 0x203B;
HairHue = 0x455;
@ -1361,7 +1361,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Inscription Instructor";
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = 0x83EA;
HairItemID = 0x203D;
@ -1418,7 +1418,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Magery Instructor";
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = 0x83EA;
HairItemID = 0x203C;
@ -1475,7 +1475,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Evaluating Intelligence Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203C;
HairHue = 0x455;
@ -1535,7 +1535,7 @@ namespace Server.Engines.MLQuests.Definitions
public AmeliaYoungstone()
{
Title = "the Tinkering Instructor";
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = 0x83EA;
HairItemID = 0x203D;
@ -1596,7 +1596,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Anatomy Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EC;
HairItemID = 0x203C;
HairHue = 0x477;
@ -1656,7 +1656,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Healing Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203B;
HairHue = 0x477;
@ -1713,7 +1713,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Focus Instructor";
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = 0x83EA;
HairItemID = 0x203C;
@ -1845,7 +1845,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Hiding Instructor";
BodyValue = 0xF7;
Body = 0xF7;
InitStats(100, 100, 25);
@ -1894,7 +1894,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Stealth Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x8403;
HairItemID = 0x203B;
HairHue = 0x455;
@ -1954,7 +1954,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Tracking Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203B;
HairHue = 0x47D;
@ -2093,7 +2093,7 @@ namespace Server.Engines.MLQuests.Definitions
public Mulcivikh()
{
Title = "the Necromancy Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203D;
HairHue = 0x457;
@ -2171,7 +2171,7 @@ namespace Server.Engines.MLQuests.Definitions
public Morganna()
{
Title = "the Spirit Speak Instructor";
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = 0x83EA;
HairItemID = 0x203C;
@ -2230,7 +2230,7 @@ namespace Server.Engines.MLQuests.Definitions
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
{
Title = "the Miner Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x2048;
HairHue = 0x44E;
@ -2292,7 +2292,7 @@ namespace Server.Engines.MLQuests.Definitions
public GeorgeHephaestus()
{
Title = "the Blacksmith Instructor";
BodyValue = 0x190;
Body = 0x190;
Hue = 0x83EA;
HairItemID = 0x203B;
HairHue = 0x47B;

View file

@ -268,7 +268,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the archer trainer";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -346,7 +346,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the archer";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -408,7 +408,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the chef";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -468,7 +468,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the servant";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -524,7 +524,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the blacksmith trainer";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -592,7 +592,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the miner";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -645,7 +645,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the carpenter";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -703,7 +703,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the mage";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -759,7 +759,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the tinker";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -804,7 +804,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the fisher";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -862,7 +862,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the courier";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -922,7 +922,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Lumberjack";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -767,7 +767,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the bowcrafter";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -834,7 +834,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the metal weaver";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -892,7 +892,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the cloth weaver";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -953,7 +953,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the guard";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -1025,7 +1025,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the keeper of tradition";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -1082,7 +1082,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the keeper of tradition";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -1150,7 +1150,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the cook";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -1213,7 +1213,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the thaumaturgist";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -1274,7 +1274,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the bark weaver";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -1320,7 +1320,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the wise";
Race = Race.Elf;
BodyValue = 0x25D;
Body = 0x25D;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -104,7 +104,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the keeper of tradition";
Race = Race.Elf;
BodyValue = 0x25E;
Body = 0x25E;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -92,7 +92,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Tortured Artist";
Race = Race.Human;
BodyValue = 0x190;
Body = 0x190;
Female = false;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);
@ -139,7 +139,7 @@ namespace Server.Engines.MLQuests.Definitions
{
Title = "the Bride";
Race = Race.Human;
BodyValue = 0x191;
Body = 0x191;
Female = true;
Hue = Race.RandomSkinHue();
InitStats(100, 100, 25);

View file

@ -299,7 +299,7 @@ namespace Server.Mobiles
public void CloneBody(Mobile from)
{
Name = from.Name;
BodyValue = from.BodyValue;
Body = from.Body;
Female = from.Female;
HairItemID = from.HairItemID;
FacialHairItemID = from.FacialHairItemID;

View file

@ -1019,12 +1019,12 @@ namespace Server.Gumps
{
if (m_Vendor.Female)
{
m_Vendor.BodyValue = 400;
m_Vendor.Body = 400;
m_Vendor.Female = false;
}
else
{
m_Vendor.BodyValue = 401;
m_Vendor.Body = 401;
m_Vendor.Female = true;
m_Vendor.FacialHairItemID = 0;

View file

@ -471,13 +471,32 @@ namespace Server.Gumps
private static bool HasAttribute(Type type, Type check, bool inherit) =>
type.GetCustomAttributes(check, inherit).Length > 0;
private static bool HasImplicitCastTo(Type type, Type check)
{
foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
{
if (method.Name != "op_Implicit" || !IsType(method.ReturnType, check))
{
continue;
}
var parameters = method.GetParameters();
if (parameters.Length == 1 && IsType(parameters[0].ParameterType, type))
{
return true;
}
}
return false;
}
private static bool IsType(Type type, Type check) => type == check || type.IsSubclassOf(check);
private static bool IsType(Type type, Type[] check)
{
for (var i = 0; i < check.Length; ++i)
{
if (IsType(type, check[i]))
if (IsType(type, check[i]) || HasImplicitCastTo(type, check[i]))
{
return true;
}

View file

@ -1,395 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Server.Commands;
using Server.Network;
namespace Server.Gumps
{
public enum ModelBodyType
{
Invalid = -1,
Monsters,
Sea,
Animals,
Human,
Equipment
}
public class SetBodyGump : Gump
{
private const int LabelColor32 = 0xFFFFFF;
private const int SelectedColor32 = 0x8080FF;
private const int TextColor32 = 0xFFFFFF;
private static List<InternalEntry> m_Monster, m_Animal, m_Sea, m_Human;
private readonly Mobile m_Mobile;
private readonly object m_Object;
private readonly List<InternalEntry> m_OurList;
private readonly int m_OurPage;
private readonly ModelBodyType m_OurType;
private readonly PropertyInfo m_Property;
private readonly PropertiesGump m_PropertiesGump;
public SetBodyGump(
PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump,
int ourPage = 0, List<InternalEntry> ourList = null, ModelBodyType ourType = ModelBodyType.Invalid
)
: base(20, 30)
{
m_PropertiesGump = propertiesGump;
m_Property = prop;
m_Mobile = mobile;
m_Object = o;
m_OurPage = ourPage;
m_OurList = ourList;
m_OurType = ourType;
AddPage(0);
AddBackground(0, 0, 525, 328, 5054);
AddImageTiled(10, 10, 505, 20, 0xA40);
AddAlphaRegion(10, 10, 505, 20);
AddImageTiled(10, 35, 505, 283, 0xA40);
AddAlphaRegion(10, 35, 505, 283);
AddTypeButton(10, 10, 1, "Monster", ModelBodyType.Monsters);
AddTypeButton(130, 10, 2, "Animal", ModelBodyType.Animals);
AddTypeButton(250, 10, 3, "Marine", ModelBodyType.Sea);
AddTypeButton(370, 10, 4, "Human", ModelBodyType.Human);
AddImage(480, 12, 0x25EA);
AddImage(497, 12, 0x25E6);
if (ourList == null)
{
AddLabel(15, 40, 0x480, "Choose a body type above.");
}
else if (ourList.Count == 0)
{
AddLabel(15, 40, 0x480, "The server must have UO:3D installed to use this feature.");
}
else
{
for (int i = 0, index = ourPage * 12; i < 12 && index >= 0 && index < ourList.Count; ++i, ++index)
{
var entry = ourList[index];
var itemID = entry.ItemID;
var bounds = ItemBounds.Table[itemID & 0x3FFF];
var x = 15 + i % 4 * 125;
var y = 40 + i / 4 * 93;
AddItem(x + (120 - bounds.Width) / 2 - bounds.X, y + (69 - bounds.Height) / 2 - bounds.Y, itemID);
AddButton(x + 6, y + 66, 0x98D, 0x98D, 7 + index);
x += 6;
y += 67;
AddHtml(x + 0, y - 1, 108, 21, Center(entry.DisplayName));
AddHtml(x + 0, y + 1, 108, 21, Center(entry.DisplayName));
AddHtml(x - 1, y + 0, 108, 21, Center(entry.DisplayName));
AddHtml(x + 1, y + 0, 108, 21, Center(entry.DisplayName));
AddHtml(x + 0, y + 0, 108, 21, Color(Center(entry.DisplayName), TextColor32));
}
if (ourPage > 0)
{
AddButton(480, 12, 0x15E3, 0x15E7, 5);
}
if ((ourPage + 1) * 12 < ourList.Count)
{
AddButton(497, 12, 0x15E1, 0x15E5, 6);
}
}
}
public string Center(string text) => $"<CENTER>{text}</CENTER>";
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
public void AddTypeButton(int x, int y, int buttonID, string text, ModelBodyType type)
{
var isSelection = m_OurType == type;
AddButton(x, y - 1, isSelection ? 4006 : 4005, 4007, buttonID);
AddHtml(x + 35, y, 200, 20, Color(text, isSelection ? SelectedColor32 : LabelColor32));
}
public override void OnResponse(NetState sender, RelayInfo info)
{
var index = info.ButtonID - 1;
if (index == -1)
{
m_PropertiesGump.SendPropertiesGump();
}
else if (index >= 0 && index < 4)
{
if (m_Monster == null)
{
LoadLists();
}
ModelBodyType type;
List<InternalEntry> list;
switch (index)
{
default:
type = ModelBodyType.Monsters;
list = m_Monster;
break;
case 1:
type = ModelBodyType.Animals;
list = m_Animal;
break;
case 2:
type = ModelBodyType.Sea;
list = m_Sea;
break;
case 3:
type = ModelBodyType.Human;
list = m_Human;
break;
}
m_Mobile.SendGump(new SetBodyGump(m_Property, m_Mobile, m_Object, m_PropertiesGump, 0, list, type));
}
else if (m_OurList != null)
{
index -= 4;
if (index == 0 && m_OurPage > 0)
{
m_Mobile.SendGump(
new SetBodyGump(
m_Property,
m_Mobile,
m_Object,
m_PropertiesGump,
m_OurPage - 1,
m_OurList,
m_OurType
)
);
}
else if (index == 1 && (m_OurPage + 1) * 12 < m_OurList.Count)
{
m_Mobile.SendGump(
new SetBodyGump(
m_Property,
m_Mobile,
m_Object,
m_PropertiesGump,
m_OurPage + 1,
m_OurList,
m_OurType
)
);
}
else
{
index -= 2;
if (index >= 0 && index < m_OurList.Count)
{
try
{
var entry = m_OurList[index];
CommandLogging.LogChangeProperty(m_Mobile, m_Object, m_Property.Name, entry.Body.ToString());
m_Property.SetValue(m_Object, entry.Body, null);
m_PropertiesGump.OnValueChanged(m_Object, m_Property);
}
catch
{
m_Mobile.SendMessage("An exception was caught. The property may not have changed.");
}
m_Mobile.SendGump(
new SetBodyGump(
m_Property,
m_Mobile,
m_Object,
m_PropertiesGump,
m_OurPage,
m_OurList,
m_OurType
)
);
}
}
}
}
public static List<BodyEntry> LoadBodies()
{
var list = new List<BodyEntry>();
var path = Path.Combine(Core.BaseDirectory, "Data/models.txt");
if (File.Exists(path))
{
using var ip = new StreamReader(path);
string line;
while ((line = ip.ReadLine()) != null)
{
line = line.Trim();
if (line.Length == 0 || line.StartsWithOrdinal("#"))
{
continue;
}
var split = line.Split('\t');
if (split.Length >= 9)
{
Body body = Utility.ToInt32(split[0]);
var type = (ModelBodyType)Utility.ToInt32(split[1]);
var name = split[8];
var entry = new BodyEntry(body, type, name);
if (!list.Contains(entry))
{
list.Add(entry);
}
}
}
}
return list;
}
private static void LoadLists()
{
m_Monster = new List<InternalEntry>();
m_Animal = new List<InternalEntry>();
m_Sea = new List<InternalEntry>();
m_Human = new List<InternalEntry>();
var entries = LoadBodies();
for (var i = 0; i < entries.Count; ++i)
{
var oldEntry = entries[i];
var bodyID = oldEntry.Body.BodyID;
if (((Body)bodyID).IsEmpty)
{
continue;
}
List<InternalEntry> list;
switch (oldEntry.BodyType)
{
default: continue;
case ModelBodyType.Monsters:
list = m_Monster;
break;
case ModelBodyType.Animals:
list = m_Animal;
break;
case ModelBodyType.Sea:
list = m_Sea;
break;
case ModelBodyType.Human:
list = m_Human;
break;
}
var itemID = ShrinkTable.Lookup(bodyID, -1);
if (itemID != -1)
{
list.Add(new InternalEntry(bodyID, itemID, oldEntry.Name));
}
}
m_Monster.Sort();
m_Animal.Sort();
m_Sea.Sort();
m_Human.Sort();
}
public class InternalEntry : IComparable<InternalEntry>
{
private static readonly string[] m_GroupNames =
{
"ogres_", "ettins_", "walking_dead_", "gargoyles_",
"orcs_", "flails_", "daemons_", "arachnids_",
"dragons_", "elementals_", "serpents_", "gazers_",
"liche_", "spirits_", "harpies_", "headless_",
"lizard_race_", "mongbat_", "rat_race_", "scorpions_",
"trolls_", "slimes_", "skeletons_", "ethereals_",
"terathan_", "imps_", "cyclops_", "krakens_",
"frogs_", "ophidians_", "centaurs_", "mages_",
"fey_race_", "genies_", "paladins_", "shadowlords_",
"succubi_", "lizards_", "rodents_", "birds_",
"bovines_", "bruins_", "canines_", "deer_",
"equines_", "felines_", "fowl_", "gorillas_",
"kirin_", "llamas_", "ostards_", "porcines_",
"ruminants_", "walrus_", "dolphins_", "sea_horse_",
"sea_serpents_", "character_", "h_", "titans_"
};
public InternalEntry(int body, int itemID, string name)
{
Body = body;
ItemID = itemID;
Name = name;
DisplayName = name.ToLower();
for (var i = 0; i < m_GroupNames.Length; ++i)
{
if (DisplayName.StartsWithOrdinal(m_GroupNames[i]))
{
DisplayName = DisplayName[m_GroupNames[i].Length..];
break;
}
}
DisplayName = DisplayName.Replace('_', ' ');
}
public int Body { get; }
public int ItemID { get; }
public string Name { get; }
public string DisplayName { get; }
public int CompareTo(InternalEntry comp)
{
var v = string.CompareOrdinal(Name, comp.Name);
return v == 0 ? Body.CompareTo(comp.Body) : v;
}
}
public record BodyEntry
{
public BodyEntry(Body body, ModelBodyType bodyType, string name)
{
Body = body;
BodyType = bodyType;
Name = name;
}
public Body Body { get; }
public ModelBodyType BodyType { get; }
public string Name { get; }
}
}
}

View file

@ -19,7 +19,7 @@ namespace Server.Gumps
private readonly Mobile m_Mobile;
private readonly object m_Object;
private readonly PropertyInfo m_Property;
private PropertiesGump m_PropertiesGump;
private readonly PropertiesGump m_PropertiesGump;
public SetGump(PropertyInfo prop, Mobile from, object o, PropertiesGump propertiesGump) : base(GumpOffsetX, GumpOffsetY)
{
@ -30,7 +30,6 @@ namespace Server.Gumps
var canNull = !prop.PropertyType.IsValueType;
var canDye = prop.IsDefined(typeof(HueAttribute), false);
var isBody = prop.IsDefined(typeof(BodyAttribute), false);
var val = prop.GetValue(m_Object, null);
var initialText = val switch
@ -46,16 +45,14 @@ namespace Server.Gumps
0,
0,
BackWidth,
BackHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0) +
(isBody ? EntryHeight + OffsetSize : 0),
BackHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0),
BackGumpID
);
AddImageTiled(
BorderSize,
BorderSize,
TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0),
TotalHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0) +
(isBody ? EntryHeight + OffsetSize : 0),
TotalHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0),
OffsetGumpID
);
@ -118,23 +115,6 @@ namespace Server.Gumps
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 3);
}
if (isBody)
{
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID);
AddLabelCropped(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, "Body Picker");
x += EntryWidth + OffsetSize;
if (SetGumpID != 0)
{
AddImageTiled(x, y, SetWidth, EntryHeight, SetGumpID);
}
AddButton(x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, 4);
}
}
@ -186,16 +166,6 @@ namespace Server.Gumps
m_Mobile.SendHuePicker(new InternalPicker(m_Property, m_Mobile, m_Object, m_PropertiesGump));
break;
}
case 4: // Body Picker
{
toSet = null;
shouldSet = false;
shouldSend = false;
m_Mobile.SendGump(new SetBodyGump(m_Property, m_Mobile, m_Object, m_PropertiesGump));
break;
}
default:

View file

@ -107,7 +107,7 @@ namespace Server.Engines.Events
}
twin.Hue = m_From.Hue;
twin.BodyValue = m_From.BodyValue;
twin.Body = m_From.Body;
twin.Kills = m_From.Kills;
var point = RandomPointOneAway(m_From.X, m_From.Y, m_From.Z, m_From.Map);

View file

@ -56,19 +56,19 @@ namespace Server.Mobiles
{
case 0:
{
BodyValue = 116;
Body = 116;
ItemID = 16039;
break;
}
case 1:
{
BodyValue = 178;
Body = 178;
ItemID = 16041;
break;
}
case 2:
{
BodyValue = 179;
Body = 179;
ItemID = 16055;
break;
}

View file

@ -107,13 +107,13 @@ namespace Server.Mobiles
if (m_HasBarding)
{
Hue = CraftResources.GetHue(m_BardingResource);
BodyValue = 0x31F;
Body = 0x31F;
ItemID = 0x3EBE;
}
else
{
Hue = 0x851;
BodyValue = 0x31A;
Body = 0x31A;
ItemID = 0x3EBD;
}

View file

@ -49,7 +49,7 @@ namespace Server.Mobiles
public override string CorpseName => "a pestilent bandage corpse";
// Neither Stratics nor UOGuide have much description
// beyond being a "Grey Mummy". BodyValue, Sound and
// beyond being a "Grey Mummy". Body, Sound and
// Hue are all guessed until they can be verified.
// Loot and Fame/Karma are also guesses at this point.
//

View file

@ -51,7 +51,7 @@ namespace Server.Mobiles
public Harrower() : base(AIType.AI_Mage, FightMode.Closest, 18, 1, 0.2, 0.4)
{
Instances.Add(this);
BodyValue = 146;
Body = 146;
SetStr(900, 1000);
SetDex(125, 135);
@ -145,7 +145,7 @@ namespace Server.Mobiles
m_TrueForm = true;
Name = "the true harrower";
BodyValue = 780;
Body = 780;
Hue = 0x497;
Hits = HitsMax;

View file

@ -206,7 +206,7 @@ namespace Server.Mobiles
{
base.InitBody();
if (BodyValue == 0x340 || BodyValue == 0x402)
if (Body == 0x340 || Body == 0x402)
{
Hue = 0;
}
@ -1050,7 +1050,7 @@ namespace Server.Mobiles
AddButton(130, 120, 4005, 4007, GetButtonID(5, 0));
AddHtml(170, 120, 120, 20, "Title");
if (m_Barkeeper.BodyValue != 0x340 && m_Barkeeper.BodyValue != 0x402)
if (m_Barkeeper.Body != 0x340 && m_Barkeeper.Body != 0x402)
{
AddButton(130, 200, 4005, 4007, GetButtonID(5, 1));
AddHtml(170, 200, 120, 20, "Appearance");

View file

@ -79,7 +79,6 @@ namespace Server
OfByte
};
public static readonly Type[] ParseTypes = { OfString };
public static bool IsSerial(Type t) => t == OfSerial;