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,53 +1,36 @@
|
|||
using ModernUO.Serialization;
|
||||
using Server.Engines.ConPVP;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class NightSightPotion : BasePotion
|
||||
{
|
||||
public class NightSightPotion : BasePotion
|
||||
[Constructible]
|
||||
public NightSightPotion() : base(0xF06, PotionEffect.Nightsight)
|
||||
{
|
||||
[Constructible]
|
||||
public NightSightPotion() : base(0xF06, PotionEffect.Nightsight)
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (from.BeginAction<LightCycle>())
|
||||
{
|
||||
}
|
||||
new LightCycle.NightSightTimer(from).Start();
|
||||
from.LightLevel = LightCycle.DungeonLevel / 2;
|
||||
|
||||
public NightSightPotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
|
||||
from.PlaySound(0x1E3);
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
PlayDrinkEffect(from);
|
||||
|
||||
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.BeginAction<LightCycle>())
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
new LightCycle.NightSightTimer(from).Start();
|
||||
from.LightLevel = LightCycle.DungeonLevel / 2;
|
||||
|
||||
from.FixedParticles(0x376A, 9, 32, 5007, EffectLayer.Waist);
|
||||
from.PlaySound(0x1E3);
|
||||
|
||||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You already have nightsight.");
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You already have nightsight.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue