Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixes EvilMage/Lord spawning naked, without hair #1755

Merged
merged 2 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading