ModernUO/Projects/UOContent/Mobiles/Healers/Healer.cs
Jack 6745cf2075
feat: Adds Mobile.Murderer virtual property, consolidates kill-threshold checks (#2355)
## Summary

- Adds `public virtual bool Murderer => Kills >= 5` property to `Mobile`, replacing ~30 scattered `Kills >= 5` / `Kills < 5` magic-number checks across the codebase
- `BaseCreature` overrides `Murderer` to also return `true` when `AlwaysMurderer` is set
- Updates `Corpse` serialization to v15, storing `_murderer` as a `bool` field (migrated from `int Kills >= 5` in earlier versions)
2026-03-06 08:36:41 -08:00

64 lines
1.5 KiB
C#

using ModernUO.Serialization;
namespace Server.Mobiles;
[SerializationGenerator(0, false)]
public partial class Healer : BaseHealer
{
[Constructible]
public Healer()
{
Title = "the healer";
if (!Core.AOS)
{
NameHue = 0x35;
}
SetSkill(SkillName.Forensics, 80.0, 100.0);
SetSkill(SkillName.SpiritSpeak, 80.0, 100.0);
SetSkill(SkillName.Swords, 80.0, 100.0);
}
public override bool CanTeach => true;
public override bool IsActiveVendor => true;
public override bool IsInvulnerable => true;
public override bool CheckTeach(SkillName skill, Mobile from)
{
if (!base.CheckTeach(skill, from))
{
return false;
}
return skill is SkillName.Forensics or SkillName.Healing or SkillName.SpiritSpeak or SkillName.Swords;
}
public override void InitSBInfo()
{
SBInfos.Add(new SBHealer());
}
public override bool CheckResurrect(Mobile m)
{
if (m.Criminal)
{
Say(501222); // Thou art a criminal. I shall not resurrect thee.
return false;
}
if (m.Murderer)
{
Say(501223); // Thou'rt not a decent and good person. I shall not resurrect thee.
return false;
}
if (m.Karma < 0)
{
Say(501224); // Thou hast strayed from the path of virtue, but thou still deservest a second chance.
}
return true;
}
}