fix: Fixes strength potion candrink check (#1863)

This commit is contained in:
Kamron Batman 2024-07-06 16:49:23 -07:00 committed by GitHub
parent 38731d98b6
commit 20855ddff3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,7 @@ public abstract partial class BaseStrengthPotion : BasePotion
public abstract int StrOffset { get; } public abstract int StrOffset { get; }
public abstract TimeSpan Duration { get; } public abstract TimeSpan Duration { get; }
public bool CanDrink(Mobile from) public override bool CanDrink(Mobile from)
{ {
if (!base.CanDrink(from)) if (!base.CanDrink(from))
{ {
@ -22,15 +22,15 @@ public abstract partial class BaseStrengthPotion : BasePotion
} }
// TODO: Verify scaled; is it offset, duration, or both? // TODO: Verify scaled; is it offset, duration, or both?
if (SpellHelper.AddStatOffset(from, StatType.Str, Scale(from, StrOffset), Duration)) if (!SpellHelper.AddStatOffset(from, StatType.Str, Scale(from, StrOffset), Duration))
{ {
from.FixedEffect(0x375A, 10, 15); from.SendLocalizedMessage(502173); // You are already under a similar effect.
from.PlaySound(0x1E7); return false;
return true;
} }
from.SendLocalizedMessage(502173); // You are already under a similar effect. from.FixedEffect(0x375A, 10, 15);
return false; from.PlaySound(0x1E7);
return true;
} }
public override void Drink(Mobile from) public override void Drink(Mobile from)