Skip to content

Commit

Permalink
fix: Fixes EvilMage/Lord spawning naked, without hair (#1755)
Browse files Browse the repository at this point in the history
  • Loading branch information
bohica89 committed May 4, 2024
1 parent 4ea1d79 commit af67c48
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 36 deletions.
37 changes: 23 additions & 14 deletions Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ public EvilMage() : base(AIType.AI_Mage)
{
Name = NameList.RandomName("evil mage");
Title = "the evil mage";
Body = Core.UOR ? 124 : 0x190;
if (Core.UOR)
{
Body = 124;
}
else
{
Body = 0x190;
Hue = Race.Human.RandomSkinHue();
Utility.AssignRandomHair(this);
Utility.AssignRandomFacialHair(this, HairHue);
}

SetStr(81, 105);
SetDex(91, 115);
Expand Down Expand Up @@ -39,8 +49,9 @@ public EvilMage() : base(AIType.AI_Mage)

VirtualArmor = 16;
PackReg(6);
PackItem(new Robe(Utility.RandomNeutralHue()));
PackItem(new Sandals());

EquipItem(new Robe(Utility.RandomNeutralHue()));
EquipItem(new Sandals());
}

public override string CorpseName => "an evil mage corpse";
Expand All @@ -63,22 +74,20 @@ private void AfterDeserialization()
{
if (Body == 0x190)
{
Body = 124;
}

if (Hue != 0)
{
Body = Utility.Random(125, 2);
HairItemID = 0;
HairHue = 0;
FacialHairItemID = 0;
FacialHairItemID = 0;
Hue = 0;
}
}
else if (Body == 124)
else if (Body.BodyID is 125 or 126)
{
Body = 0x190;

if (Hue == 0)
{
Hue = Race.Human.RandomSkinHue();
}
Hue = Race.Human.RandomSkinHue();
Utility.AssignRandomHair(this);
Utility.AssignRandomFacialHair(this, HairHue);
}
}
}
Expand Down
44 changes: 22 additions & 22 deletions Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMageLord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ public partial class EvilMageLord : BaseCreature
public EvilMageLord() : base(AIType.AI_Mage)
{
Name = NameList.RandomName("evil mage lord");
Body = Core.UOR ? Utility.Random(125, 2) : 0x190;
Hue = Core.UOR ? 0 : Race.Human.RandomSkinHue();
if (Core.UOR)
{
Body = Utility.Random(125, 2);
}
else
{
Body = 0x190;
Hue = Race.Human.RandomSkinHue();
Utility.AssignRandomHair(this);
Utility.AssignRandomFacialHair(this, HairHue);
}

SetStr(81, 105);
SetDex(191, 215);
Expand Down Expand Up @@ -42,17 +51,10 @@ public EvilMageLord() : base(AIType.AI_Mage)
VirtualArmor = 16;
PackReg(23);

PackItem(new Robe(Utility.RandomMetalHue()));
PackItem(new WizardsHat(Utility.RandomMetalHue()));

if (Utility.RandomBool())
{
PackItem(new Shoes());
}
else
{
PackItem(new Sandals());
}
var hue = Utility.RandomNeutralHue();
EquipItem(new Robe(hue));
EquipItem(new WizardsHat(hue));
EquipItem(new Sandals());
}

public override string CorpseName => "an evil mage lord corpse";
Expand All @@ -77,21 +79,19 @@ private void AfterDeserialization()
if (Body == 0x190)
{
Body = Utility.Random(125, 2);
}

if (Hue != 0)
{
HairItemID = 0;
HairHue = 0;
FacialHairItemID = 0;
FacialHairItemID = 0;
Hue = 0;
}
}
else if (Body.BodyID is 125 or 126)
{
Body = 0x190;

if (Hue == 0)
{
Hue = Race.Human.RandomSkinHue();
}
Hue = Race.Human.RandomSkinHue();
Utility.AssignRandomHair(this);
Utility.AssignRandomFacialHair(this, HairHue);
}
}
}
Expand Down

0 comments on commit af67c48

Please sign in to comment.