diff --git a/Projects/UOContent/Spells/Necromancy/BloodOathSpell.cs b/Projects/UOContent/Spells/Necromancy/BloodOathSpell.cs index 5ccf49ea4..bc3903dd3 100644 --- a/Projects/UOContent/Spells/Necromancy/BloodOathSpell.cs +++ b/Projects/UOContent/Spells/Necromancy/BloodOathSpell.cs @@ -80,7 +80,7 @@ public class BloodOathSpell : NecromancerSpell, ITargetingSpell m.FixedParticles(0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist); m.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255); - var duration = TimeSpan.FromSeconds((GetDamageSkill(Caster) - GetResistSkill(m)) / 8 + 8); + var duration = TimeSpan.FromSeconds((GetDamageSkill(Caster) - GetResistSkill(m)) / 80 + 8); m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain var timer = new ExpireTimer(Caster, m, duration); @@ -101,28 +101,28 @@ public class BloodOathSpell : NecromancerSpell, ITargetingSpell public static bool RemoveCurse(Mobile target) { - if (_table.Remove(target, out var timer)) + if (!_table.Remove(target, out var timer)) { - var caster = timer.Caster; - if (_oathTable.Remove(caster)) - { - caster.SendLocalizedMessage(1061620); // Your Blood Oath has been broken. - } - - if (_oathTable.Remove(target)) - { - target.SendLocalizedMessage(1061620); // Your Blood Oath has been broken. - } - - timer.Stop(); - - BuffInfo.RemoveBuff(caster, BuffIcon.BloodOathCaster); - BuffInfo.RemoveBuff(target, BuffIcon.BloodOathCurse); - - return true; + return false; } - return false; + var caster = timer.Caster; + if (_oathTable.Remove(caster)) + { + caster.SendLocalizedMessage(1061620); // Your Blood Oath has been broken. + } + + if (_oathTable.Remove(target)) + { + target.SendLocalizedMessage(1061620); // Your Blood Oath has been broken. + } + + timer.Stop(); + + BuffInfo.RemoveBuff(caster, BuffIcon.BloodOathCaster); + BuffInfo.RemoveBuff(target, BuffIcon.BloodOathCurse); + + return true; } public static Mobile GetBloodOath(Mobile m) => @@ -130,8 +130,8 @@ public class BloodOathSpell : NecromancerSpell, ITargetingSpell private class ExpireTimer : Timer { - private Mobile _target; - private DateTime _end; + private readonly Mobile _target; + private readonly DateTime _end; public Mobile Caster { get; } @@ -147,8 +147,7 @@ public class BloodOathSpell : NecromancerSpell, ITargetingSpell protected override void OnTick() { - if (Caster.Deleted || _target.Deleted || !Caster.Alive || !_target.Alive || - Core.Now >= _end) + if (Caster.Deleted || _target.Deleted || !Caster.Alive || !_target.Alive || Core.Now >= _end) { RemoveCurse(_target); }