fix: Codegens potions and fixes a few minor bugs (#1347)

This commit is contained in:
Kamron Batman 2023-02-24 18:06:59 -08:00 committed by GitHub
parent 42bcf3c95a
commit 8c4aaeeda6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 1644 additions and 2095 deletions

View file

@ -1,33 +1,16 @@
using System;
using ModernUO.Serialization;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class AgilityPotion : BaseAgilityPotion
{
public class AgilityPotion : BaseAgilityPotion
[Constructible]
public AgilityPotion() : base(PotionEffect.Agility)
{
[Constructible]
public AgilityPotion() : base(PotionEffect.Agility)
{
}
public AgilityPotion(Serial serial) : base(serial)
{
}
public override int DexOffset => 10;
public override TimeSpan Duration => TimeSpan.FromMinutes(2.0);
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 int DexOffset => 10;
public override TimeSpan Duration => TimeSpan.FromMinutes(2.0);
}

View file

@ -1,60 +1,43 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class BaseAgilityPotion : BasePotion
{
public abstract class BaseAgilityPotion : BasePotion
public BaseAgilityPotion(PotionEffect effect) : base(0xF08, effect)
{
public BaseAgilityPotion(PotionEffect effect) : base(0xF08, effect)
}
public abstract int DexOffset { get; }
public abstract TimeSpan Duration { get; }
public bool DoAgility(Mobile from)
{
// TODO: Verify scaled; is it offset, duration, or both?
if (SpellHelper.AddStatOffset(from, StatType.Dex, Scale(from, DexOffset), Duration))
{
from.FixedEffect(0x375A, 10, 15);
from.PlaySound(0x1E7);
return true;
}
public BaseAgilityPotion(Serial serial) : base(serial)
from.SendLocalizedMessage(502173); // You are already under a similar effect.
return false;
}
public override void Drink(Mobile from)
{
if (DoAgility(from))
{
}
PlayDrinkEffect(from);
public abstract int DexOffset { get; }
public abstract TimeSpan Duration { 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 bool DoAgility(Mobile from)
{
// TODO: Verify scaled; is it offset, duration, or both?
if (SpellHelper.AddStatOffset(from, StatType.Dex, Scale(from, DexOffset), Duration))
if (!DuelContext.IsFreeConsume(from))
{
from.FixedEffect(0x375A, 10, 15);
from.PlaySound(0x1E7);
return true;
}
from.SendLocalizedMessage(502173); // You are already under a similar effect.
return false;
}
public override void Drink(Mobile from)
{
if (DoAgility(from))
{
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
Consume();
}
}
}

View file

@ -1,33 +1,16 @@
using System;
using ModernUO.Serialization;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class GreaterAgilityPotion : BaseAgilityPotion
{
public class GreaterAgilityPotion : BaseAgilityPotion
[Constructible]
public GreaterAgilityPotion() : base(PotionEffect.AgilityGreater)
{
[Constructible]
public GreaterAgilityPotion() : base(PotionEffect.AgilityGreater)
{
}
public GreaterAgilityPotion(Serial serial) : base(serial)
{
}
public override int DexOffset => 20;
public override TimeSpan Duration => TimeSpan.FromMinutes(2.0);
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 int DexOffset => 20;
public override TimeSpan Duration => TimeSpan.FromMinutes(2.0);
}

View file

@ -1,292 +1,241 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Engines.Craft;
using Server.Utilities;
namespace Server.Items
namespace Server.Items;
public enum PotionEffect
{
public enum PotionEffect
Nightsight,
CureLesser,
Cure,
CureGreater,
Agility,
AgilityGreater,
Strength,
StrengthGreater,
PoisonLesser,
Poison,
PoisonGreater,
PoisonDeadly,
Refresh,
RefreshTotal,
HealLesser,
Heal,
HealGreater,
ExplosionLesser,
Explosion,
ExplosionGreater,
Conflagration,
ConflagrationGreater,
MaskOfDeath, // Mask of Death is not available in OSI but does exist in cliloc files
MaskOfDeathGreater, // included in enumeration for compatibility if later enabled by OSI
ConfusionBlast,
ConfusionBlastGreater,
Invisibility,
Parasitic,
Darkglow
}
[SerializationGenerator(2, false)]
public abstract partial class BasePotion : Item, ICraftable, ICommodity
{
[InvalidateProperties]
[SerializableField(0)]
private PotionEffect _potionEffect;
public BasePotion(int itemID, PotionEffect effect) : base(itemID)
{
Nightsight,
CureLesser,
Cure,
CureGreater,
Agility,
AgilityGreater,
Strength,
StrengthGreater,
PoisonLesser,
Poison,
PoisonGreater,
PoisonDeadly,
Refresh,
RefreshTotal,
HealLesser,
Heal,
HealGreater,
ExplosionLesser,
Explosion,
ExplosionGreater,
Conflagration,
ConflagrationGreater,
MaskOfDeath, // Mask of Death is not available in OSI but does exist in cliloc files
MaskOfDeathGreater, // included in enumeration for compatibility if later enabled by OSI
ConfusionBlast,
ConfusionBlastGreater,
Invisibility,
Parasitic,
Darkglow
_potionEffect = effect;
Stackable = Core.ML;
Weight = 1.0;
}
public abstract class BasePotion : Item, ICraftable, ICommodity
public override int LabelNumber => 1041314 + (int)_potionEffect;
public virtual bool RequireFreeHand => true;
int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => Core.ML;
public int OnCraft(
int quality,
bool makersMark,
Mobile from,
CraftSystem craftSystem,
Type typeRes,
BaseTool tool,
CraftItem craftItem,
int resHue
)
{
private PotionEffect m_PotionEffect;
public BasePotion(int itemID, PotionEffect effect) : base(itemID)
if (craftSystem is DefAlchemy)
{
m_PotionEffect = effect;
var pack = from.Backpack;
Stackable = Core.ML;
Weight = 1.0;
}
public BasePotion(Serial serial) : base(serial)
{
}
public PotionEffect PotionEffect
{
get => m_PotionEffect;
set
if (pack != null)
{
m_PotionEffect = value;
InvalidateProperties();
}
}
public override int LabelNumber => 1041314 + (int)m_PotionEffect;
public virtual bool RequireFreeHand => true;
int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => Core.ML;
public int OnCraft(
int quality,
bool makersMark,
Mobile from,
CraftSystem craftSystem,
Type typeRes,
BaseTool tool,
CraftItem craftItem,
int resHue
)
{
if (craftSystem is DefAlchemy)
{
var pack = from.Backpack;
if (pack != null)
if ((int)PotionEffect >= (int)PotionEffect.Invisibility)
{
if ((int)PotionEffect >= (int)PotionEffect.Invisibility)
return 1;
}
var kegs = pack.FindItemsByType<PotionKeg>();
for (var i = 0; i < kegs.Count; ++i)
{
var keg = kegs[i];
if (keg.Held is <= 0 or >= 100)
{
return 1;
continue;
}
var kegs = pack.FindItemsByType<PotionKeg>();
for (var i = 0; i < kegs.Count; ++i)
if (keg.Type != PotionEffect)
{
var keg = kegs[i];
// Should never happen
// if (keg == null)
// continue;
if (keg.Held is <= 0 or >= 100)
{
continue;
}
if (keg.Type != PotionEffect)
{
continue;
}
++keg.Held;
Consume();
from.AddToBackpack(new Bottle());
return -1; // signal placed in keg
continue;
}
++keg.Held;
Consume();
from.AddToBackpack(new Bottle());
return -1; // signal placed in keg
}
}
return 1;
}
public static bool HasFreeHand(Mobile m)
return 1;
}
public static bool HasFreeHand(Mobile m)
{
var handOne = m.FindItemOnLayer(Layer.OneHanded);
var handTwo = m.FindItemOnLayer(Layer.TwoHanded);
if (handTwo is BaseWeapon)
{
var handOne = m.FindItemOnLayer(Layer.OneHanded);
var handTwo = m.FindItemOnLayer(Layer.TwoHanded);
if (handTwo is BaseWeapon)
{
handOne = handTwo;
}
if (handTwo is BaseRanged ranged && ranged.Balanced)
{
return true;
}
return handOne == null || handTwo == null;
handOne = handTwo;
}
public override void OnDoubleClick(Mobile from)
if (handTwo is BaseRanged ranged && ranged.Balanced)
{
if (!Movable)
return true;
}
return handOne == null || handTwo == null;
}
public override void OnDoubleClick(Mobile from)
{
if (!Movable)
{
return;
}
if (!from.InRange(GetWorldLocation(), 1))
{
from.SendLocalizedMessage(502138); // That is too far away for you to use
return;
}
if (RequireFreeHand && !HasFreeHand(from))
{
from.SendLocalizedMessage(502172); // You must have a free hand to drink a potion.
return;
}
if (this is BaseExplosionPotion && Amount > 1)
{
var pot = GetType().CreateInstance<BaseExplosionPotion>();
Amount--;
if (from.Backpack?.Deleted == false)
{
return;
}
if (from.InRange(GetWorldLocation(), 1))
{
if (!RequireFreeHand || HasFreeHand(from))
{
if (this is BaseExplosionPotion && Amount > 1)
{
var pot = GetType().CreateInstance<BaseExplosionPotion>();
Amount--;
if (from.Backpack?.Deleted == false)
{
from.Backpack.DropItem(pot);
}
else
{
pot.MoveToWorld(from.Location, from.Map);
}
pot.Drink(from);
}
else
{
Drink(from);
}
}
else
{
from.SendLocalizedMessage(502172); // You must have a free hand to drink a potion.
}
from.Backpack.DropItem(pot);
}
else
{
from.SendLocalizedMessage(502138); // That is too far away for you to use
pot.MoveToWorld(from.Location, from.Map);
}
}
public override void Serialize(IGenericWriter writer)
pot.Drink(from);
}
else
{
base.Serialize(writer);
writer.Write(1); // version
writer.Write((int)m_PotionEffect);
Drink(from);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
switch (version)
{
case 1:
case 0:
{
m_PotionEffect = (PotionEffect)reader.ReadInt();
break;
}
}
if (version == 0)
{
Stackable = Core.ML;
}
}
public abstract void Drink(Mobile from);
public static void PlayDrinkEffect(Mobile m)
{
m.RevealingAction();
m.PlaySound(0x2D6);
if (!DuelContext.IsFreeConsume(m))
{
m.AddToBackpack(new Bottle());
}
if (m.Body.IsHuman && !m.Mounted)
{
m.Animate(34, 5, 1, true, false, 0);
}
}
public static int EnhancePotions(Mobile m)
{
var EP = AosAttributes.GetValue(m, AosAttribute.EnhancePotions);
var skillBonus = m.Skills.Alchemy.Fixed / 330 * 10;
if (Core.ML && EP > 50 && m.AccessLevel <= AccessLevel.Player)
{
EP = 50;
}
return EP + skillBonus;
}
public static TimeSpan Scale(Mobile m, TimeSpan v)
{
if (!Core.AOS)
{
return v;
}
var scalar = 1.0 + 0.01 * EnhancePotions(m);
return TimeSpan.FromSeconds(v.TotalSeconds * scalar);
}
public static double Scale(Mobile m, double v)
{
if (!Core.AOS)
{
return v;
}
var scalar = 1.0 + 0.01 * EnhancePotions(m);
return v * scalar;
}
public static int Scale(Mobile m, int v)
{
if (!Core.AOS)
{
return v;
}
return AOS.Scale(v, 100 + EnhancePotions(m));
}
public override bool StackWith(Mobile from, Item dropped, bool playSound) =>
dropped is BasePotion potion && potion.m_PotionEffect == m_PotionEffect &&
base.StackWith(from, potion, playSound);
}
private void Deserialize(IGenericReader reader, int version)
{
_potionEffect = (PotionEffect)reader.ReadInt();
}
public abstract void Drink(Mobile from);
public static void PlayDrinkEffect(Mobile m)
{
m.RevealingAction();
m.PlaySound(0x2D6);
if (!DuelContext.IsFreeConsume(m))
{
m.AddToBackpack(new Bottle());
}
if (m.Body.IsHuman && !m.Mounted)
{
m.Animate(34, 5, 1, true, false, 0);
}
}
public static int EnhancePotions(Mobile m)
{
var EP = AosAttributes.GetValue(m, AosAttribute.EnhancePotions);
var skillBonus = m.Skills.Alchemy.Fixed / 330 * 10;
if (Core.ML && EP > 50 && m.AccessLevel <= AccessLevel.Player)
{
EP = 50;
}
return EP + skillBonus;
}
public static TimeSpan Scale(Mobile m, TimeSpan v)
{
if (!Core.AOS)
{
return v;
}
var scalar = 1.0 + 0.01 * EnhancePotions(m);
return TimeSpan.FromSeconds(v.TotalSeconds * scalar);
}
public static double Scale(Mobile m, double v)
{
if (!Core.AOS)
{
return v;
}
var scalar = 1.0 + 0.01 * EnhancePotions(m);
return v * scalar;
}
public static int Scale(Mobile m, int v) => !Core.AOS ? v : AOS.Scale(v, 100 + EnhancePotions(m));
public override bool StackWith(Mobile from, Item dropped, bool playSound) =>
dropped is BasePotion potion && potion._potionEffect == _potionEffect &&
base.StackWith(from, potion, playSound);
}

View file

@ -1,323 +1,289 @@
using System;
using System.Collections.Generic;
using ModernUO.Serialization;
using Server.Spells;
using Server.Targeting;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class BaseConflagrationPotion : BasePotion
{
public abstract class BaseConflagrationPotion : BasePotion
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Delay = new();
private readonly List<Mobile> m_Users = new();
public BaseConflagrationPotion(PotionEffect effect) : base(0xF06, effect) => Hue = 0x489;
public abstract int MinDamage { get; }
public abstract int MaxDamage { get; }
public override bool RequireFreeHand => false;
public override void Drink(Mobile from)
{
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Delay = new();
private readonly List<Mobile> m_Users = new();
public BaseConflagrationPotion(PotionEffect effect) : base(0xF06, effect) => Hue = 0x489;
public BaseConflagrationPotion(Serial serial) : base(serial)
if (Core.AOS && (from.Paralyzed || from.Frozen || from.Spell?.IsCasting == true))
{
from.SendLocalizedMessage(1062725); // You can not use that potion while paralyzed.
return;
}
public abstract int MinDamage { get; }
public abstract int MaxDamage { get; }
var delay = GetDelay(from);
public override bool RequireFreeHand => false;
public override void Drink(Mobile from)
if (delay > 0)
{
if (Core.AOS && (from.Paralyzed || from.Frozen || from.Spell?.IsCasting == true))
// You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
from.SendLocalizedMessage(1072529, $"{delay}\t{(delay > 1 ? "seconds." : "second.")}");
return;
}
if (from.Target is ThrowTarget targ && targ.Potion == this)
{
return;
}
from.RevealingAction();
if (!m_Users.Contains(from))
{
m_Users.Add(from);
}
from.Target = new ThrowTarget(this);
}
public virtual void Explode(Mobile from, Point3D loc, Map map)
{
if (Deleted || map == null)
{
return;
}
Consume();
// Check if any other players are using this potion
for (var i = 0; i < m_Users.Count; i++)
{
if (m_Users[i].Target is ThrowTarget targ && targ.Potion == this)
{
from.SendLocalizedMessage(1062725); // You can not use that potion while paralyzed.
return;
Target.Cancel(from);
}
}
var delay = GetDelay(from);
// Effects
Effects.PlaySound(loc, map, 0x20C);
if (delay > 0)
for (var i = -2; i <= 2; i++)
{
for (var j = -2; j <= 2; j++)
{
from.SendLocalizedMessage(
1072529,
$"{delay}\t{(delay > 1 ? "seconds." : "second.")}"
); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
return;
}
var p = new Point3D(loc.X + i, loc.Y + j, loc.Z);
if (from.Target is ThrowTarget targ && targ.Potion == this)
if (map.CanFit(p, 12, true, false) && from.InLOS(p))
{
new InternalItem(from, p, map, MinDamage, MaxDamage);
}
}
}
}
public static void AddDelay(Mobile m)
{
m_Delay.TryGetValue(m, out var timer);
timer.Cancel();
Timer.StartTimer(TimeSpan.FromSeconds(30), () => EndDelay(m), out timer);
m_Delay[m] = timer;
}
public static int GetDelay(Mobile m)
{
if (m_Delay.TryGetValue(m, out var timer) && timer.Next > Core.Now)
{
return (int)(timer.Next - Core.Now).TotalSeconds;
}
return 0;
}
public static void EndDelay(Mobile m)
{
if (m_Delay.Remove(m, out var timer))
{
timer.Cancel();
}
}
private class ThrowTarget : Target
{
public ThrowTarget(BaseConflagrationPotion potion) : base(12, true, TargetFlags.None) => Potion = potion;
public BaseConflagrationPotion Potion { get; }
protected override void OnTarget(Mobile from, object targeted)
{
if (Potion.Deleted || Potion.Map == Map.Internal)
{
return;
}
if (targeted is not IPoint3D p || from.Map == null)
{
return;
}
// Add delay
AddDelay(from);
SpellHelper.GetSurfaceTop(ref p);
var loc = new Point3D(p);
var map = from.Map;
from.RevealingAction();
if (!m_Users.Contains(from))
IEntity to;
if (p is Mobile mobile)
{
m_Users.Add(from);
to = mobile;
}
else
{
to = new Entity(Serial.Zero, loc, map);
}
from.Target = new ThrowTarget(this);
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, Potion.Hue);
Timer.StartTimer(TimeSpan.FromSeconds(1.5), () => Potion.Explode(from, loc, map));
}
}
[SerializationGenerator(0, false)]
public partial class InternalItem : Item
{
[SerializableField(0, setter: "private")]
private Mobile _from;
[SerializableField(1, getter: "private", setter: "private")]
private DateTime _end;
[SerializableField(2, getter: "private", setter: "private")]
private int _minDamage;
[SerializableField(3, getter: "private", setter: "private")]
private int _maxDamage;
private Timer _timer;
public InternalItem(Mobile from, Point3D loc, Map map, int min, int max) : base(0x398C)
{
Movable = false;
Light = LightType.Circle300;
MoveToWorld(loc, map);
From = from;
_end = Core.Now + TimeSpan.FromSeconds(10);
SetDamage(min, max);
_timer = new InternalTimer(this, _end);
_timer.Start();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
public override bool BlocksFit => true;
writer.Write(0); // version
public override void OnAfterDelete()
{
base.OnAfterDelete();
_timer?.Stop();
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
public int GetDamage() => Utility.RandomMinMax(_minDamage, _maxDamage);
var version = reader.ReadInt();
}
public virtual void Explode(Mobile from, Point3D loc, Map map)
private void SetDamage(int min, int max)
{
if (Deleted || map == null)
/**
* new way to apply alchemy bonus according to Stratics' calculator.
* this gives a mean to values 25, 50, 75 and 100. Stratics' calculator is outdated.
* Those goals will give 2 to alchemy bonus. It's not really OSI-like but it's an approximation.
*/
_minDamage = min;
_maxDamage = max;
if (From == null)
{
return;
}
Consume();
var alchemySkill = From.Skills.Alchemy.Fixed;
var alchemyBonus = alchemySkill / 125 + alchemySkill / 250;
// Check if any other players are using this potion
for (var i = 0; i < m_Users.Count; i++)
{
if (m_Users[i].Target is ThrowTarget targ && targ.Potion == this)
{
Target.Cancel(from);
}
}
// Effects
Effects.PlaySound(loc, map, 0x20C);
for (var i = -2; i <= 2; i++)
{
for (var j = -2; j <= 2; j++)
{
var p = new Point3D(loc.X + i, loc.Y + j, loc.Z);
if (map.CanFit(p, 12, true, false) && from.InLOS(p))
{
new InternalItem(from, p, map, MinDamage, MaxDamage);
}
}
}
_minDamage = Scale(From, _minDamage + alchemyBonus);
_maxDamage = Scale(From, _maxDamage + alchemyBonus);
}
public static void AddDelay(Mobile m)
[AfterDeserialization]
private void AfterDeserialization()
{
m_Delay.TryGetValue(m, out var timer);
timer.Cancel();
Timer.StartTimer(TimeSpan.FromSeconds(30), () => EndDelay(m), out timer);
m_Delay[m] = timer;
_timer = new InternalTimer(this, _end);
_timer.Start();
}
public static int GetDelay(Mobile m)
public override bool OnMoveOver(Mobile m)
{
if (m_Delay.TryGetValue(m, out var timer) && timer.Next > Core.Now)
if (Visible && From != null && (!Core.AOS || m != From) && SpellHelper.ValidIndirectTarget(From, m) &&
From.CanBeHarmful(m, false))
{
return (int)(timer.Next - Core.Now).TotalSeconds;
From.DoHarmful(m);
AOS.Damage(m, From, GetDamage(), 0, 100, 0, 0, 0);
m.PlaySound(0x208);
}
return 0;
return true;
}
public static void EndDelay(Mobile m)
private class InternalTimer : Timer
{
if (m_Delay.Remove(m, out var timer))
private readonly DateTime _end;
private readonly InternalItem _item;
public InternalTimer(InternalItem item, DateTime end) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0))
{
timer.Cancel();
_item = item;
_end = end;
}
}
private class ThrowTarget : Target
{
public ThrowTarget(BaseConflagrationPotion potion) : base(12, true, TargetFlags.None) => Potion = potion;
public BaseConflagrationPotion Potion { get; }
protected override void OnTarget(Mobile from, object targeted)
protected override void OnTick()
{
if (Potion.Deleted || Potion.Map == Map.Internal)
if (_item.Deleted)
{
return;
}
if (targeted is not IPoint3D p || from.Map == null)
if (Core.Now > _end)
{
_item.Delete();
Stop();
return;
}
var from = _item.From;
if (_item.Map == null || from == null)
{
return;
}
// Add delay
AddDelay(from);
SpellHelper.GetSurfaceTop(ref p);
var loc = new Point3D(p);
var map = from.Map;
from.RevealingAction();
IEntity to;
if (p is Mobile mobile)
foreach (var m in _item.GetMobilesInRange(0))
{
to = mobile;
}
else
{
to = new Entity(Serial.Zero, loc, map);
}
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, Potion.Hue);
Timer.StartTimer(TimeSpan.FromSeconds(1.5), () => Potion.Explode(from, loc, map));
}
}
public class InternalItem : Item
{
private DateTime m_End;
private int m_MaxDamage;
private int m_MinDamage;
private Timer m_Timer;
public InternalItem(Mobile from, Point3D loc, Map map, int min, int max) : base(0x398C)
{
Movable = false;
Light = LightType.Circle300;
MoveToWorld(loc, map);
From = from;
m_End = Core.Now + TimeSpan.FromSeconds(10);
SetDamage(min, max);
m_Timer = new InternalTimer(this, m_End);
m_Timer.Start();
}
public InternalItem(Serial serial) : base(serial)
{
}
public Mobile From { get; private set; }
public override bool BlocksFit => true;
public override void OnAfterDelete()
{
base.OnAfterDelete();
m_Timer?.Stop();
}
public int GetDamage() => Utility.RandomMinMax(m_MinDamage, m_MaxDamage);
private void SetDamage(int min, int max)
{
/* new way to apply alchemy bonus according to Stratics' calculator.
this gives a mean to values 25, 50, 75 and 100. Stratics' calculator is outdated.
Those goals will give 2 to alchemy bonus. It's not really OSI-like but it's an approximation. */
m_MinDamage = min;
m_MaxDamage = max;
if (From == null)
{
return;
}
var alchemySkill = From.Skills.Alchemy.Fixed;
var alchemyBonus = alchemySkill / 125 + alchemySkill / 250;
m_MinDamage = Scale(From, m_MinDamage + alchemyBonus);
m_MaxDamage = Scale(From, m_MaxDamage + alchemyBonus);
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
writer.Write(From);
writer.Write(m_End);
writer.Write(m_MinDamage);
writer.Write(m_MaxDamage);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
From = reader.ReadEntity<Mobile>();
m_End = reader.ReadDateTime();
m_MinDamage = reader.ReadInt();
m_MaxDamage = reader.ReadInt();
m_Timer = new InternalTimer(this, m_End);
m_Timer.Start();
}
public override bool OnMoveOver(Mobile m)
{
if (Visible && From != null && (!Core.AOS || m != From) && SpellHelper.ValidIndirectTarget(From, m) &&
From.CanBeHarmful(m, false))
{
From.DoHarmful(m);
AOS.Damage(m, From, GetDamage(), 0, 100, 0, 0, 0);
m.PlaySound(0x208);
}
return true;
}
private class InternalTimer : Timer
{
private readonly DateTime m_End;
private readonly InternalItem m_Item;
public InternalTimer(InternalItem item, DateTime end) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0))
{
m_Item = item;
m_End = end;
}
protected override void OnTick()
{
if (m_Item.Deleted)
if (m.Z + 16 > _item.Z && _item.Z + 12 > m.Z && (!Core.AOS || m != from) &&
SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false))
{
return;
}
from.DoHarmful(m);
if (Core.Now > m_End)
{
m_Item.Delete();
Stop();
return;
}
var from = m_Item.From;
if (m_Item.Map == null || from == null)
{
return;
}
foreach (var m in m_Item.GetMobilesInRange(0))
{
if (m.Z + 16 > m_Item.Z && m_Item.Z + 12 > m.Z && (!Core.AOS || m != from) &&
SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false))
{
from.DoHarmful(m);
AOS.Damage(m, from, m_Item.GetDamage(), 0, 100, 0, 0, 0);
m.PlaySound(0x208);
}
AOS.Damage(m, from, _item.GetDamage(), 0, 100, 0, 0, 0);
m.PlaySound(0x208);
}
}
}

View file

@ -1,33 +1,17 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class ConflagrationPotion : BaseConflagrationPotion
{
public class ConflagrationPotion : BaseConflagrationPotion
[Constructible]
public ConflagrationPotion() : base(PotionEffect.Conflagration)
{
[Constructible]
public ConflagrationPotion() : base(PotionEffect.Conflagration)
{
}
public ConflagrationPotion(Serial serial) : base(serial)
{
}
public override int MinDamage => 2;
public override int MaxDamage => 4;
public override int LabelNumber => 1072095; // a Conflagration potion
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 int MinDamage => 2;
public override int MaxDamage => 4;
public override int LabelNumber => 1072095; // a Conflagration potion
}

View file

@ -1,33 +1,17 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class GreaterConflagrationPotion : BaseConflagrationPotion
{
public class GreaterConflagrationPotion : BaseConflagrationPotion
[Constructible]
public GreaterConflagrationPotion() : base(PotionEffect.ConflagrationGreater)
{
[Constructible]
public GreaterConflagrationPotion() : base(PotionEffect.ConflagrationGreater)
{
}
public GreaterConflagrationPotion(Serial serial) : base(serial)
{
}
public override int MinDamage => 4;
public override int MaxDamage => 8;
public override int LabelNumber => 1072098; // a Greater Conflagration potion
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 int MinDamage => 4;
public override int MaxDamage => 8;
public override int LabelNumber => 1072098; // a Greater Conflagration potion
}

View file

@ -1,195 +1,179 @@
using System;
using System.Collections.Generic;
using ModernUO.Serialization;
using Server.Misc;
using Server.Mobiles;
using Server.Spells;
using Server.Targeting;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class BaseConfusionBlastPotion : BasePotion
{
public abstract class BaseConfusionBlastPotion : BasePotion
private static readonly Dictionary<Mobile, TimerExecutionToken> _delay = new();
private HashSet<Mobile> _users;
public BaseConfusionBlastPotion(PotionEffect effect) : base(0xF06, effect) => Hue = 0x48D;
public abstract int Radius { get; }
public override bool RequireFreeHand => false;
public override void Drink(Mobile from)
{
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Delay = new();
private readonly List<Mobile> m_Users = new();
public BaseConfusionBlastPotion(PotionEffect effect) : base(0xF06, effect) => Hue = 0x48D;
public BaseConfusionBlastPotion(Serial serial) : base(serial)
if (Core.AOS && (from.Paralyzed || from.Frozen || from.Spell?.IsCasting == true))
{
from.SendLocalizedMessage(1062725); // You can not use that potion while paralyzed.
return;
}
public abstract int Radius { get; }
var delay = GetDelay(from);
public override bool RequireFreeHand => false;
public override void Drink(Mobile from)
if (delay > 0)
{
if (Core.AOS && (from.Paralyzed || from.Frozen || from.Spell?.IsCasting == true))
{
from.SendLocalizedMessage(1062725); // You can not use that potion while paralyzed.
return;
}
var delay = GetDelay(from);
if (delay > 0)
{
from.SendLocalizedMessage(
1072529,
$"{delay}\t{(delay > 1 ? "seconds." : "second.")}"
); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
return;
}
if (from.Target is ThrowTarget targ && targ.Potion == this)
{
return;
}
from.RevealingAction();
if (!m_Users.Contains(from))
{
m_Users.Add(from);
}
from.Target = new ThrowTarget(this);
// You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
from.SendLocalizedMessage(1072529, $"{delay}\t{(delay > 1 ? "seconds." : "second.")}");
return;
}
public override void Serialize(IGenericWriter writer)
if (from.Target is ThrowTarget targ && targ.Potion == this)
{
base.Serialize(writer);
writer.Write(0); // version
return;
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
from.RevealingAction();
var version = reader.ReadInt();
_users ??= new HashSet<Mobile>();
_users.Add(from);
from.Target = new ThrowTarget(this);
}
public virtual void Explode(Mobile from, Point3D loc, Map map)
{
if (Deleted || map == null)
{
return;
}
public virtual void Explode(Mobile from, Point3D loc, Map map)
Consume();
if (_users != null)
{
if (Deleted || map == null)
{
return;
}
Consume();
// Check if any other players are using this potion
for (var i = 0; i < m_Users.Count; i++)
foreach (var user in _users)
{
if (m_Users[i].Target is ThrowTarget targ && targ.Potion == this)
if ((user.Target as ThrowTarget)?.Potion == this)
{
Target.Cancel(from);
}
}
// Effects
Effects.PlaySound(loc, map, 0x207);
_users.Clear();
}
Geometry.Circle2D(loc, map, Radius, BlastEffect, 270, 90);
// Effects
Effects.PlaySound(loc, map, 0x207);
Timer.StartTimer(TimeSpan.FromSeconds(0.3), () => CircleEffect2(loc, map));
Geometry.Circle2D(loc, map, Radius, BlastEffect, 270, 90);
foreach (var mobile in map.GetMobilesInRange(loc, Radius))
Timer.StartTimer(TimeSpan.FromSeconds(0.3), () => CircleEffect2(loc, map));
foreach (var mobile in map.GetMobilesInRange(loc, Radius))
{
if (mobile is BaseCreature mon)
{
if (mobile is BaseCreature mon)
if (mon.Controlled || mon.Summoned)
{
if (mon.Controlled || mon.Summoned)
{
continue;
}
mon.Pacify(from, Core.Now + TimeSpan.FromSeconds(5.0)); // TODO check
}
}
}
public virtual void BlastEffect(Point3D p, Map map)
{
if (map.CanFit(p, 12, true, false))
{
Effects.SendLocationEffect(p, map, 0x376A, 4, 9);
}
}
public void CircleEffect2(Point3D p, Map m)
{
Geometry.Circle2D(p, m, Radius, BlastEffect, 90, 270);
}
public static void AddDelay(Mobile m)
{
m_Delay.TryGetValue(m, out var timer);
timer.Cancel();
Timer.StartTimer(TimeSpan.FromSeconds(60), () => EndDelay(m), out timer);
m_Delay[m] = timer;
}
public static int GetDelay(Mobile m)
{
if (m_Delay.TryGetValue(m, out var timer) && timer.Next > Core.Now)
{
return (int)(timer.Next - Core.Now).TotalSeconds;
}
return 0;
}
public static void EndDelay(Mobile m)
{
if (m_Delay.Remove(m, out var timer))
{
timer.Cancel();
}
}
private class ThrowTarget : Target
{
public ThrowTarget(BaseConfusionBlastPotion potion) : base(12, true, TargetFlags.None) => Potion = potion;
public BaseConfusionBlastPotion Potion { get; }
protected override void OnTarget(Mobile from, object targeted)
{
if (Potion.Deleted || Potion.Map == Map.Internal)
{
return;
continue;
}
if (targeted is not IPoint3D p || from.Map == null)
{
return;
}
// Add delay
AddDelay(from);
SpellHelper.GetSurfaceTop(ref p);
var loc = new Point3D(p);
var map = from.Map;
from.RevealingAction();
IEntity to;
if (p is Mobile mobile)
{
to = mobile;
}
else
{
to = new Entity(Serial.Zero, loc, map);
}
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, Potion.Hue);
Timer.StartTimer(TimeSpan.FromSeconds(1.0), () => Potion.Explode(from, loc, map));
mon.Pacify(from, Core.Now + TimeSpan.FromSeconds(5.0)); // TODO check
}
}
}
public virtual void BlastEffect(Point3D p, Map map)
{
if (map.CanFit(p, 12, true, false))
{
Effects.SendLocationEffect(p, map, 0x376A, 4, 9);
}
}
public void CircleEffect2(Point3D p, Map m)
{
Geometry.Circle2D(p, m, Radius, BlastEffect, 90, 270);
}
public static void AddDelay(Mobile m)
{
_delay.TryGetValue(m, out var timer);
timer.Cancel();
Timer.StartTimer(TimeSpan.FromSeconds(60), () => EndDelay(m), out timer);
_delay[m] = timer;
}
public static int GetDelay(Mobile m)
{
if (_delay.TryGetValue(m, out var timer) && timer.Next > Core.Now)
{
return (int)(timer.Next - Core.Now).TotalSeconds;
}
return 0;
}
public static void EndDelay(Mobile m)
{
if (_delay.Remove(m, out var timer))
{
timer.Cancel();
}
}
private class ThrowTarget : Target
{
public ThrowTarget(BaseConfusionBlastPotion potion) : base(12, true, TargetFlags.None) => Potion = potion;
public BaseConfusionBlastPotion Potion { get; }
protected override void OnTarget(Mobile from, object targeted)
{
if (Potion.Deleted || Potion.Map == Map.Internal)
{
return;
}
if (targeted is not IPoint3D p || from.Map == null)
{
return;
}
// Add delay
AddDelay(from);
SpellHelper.GetSurfaceTop(ref p);
var loc = new Point3D(p);
var map = from.Map;
from.RevealingAction();
IEntity to;
if (p is Mobile mobile)
{
to = mobile;
}
else
{
to = new Entity(Serial.Zero, loc, map);
}
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, Potion.Hue);
Timer.StartTimer(TimeSpan.FromSeconds(1.0), () => Potion.Explode(from, loc, map));
}
}
}

View file

@ -1,32 +1,16 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class ConfusionBlastPotion : BaseConfusionBlastPotion
{
public class ConfusionBlastPotion : BaseConfusionBlastPotion
[Constructible]
public ConfusionBlastPotion() : base(PotionEffect.ConfusionBlast)
{
[Constructible]
public ConfusionBlastPotion() : base(PotionEffect.ConfusionBlast)
{
}
public ConfusionBlastPotion(Serial serial) : base(serial)
{
}
public override int Radius => 5;
public override int LabelNumber => 1072105; // a Confusion Blast potion
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 int Radius => 5;
public override int LabelNumber => 1072105; // a Confusion Blast potion
}

View file

@ -1,32 +1,16 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class GreaterConfusionBlastPotion : BaseConfusionBlastPotion
{
public class GreaterConfusionBlastPotion : BaseConfusionBlastPotion
[Constructible]
public GreaterConfusionBlastPotion() : base(PotionEffect.ConfusionBlastGreater)
{
[Constructible]
public GreaterConfusionBlastPotion() : base(PotionEffect.ConfusionBlastGreater)
{
}
public GreaterConfusionBlastPotion(Serial serial) : base(serial)
{
}
public override int Radius => 7;
public override int LabelNumber => 1072108; // a Greater Confusion Blast potion
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 int Radius => 7;
public override int LabelNumber => 1072108; // a Greater Confusion Blast potion
}

View file

@ -1,102 +1,85 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;
using Server.Spells.Necromancy;
namespace Server.Items
namespace Server.Items;
public class CureLevelInfo
{
public class CureLevelInfo
public CureLevelInfo(Poison poison, double chance)
{
public CureLevelInfo(Poison poison, double chance)
{
Poison = poison;
Chance = chance;
}
public Poison Poison { get; }
public double Chance { get; }
Poison = poison;
Chance = chance;
}
public abstract class BaseCurePotion : BasePotion
public Poison Poison { get; }
public double Chance { get; }
}
[SerializationGenerator(0, false)]
public abstract partial class BaseCurePotion : BasePotion
{
public BaseCurePotion(PotionEffect effect) : base(0xF07, effect)
{
public BaseCurePotion(PotionEffect effect) : base(0xF07, effect)
}
public abstract CureLevelInfo[] LevelInfo { get; }
public void DoCure(Mobile from)
{
var cure = false;
var info = LevelInfo;
for (var i = 0; i < info.Length; ++i)
{
}
var li = info[i];
public BaseCurePotion(Serial serial) : base(serial)
{
}
public abstract CureLevelInfo[] LevelInfo { 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 void DoCure(Mobile from)
{
var cure = false;
var info = LevelInfo;
for (var i = 0; i < info.Length; ++i)
if (li.Poison == from.Poison && Scale(from, li.Chance) > Utility.RandomDouble())
{
var li = info[i];
if (li.Poison == from.Poison && Scale(from, li.Chance) > Utility.RandomDouble())
{
cure = true;
break;
}
}
if (cure && from.CurePoison(from))
{
from.SendLocalizedMessage(500231); // You feel cured of poison!
from.FixedEffect(0x373A, 10, 15);
from.PlaySound(0x1E0);
}
else if (!cure)
{
from.SendLocalizedMessage(500232); // That potion was not strong enough to cure your ailment!
cure = true;
break;
}
}
public override void Drink(Mobile from)
if (cure && from.CurePoison(from))
{
if (TransformationSpellHelper.UnderTransformation(from, typeof(VampiricEmbraceSpell)))
{
from.SendLocalizedMessage(1061652); // The garlic in the potion would surely kill you.
}
else if (from.Poisoned)
{
DoCure(from);
from.SendLocalizedMessage(500231); // You feel cured of poison!
PlayDrinkEffect(from);
from.FixedEffect(0x373A, 10, 15);
from.PlaySound(0x1E0);
}
else if (!cure)
{
from.SendLocalizedMessage(500232); // That potion was not strong enough to cure your ailment!
}
}
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
from.PlaySound(0x1E0);
public override void Drink(Mobile from)
{
if (TransformationSpellHelper.UnderTransformation(from, typeof(VampiricEmbraceSpell)))
{
from.SendLocalizedMessage(1061652); // The garlic in the potion would surely kill you.
}
else if (from.Poisoned)
{
DoCure(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
else
PlayDrinkEffect(from);
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
from.PlaySound(0x1E0);
if (!DuelContext.IsFreeConsume(from))
{
from.SendLocalizedMessage(1042000); // You are not poisoned.
Consume();
}
}
else
{
from.SendLocalizedMessage(1042000); // You are not poisoned.
}
}
}

View file

@ -1,47 +1,31 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class CurePotion : BaseCurePotion
{
public class CurePotion : BaseCurePotion
private static readonly CureLevelInfo[] _oldLevelInfo =
{
private static readonly CureLevelInfo[] m_OldLevelInfo =
{
new(Poison.Lesser, 1.00), // 100% chance to cure lesser poison
new(Poison.Regular, 0.75), // 75% chance to cure regular poison
new(Poison.Greater, 0.50), // 50% chance to cure greater poison
new(Poison.Deadly, 0.15) // 15% chance to cure deadly poison
};
new(Poison.Lesser, 1.00), // 100% chance to cure lesser poison
new(Poison.Regular, 0.75), // 75% chance to cure regular poison
new(Poison.Greater, 0.50), // 50% chance to cure greater poison
new(Poison.Deadly, 0.15) // 15% chance to cure deadly poison
};
private static readonly CureLevelInfo[] m_AosLevelInfo =
{
new(Poison.Lesser, 1.00),
new(Poison.Regular, 0.95),
new(Poison.Greater, 0.75),
new(Poison.Deadly, 0.50),
new(Poison.Lethal, 0.25)
};
private static readonly CureLevelInfo[] _aosLevelInfo =
{
new(Poison.Lesser, 1.00),
new(Poison.Regular, 0.95),
new(Poison.Greater, 0.75),
new(Poison.Deadly, 0.50),
new(Poison.Lethal, 0.25)
};
[Constructible]
public CurePotion() : base(PotionEffect.Cure)
{
}
public CurePotion(Serial serial) : base(serial)
{
}
public override CureLevelInfo[] LevelInfo => Core.AOS ? m_AosLevelInfo : m_OldLevelInfo;
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();
}
[Constructible]
public CurePotion() : base(PotionEffect.Cure)
{
}
public override CureLevelInfo[] LevelInfo => Core.AOS ? _aosLevelInfo : _oldLevelInfo;
}

View file

@ -1,48 +1,47 @@
namespace Server.Items
namespace Server.Items;
public class GreaterCurePotion : BaseCurePotion
{
public class GreaterCurePotion : BaseCurePotion
private static readonly CureLevelInfo[] m_OldLevelInfo =
{
private static readonly CureLevelInfo[] m_OldLevelInfo =
{
new(Poison.Lesser, 1.00), // 100% chance to cure lesser poison
new(Poison.Regular, 1.00), // 100% chance to cure regular poison
new(Poison.Greater, 1.00), // 100% chance to cure greater poison
new(Poison.Deadly, 0.75), // 75% chance to cure deadly poison
new(Poison.Lethal, 0.25) // 25% chance to cure lethal poison
};
new(Poison.Lesser, 1.00), // 100% chance to cure lesser poison
new(Poison.Regular, 1.00), // 100% chance to cure regular poison
new(Poison.Greater, 1.00), // 100% chance to cure greater poison
new(Poison.Deadly, 0.75), // 75% chance to cure deadly poison
new(Poison.Lethal, 0.25) // 25% chance to cure lethal poison
};
private static readonly CureLevelInfo[] m_AosLevelInfo =
{
new(Poison.Lesser, 1.00),
new(Poison.Regular, 1.00),
new(Poison.Greater, 1.00),
new(Poison.Deadly, 0.95),
new(Poison.Lethal, 0.75)
};
private static readonly CureLevelInfo[] m_AosLevelInfo =
{
new(Poison.Lesser, 1.00),
new(Poison.Regular, 1.00),
new(Poison.Greater, 1.00),
new(Poison.Deadly, 0.95),
new(Poison.Lethal, 0.75)
};
[Constructible]
public GreaterCurePotion() : base(PotionEffect.CureGreater)
{
}
public GreaterCurePotion(Serial serial) : base(serial)
{
}
public override CureLevelInfo[] LevelInfo => Core.AOS ? m_AosLevelInfo : m_OldLevelInfo;
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();
}
[Constructible]
public GreaterCurePotion() : base(PotionEffect.CureGreater)
{
}
}
public GreaterCurePotion(Serial serial) : base(serial)
{
}
public override CureLevelInfo[] LevelInfo => Core.AOS ? m_AosLevelInfo : m_OldLevelInfo;
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();
}
}

View file

@ -1,44 +1,28 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class LesserCurePotion : BaseCurePotion
{
public class LesserCurePotion : BaseCurePotion
private static readonly CureLevelInfo[] _oldLevelInfo =
{
private static readonly CureLevelInfo[] m_OldLevelInfo =
{
new(Poison.Lesser, 0.75), // 75% chance to cure lesser poison
new(Poison.Regular, 0.50), // 50% chance to cure regular poison
new(Poison.Greater, 0.15) // 15% chance to cure greater poison
};
new(Poison.Lesser, 0.75), // 75% chance to cure lesser poison
new(Poison.Regular, 0.50), // 50% chance to cure regular poison
new(Poison.Greater, 0.15) // 15% chance to cure greater poison
};
private static readonly CureLevelInfo[] m_AosLevelInfo =
{
new(Poison.Lesser, 0.75),
new(Poison.Regular, 0.50),
new(Poison.Greater, 0.25)
};
private static readonly CureLevelInfo[] _aosLevelInfo =
{
new(Poison.Lesser, 0.75),
new(Poison.Regular, 0.50),
new(Poison.Greater, 0.25)
};
[Constructible]
public LesserCurePotion() : base(PotionEffect.CureLesser)
{
}
public LesserCurePotion(Serial serial) : base(serial)
{
}
public override CureLevelInfo[] LevelInfo => Core.AOS ? m_AosLevelInfo : m_OldLevelInfo;
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();
}
[Constructible]
public LesserCurePotion() : base(PotionEffect.CureLesser)
{
}
public override CureLevelInfo[] LevelInfo => Core.AOS ? _aosLevelInfo : _oldLevelInfo;
}

View file

@ -1,33 +0,0 @@
namespace Server.Items
{
public class DarkglowPotion : BasePoisonPotion
{
[Constructible]
public DarkglowPotion() : base(PotionEffect.Darkglow) => Hue = 0x96;
public DarkglowPotion(Serial serial) : base(serial)
{
}
public override Poison Poison => Poison.Greater; /* MUST be restored when prerequisites are done */
public override double MinPoisoningSkill => 95.0;
public override double MaxPoisoningSkill => 100.0;
public override int LabelNumber => 1072849; // Darkglow Poison
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();
}
}
}

