fix: Fixes blood oath duration (#2027)

This commit is contained in:
Kamron Batman 2024-12-18 08:41:52 -08:00 committed by GitHub
parent e27773e3d9
commit 059f008b48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,7 +80,7 @@ public class BloodOathSpell : NecromancerSpell, ITargetingSpell<Mobile>
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<Mobile>
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<Mobile>
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<Mobile>
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);
}