From 408a343e0c3264137faa279ec0b7ffb87ab3553d Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 26 Aug 2021 19:11:16 -0700 Subject: [PATCH] Fix: Fixes evil mages so they look correct for T2A/UOTD (#735) --- .../Server.Mobiles.EvilMage.v0.json | 4 ++ .../Server.Mobiles.EvilMageLord.v0.json | 4 ++ .../Monsters/Humanoid/Magic/EvilMage.cs | 43 ++++++++++------- .../Monsters/Humanoid/Magic/EvilMageLord.cs | 48 ++++++++++++------- 4 files changed, 65 insertions(+), 34 deletions(-) create mode 100644 Projects/UOContent/Migrations/Server.Mobiles.EvilMage.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Mobiles.EvilMageLord.v0.json diff --git a/Projects/UOContent/Migrations/Server.Mobiles.EvilMage.v0.json b/Projects/UOContent/Migrations/Server.Mobiles.EvilMage.v0.json new file mode 100644 index 000000000..ebc9ceda0 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Mobiles.EvilMage.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Mobiles.EvilMage" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Mobiles.EvilMageLord.v0.json b/Projects/UOContent/Migrations/Server.Mobiles.EvilMageLord.v0.json new file mode 100644 index 000000000..3dac1cf14 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Mobiles.EvilMageLord.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Mobiles.EvilMageLord" +} \ No newline at end of file diff --git a/Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMage.cs b/Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMage.cs index 28529129f..508ee434b 100644 --- a/Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMage.cs +++ b/Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMage.cs @@ -2,14 +2,15 @@ using Server.Items; namespace Server.Mobiles { - public class EvilMage : BaseCreature + [Serializable(0, false)] + public partial class EvilMage : BaseCreature { [Constructible] public EvilMage() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4) { Name = NameList.RandomName("evil mage"); Title = "the evil mage"; - Body = 124; + Body = Core.UOR ? 124 : 0x190; SetStr(81, 105); SetDex(91, 115); @@ -37,12 +38,8 @@ namespace Server.Mobiles VirtualArmor = 16; PackReg(6); - PackItem(new Robe(Utility.RandomNeutralHue())); // TODO: Proper hue - PackItem(new Sandals()); - } - - public EvilMage(Serial serial) : base(serial) - { + EquipItem(new Robe(Utility.RandomNeutralHue())); + EquipItem(new Sandals()); } public override string CorpseName => "an evil mage corpse"; @@ -58,16 +55,30 @@ namespace Server.Mobiles AddLoot(LootPack.MedScrolls); } - public override void Serialize(IGenericWriter writer) + [AfterDeserialization] + private void AfterDeserialization() { - base.Serialize(writer); - writer.Write(0); - } + if (Core.UOR) + { + if (Body == 0x190) + { + Body = 124; + } - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - var version = reader.ReadInt(); + if (Hue != 0) + { + Hue = 0; + } + } + else if (Body == 124) + { + Body = 0x190; + + if (Hue == 0) + { + Hue = Race.Human.RandomSkinHue(); + } + } } } } diff --git a/Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMageLord.cs b/Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMageLord.cs index 508da8ef4..897983ebe 100644 --- a/Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMageLord.cs +++ b/Projects/UOContent/Mobiles/Monsters/Humanoid/Magic/EvilMageLord.cs @@ -2,16 +2,18 @@ using Server.Items; namespace Server.Mobiles { - public class EvilMageLord : BaseCreature + [Serializable(0, false)] + public partial class EvilMageLord : BaseCreature { [Constructible] public EvilMageLord() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4) { Name = NameList.RandomName("evil mage lord"); - Body = Utility.RandomList(125, 126); + Body = Core.UOR ? Utility.Random(125, 2) : 0x190; + Hue = Core.UOR ? 0 : Race.Human.RandomSkinHue(); - PackItem(new Robe(Utility.RandomMetalHue())); - PackItem(new WizardsHat(Utility.RandomMetalHue())); + EquipItem(new Robe(Utility.RandomMetalHue())); + EquipItem(new WizardsHat(Utility.RandomMetalHue())); SetStr(81, 105); SetDex(191, 215); @@ -43,18 +45,14 @@ namespace Server.Mobiles PackReg(23); if (Utility.RandomBool()) { - PackItem(new Shoes()); + EquipItem(new Shoes()); } else { - PackItem(new Sandals()); + EquipItem(new Sandals()); } } - public EvilMageLord(Serial serial) : base(serial) - { - } - public override string CorpseName => "an evil mage lord corpse"; public override bool CanRummageCorpses => true; @@ -69,16 +67,30 @@ namespace Server.Mobiles AddLoot(LootPack.MedScrolls, 2); } - public override void Serialize(IGenericWriter writer) + [AfterDeserialization] + private void AfterDeserialization() { - base.Serialize(writer); - writer.Write(0); - } + if (Core.UOR) + { + if (Body == 0x190) + { + Body = Utility.Random(125, 2); + } - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - var version = reader.ReadInt(); + if (Hue != 0) + { + Hue = 0; + } + } + else if (Body.BodyID is 125 or 126) + { + Body = 0x190; + + if (Hue == 0) + { + Hue = Race.Human.RandomSkinHue(); + } + } } } }