View file

@ -1,336 +1,321 @@
using System;
using System.Collections.Generic;
using ModernUO.Serialization;
using Server.Collections;
using Server.Network;
using Server.Spells;
using Server.Targeting;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class BaseExplosionPotion : BasePotion
{
public abstract class BaseExplosionPotion : BasePotion
private const int ExplosionRange = 2; // How long is the blast radius?
private const bool LeveledExplosion = false; // Should explosion potions explode other nearby potions?
private const bool InstantExplosion = false; // Should explosion potions explode on impact?
private const bool RelativeLocation = false; // Is the explosion target location relative for mobiles?
private Timer _timer;
public BaseExplosionPotion(PotionEffect effect) : base(0xF0D, effect)
{
private const int ExplosionRange = 2; // How long is the blast radius?
}
private const bool LeveledExplosion = false; // Should explosion potions explode other nearby potions?
private const bool InstantExplosion = false; // Should explosion potions explode on impact?
private const bool RelativeLocation = false; // Is the explosion target location relative for mobiles?
public abstract int MinDamage { get; }
public abstract int MaxDamage { get; }
private Timer _timer;
public override bool RequireFreeHand => false;
public BaseExplosionPotion(PotionEffect effect) : base(0xF0D, effect)
private HashSet<Mobile> _users;
public virtual IEntity FindParent(Mobile from)
{
if (HeldBy?.Holding == this)
{
return HeldBy;
}
public BaseExplosionPotion(Serial serial) : base(serial)
if (RootParent != null)
{
return RootParent;
}
public abstract int MinDamage { get; }
public abstract int MaxDamage { get; }
public override bool RequireFreeHand => false;
private HashSet<Mobile> _users;
public override void Serialize(IGenericWriter writer)
if (Map == Map.Internal)
{
base.Serialize(writer);
writer.Write(0); // version
return from;
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
return this;
}
var version = reader.ReadInt();
public override void Drink(Mobile from)
{
if (Core.AOS && (from.Paralyzed || from.Frozen || from.Spell?.IsCasting == true))
{
from.SendLocalizedMessage(1062725); // You can not use a purple potion while paralyzed.
return;
}
public virtual IEntity FindParent(Mobile from)
var targ = from.Target as ThrowTarget;
Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
if (targ?.Potion == this)
{
if (HeldBy?.Holding == this)
{
return HeldBy;
}
if (RootParent != null)
{
return RootParent;
}
if (Map == Map.Internal)
{
return from;
}
return this;
return;
}
public override void Drink(Mobile from)
from.RevealingAction();
_users ??= new HashSet<Mobile>();
_users.Add(from);
from.Target = new ThrowTarget(this);
if (_timer?.Running != true)
{
if (Core.AOS && (from.Paralyzed || from.Frozen || from.Spell?.IsCasting == true))
from.SendLocalizedMessage(500236); // You should throw it now!
if (Core.ML)
{
from.SendLocalizedMessage(1062725); // You can not use a purple potion while paralyzed.
return;
}
var targ = from.Target as ThrowTarget;
Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
if (targ?.Potion == this)
{
return;
}
from.RevealingAction();
_users ??= new HashSet<Mobile>();
_users.Add(from);
from.Target = new ThrowTarget(this);
if (_timer?.Running != true)
{
from.SendLocalizedMessage(500236); // You should throw it now!
if (Core.ML)
{
_timer = new DetonateTimer(this, from, TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.25), 5);
}
else
{
_timer = new DetonateTimer(this, from, TimeSpan.FromSeconds(0.75), TimeSpan.FromSeconds(1.0), 4);
}
_timer.Start();
}
}
private void Reposition_OnTick(Mobile from, Point3D loc, Map map)
{
if (Deleted)
{
return;
}
if (InstantExplosion || _timer?.Running != true)
{
Explode(from, true, loc, map);
_timer = new DetonateTimer(this, from, TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.25), 5);
}
else
{
MoveToWorld(loc, map);
_timer = new DetonateTimer(this, from, TimeSpan.FromSeconds(0.75), TimeSpan.FromSeconds(1.0), 4);
}
_timer.Start();
}
}
private void Reposition_OnTick(Mobile from, Point3D loc, Map map)
{
if (Deleted)
{
return;
}
public void Explode(Mobile from, bool direct, Point3D loc, Map map)
if (InstantExplosion || _timer?.Running != true)
{
if (Deleted)
{
return;
}
Explode(from, true, loc, map);
}
else
{
MoveToWorld(loc, map);
}
}
Consume();
public void Explode(Mobile from, bool direct, Point3D loc, Map map)
{
if (Deleted)
{
return;
}
Consume();
if (_users != null)
{
foreach (var user in _users)
{
if (user.Target is ThrowTarget targ && targ.Potion == this)
if ((user.Target as ThrowTarget)?.Potion == this)
{
Target.Cancel(user);
}
}
_users.Clear();
}
if (map == null)
{
return;
}
Effects.PlaySound(loc, map, 0x307);
Effects.SendLocationEffect(loc, map, 0x36B0, 9);
var alchemyBonus = 0;
if (direct)
{
alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
}
var eable = map.GetObjectsInRange(loc, ExplosionRange);
using var queue = PooledRefQueue<IEntity>.Create();
var toDamage = 0;
foreach (var entity in eable)
{
if (entity == this)
{
continue;
}
if (entity is Mobile mobile)
{
if (from == null || SpellHelper.ValidIndirectTarget(from, mobile) && from.CanBeHarmful(mobile, false))
{
++toDamage;
queue.Enqueue(entity);
}
}
else if (LeveledExplosion && entity is BaseExplosionPotion)
{
queue.Enqueue(entity);
}
}
eable.Free();
var min = Scale(from, MinDamage);
var max = Scale(from, MaxDamage);
while (queue.Count > 0)
{
var entity = queue.Dequeue();
if (entity is Mobile m)
{
from?.DoHarmful(m);
var damage = Utility.RandomMinMax(min, max) + alchemyBonus;
if (!Core.AOS && damage > 40)
{
damage = 40;
}
else if (Core.AOS && toDamage > 2)
{
damage /= toDamage - 1;
}
AOS.Damage(m, from, damage, 0, 100, 0, 0, 0);
}
else if (entity is BaseExplosionPotion pot)
{
pot.Explode(from, false, pot.GetWorldLocation(), pot.Map);
}
}
}
private class ThrowTarget : Target
{
public ThrowTarget(BaseExplosionPotion potion) : base(Core.ML ? 12 : 10, true, TargetFlags.None) => Potion = potion;
public BaseExplosionPotion Potion { get; }
protected override void OnTarget(Mobile from, object targeted)
{
if (Potion.Deleted || Potion.Map == Map.Internal)
{
return;
}
if (targeted is not IPoint3D p)
{
return;
}
var map = from.Map;
if (map == null)
{
return;
}
Effects.PlaySound(loc, map, 0x307);
Effects.SendLocationEffect(loc, map, 0x36B0, 9);
SpellHelper.GetSurfaceTop(ref p);
var loc = new Point3D(p);
var alchemyBonus = 0;
if (direct)
from.RevealingAction();
IEntity to = new Entity(Serial.Zero, loc, map);
if (p is Mobile m)
{
alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
}
var eable = map.GetObjectsInRange(loc, ExplosionRange);
using var queue = PooledRefQueue<IEntity>.Create();
var toDamage = 0;
foreach (var entity in eable)
{
if (entity == this)
if (!RelativeLocation) // explosion location = current mob location.
{
continue;
loc = m.Location;
}
if (entity is Mobile mobile)
else
{
if (from == null || SpellHelper.ValidIndirectTarget(from, mobile) && from.CanBeHarmful(mobile, false))
{
++toDamage;
queue.Enqueue(entity);
}
}
else if (LeveledExplosion && entity is BaseExplosionPotion)
{
queue.Enqueue(entity);
to = m;
}
}
eable.Free();
Effects.SendMovingEffect(from, to, Potion.ItemID, 7, 0, false, false, Potion.Hue);
var min = Scale(from, MinDamage);
var max = Scale(from, MaxDamage);
while (queue.Count > 0)
if (Potion.Amount > 1)
{
var entity = queue.Dequeue();
if (entity is Mobile m)
{
from?.DoHarmful(m);
var damage = Utility.RandomMinMax(min, max) + alchemyBonus;
if (!Core.AOS && damage > 40)
{
damage = 40;
}
else if (Core.AOS && toDamage > 2)
{
damage /= toDamage - 1;
}
AOS.Damage(m, from, damage, 0, 100, 0, 0, 0);
}
else if (entity is BaseExplosionPotion pot)
{
pot.Explode(from, false, pot.GetWorldLocation(), pot.Map);
}
Mobile.LiftItemDupe(Potion, 1);
}
Potion.Internalize();
var delay = TimeSpan.FromSeconds(0.1 * from.GetDistanceToSqrt(loc));
// If the potion is about to explode, stop the timer so it doesn't explode on you, while it is mid-air
if (Potion._timer.RemainingCount <= 1 && Potion._timer.Next <= Core.Now + delay)
{
Potion._timer.Stop();
}
Timer.StartTimer(delay, () => Potion.Reposition_OnTick(from, loc, map));
}
}
private class DetonateTimer : Timer
{
private BaseExplosionPotion _potion;
private Mobile _from;
public DetonateTimer(BaseExplosionPotion potion, Mobile from, TimeSpan delay, TimeSpan interval, int count) : base(delay, interval, count)
{
_from = from;
_potion = potion;
}
private class ThrowTarget : Target
protected override void OnTick()
{
public ThrowTarget(BaseExplosionPotion potion) : base(Core.ML ? 12 : 10, true, TargetFlags.None) => Potion = potion;
public BaseExplosionPotion Potion { get; }
protected override void OnTarget(Mobile from, object targeted)
if (_potion.Deleted)
{
if (Potion.Deleted || Potion.Map == Map.Internal)
{
return;
}
if (targeted is not IPoint3D p)
{
return;
}
var map = from.Map;
if (map == null)
{
return;
}
SpellHelper.GetSurfaceTop(ref p);
var loc = new Point3D(p);
from.RevealingAction();
IEntity to = new Entity(Serial.Zero, loc, map);
if (p is Mobile m)
{
if (!RelativeLocation) // explosion location = current mob location.
{
loc = m.Location;
}
else
{
to = m;
}
}
Effects.SendMovingEffect(from, to, Potion.ItemID, 7, 0, false, false, Potion.Hue);
if (Potion.Amount > 1)
{
Mobile.LiftItemDupe(Potion, 1);
}
Potion.Internalize();
var delay = TimeSpan.FromSeconds(0.1 * from.GetDistanceToSqrt(loc));
// If the potion is about to explode, stop the timer so it doesn't explode on you, while it is mid-air
if (Potion._timer.RemainingCount <= 1 && Potion._timer.Next <= Core.Now + delay)
{
Potion._timer.Stop();
}
Timer.StartTimer(delay, () => Potion.Reposition_OnTick(from, loc, map));
}
}
private class DetonateTimer : Timer
{
private BaseExplosionPotion _potion;
private Mobile _from;
public DetonateTimer(BaseExplosionPotion potion, Mobile from, TimeSpan delay, TimeSpan interval, int count) : base(delay, interval, count)
{
_from = from;
_potion = potion;
return;
}
protected override void OnTick()
var parent = _potion.FindParent(_from);
if (RemainingCount == 0)
{
if (_potion.Deleted)
Point3D loc;
Map map;
if (parent is Item item)
{
loc = item.GetWorldLocation();
map = item.Map;
}
else if (parent is Mobile m)
{
loc = m.Location;
map = m.Map;
}
else
{
return;
}
var parent = _potion.FindParent(_from);
if (RemainingCount == 0)
_potion.Explode(_from, true, loc, map);
}
else if (RemainingCount <= 3)
{
if (parent is Item item)
{
Point3D loc;
Map map;
if (parent is Item item)
{
loc = item.GetWorldLocation();
map = item.Map;
}
else if (parent is Mobile m)
{
loc = m.Location;
map = m.Map;
}
else
{
return;
}
_potion.Explode(_from, true, loc, map);
item.PublicOverheadMessage(MessageType.Regular, 0x22, false, RemainingCount.ToString());
}
else if (RemainingCount <= 3)
else if (parent is Mobile mobile)
{
if (parent is Item item)
{
item.PublicOverheadMessage(MessageType.Regular, 0x22, false, RemainingCount.ToString());
}
else if (parent is Mobile mobile)
{
mobile.PublicOverheadMessage(MessageType.Regular, 0x22, false, RemainingCount.ToString());
}
mobile.PublicOverheadMessage(MessageType.Regular, 0x22, false, RemainingCount.ToString());
}
}
}

View file

@ -1,31 +1,15 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class ExplosionPotion : BaseExplosionPotion
{
public class ExplosionPotion : BaseExplosionPotion
[Constructible]
public ExplosionPotion() : base(PotionEffect.Explosion)
{
[Constructible]
public ExplosionPotion() : base(PotionEffect.Explosion)
{
}
public ExplosionPotion(Serial serial) : base(serial)
{
}
public override int MinDamage => 10;
public override int MaxDamage => 20;
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 int MinDamage => 10;
public override int MaxDamage => 20;
}

View file

@ -1,31 +1,15 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class GreaterExplosionPotion : BaseExplosionPotion
{
public class GreaterExplosionPotion : BaseExplosionPotion
[Constructible]
public GreaterExplosionPotion() : base(PotionEffect.ExplosionGreater)
{
[Constructible]
public GreaterExplosionPotion() : base(PotionEffect.ExplosionGreater)
{
}
public GreaterExplosionPotion(Serial serial) : base(serial)
{
}
public override int MinDamage => Core.AOS ? 20 : 15;
public override int MaxDamage => Core.AOS ? 40 : 30;
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 int MinDamage => Core.AOS ? 20 : 15;
public override int MaxDamage => Core.AOS ? 40 : 30;
}

View file

@ -1,31 +1,15 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class LesserExplosionPotion : BaseExplosionPotion
{
public class LesserExplosionPotion : BaseExplosionPotion
[Constructible]
public LesserExplosionPotion() : base(PotionEffect.ExplosionLesser)
{
[Constructible]
public LesserExplosionPotion() : base(PotionEffect.ExplosionLesser)
{
}
public LesserExplosionPotion(Serial serial) : base(serial)
{
}
public override int MinDamage => 5;
public override int MaxDamage => 10;
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 int MinDamage => 5;
public override int MaxDamage => 10;
}

View file

@ -1,81 +1,60 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Network;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class BaseHealPotion : BasePotion
{
public abstract class BaseHealPotion : BasePotion
public BaseHealPotion(PotionEffect effect) : base(0xF0C, effect)
{
public BaseHealPotion(PotionEffect effect) : base(0xF0C, effect)
}
public abstract int MinHeal { get; }
public abstract int MaxHeal { get; }
public abstract double Delay { get; }
public void DoHeal(Mobile from)
{
var min = Scale(from, MinHeal);
var max = Scale(from, MaxHeal);
from.Heal(Utility.RandomMinMax(min, max));
}
public override void Drink(Mobile from)
{
if (from.Hits >= from.HitsMax)
{
// You decide against drinking this potion, as you are already at full health.
from.SendLocalizedMessage(1049547);
return;
}
public BaseHealPotion(Serial serial) : base(serial)
if (from.Poisoned || MortalStrike.IsWounded(from))
{
// You can not heal yourself in your current state.
from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000);
return;
}
public abstract int MinHeal { get; }
public abstract int MaxHeal { get; }
public abstract double Delay { get; }
public override void Serialize(IGenericWriter writer)
if (!from.BeginAction<BaseHealPotion>())
{
base.Serialize(writer);
writer.Write(0); // version
// You must wait 10 seconds before using another healing potion.
from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235);
return;
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
DoHeal(from);
var version = reader.ReadInt();
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
public void DoHeal(Mobile from)
{
var min = Scale(from, MinHeal);
var max = Scale(from, MaxHeal);
from.Heal(Utility.RandomMinMax(min, max));
}
public override void Drink(Mobile from)
{
if (from.Hits < from.HitsMax)
{
if (from.Poisoned || MortalStrike.IsWounded(from))
{
// You can not heal yourself in your current state.
from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000);
}
else
{
if (from.BeginAction<BaseHealPotion>())
{
DoHeal(from);
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
Timer.StartTimer(TimeSpan.FromSeconds(Delay), from.EndAction<BaseHealPotion>);
}
else
{
// You must wait 10 seconds before using another healing potion.
from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235);
}
}
}
else
{
// You decide against drinking this potion, as you are already at full health.
from.SendLocalizedMessage(1049547);
}
}
Timer.StartTimer(TimeSpan.FromSeconds(Delay), from.EndAction<BaseHealPotion>);
}
}

View file

@ -1,32 +1,16 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class GreaterHealPotion : BaseHealPotion
{
public class GreaterHealPotion : BaseHealPotion
[Constructible]
public GreaterHealPotion() : base(PotionEffect.HealGreater)
{
[Constructible]
public GreaterHealPotion() : base(PotionEffect.HealGreater)
{
}
public GreaterHealPotion(Serial serial) : base(serial)
{
}
public override int MinHeal => Core.AOS ? 20 : 9;
public override int MaxHeal => Core.AOS ? 25 : 30;
public override double Delay => 10.0;
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 int MinHeal => Core.AOS ? 20 : 9;
public override int MaxHeal => Core.AOS ? 25 : 30;
public override double Delay => 10.0;
}

View file

@ -1,32 +1,16 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class HealPotion : BaseHealPotion
{
public class HealPotion : BaseHealPotion
[Constructible]
public HealPotion() : base(PotionEffect.Heal)
{
[Constructible]
public HealPotion() : base(PotionEffect.Heal)
{
}
public HealPotion(Serial serial) : base(serial)
{
}
public override int MinHeal => Core.AOS ? 13 : 6;
public override int MaxHeal => Core.AOS ? 16 : 20;
public override double Delay => Core.AOS ? 8.0 : 10.0;
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 int MinHeal => Core.AOS ? 13 : 6;
public override int MaxHeal => Core.AOS ? 16 : 20;
public override double Delay => Core.AOS ? 8.0 : 10.0;
}

View file

@ -1,32 +1,16 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class LesserHealPotion : BaseHealPotion
{
public class LesserHealPotion : BaseHealPotion
[Constructible]
public LesserHealPotion() : base(PotionEffect.HealLesser)
{
[Constructible]
public LesserHealPotion() : base(PotionEffect.HealLesser)
{
}
public LesserHealPotion(Serial serial) : base(serial)
{
}
public override int MinHeal => Core.AOS ? 6 : 3;
public override int MaxHeal => Core.AOS ? 8 : 10;
public override double Delay => Core.AOS ? 3.0 : 10.0;
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 int MinHeal => Core.AOS ? 6 : 3;
public override int MaxHeal => Core.AOS ? 8 : 10;
public override double Delay => Core.AOS ? 3.0 : 10.0;
}

View file

@ -1,95 +1,79 @@
using System;
using System.Collections.Generic;
using ModernUO.Serialization;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class InvisibilityPotion : BasePotion
{
public class InvisibilityPotion : BasePotion
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new();
[Constructible]
public InvisibilityPotion() : base(0xF0A, PotionEffect.Invisibility) => Hue = 0x48D;
public override int LabelNumber => 1072941; // Potion of Invisibility
public override void Drink(Mobile from)
{
private static readonly Dictionary<Mobile, TimerExecutionToken> m_Table = new();
[Constructible]
public InvisibilityPotion() : base(0xF0A, PotionEffect.Invisibility) => Hue = 0x48D;
public InvisibilityPotion(Serial serial) : base(serial)
if (from.Hidden)
{
from.SendLocalizedMessage(1073185); // You are already unseen.
return;
}
public override int LabelNumber => 1072941; // Potion of Invisibility
public override void Drink(Mobile from)
if (HasTimer(from))
{
if (from.Hidden)
from.SendLocalizedMessage(1073186); // An invisibility potion is already taking effect on your person.
return;
}
Consume();
Timer.StartTimer(TimeSpan.FromSeconds(2), () => Hide(from), out var timerToken);
m_Table[from] = timerToken;
PlayDrinkEffect(from);
}
public static void Hide(Mobile m)
{
Effects.SendLocationParticles(
EffectItem.Create(new Point3D(m.X, m.Y, m.Z + 16), m.Map, EffectItem.DefaultDuration),
0x376A,
10,
15,
5045
);
m.PlaySound(0x3C4);
m.Hidden = true;
BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Invisibility, 1075825)); // Invisibility/Invisible
RemoveTimer(m);
Timer.StartTimer(TimeSpan.FromSeconds(30), () => EndHide(m));
}
public static void EndHide(Mobile m)
{
m.RevealingAction();
RemoveTimer(m);
}
public static bool HasTimer(Mobile m) => m_Table.ContainsKey(m);
public static void RemoveTimer(Mobile m, bool interrupted = false)
{
if (m_Table.Remove(m, out var timer))
{
if (interrupted)
{
from.SendLocalizedMessage(1073185); // You are already unseen.
return;
m.SendLocalizedMessage(1073187); // The invisibility effect is interrupted.
}
if (HasTimer(from))
{
from.SendLocalizedMessage(1073186); // An invisibility potion is already taking effect on your person.
return;
}
Consume();
Timer.StartTimer(TimeSpan.FromSeconds(2), () => Hide(from), out var timerToken);
m_Table[from] = timerToken;
PlayDrinkEffect(from);
}
public static void Hide(Mobile m)
{
Effects.SendLocationParticles(
EffectItem.Create(new Point3D(m.X, m.Y, m.Z + 16), m.Map, EffectItem.DefaultDuration),
0x376A,
10,
15,
5045
);
m.PlaySound(0x3C4);
m.Hidden = true;
BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Invisibility, 1075825)); // Invisibility/Invisible
RemoveTimer(m);
Timer.StartTimer(TimeSpan.FromSeconds(30), () => EndHide(m));
}
public static void EndHide(Mobile m)
{
m.RevealingAction();
RemoveTimer(m);
}
public static bool HasTimer(Mobile m) => m_Table.ContainsKey(m);
public static void RemoveTimer(Mobile m, bool interrupted = false)
{
if (m_Table.Remove(m, out var timer))
{
if (interrupted)
{
m.SendLocalizedMessage(1073187); // The invisibility effect is interrupted.
}
timer.Cancel();
}
}
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();
timer.Cancel();
}
}
}

