fix: Timer Remaining Count off by 1 fix (#2046)
This commit is contained in:
parent
1586a8e6ba
commit
57a7861d5e
2 changed files with 16 additions and 12 deletions
|
|
@ -295,7 +295,13 @@ public abstract partial class BaseExplosionPotion : BasePotion
|
||||||
|
|
||||||
var parent = _potion.FindParent(_from);
|
var parent = _potion.FindParent(_from);
|
||||||
|
|
||||||
if (RemainingCount == 0)
|
if (RemainingCount > 3)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remaining decrements after OnTick so it is off by 1
|
||||||
|
if (RemainingCount <= 1)
|
||||||
{
|
{
|
||||||
Point3D loc;
|
Point3D loc;
|
||||||
Map map;
|
Map map;
|
||||||
|
|
@ -317,16 +323,13 @@ public abstract partial class BaseExplosionPotion : BasePotion
|
||||||
|
|
||||||
_potion.Explode(_from, true, loc, map);
|
_potion.Explode(_from, true, loc, map);
|
||||||
}
|
}
|
||||||
else if (RemainingCount <= 3)
|
else if (parent is Item item)
|
||||||
{
|
{
|
||||||
if (parent is Item item)
|
item.PublicOverheadMessage(MessageType.Regular, 0x22, false, RemainingCount.ToString());
|
||||||
{
|
}
|
||||||
item.PublicOverheadMessage(MessageType.Regular, 0x22, false, RemainingCount.ToString());
|
else if (parent is Mobile mobile)
|
||||||
}
|
{
|
||||||
else if (parent is Mobile mobile)
|
mobile.PublicOverheadMessage(MessageType.Regular, 0x22, false, RemainingCount.ToString());
|
||||||
{
|
|
||||||
mobile.PublicOverheadMessage(MessageType.Regular, 0x22, false, RemainingCount.ToString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,14 +62,15 @@ public abstract class MonsterAbilitySingleTargetDoT : MonsterAbilitySingleTarget
|
||||||
|
|
||||||
protected override void OnTick()
|
protected override void OnTick()
|
||||||
{
|
{
|
||||||
var delay = RemainingCount == 0
|
var delay = RemainingCount <= 1
|
||||||
? TimeSpan.MinValue
|
? TimeSpan.MinValue
|
||||||
: Utility.RandomMinMax(_ability.MinDelay, _ability.MaxDelay);
|
: Utility.RandomMinMax(_ability.MinDelay, _ability.MaxDelay);
|
||||||
|
|
||||||
_ability.EffectTick(_source, _defender, ref delay);
|
_ability.EffectTick(_source, _defender, ref delay);
|
||||||
Interval = delay;
|
Interval = delay;
|
||||||
|
|
||||||
if (RemainingCount == 0)
|
// Remaining decrements after OnTick so it is off by 1
|
||||||
|
if (RemainingCount <= 1)
|
||||||
{
|
{
|
||||||
_ability.RemoveEffect(_source, _defender);
|
_ability.RemoveEffect(_source, _defender);
|
||||||
_ability.OnEffectExpired(_source, _defender);
|
_ability.OnEffectExpired(_source, _defender);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue