fix: Codegens potions and fixes a few minor bugs (#1347)
This commit is contained in:
parent
42bcf3c95a
commit
8c4aaeeda6
76 changed files with 1644 additions and 2095 deletions
|
|
@ -1,50 +1,33 @@
|
|||
using ModernUO.Serialization;
|
||||
using Server.Engines.ConPVP;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BaseRefreshPotion : BasePotion
|
||||
{
|
||||
public abstract class BaseRefreshPotion : BasePotion
|
||||
public BaseRefreshPotion(PotionEffect effect) : base(0xF0B, effect)
|
||||
{
|
||||
public BaseRefreshPotion(PotionEffect effect) : base(0xF0B, effect)
|
||||
}
|
||||
|
||||
public abstract double Refresh { get; }
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (from.Stam < from.StamMax)
|
||||
{
|
||||
}
|
||||
from.Stam += Scale(from, (int)(Refresh * from.StamMax));
|
||||
|
||||
public BaseRefreshPotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
PlayDrinkEffect(from);
|
||||
|
||||
public abstract double Refresh { get; }
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (from.Stam < from.StamMax)
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
from.Stam += Scale(from, (int)(Refresh * from.StamMax));
|
||||
|
||||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You decide against drinking this potion, as you are already at full stamina.");
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You decide against drinking this potion, as you are already at full stamina.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue