ModernUO/Projects/UOContent/Mobiles/Monsters/ML/Bedlam/MasterTheophilus.cs
Kamron Batman 410a964789
fix: NPC outfits no longer stack two items on one layer (#2715)
Companion to #2712, which covers HireRanger's refused `EquipItem`. A sweep that built every constructible Mobile 2,000 times under each expansion found these other outfits that put two items on one layer. They don't leak, because `AddItem` skips `CheckEquip`, but the NPC wears both items and the client draws only one.

| NPC | Conflict |
|---|---|
| Miner, Ranger, Thief | Own shirt/pants/ThighBoots added on top of the random `BaseVendor.InitOutfit` (shoes doubled on every spawn) |
| MasterTheophilus | Shoes + Robe added over `EvilMageLord`'s Sandals + Robe |
| Merchant | Shirt + FancyShirt, or PlainDress + FancyDress |
| IronWorker | Bandana/JesterHat + Bascinet |
| MeerCaptain | One-handed sword + Crossbow |
| BakeKitsune | `BodyMod` isn't saved, so after a restart `RemoveDisguise` bailed and the next `Disguise()` stacked a second robe and pair of shoes |

## Changes
- `BaseCreature.ReplaceEquipment(item)` equips an item in place of whatever an inherited outfit put on its layer, and deletes the item if it still can't be equipped.
- Miner, Ranger, Thief, MasterTheophilus: their own pieces replace the inherited ones.
- Merchant and IronWorker: dropped the duplicate roll. Each kept the item the client was already drawing, which is the last one sent: the fancy set and the Bascinet.
- MeerCaptain: the sword goes into its pack as loot. **Behavior change:** `Mobile.Weapon` checks the one-handed layer first, so it was fighting with the sword despite its archer AI, its Archery skill and the bolts in its pack. It now uses the crossbow.
- BakeKitsune: `RemoveDisguise` strips the disguise without checking `IsBodyMod`.

## Testing
- I re-ran the sweep (local diagnostic, not committed; needs client tiledata) at 500 rolls × 12 expansions. Only HireRanger (#2712) and LordOaks (separate fix coming) remain.
- UOContent.Tests: 1218 passed, 2 skipped.
2026-10-17 16:17:11 -07:00

78 lines
2.2 KiB
C#

using ModernUO.Serialization;
using Server.Items;
namespace Server.Mobiles
{
[SerializationGenerator(0, false)]
public partial class MasterTheophilus : EvilMageLord
{
[Constructible]
public MasterTheophilus()
{
IsParagon = true;
Title = "the necromancer";
Hue = 0;
SetStr(137, 187);
SetDex(253, 301);
SetInt(393, 444);
SetHits(663, 876);
SetDamage(15, 20);
SetDamageType(ResistanceType.Physical, 100);
SetResistance(ResistanceType.Physical, 55, 60);
SetResistance(ResistanceType.Fire, 50, 58);
SetResistance(ResistanceType.Cold, 50, 60);
SetResistance(ResistanceType.Poison, 50, 60);
SetResistance(ResistanceType.Energy, 50, 60);
SetSkill(SkillName.Wrestling, 69.9, 105.3);
SetSkill(SkillName.Tactics, 113.0, 117.9);
SetSkill(SkillName.MagicResist, 127.0, 132.8);
SetSkill(SkillName.Magery, 138.1, 143.7);
SetSkill(SkillName.EvalInt, 125.6, 133.8);
SetSkill(SkillName.Necromancy, 125.6, 133.8);
SetSkill(SkillName.SpiritSpeak, 125.6, 133.8);
SetSkill(SkillName.Meditation, 128.8, 132.9);
Fame = 18000;
Karma = -18000;
ReplaceEquipment(new Shoes(0x537));
ReplaceEquipment(new Robe(0x452));
for (var i = 0; i < 2; ++i)
{
if (Utility.RandomBool())
{
PackNecroScroll(Utility.RandomMinMax(5, 9));
}
else
{
PackScroll(4, 7);
}
}
PackReg(7);
PackReg(7);
PackReg(8);
}
public override string CorpseName => "a Master Theophilus corpse";
public override string DefaultName => "Master Theophilus";
public override bool GivesMLMinorArtifact => true;
public override int TreasureMapLevel => 5;
public override void GenerateLoot()
{
AddLoot(LootPack.UltraRich, 3);
}
public override WeaponAbility GetWeaponAbility() => WeaponAbility.ParalyzingBlow;
}
}