View file

@ -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.");
}
}
}

View file

@ -1,34 +0,0 @@
namespace Server.Items
{
public class ParasiticPotion : BasePoisonPotion
{
[Constructible]
public ParasiticPotion() : base(PotionEffect.Parasitic) => Hue = 0x17C;
public ParasiticPotion(Serial serial) : base(serial)
{
}
/* public override Poison Poison => Poison.Darkglow; MUST be restored when prerequisites are done */
public override Poison Poison => Poison.Greater;
public override double MinPoisoningSkill => 95.0;
public override double MaxPoisoningSkill => 100.0;
public override int LabelNumber => 1072848; // Parasitic Poison
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();
}
}
}

View file

@ -1,51 +1,38 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class BasePoisonPotion : BasePotion
{
public abstract class BasePoisonPotion : BasePotion
public BasePoisonPotion(PotionEffect effect) : base(0xF0A, effect)
{
public BasePoisonPotion(PotionEffect effect) : base(0xF0A, effect)
}
public BasePoisonPotion(Serial serial) : base(serial)
{
}
public abstract Poison Poison { get; }
public abstract double MinPoisoningSkill { get; }
public abstract double MaxPoisoningSkill { get; }
public void DoPoison(Mobile from)
{
from.ApplyPoison(from, Poison);
}
public override void Drink(Mobile from)
{
DoPoison(from);
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
}
public BasePoisonPotion(Serial serial) : base(serial)
{
}
public abstract Poison Poison { get; }
public abstract double MinPoisoningSkill { get; }
public abstract double MaxPoisoningSkill { 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 void DoPoison(Mobile from)
{
from.ApplyPoison(from, Poison);
}
public override void Drink(Mobile from)
{
DoPoison(from);
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
Consume();
}
}
}

View file

@ -0,0 +1,18 @@
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class DarkglowPotion : BasePoisonPotion
{
[Constructible]
public DarkglowPotion() : base(PotionEffect.Darkglow) => Hue = 0x96;
/* public override Poison Poison => Poison.DarkGlow; // MUST be restored when prerequisites are done */
public override Poison Poison => Poison.Greater;
public override double MinPoisoningSkill => 95.0;
public override double MaxPoisoningSkill => 100.0;
public override int LabelNumber => 1072849; // Darkglow Poison
}

View file

@ -1,33 +1,17 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class DeadlyPoisonPotion : BasePoisonPotion
{
public class DeadlyPoisonPotion : BasePoisonPotion
[Constructible]
public DeadlyPoisonPotion() : base(PotionEffect.PoisonDeadly)
{
[Constructible]
public DeadlyPoisonPotion() : base(PotionEffect.PoisonDeadly)
{
}
public DeadlyPoisonPotion(Serial serial) : base(serial)
{
}
public override Poison Poison => Poison.Deadly;
public override double MinPoisoningSkill => 95.0;
public override double MaxPoisoningSkill => 100.0;
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 Poison Poison => Poison.Deadly;
public override double MinPoisoningSkill => 95.0;
public override double MaxPoisoningSkill => 100.0;
}

View file

@ -1,33 +1,17 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class GreaterPoisonPotion : BasePoisonPotion
{
public class GreaterPoisonPotion : BasePoisonPotion
[Constructible]
public GreaterPoisonPotion() : base(PotionEffect.PoisonGreater)
{
[Constructible]
public GreaterPoisonPotion() : base(PotionEffect.PoisonGreater)
{
}
public GreaterPoisonPotion(Serial serial) : base(serial)
{
}
public override Poison Poison => Poison.Greater;
public override double MinPoisoningSkill => 60.0;
public override double MaxPoisoningSkill => 100.0;
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 Poison Poison => Poison.Greater;
public override double MinPoisoningSkill => 60.0;
public override double MaxPoisoningSkill => 100.0;
}

View file

@ -1,33 +1,17 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class LesserPoisonPotion : BasePoisonPotion
{
public class LesserPoisonPotion : BasePoisonPotion
[Constructible]
public LesserPoisonPotion() : base(PotionEffect.PoisonLesser)
{
[Constructible]
public LesserPoisonPotion() : base(PotionEffect.PoisonLesser)
{
}
public LesserPoisonPotion(Serial serial) : base(serial)
{
}
public override Poison Poison => Poison.Lesser;
public override double MinPoisoningSkill => 0.0;
public override double MaxPoisoningSkill => 60.0;
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 Poison Poison => Poison.Lesser;
public override double MinPoisoningSkill => 0.0;
public override double MaxPoisoningSkill => 60.0;
}

View file

@ -0,0 +1,16 @@
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class ParasiticPotion : BasePoisonPotion
{
[Constructible]
public ParasiticPotion() : base(PotionEffect.Parasitic) => Hue = 0x17C;
/* public override Poison Poison => Poison.Parasitic; // MUST be restored when prerequisites are done */
public override Poison Poison => Poison.Greater;
public override double MinPoisoningSkill => 95.0;
public override double MaxPoisoningSkill => 100.0;
}

View file

@ -1,33 +1,17 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class PoisonPotion : BasePoisonPotion
{
public class PoisonPotion : BasePoisonPotion
[Constructible]
public PoisonPotion() : base(PotionEffect.Poison)
{
[Constructible]
public PoisonPotion() : base(PotionEffect.Poison)
{
}
public PoisonPotion(Serial serial) : base(serial)
{
}
public override Poison Poison => Poison.Regular;
public override double MinPoisoningSkill => 30.0;
public override double MaxPoisoningSkill => 70.0;
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 Poison Poison => Poison.Regular;
public override double MinPoisoningSkill => 30.0;
public override double MaxPoisoningSkill => 70.0;
}

View file

@ -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.");
}
}
}

View file

@ -1,30 +1,14 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class RefreshPotion : BaseRefreshPotion
{
public class RefreshPotion : BaseRefreshPotion
[Constructible]
public RefreshPotion() : base(PotionEffect.Refresh)
{
[Constructible]
public RefreshPotion() : base(PotionEffect.Refresh)
{
}
public RefreshPotion(Serial serial) : base(serial)
{
}
public override double Refresh => 0.25;
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 double Refresh => 0.25;
}

View file

@ -1,30 +1,14 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class TotalRefreshPotion : BaseRefreshPotion
{
public class TotalRefreshPotion : BaseRefreshPotion
[Constructible]
public TotalRefreshPotion() : base(PotionEffect.RefreshTotal)
{
[Constructible]
public TotalRefreshPotion() : base(PotionEffect.RefreshTotal)
{
}
public TotalRefreshPotion(Serial serial) : base(serial)
{
}
public override double Refresh => 1.0;
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 double Refresh => 1.0;
}

View file

@ -1,60 +1,43 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class BaseStrengthPotion : BasePotion
{
public abstract class BaseStrengthPotion : BasePotion
public BaseStrengthPotion(PotionEffect effect) : base(0xF09, effect)
{
public BaseStrengthPotion(PotionEffect effect) : base(0xF09, effect)
}
public abstract int StrOffset { get; }
public abstract TimeSpan Duration { get; }
public bool DoStrength(Mobile from)
{
// TODO: Verify scaled; is it offset, duration, or both?
if (SpellHelper.AddStatOffset(from, StatType.Str, Scale(from, StrOffset), Duration))
{
from.FixedEffect(0x375A, 10, 15);
from.PlaySound(0x1E7);
return true;
}
public BaseStrengthPotion(Serial serial) : base(serial)
from.SendLocalizedMessage(502173); // You are already under a similar effect.
return false;
}
public override void Drink(Mobile from)
{
if (DoStrength(from))
{
}
PlayDrinkEffect(from);
public abstract int StrOffset { get; }
public abstract TimeSpan Duration { 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 bool DoStrength(Mobile from)
{
// TODO: Verify scaled; is it offset, duration, or both?
if (SpellHelper.AddStatOffset(from, StatType.Str, Scale(from, StrOffset), Duration))
if (!DuelContext.IsFreeConsume(from))
{
from.FixedEffect(0x375A, 10, 15);
from.PlaySound(0x1E7);
return true;
}
from.SendLocalizedMessage(502173); // You are already under a similar effect.
return false;
}
public override void Drink(Mobile from)
{
if (DoStrength(from))
{
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
Consume();
}
}
}

View file

@ -1,33 +1,16 @@
using System;
using ModernUO.Serialization;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class GreaterStrengthPotion : BaseStrengthPotion
{
public class GreaterStrengthPotion : BaseStrengthPotion
[Constructible]
public GreaterStrengthPotion() : base(PotionEffect.StrengthGreater)
{
[Constructible]
public GreaterStrengthPotion() : base(PotionEffect.StrengthGreater)
{
}
public GreaterStrengthPotion(Serial serial) : base(serial)
{
}
public override int StrOffset => 20;
public override TimeSpan Duration => TimeSpan.FromMinutes(2.0);
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 int StrOffset => 20;
public override TimeSpan Duration => TimeSpan.FromMinutes(2.0);
}

View file

@ -1,33 +1,20 @@
using System;
using ModernUO.Serialization;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class StrengthPotion : BaseStrengthPotion
{
public class StrengthPotion : BaseStrengthPotion
[Constructible]
public StrengthPotion() : base(PotionEffect.Strength)
{
[Constructible]
public StrengthPotion() : base(PotionEffect.Strength)
{
}
public StrengthPotion(Serial serial) : base(serial)
{
}
public override int StrOffset => 10;
public override TimeSpan Duration => TimeSpan.FromMinutes(2.0);
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 StrengthPotion(Serial serial) : base(serial)
{
}
public override int StrOffset => 10;
public override TimeSpan Duration => TimeSpan.FromMinutes(2.0);
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.AgilityPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BaseAgilityPotion"
}

View file

@ -0,0 +1,35 @@
{
"version": 0,
"type": "Server.Items.BaseConflagrationPotion.InternalItem",
"properties": [
{
"name": "From",
"type": "Server.Mobile",
"rule": "SerializableInterfaceMigrationRule"
},
{
"name": "End",
"type": "System.DateTime",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "MinDamage",
"type": "int",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "MaxDamage",
"type": "int",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
}
]
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BaseConflagrationPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BaseConfusionBlastPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BaseCurePotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BaseExplosionPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BaseHealPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BasePoisonPotion"
}

View file

@ -0,0 +1,11 @@
{
"version": 2,
"type": "Server.Items.BasePotion",
"properties": [
{
"name": "PotionEffect",
"type": "Server.Items.PotionEffect",
"rule": "EnumMigrationRule"
}
]
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BaseRefreshPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.BaseStrengthPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.ConflagrationPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.ConfusionBlastPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.CurePotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DarkglowPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DeadlyPoisonPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.ExplosionPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GreaterAgilityPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GreaterConflagrationPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GreaterConfusionBlastPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GreaterExplosionPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GreaterHealPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GreaterPoisonPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GreaterStrengthPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.HealPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.InvisibilityPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.LesserCurePotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.LesserExplosionPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.LesserHealPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.LesserPoisonPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.NightSightPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.ParasiticPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.PoisonPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.RefreshPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.StrengthPotion"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.TotalRefreshPotion"
}