diff --git a/Projects/UOContent/Items/Traps/BaseTrap.cs b/Projects/UOContent/Items/Traps/BaseTrap.cs index 5ee4e4fd8..9608c0a06 100644 --- a/Projects/UOContent/Items/Traps/BaseTrap.cs +++ b/Projects/UOContent/Items/Traps/BaseTrap.cs @@ -1,83 +1,66 @@ using System; +using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public abstract partial class BaseTrap : Item { - public abstract class BaseTrap : Item + private DateTime m_NextPassiveTrigger, m_NextActiveTrigger; + + public BaseTrap(int itemID) : base(itemID) => Movable = false; + + public virtual bool PassivelyTriggered => false; + public virtual TimeSpan PassiveTriggerDelay => TimeSpan.Zero; + public virtual int PassiveTriggerRange => -1; + public virtual TimeSpan ResetDelay => TimeSpan.Zero; + + public override bool HandlesOnMovement => true; // Tell the core that we implement OnMovement + + public virtual void OnTrigger(Mobile from) { - private DateTime m_NextPassiveTrigger, m_NextActiveTrigger; + } - public BaseTrap(int itemID) : base(itemID) => Movable = false; + public virtual int GetEffectHue() + { + var hue = Hue & 0x3FFF; - public BaseTrap(Serial serial) : base(serial) + if (hue < 2) { + return 0; } - public virtual bool PassivelyTriggered => false; - public virtual TimeSpan PassiveTriggerDelay => TimeSpan.Zero; - public virtual int PassiveTriggerRange => -1; - public virtual TimeSpan ResetDelay => TimeSpan.Zero; + return hue - 1; + } - public override bool HandlesOnMovement => true; // Tell the core that we implement OnMovement + public bool CheckRange(Point3D loc, Point3D oldLoc, int range) => + CheckRange(loc, range) && !CheckRange(oldLoc, range); - public virtual void OnTrigger(Mobile from) + public bool CheckRange(Point3D loc, int range) => + Z + 8 >= loc.Z && loc.Z + 16 > Z + && Utility.InRange(GetWorldLocation(), loc, range); + + public override void OnMovement(Mobile m, Point3D oldLocation) + { + base.OnMovement(m, oldLocation); + + if (m.Location == oldLocation) { + return; } - public virtual int GetEffectHue() + if (CheckRange(m.Location, oldLocation, 0) && Core.Now >= m_NextActiveTrigger) { - var hue = Hue & 0x3FFF; + m_NextActiveTrigger = m_NextPassiveTrigger = Core.Now + ResetDelay; - if (hue < 2) - { - return 0; - } - - return hue - 1; + OnTrigger(m); } - - public bool CheckRange(Point3D loc, Point3D oldLoc, int range) => - CheckRange(loc, range) && !CheckRange(oldLoc, range); - - public bool CheckRange(Point3D loc, int range) => - Z + 8 >= loc.Z && loc.Z + 16 > Z - && Utility.InRange(GetWorldLocation(), loc, range); - - public override void OnMovement(Mobile m, Point3D oldLocation) + else if (PassivelyTriggered && CheckRange(m.Location, oldLocation, PassiveTriggerRange) && + Core.Now >= m_NextPassiveTrigger) { - base.OnMovement(m, oldLocation); + m_NextPassiveTrigger = Core.Now + PassiveTriggerDelay; - if (m.Location == oldLocation) - { - return; - } - - if (CheckRange(m.Location, oldLocation, 0) && Core.Now >= m_NextActiveTrigger) - { - m_NextActiveTrigger = m_NextPassiveTrigger = Core.Now + ResetDelay; - - OnTrigger(m); - } - else if (PassivelyTriggered && CheckRange(m.Location, oldLocation, PassiveTriggerRange) && - Core.Now >= m_NextPassiveTrigger) - { - m_NextPassiveTrigger = Core.Now + PassiveTriggerDelay; - - OnTrigger(m); - } - } - - 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(); + OnTrigger(m); } } } diff --git a/Projects/UOContent/Items/Traps/FireColumnTrap.cs b/Projects/UOContent/Items/Traps/FireColumnTrap.cs index e2a5c2179..928e4f8d9 100644 --- a/Projects/UOContent/Items/Traps/FireColumnTrap.cs +++ b/Projects/UOContent/Items/Traps/FireColumnTrap.cs @@ -1,134 +1,80 @@ using System; +using ModernUO.Serialization; using Server.Spells; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class FireColumnTrap : BaseTrap { - public class FireColumnTrap : BaseTrap + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private bool _warningFlame; + + [SerializableField(1)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _minDamage; + + [SerializableField(2)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _maxDamage; + + [Constructible] + public FireColumnTrap() : base(0x1B71) { - private int m_MaxDamage; + _minDamage = 10; + _maxDamage = 40; - private int m_MinDamage; + _warningFlame = true; + } - private bool m_WarningFlame; + public override bool PassivelyTriggered => true; + public override TimeSpan PassiveTriggerDelay => TimeSpan.FromSeconds(2.0); + public override int PassiveTriggerRange => 3; + public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.5); - [Constructible] - public FireColumnTrap() : base(0x1B71) + public override void OnTrigger(Mobile from) + { + if (from.AccessLevel > AccessLevel.Player) { - m_MinDamage = 10; - m_MaxDamage = 40; - - m_WarningFlame = true; + return; } - public FireColumnTrap(Serial serial) : base(serial) + if (WarningFlame) { + DoEffect(); } - public override bool PassivelyTriggered => true; - public override TimeSpan PassiveTriggerDelay => TimeSpan.FromSeconds(2.0); - public override int PassiveTriggerRange => 3; - public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.5); - - [CommandProperty(AccessLevel.GameMaster)] - public virtual int MinDamage + if (from.Alive && CheckRange(from.Location, 0)) { - get => m_MinDamage; - set => m_MinDamage = value; - } + SpellHelper.Damage( + TimeSpan.FromSeconds(0.5), + from, + from, + Utility.RandomMinMax(MinDamage, MaxDamage), + 0, + 100, + 0, + 0, + 0 + ); - [CommandProperty(AccessLevel.GameMaster)] - public virtual int MaxDamage - { - get => m_MaxDamage; - set => m_MaxDamage = value; - } - - [CommandProperty(AccessLevel.GameMaster)] - public virtual bool WarningFlame - { - get => m_WarningFlame; - set => m_WarningFlame = value; - } - - public override void OnTrigger(Mobile from) - { - if (from.AccessLevel > AccessLevel.Player) - { - return; - } - - if (WarningFlame) + if (!WarningFlame) { DoEffect(); } - - if (from.Alive && CheckRange(from.Location, 0)) - { - SpellHelper.Damage( - TimeSpan.FromSeconds(0.5), - from, - from, - Utility.RandomMinMax(MinDamage, MaxDamage), - 0, - 100, - 0, - 0, - 0 - ); - - if (!WarningFlame) - { - DoEffect(); - } - } - } - - private void DoEffect() - { - Effects.SendLocationParticles( - EffectItem.Create(Location, Map, EffectItem.DefaultDuration), - 0x3709, - 10, - 30, - 5052 - ); - Effects.PlaySound(Location, Map, 0x225); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(1); // version - - writer.Write(m_WarningFlame); - writer.Write(m_MinDamage); - writer.Write(m_MaxDamage); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 1: - { - m_WarningFlame = reader.ReadBool(); - m_MinDamage = reader.ReadInt(); - m_MaxDamage = reader.ReadInt(); - break; - } - } - - if (version == 0) - { - m_WarningFlame = true; - m_MinDamage = 10; - m_MaxDamage = 40; - } } } + + private void DoEffect() + { + Effects.SendLocationParticles( + EffectItem.Create(Location, Map, EffectItem.DefaultDuration), + 0x3709, + 10, + 30, + 5052 + ); + Effects.PlaySound(Location, Map, 0x225); + } } diff --git a/Projects/UOContent/Items/Traps/FlameSpurtTrap.cs b/Projects/UOContent/Items/Traps/FlameSpurtTrap.cs index 18ea40a46..dd62f9c02 100644 --- a/Projects/UOContent/Items/Traps/FlameSpurtTrap.cs +++ b/Projects/UOContent/Items/Traps/FlameSpurtTrap.cs @@ -1,178 +1,152 @@ using System; +using ModernUO.Serialization; using Server.Spells; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class FlameSpurtTrap : BaseTrap { - public class FlameSpurtTrap : BaseTrap + private Item _spurt; + private TimerExecutionToken _timerToken; + + [Constructible] + public FlameSpurtTrap() : base(0x1B71) => Visible = false; + + public virtual void StartTimer() { - private Item m_Spurt; - private TimerExecutionToken _timerToken; - - [Constructible] - public FlameSpurtTrap() : base(0x1B71) => Visible = false; - - public FlameSpurtTrap(Serial serial) : base(serial) + if (!_timerToken.Running) { + Timer.StartTimer(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), Refresh, out _timerToken); } + } - public virtual void StartTimer() + public virtual void StopTimer() + { + _timerToken.Cancel(); + } + + public virtual void CheckTimer() + { + var map = Map; + + if (map?.GetSector(GetWorldLocation()).Active == true) { - if (!_timerToken.Running) - { - Timer.StartTimer(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), Refresh, out _timerToken); - } - } - - public virtual void StopTimer() - { - _timerToken.Cancel(); - } - - public virtual void CheckTimer() - { - var map = Map; - - if (map?.GetSector(GetWorldLocation()).Active == true) - { - StartTimer(); - } - else - { - StopTimer(); - } - } - - public override void OnLocationChange(Point3D oldLocation) - { - base.OnLocationChange(oldLocation); - - CheckTimer(); - } - - public override void OnMapChange() - { - base.OnMapChange(); - - CheckTimer(); - } - - public override void OnSectorActivate() - { - base.OnSectorActivate(); - StartTimer(); } - - public override void OnSectorDeactivate() + else { - base.OnSectorDeactivate(); - StopTimer(); } + } - public override void OnDelete() + public override void OnLocationChange(Point3D oldLocation) + { + base.OnLocationChange(oldLocation); + + CheckTimer(); + } + + public override void OnMapChange() + { + base.OnMapChange(); + + CheckTimer(); + } + + public override void OnSectorActivate() + { + base.OnSectorActivate(); + + StartTimer(); + } + + public override void OnSectorDeactivate() + { + base.OnSectorDeactivate(); + + StopTimer(); + } + + public override void OnDelete() + { + base.OnDelete(); + + _spurt?.Delete(); + } + + public virtual void Refresh() + { + if (Deleted) { - base.OnDelete(); - - m_Spurt?.Delete(); + return; } - public virtual void Refresh() + foreach (var mob in GetMobilesInRange(3)) { - if (Deleted) + if (mob.Player && mob.Alive && mob.AccessLevel <= AccessLevel.Player && Z + 8 >= mob.Z && mob.Z + 16 > Z) { + if (_spurt?.Deleted != false) + { + _spurt = new Static(0x3709); + _spurt.MoveToWorld(Location, Map); + + Effects.PlaySound(GetWorldLocation(), Map, 0x309); + } + return; } - - foreach (var mob in GetMobilesInRange(3)) - { - if (mob.Player && mob.Alive && mob.AccessLevel <= AccessLevel.Player && Z + 8 >= mob.Z && mob.Z + 16 > Z) - { - if (m_Spurt?.Deleted != false) - { - m_Spurt = new Static(0x3709); - m_Spurt.MoveToWorld(Location, Map); - - Effects.PlaySound(GetWorldLocation(), Map, 0x309); - } - - return; - } - } - - m_Spurt?.Delete(); - m_Spurt = null; } - public override bool OnMoveOver(Mobile m) + _spurt?.Delete(); + _spurt = null; + } + + public override bool OnMoveOver(Mobile m) + { + if (m.AccessLevel > AccessLevel.Player) { - if (m.AccessLevel > AccessLevel.Player) - { - return true; - } - - if (!(m.Player && m.Alive)) - { - return false; - } - - CheckTimer(); - - SpellHelper.Damage(TimeSpan.FromTicks(1), m, m, Utility.RandomMinMax(1, 30)); - m.PlaySound(m.Female ? 0x327 : 0x437); + return true; + } + if (!(m.Player && m.Alive)) + { return false; } - public override void OnMovement(Mobile m, Point3D oldLocation) + CheckTimer(); + + SpellHelper.Damage(TimeSpan.FromTicks(1), m, m, Utility.RandomMinMax(1, 30)); + m.PlaySound(m.Female ? 0x327 : 0x437); + + return false; + } + + public override void OnMovement(Mobile m, Point3D oldLocation) + { + base.OnMovement(m, oldLocation); + + if (m.Location == oldLocation || !m.Player || !m.Alive || m.AccessLevel > AccessLevel.Player + || !CheckRange(m.Location, oldLocation, 1)) { - base.OnMovement(m, oldLocation); - - if (m.Location == oldLocation || !m.Player || !m.Alive || m.AccessLevel > AccessLevel.Player - || !CheckRange(m.Location, oldLocation, 1)) - { - return; - } - - CheckTimer(); - - SpellHelper.Damage(TimeSpan.FromTicks(1), m, m, Utility.RandomMinMax(1, 10)); - m.PlaySound(m.Female ? 0x327 : 0x437); - - if (m.Body.IsHuman) - { - m.Animate(20, 1, 1, true, false, 0); - } + return; } - public override void Serialize(IGenericWriter writer) + CheckTimer(); + + SpellHelper.Damage(TimeSpan.FromTicks(1), m, m, Utility.RandomMinMax(1, 10)); + m.PlaySound(m.Female ? 0x327 : 0x437); + + if (m.Body.IsHuman) { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write(m_Spurt); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 0: - { - var item = reader.ReadEntity(); - - item?.Delete(); - - CheckTimer(); - - break; - } - } + m.Animate(20, 1, 1, true, false, 0); } } + + [AfterDeserialization(false)] + private void AfterDeserialization() + { + _spurt?.Delete(); + CheckTimer(); + } } diff --git a/Projects/UOContent/Items/Traps/GasTrap.cs b/Projects/UOContent/Items/Traps/GasTrap.cs index 04591abf6..03a9d4e5e 100644 --- a/Projects/UOContent/Items/Traps/GasTrap.cs +++ b/Projects/UOContent/Items/Traps/GasTrap.cs @@ -1,106 +1,76 @@ using System; +using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +public enum GasTrapType { - public enum GasTrapType + NorthWall, + WestWall, + Floor +} + +[SerializationGenerator(0, false)] +public partial class GasTrap : BaseTrap +{ + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private Poison _poison; + + [Constructible] + public GasTrap() : this(Poison.Lesser) { - NorthWall, - WestWall, - Floor } - public class GasTrap : BaseTrap + [Constructible] + public GasTrap(Poison poison) : this(GasTrapType.Floor, poison) { - [Constructible] - public GasTrap() : this(Poison.Lesser) + } + + [Constructible] + public GasTrap(GasTrapType type, Poison poison = null) : base(GetBaseID(type)) => Poison = poison; + + [CommandProperty(AccessLevel.GameMaster)] + public GasTrapType Type + { + get => ItemID switch { + 0x113C => GasTrapType.NorthWall, + 0x1147 => GasTrapType.WestWall, + 0x11A8 => GasTrapType.Floor, + _ => GasTrapType.WestWall + }; + set => ItemID = GetBaseID(value); + } + + public override bool PassivelyTriggered => false; + public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; + public override int PassiveTriggerRange => 0; + public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.0); + + public static int GetBaseID(GasTrapType type) + { + return type switch + { + GasTrapType.NorthWall => 0x113C, + GasTrapType.WestWall => 0x1147, + GasTrapType.Floor => 0x11A8, + _ => 0 + }; + } + + public override void OnTrigger(Mobile from) + { + if (Poison == null || !from.Player || !from.Alive || from.AccessLevel > AccessLevel.Player) + { + return; } - [Constructible] - public GasTrap(Poison poison) : this(GasTrapType.Floor, poison) - { - } + Effects.SendLocationEffect(Location, Map, GetBaseID(Type) - 2, 16, 3, GetEffectHue()); + Effects.PlaySound(Location, Map, 0x231); - [Constructible] - public GasTrap(GasTrapType type, Poison poison = null) : base(GetBaseID(type)) => Poison = poison; + from.ApplyPoison(from, Poison); - public GasTrap(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public Poison Poison { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public GasTrapType Type - { - get - { - return ItemID switch - { - 0x113C => GasTrapType.NorthWall, - 0x1147 => GasTrapType.WestWall, - 0x11A8 => GasTrapType.Floor, - _ => GasTrapType.WestWall - }; - } - set => ItemID = GetBaseID(value); - } - - public override bool PassivelyTriggered => false; - public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; - public override int PassiveTriggerRange => 0; - public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.0); - - public static int GetBaseID(GasTrapType type) - { - return type switch - { - GasTrapType.NorthWall => 0x113C, - GasTrapType.WestWall => 0x1147, - GasTrapType.Floor => 0x11A8, - _ => 0 - }; - } - - public override void OnTrigger(Mobile from) - { - if (Poison == null || !from.Player || !from.Alive || from.AccessLevel > AccessLevel.Player) - { - return; - } - - Effects.SendLocationEffect(Location, Map, GetBaseID(Type) - 2, 16, 3, GetEffectHue()); - Effects.PlaySound(Location, Map, 0x231); - - from.ApplyPoison(from, Poison); - - from.LocalOverheadMessage(MessageType.Regular, 0x22, 500855); // You are enveloped by a noxious gas cloud! - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write(Poison); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 0: - { - Poison = reader.ReadPoison(); - break; - } - } - } + from.LocalOverheadMessage(MessageType.Regular, 0x22, 500855); // You are enveloped by a noxious gas cloud! } } diff --git a/Projects/UOContent/Items/Traps/GiantSpikeTrap.cs b/Projects/UOContent/Items/Traps/GiantSpikeTrap.cs index 6978b947b..02c8c7100 100644 --- a/Projects/UOContent/Items/Traps/GiantSpikeTrap.cs +++ b/Projects/UOContent/Items/Traps/GiantSpikeTrap.cs @@ -1,51 +1,34 @@ using System; +using ModernUO.Serialization; using Server.Spells; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class GiantSpikeTrap : BaseTrap { - public class GiantSpikeTrap : BaseTrap + [Constructible] + public GiantSpikeTrap() : base(1) { - [Constructible] - public GiantSpikeTrap() : base(1) + } + + public override bool PassivelyTriggered => true; + public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; + public override int PassiveTriggerRange => 3; + public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.0); + + public override void OnTrigger(Mobile from) + { + if (from.AccessLevel > AccessLevel.Player) { + return; } - public GiantSpikeTrap(Serial serial) : base(serial) + Effects.SendLocationEffect(Location, Map, 0x1D99, 48, 2, GetEffectHue()); + + if (from.Alive && CheckRange(from.Location, 0)) { - } - - public override bool PassivelyTriggered => true; - public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; - public override int PassiveTriggerRange => 3; - public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.0); - - public override void OnTrigger(Mobile from) - { - if (from.AccessLevel > AccessLevel.Player) - { - return; - } - - Effects.SendLocationEffect(Location, Map, 0x1D99, 48, 2, GetEffectHue()); - - if (from.Alive && CheckRange(from.Location, 0)) - { - SpellHelper.Damage(TimeSpan.FromTicks(1), from, from, Utility.Dice(10, 7, 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(); + SpellHelper.Damage(TimeSpan.FromTicks(1), from, from, Utility.Dice(10, 7, 0)); } } } diff --git a/Projects/UOContent/Items/Traps/MushroomTrap.cs b/Projects/UOContent/Items/Traps/MushroomTrap.cs index 62f1c15b1..566862e6a 100644 --- a/Projects/UOContent/Items/Traps/MushroomTrap.cs +++ b/Projects/UOContent/Items/Traps/MushroomTrap.cs @@ -1,69 +1,56 @@ using System; +using ModernUO.Serialization; using Server.Regions; using Server.Spells; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class MushroomTrap : BaseTrap { - public class MushroomTrap : BaseTrap + [Constructible] + public MushroomTrap() : base(0x1125) { - [Constructible] - public MushroomTrap() : base(0x1125) + } + + public override bool PassivelyTriggered => true; + public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; + public override int PassiveTriggerRange => 2; + public override TimeSpan ResetDelay => TimeSpan.Zero; + + public override void OnTrigger(Mobile from) + { + if (!from.Alive || ItemID != 0x1125 || from.AccessLevel > AccessLevel.Player) { + return; } - public MushroomTrap(Serial serial) : base(serial) + ItemID = 0x1126; + Effects.PlaySound(Location, Map, 0x306); + + SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, Utility.Dice(2, 4, 0)); + + Timer.StartTimer(TimeSpan.FromSeconds(2.0), OnMushroomReset); + } + + public virtual void OnMushroomReset() + { + if (Region.Find(Location, Map).IsPartOf()) { + ItemID = 0x1125; // reset } - - public override bool PassivelyTriggered => true; - public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; - public override int PassiveTriggerRange => 2; - public override TimeSpan ResetDelay => TimeSpan.Zero; - - public override void OnTrigger(Mobile from) + else { - if (!from.Alive || ItemID != 0x1125 || from.AccessLevel > AccessLevel.Player) - { - return; - } - - ItemID = 0x1126; - Effects.PlaySound(Location, Map, 0x306); - - SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, Utility.Dice(2, 4, 0)); - - Timer.StartTimer(TimeSpan.FromSeconds(2.0), OnMushroomReset); + Delete(); } + } - public virtual void OnMushroomReset() + [AfterDeserialization(false)] + private void AfterDeserialization() + { + if (ItemID == 0x1126) { - if (Region.Find(Location, Map).IsPartOf()) - { - ItemID = 0x1125; // reset - } - else - { - Delete(); - } - } - - 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(); - - if (ItemID == 0x1126) - { - OnMushroomReset(); - } + OnMushroomReset(); } } } diff --git a/Projects/UOContent/Items/Traps/SawTrap.cs b/Projects/UOContent/Items/Traps/SawTrap.cs index 5cf4c9e8c..d4ab21077 100644 --- a/Projects/UOContent/Items/Traps/SawTrap.cs +++ b/Projects/UOContent/Items/Traps/SawTrap.cs @@ -1,88 +1,87 @@ using System; using Server.Spells; -namespace Server.Items +namespace Server.Items; + +public enum SawTrapType { - public enum SawTrapType + WestWall, + NorthWall, + WestFloor, + NorthFloor +} + +public class SawTrap : BaseTrap +{ + [Constructible] + public SawTrap(SawTrapType type = SawTrapType.NorthFloor) : base(GetBaseID(type)) { - WestWall, - NorthWall, - WestFloor, - NorthFloor } - public class SawTrap : BaseTrap + public SawTrap(Serial serial) : base(serial) { - [Constructible] - public SawTrap(SawTrapType type = SawTrapType.NorthFloor) : base(GetBaseID(type)) - { - } + } - public SawTrap(Serial serial) : base(serial) + [CommandProperty(AccessLevel.GameMaster)] + public SawTrapType Type + { + get { - } - - [CommandProperty(AccessLevel.GameMaster)] - public SawTrapType Type - { - get + return ItemID switch { - return ItemID switch - { - 0x1103 => SawTrapType.NorthWall, - 0x1116 => SawTrapType.WestWall, - 0x11AC => SawTrapType.NorthFloor, - 0x11B1 => SawTrapType.WestFloor, - _ => SawTrapType.NorthWall - }; - } - set => ItemID = GetBaseID(value); - } - - public override bool PassivelyTriggered => false; - public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; - public override int PassiveTriggerRange => 0; - public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.0); - - public static int GetBaseID(SawTrapType type) - { - return type switch - { - SawTrapType.NorthWall => 0x1103, - SawTrapType.WestWall => 0x1116, - SawTrapType.NorthFloor => 0x11AC, - SawTrapType.WestFloor => 0x11B1, - _ => 0 + 0x1103 => SawTrapType.NorthWall, + 0x1116 => SawTrapType.WestWall, + 0x11AC => SawTrapType.NorthFloor, + 0x11B1 => SawTrapType.WestFloor, + _ => SawTrapType.NorthWall }; } - - public override void OnTrigger(Mobile from) - { - if (!from.Alive || from.AccessLevel > AccessLevel.Player) - { - return; - } - - Effects.SendLocationEffect(Location, Map, GetBaseID(Type) + 1, 6, 3, GetEffectHue()); - Effects.PlaySound(Location, Map, 0x21C); - - SpellHelper.Damage(TimeSpan.FromTicks(1), from, from, Utility.RandomMinMax(5, 15)); - - from.LocalOverheadMessage(MessageType.Regular, 0x22, 500853); // You stepped onto a blade trap! - } - - 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(); - } + set => ItemID = GetBaseID(value); } -} + + public override bool PassivelyTriggered => false; + public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; + public override int PassiveTriggerRange => 0; + public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.0); + + public static int GetBaseID(SawTrapType type) + { + return type switch + { + SawTrapType.NorthWall => 0x1103, + SawTrapType.WestWall => 0x1116, + SawTrapType.NorthFloor => 0x11AC, + SawTrapType.WestFloor => 0x11B1, + _ => 0 + }; + } + + public override void OnTrigger(Mobile from) + { + if (!from.Alive || from.AccessLevel > AccessLevel.Player) + { + return; + } + + Effects.SendLocationEffect(Location, Map, GetBaseID(Type) + 1, 6, 3, GetEffectHue()); + Effects.PlaySound(Location, Map, 0x21C); + + SpellHelper.Damage(TimeSpan.FromTicks(1), from, from, Utility.RandomMinMax(5, 15)); + + from.LocalOverheadMessage(MessageType.Regular, 0x22, 500853); // You stepped onto a blade trap! + } + + 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(); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Traps/SpikeTrap.cs b/Projects/UOContent/Items/Traps/SpikeTrap.cs index 9a0ec4b8a..dd036a583 100644 --- a/Projects/UOContent/Items/Traps/SpikeTrap.cs +++ b/Projects/UOContent/Items/Traps/SpikeTrap.cs @@ -1,153 +1,125 @@ using System; +using ModernUO.Serialization; using Server.Spells; -namespace Server.Items +namespace Server.Items; + +public enum SpikeTrapType { - public enum SpikeTrapType + WestWall, + NorthWall, + WestFloor, + NorthFloor +} + +[SerializationGenerator(0, false)] +public partial class SpikeTrap : BaseTrap +{ + [Constructible] + public SpikeTrap(SpikeTrapType type = SpikeTrapType.WestFloor) : base(GetBaseID(type)) { - WestWall, - NorthWall, - WestFloor, - NorthFloor } - public class SpikeTrap : BaseTrap + [CommandProperty(AccessLevel.GameMaster)] + public SpikeTrapType Type { - [Constructible] - public SpikeTrap(SpikeTrapType type = SpikeTrapType.WestFloor) : base(GetBaseID(type)) + get { - } - - public SpikeTrap(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public SpikeTrapType Type - { - get + return ItemID switch { - return ItemID switch - { - 4360 => SpikeTrapType.WestWall, - 4361 => SpikeTrapType.WestWall, - 4366 => SpikeTrapType.WestWall, - 4379 => SpikeTrapType.NorthWall, - 4380 => SpikeTrapType.NorthWall, - 4385 => SpikeTrapType.NorthWall, - 4506 => SpikeTrapType.WestFloor, - 4507 => SpikeTrapType.WestFloor, - 4511 => SpikeTrapType.WestFloor, - 4512 => SpikeTrapType.NorthFloor, - 4513 => SpikeTrapType.NorthFloor, - 4517 => SpikeTrapType.NorthFloor, - _ => SpikeTrapType.WestWall - }; - } - set - { - var extended = Extended; - - ItemID = extended ? GetExtendedID(value) : GetBaseID(value); - } - } - - public bool Extended - { - get => ItemID == GetExtendedID(Type); - set - { - if (value) - { - ItemID = GetExtendedID(Type); - } - else - { - ItemID = GetBaseID(Type); - } - } - } - - public override bool PassivelyTriggered => false; - public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; - public override int PassiveTriggerRange => 0; - public override TimeSpan ResetDelay => TimeSpan.FromSeconds(6.0); - - public static int GetBaseID(SpikeTrapType type) - { - return type switch - { - SpikeTrapType.WestWall => 4360, - SpikeTrapType.NorthWall => 4379, - SpikeTrapType.WestFloor => 4506, - SpikeTrapType.NorthFloor => 4512, - _ => 0 + 4360 => SpikeTrapType.WestWall, + 4361 => SpikeTrapType.WestWall, + 4366 => SpikeTrapType.WestWall, + 4379 => SpikeTrapType.NorthWall, + 4380 => SpikeTrapType.NorthWall, + 4385 => SpikeTrapType.NorthWall, + 4506 => SpikeTrapType.WestFloor, + 4507 => SpikeTrapType.WestFloor, + 4511 => SpikeTrapType.WestFloor, + 4512 => SpikeTrapType.NorthFloor, + 4513 => SpikeTrapType.NorthFloor, + 4517 => SpikeTrapType.NorthFloor, + _ => SpikeTrapType.WestWall }; } + set => ItemID = Extended ? GetExtendedID(value) : GetBaseID(value); + } - public static int GetExtendedID(SpikeTrapType type) => GetBaseID(type) + GetExtendedOffset(type); + public bool Extended + { + get => ItemID == GetExtendedID(Type); + set => ItemID = value ? GetExtendedID(Type) : GetBaseID(Type); + } - public static int GetExtendedOffset(SpikeTrapType type) + public override bool PassivelyTriggered => false; + public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; + public override int PassiveTriggerRange => 0; + public override TimeSpan ResetDelay => TimeSpan.FromSeconds(6.0); + + public static int GetBaseID(SpikeTrapType type) + { + return type switch { - return type switch - { - SpikeTrapType.WestWall => 6, - SpikeTrapType.NorthWall => 6, - SpikeTrapType.WestFloor => 5, - SpikeTrapType.NorthFloor => 5, - _ => 0 - }; + SpikeTrapType.WestWall => 4360, + SpikeTrapType.NorthWall => 4379, + SpikeTrapType.WestFloor => 4506, + SpikeTrapType.NorthFloor => 4512, + _ => 0 + }; + } + + public static int GetExtendedID(SpikeTrapType type) => GetBaseID(type) + GetExtendedOffset(type); + + public static int GetExtendedOffset(SpikeTrapType type) + { + return type switch + { + SpikeTrapType.WestWall => 6, + SpikeTrapType.NorthWall => 6, + SpikeTrapType.WestFloor => 5, + SpikeTrapType.NorthFloor => 5, + _ => 0 + }; + } + + public override void OnTrigger(Mobile from) + { + if (!from.Alive || from.AccessLevel > AccessLevel.Player) + { + return; } - public override void OnTrigger(Mobile from) + Effects.SendLocationEffect(Location, Map, GetBaseID(Type) + 1, 18, 3, GetEffectHue()); + Effects.PlaySound(Location, Map, 0x22C); + + foreach (var mob in GetMobilesInRange(0)) { - if (!from.Alive || from.AccessLevel > AccessLevel.Player) + if (mob.Alive && !mob.IsDeadBondedPet) { - return; + SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, Utility.RandomMinMax(1, 6) * 6); } - - Effects.SendLocationEffect(Location, Map, GetBaseID(Type) + 1, 18, 3, GetEffectHue()); - Effects.PlaySound(Location, Map, 0x22C); - - foreach (var mob in GetMobilesInRange(0)) - { - if (mob.Alive && !mob.IsDeadBondedPet) - { - SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, Utility.RandomMinMax(1, 6) * 6); - } - } - - Timer.StartTimer(TimeSpan.FromSeconds(1.0), OnSpikeExtended); - - from.LocalOverheadMessage(MessageType.Regular, 0x22, 500852); // You stepped onto a spike trap! } - public virtual void OnSpikeExtended() - { - Extended = true; - Timer.StartTimer(TimeSpan.FromSeconds(5.0), OnSpikeRetracted); - } + Timer.StartTimer(TimeSpan.FromSeconds(1.0), OnSpikeExtended); - public virtual void OnSpikeRetracted() - { - Extended = false; - Effects.SendLocationEffect(Location, Map, GetExtendedID(Type) - 1, 6, 3, GetEffectHue()); - } + from.LocalOverheadMessage(MessageType.Regular, 0x22, 500852); // You stepped onto a spike trap! + } - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); + public virtual void OnSpikeExtended() + { + Extended = true; + Timer.StartTimer(TimeSpan.FromSeconds(5.0), OnSpikeRetracted); + } - writer.Write(0); // version - } + public virtual void OnSpikeRetracted() + { + Extended = false; + Effects.SendLocationEffect(Location, Map, GetExtendedID(Type) - 1, 6, 3, GetEffectHue()); + } - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - Extended = false; - } + [AfterDeserialization] + private void AfterDeserialization() + { + Extended = false; } } diff --git a/Projects/UOContent/Items/Traps/StoneFaceTrap.cs b/Projects/UOContent/Items/Traps/StoneFaceTrap.cs index 8c454901c..322cb192b 100644 --- a/Projects/UOContent/Items/Traps/StoneFaceTrap.cs +++ b/Projects/UOContent/Items/Traps/StoneFaceTrap.cs @@ -1,170 +1,125 @@ using System; +using ModernUO.Serialization; using Server.Spells; -namespace Server.Items +namespace Server.Items; + +public enum StoneFaceTrapType { - public enum StoneFaceTrapType + NorthWestWall, + NorthWall, + WestWall +} + +[SerializationGenerator(0, false)] +public partial class StoneFaceTrap : BaseTrap +{ + [Constructible] + public StoneFaceTrap() : base(0x10FC) => Light = LightType.Circle225; + + [CommandProperty(AccessLevel.GameMaster)] + public StoneFaceTrapType Type { - NorthWestWall, - NorthWall, - WestWall + get + { + return ItemID switch + { + 0x10F5 => StoneFaceTrapType.NorthWestWall, + 0x10F6 => StoneFaceTrapType.NorthWestWall, + 0x10F7 => StoneFaceTrapType.NorthWestWall, + 0x10FC => StoneFaceTrapType.NorthWall, + 0x10FD => StoneFaceTrapType.NorthWall, + 0x10FE => StoneFaceTrapType.NorthWall, + 0x110F => StoneFaceTrapType.WestWall, + 0x1110 => StoneFaceTrapType.WestWall, + 0x1111 => StoneFaceTrapType.WestWall, + _ => StoneFaceTrapType.NorthWestWall + }; + } + set => ItemID = Breathing ? GetFireID(value) : GetBaseID(value); } - public class StoneFaceTrap : BaseTrap + public bool Breathing { - [Constructible] - public StoneFaceTrap() : base(0x10FC) => Light = LightType.Circle225; + get => ItemID == GetFireID(Type); + set => ItemID = value ? GetFireID(Type) : GetBaseID(Type); + } - public StoneFaceTrap(Serial serial) : base(serial) + public override bool PassivelyTriggered => true; + public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; + public override int PassiveTriggerRange => 2; + public override TimeSpan ResetDelay => TimeSpan.Zero; + + public static int GetBaseID(StoneFaceTrapType type) + { + return type switch { + StoneFaceTrapType.NorthWestWall => 0x10F5, + StoneFaceTrapType.NorthWall => 0x10FC, + StoneFaceTrapType.WestWall => 0x110F, + _ => 0 + }; + } + + public static int GetFireID(StoneFaceTrapType type) + { + return type switch + { + StoneFaceTrapType.NorthWestWall => 0x10F7, + StoneFaceTrapType.NorthWall => 0x10FE, + StoneFaceTrapType.WestWall => 0x1111, + _ => 0 + }; + } + + public override void OnTrigger(Mobile from) + { + if (!from.Alive || from.AccessLevel > AccessLevel.Player) + { + return; } - [CommandProperty(AccessLevel.GameMaster)] - public StoneFaceTrapType Type + Effects.PlaySound(Location, Map, 0x359); + + Breathing = true; + + Timer.StartTimer(TimeSpan.FromSeconds(2.0), FinishBreath); + Timer.StartTimer(TimeSpan.FromSeconds(1.0), TriggerDamage); + } + + public virtual void FinishBreath() + { + Breathing = false; + } + + public virtual void TriggerDamage() + { + foreach (var mob in GetMobilesInRange(1)) { - get + if (mob.Alive && !mob.IsDeadBondedPet && mob.AccessLevel == AccessLevel.Player) { - return ItemID switch - { - 0x10F5 => StoneFaceTrapType.NorthWestWall, - 0x10F6 => StoneFaceTrapType.NorthWestWall, - 0x10F7 => StoneFaceTrapType.NorthWestWall, - 0x10FC => StoneFaceTrapType.NorthWall, - 0x10FD => StoneFaceTrapType.NorthWall, - 0x10FE => StoneFaceTrapType.NorthWall, - 0x110F => StoneFaceTrapType.WestWall, - 0x1110 => StoneFaceTrapType.WestWall, - 0x1111 => StoneFaceTrapType.WestWall, - _ => StoneFaceTrapType.NorthWestWall - }; + SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, Utility.Dice(3, 15, 0)); } - set - { - var breathing = Breathing; - - ItemID = breathing ? GetFireID(value) : GetBaseID(value); - } - } - - public bool Breathing - { - get => ItemID == GetFireID(Type); - set - { - if (value) - { - ItemID = GetFireID(Type); - } - else - { - ItemID = GetBaseID(Type); - } - } - } - - public override bool PassivelyTriggered => true; - public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero; - public override int PassiveTriggerRange => 2; - public override TimeSpan ResetDelay => TimeSpan.Zero; - - public static int GetBaseID(StoneFaceTrapType type) - { - return type switch - { - StoneFaceTrapType.NorthWestWall => 0x10F5, - StoneFaceTrapType.NorthWall => 0x10FC, - StoneFaceTrapType.WestWall => 0x110F, - _ => 0 - }; - } - - public static int GetFireID(StoneFaceTrapType type) - { - return type switch - { - StoneFaceTrapType.NorthWestWall => 0x10F7, - StoneFaceTrapType.NorthWall => 0x10FE, - StoneFaceTrapType.WestWall => 0x1111, - _ => 0 - }; - } - - public override void OnTrigger(Mobile from) - { - if (!from.Alive || from.AccessLevel > AccessLevel.Player) - { - return; - } - - Effects.PlaySound(Location, Map, 0x359); - - Breathing = true; - - Timer.StartTimer(TimeSpan.FromSeconds(2.0), FinishBreath); - Timer.StartTimer(TimeSpan.FromSeconds(1.0), TriggerDamage); - } - - public virtual void FinishBreath() - { - Breathing = false; - } - - public virtual void TriggerDamage() - { - foreach (var mob in GetMobilesInRange(1)) - { - if (mob.Alive && !mob.IsDeadBondedPet && mob.AccessLevel == AccessLevel.Player) - { - SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, Utility.Dice(3, 15, 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(); - - Breathing = false; } } - public class StoneFaceTrapNoDamage : StoneFaceTrap + [AfterDeserialization] + private void AfterDeserialization() { - [Constructible] - public StoneFaceTrapNoDamage() - { - } - - public StoneFaceTrapNoDamage(Serial serial) : base(serial) - { - } - - public override void TriggerDamage() - { - // nothing.. - } - - 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(); - } + Breathing = false; + } +} + +[SerializationGenerator(0, false)] +public partial class StoneFaceTrapNoDamage : StoneFaceTrap +{ + [Constructible] + public StoneFaceTrapNoDamage() + { + } + + public override void TriggerDamage() + { + // nothing.. } } diff --git a/Projects/UOContent/Items/Wands/BaseWand.cs b/Projects/UOContent/Items/Wands/BaseWand.cs index 4dc29a241..58fcccb7c 100644 --- a/Projects/UOContent/Items/Wands/BaseWand.cs +++ b/Projects/UOContent/Items/Wands/BaseWand.cs @@ -5,257 +5,256 @@ using Server.Network; using Server.Spells; using Server.Targeting; -namespace Server.Items +namespace Server.Items; + +public enum WandEffect { - public enum WandEffect + Clumsiness, + Identification, + Healing, + Feeblemindedness, + Weakness, + MagicArrow, + Harming, + Fireball, + GreaterHealing, + Lightning, + ManaDraining +} + +[SerializationGenerator(1, false)] +public abstract partial class BaseWand : BaseBashing +{ + [InvalidateProperties] + [SerializedCommandProperty(AccessLevel.GameMaster)] + [SerializableField(0)] + private WandEffect _wandEffect; + + [InvalidateProperties] + [SerializedCommandProperty(AccessLevel.GameMaster)] + [SerializableField(1)] + private int _charges; + + public BaseWand(WandEffect effect, int minCharges, int maxCharges) : base(0xDF2 + Utility.Random(4)) { - Clumsiness, - Identification, - Healing, - Feeblemindedness, - Weakness, - MagicArrow, - Harming, - Fireball, - GreaterHealing, - Lightning, - ManaDraining + Weight = 1.0; + _wandEffect = effect; + _charges = Utility.RandomMinMax(minCharges, maxCharges); + Attributes.SpellChanneling = 1; + Attributes.CastSpeed = -1; + WeaponAttributes.MageWeapon = Utility.RandomMinMax(1, 10); } - [SerializationGenerator(1, false)] - public abstract partial class BaseWand : BaseBashing + public override WeaponAbility PrimaryAbility => WeaponAbility.Dismount; + public override WeaponAbility SecondaryAbility => WeaponAbility.Disarm; + + public override int AosStrengthReq => 5; + public override int AosMinDamage => 9; + public override int AosMaxDamage => 11; + public override int AosSpeed => 40; + public override float MlSpeed => 2.75f; + + public override int OldStrengthReq => 0; + public override int OldMinDamage => 2; + public override int OldMaxDamage => 6; + public override int OldSpeed => 35; + + public override int InitMinHits => 31; + public override int InitMaxHits => 110; + + public virtual TimeSpan GetUseDelay => TimeSpan.FromSeconds(4.0); + + public void ConsumeCharge(Mobile from) { - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(0)] - private WandEffect _wandEffect; + --Charges; - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(1)] - private int _charges; - - public BaseWand(WandEffect effect, int minCharges, int maxCharges) : base(0xDF2 + Utility.Random(4)) + if (_charges == 0) { - Weight = 1.0; - _wandEffect = effect; - _charges = Utility.RandomMinMax(minCharges, maxCharges); - Attributes.SpellChanneling = 1; - Attributes.CastSpeed = -1; - WeaponAttributes.MageWeapon = Utility.RandomMinMax(1, 10); + from.SendLocalizedMessage(1019073); // This item is out of charges. } - public override WeaponAbility PrimaryAbility => WeaponAbility.Dismount; - public override WeaponAbility SecondaryAbility => WeaponAbility.Disarm; + ApplyDelayTo(from); + } - public override int AosStrengthReq => 5; - public override int AosMinDamage => 9; - public override int AosMaxDamage => 11; - public override int AosSpeed => 40; - public override float MlSpeed => 2.75f; + public virtual void ApplyDelayTo(Mobile from) + { + from.BeginAction(); + Timer.StartTimer(GetUseDelay, + () => + { + from.EndAction(); + ReleaseWandLock_Callback(from); + } + ); + } - public override int OldStrengthReq => 0; - public override int OldMinDamage => 2; - public override int OldMaxDamage => 6; - public override int OldSpeed => 35; + public virtual void ReleaseWandLock_Callback(Mobile state) + { + } - public override int InitMinHits => 31; - public override int InitMaxHits => 110; - - public virtual TimeSpan GetUseDelay => TimeSpan.FromSeconds(4.0); - - public void ConsumeCharge(Mobile from) + public override void OnDoubleClick(Mobile from) + { + if (!from.CanBeginAction()) { - --Charges; + from.SendLocalizedMessage(1070860); // You must wait a moment for the wand to recharge. + return; + } - if (_charges == 0) + if (Parent == from) + { + if (_charges > 0) + { + OnWandUse(from); + } + else { from.SendLocalizedMessage(1019073); // This item is out of charges. } - - ApplyDelayTo(from); } - - public virtual void ApplyDelayTo(Mobile from) + else { - from.BeginAction(); - Timer.StartTimer(GetUseDelay, - () => - { - from.EndAction(); - ReleaseWandLock_Callback(from); - } - ); + from.SendLocalizedMessage(502641); // You must equip this item to use it. } - - public virtual void ReleaseWandLock_Callback(Mobile state) - { - } - - public override void OnDoubleClick(Mobile from) - { - if (!from.CanBeginAction()) - { - from.SendLocalizedMessage(1070860); // You must wait a moment for the wand to recharge. - return; - } - - if (Parent == from) - { - if (_charges > 0) - { - OnWandUse(from); - } - else - { - from.SendLocalizedMessage(1019073); // This item is out of charges. - } - } - else - { - from.SendLocalizedMessage(502641); // You must equip this item to use it. - } - } - - private void Deserialize(IGenericReader reader, int version) - { - _wandEffect = (WandEffect)reader.ReadInt(); - _charges = reader.ReadInt(); - } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - switch (_wandEffect) - { - case WandEffect.Clumsiness: - list.Add(1017326, $"{_charges}"); - break; // clumsiness charges: ~1_val~ - case WandEffect.Identification: - list.Add(1017350, $"{_charges}"); - break; // identification charges: ~1_val~ - case WandEffect.Healing: - list.Add(1017329, $"{_charges}"); - break; // healing charges: ~1_val~ - case WandEffect.Feeblemindedness: - list.Add(1017327, $"{_charges}"); - break; // feeblemind charges: ~1_val~ - case WandEffect.Weakness: - list.Add(1017328, $"{_charges}"); - break; // weakness charges: ~1_val~ - case WandEffect.MagicArrow: - list.Add(1060492, $"{_charges}"); - break; // magic arrow charges: ~1_val~ - case WandEffect.Harming: - list.Add(1017334, $"{_charges}"); - break; // harm charges: ~1_val~ - case WandEffect.Fireball: - list.Add(1060487, $"{_charges}"); - break; // fireball charges: ~1_val~ - case WandEffect.GreaterHealing: - list.Add(1017330, $"{_charges}"); - break; // greater healing charges: ~1_val~ - case WandEffect.Lightning: - list.Add(1060491, $"{_charges}"); - break; // lightning charges: ~1_val~ - case WandEffect.ManaDraining: - list.Add(1017339, $"{_charges}"); - break; // mana drain charges: ~1_val~ - } - } - - public override void OnSingleClick(Mobile from) - { - var attrs = new List(); - - if (DisplayLootType) - { - if (LootType == LootType.Blessed) - { - attrs.Add(new EquipInfoAttribute(1038021)); // blessed - } - else if (LootType == LootType.Cursed) - { - attrs.Add(new EquipInfoAttribute(1049643)); // cursed - } - } - - if (!Identified) - { - attrs.Add(new EquipInfoAttribute(1038000)); // Unidentified - } - else - { - var num = _wandEffect switch - { - WandEffect.Clumsiness => 3002011, - WandEffect.Identification => 1044063, - WandEffect.Healing => 3002014, - WandEffect.Feeblemindedness => 3002013, - WandEffect.Weakness => 3002018, - WandEffect.MagicArrow => 3002015, - WandEffect.Harming => 3002022, - WandEffect.Fireball => 3002028, - WandEffect.GreaterHealing => 3002039, - WandEffect.Lightning => 3002040, - WandEffect.ManaDraining => 3002041, - _ => 0 - }; - - if (num > 0) - { - attrs.Add(new EquipInfoAttribute(num, _charges)); - } - } - - int number; - - if (Name == null) - { - number = 1017085; - } - else - { - LabelTo(from, Name); - number = 1041000; - } - - if (attrs.Count == 0 && Crafter == null && Name != null) - { - return; - } - - from.NetState.SendDisplayEquipmentInfo(Serial, number, Crafter?.RawName, false, attrs); - } - - public void Cast(Spell spell) - { - var m = Movable; - - Movable = false; - spell.Cast(); - Movable = m; - } - - public virtual void OnWandUse(Mobile from) - { - from.Target = new WandTarget(this); - } - - public virtual void DoWandTarget(Mobile from, object o) - { - if (Deleted || _charges <= 0 || Parent != from || o is StaticTarget or LandTarget) - { - return; - } - - if (OnWandTarget(from, o)) - { - ConsumeCharge(from); - } - } - - public virtual bool OnWandTarget(Mobile from, object o) => true; } + + private void Deserialize(IGenericReader reader, int version) + { + _wandEffect = (WandEffect)reader.ReadInt(); + _charges = reader.ReadInt(); + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + switch (_wandEffect) + { + case WandEffect.Clumsiness: + list.Add(1017326, $"{_charges}"); + break; // clumsiness charges: ~1_val~ + case WandEffect.Identification: + list.Add(1017350, $"{_charges}"); + break; // identification charges: ~1_val~ + case WandEffect.Healing: + list.Add(1017329, $"{_charges}"); + break; // healing charges: ~1_val~ + case WandEffect.Feeblemindedness: + list.Add(1017327, $"{_charges}"); + break; // feeblemind charges: ~1_val~ + case WandEffect.Weakness: + list.Add(1017328, $"{_charges}"); + break; // weakness charges: ~1_val~ + case WandEffect.MagicArrow: + list.Add(1060492, $"{_charges}"); + break; // magic arrow charges: ~1_val~ + case WandEffect.Harming: + list.Add(1017334, $"{_charges}"); + break; // harm charges: ~1_val~ + case WandEffect.Fireball: + list.Add(1060487, $"{_charges}"); + break; // fireball charges: ~1_val~ + case WandEffect.GreaterHealing: + list.Add(1017330, $"{_charges}"); + break; // greater healing charges: ~1_val~ + case WandEffect.Lightning: + list.Add(1060491, $"{_charges}"); + break; // lightning charges: ~1_val~ + case WandEffect.ManaDraining: + list.Add(1017339, $"{_charges}"); + break; // mana drain charges: ~1_val~ + } + } + + public override void OnSingleClick(Mobile from) + { + var attrs = new List(); + + if (DisplayLootType) + { + if (LootType == LootType.Blessed) + { + attrs.Add(new EquipInfoAttribute(1038021)); // blessed + } + else if (LootType == LootType.Cursed) + { + attrs.Add(new EquipInfoAttribute(1049643)); // cursed + } + } + + if (!Identified) + { + attrs.Add(new EquipInfoAttribute(1038000)); // Unidentified + } + else + { + var num = _wandEffect switch + { + WandEffect.Clumsiness => 3002011, + WandEffect.Identification => 1044063, + WandEffect.Healing => 3002014, + WandEffect.Feeblemindedness => 3002013, + WandEffect.Weakness => 3002018, + WandEffect.MagicArrow => 3002015, + WandEffect.Harming => 3002022, + WandEffect.Fireball => 3002028, + WandEffect.GreaterHealing => 3002039, + WandEffect.Lightning => 3002040, + WandEffect.ManaDraining => 3002041, + _ => 0 + }; + + if (num > 0) + { + attrs.Add(new EquipInfoAttribute(num, _charges)); + } + } + + int number; + + if (Name == null) + { + number = 1017085; + } + else + { + LabelTo(from, Name); + number = 1041000; + } + + if (attrs.Count == 0 && Crafter == null && Name != null) + { + return; + } + + from.NetState.SendDisplayEquipmentInfo(Serial, number, Crafter?.RawName, false, attrs); + } + + public void Cast(Spell spell) + { + var m = Movable; + + Movable = false; + spell.Cast(); + Movable = m; + } + + public virtual void OnWandUse(Mobile from) + { + from.Target = new WandTarget(this); + } + + public virtual void DoWandTarget(Mobile from, object o) + { + if (Deleted || _charges <= 0 || Parent != from || o is StaticTarget or LandTarget) + { + return; + } + + if (OnWandTarget(from, o)) + { + ConsumeCharge(from); + } + } + + public virtual bool OnWandTarget(Mobile from, object o) => true; } diff --git a/Projects/UOContent/Items/Wands/ClumsyWand.cs b/Projects/UOContent/Items/Wands/ClumsyWand.cs index cbe1653de..04e80c8f1 100644 --- a/Projects/UOContent/Items/Wands/ClumsyWand.cs +++ b/Projects/UOContent/Items/Wands/ClumsyWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.First; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class ClumsyWand : BaseWand - { - [Constructible] - public ClumsyWand() : base(WandEffect.Clumsiness, 5, 30) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new ClumsySpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class ClumsyWand : BaseWand +{ + [Constructible] + public ClumsyWand() : base(WandEffect.Clumsiness, 5, 30) + { + } + + public override void OnWandUse(Mobile from) + { + Cast(new ClumsySpell(from, this)); } } diff --git a/Projects/UOContent/Items/Wands/FeebleWand.cs b/Projects/UOContent/Items/Wands/FeebleWand.cs index 93965c518..fba902b94 100644 --- a/Projects/UOContent/Items/Wands/FeebleWand.cs +++ b/Projects/UOContent/Items/Wands/FeebleWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.First; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class FeebleWand : BaseWand - { - [Constructible] - public FeebleWand() : base(WandEffect.Feeblemindedness, 5, 30) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new FeeblemindSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class FeebleWand : BaseWand +{ + [Constructible] + public FeebleWand() : base(WandEffect.Feeblemindedness, 5, 30) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new FeeblemindSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/FireballWand.cs b/Projects/UOContent/Items/Wands/FireballWand.cs index 1024112b8..73a32255e 100644 --- a/Projects/UOContent/Items/Wands/FireballWand.cs +++ b/Projects/UOContent/Items/Wands/FireballWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.Third; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class FireballWand : BaseWand - { - [Constructible] - public FireballWand() : base(WandEffect.Fireball, 5, Core.ML ? 109 : 15) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new FireballSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class FireballWand : BaseWand +{ + [Constructible] + public FireballWand() : base(WandEffect.Fireball, 5, Core.ML ? 109 : 15) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new FireballSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/GreaterHealWand.cs b/Projects/UOContent/Items/Wands/GreaterHealWand.cs index 9624de117..23de7c140 100644 --- a/Projects/UOContent/Items/Wands/GreaterHealWand.cs +++ b/Projects/UOContent/Items/Wands/GreaterHealWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.Fourth; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class GreaterHealWand : BaseWand - { - [Constructible] - public GreaterHealWand() : base(WandEffect.GreaterHealing, 1, Core.ML ? 109 : 5) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new GreaterHealSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class GreaterHealWand : BaseWand +{ + [Constructible] + public GreaterHealWand() : base(WandEffect.GreaterHealing, 1, Core.ML ? 109 : 5) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new GreaterHealSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/HarmWand.cs b/Projects/UOContent/Items/Wands/HarmWand.cs index e727fcb31..2cf5a6cb3 100644 --- a/Projects/UOContent/Items/Wands/HarmWand.cs +++ b/Projects/UOContent/Items/Wands/HarmWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.Second; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class HarmWand : BaseWand - { - [Constructible] - public HarmWand() : base(WandEffect.Harming, 5, Core.ML ? 109 : 30) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new HarmSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class HarmWand : BaseWand +{ + [Constructible] + public HarmWand() : base(WandEffect.Harming, 5, Core.ML ? 109 : 30) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new HarmSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/HealWand.cs b/Projects/UOContent/Items/Wands/HealWand.cs index 7319b10fe..714a32201 100644 --- a/Projects/UOContent/Items/Wands/HealWand.cs +++ b/Projects/UOContent/Items/Wands/HealWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.First; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class HealWand : BaseWand - { - [Constructible] - public HealWand() : base(WandEffect.Healing, 10, Core.ML ? 109 : 25) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new HealSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class HealWand : BaseWand +{ + [Constructible] + public HealWand() : base(WandEffect.Healing, 10, Core.ML ? 109 : 25) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new HealSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/IDWand.cs b/Projects/UOContent/Items/Wands/IDWand.cs index 1e916f4a7..2c6143026 100644 --- a/Projects/UOContent/Items/Wands/IDWand.cs +++ b/Projects/UOContent/Items/Wands/IDWand.cs @@ -1,40 +1,39 @@ using System; using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class IDWand : BaseWand { - [SerializationGenerator(0, false)] - public partial class IDWand : BaseWand + [Constructible] + public IDWand() : base(WandEffect.Identification, 25, 175) { - [Constructible] - public IDWand() : base(WandEffect.Identification, 25, 175) - { - } + } - public override TimeSpan GetUseDelay => TimeSpan.Zero; + public override TimeSpan GetUseDelay => TimeSpan.Zero; - public override bool OnWandTarget(Mobile from, object o) + public override bool OnWandTarget(Mobile from, object o) + { + if (o is Item item) { - if (o is Item item) + if (item is BaseWeapon weapon) { - if (item is BaseWeapon weapon) - { - weapon.Identified = true; - } - else if (item is BaseArmor armor) - { - armor.Identified = true; - } - - if (!Core.AOS) - { - item.OnSingleClick(from); - } - - return true; + weapon.Identified = true; + } + else if (item is BaseArmor armor) + { + armor.Identified = true; } - return false; + if (!Core.AOS) + { + item.OnSingleClick(from); + } + + return true; } + + return false; } -} +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/LightningWand.cs b/Projects/UOContent/Items/Wands/LightningWand.cs index 9c02f2288..8c3c57411 100644 --- a/Projects/UOContent/Items/Wands/LightningWand.cs +++ b/Projects/UOContent/Items/Wands/LightningWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.Fourth; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class LightningWand : BaseWand - { - [Constructible] - public LightningWand() : base(WandEffect.Lightning, 5, Core.ML ? 109 : 20) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new LightningSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class LightningWand : BaseWand +{ + [Constructible] + public LightningWand() : base(WandEffect.Lightning, 5, Core.ML ? 109 : 20) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new LightningSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/MagicArrowWand.cs b/Projects/UOContent/Items/Wands/MagicArrowWand.cs index 1e9eb79c0..c07f9869b 100644 --- a/Projects/UOContent/Items/Wands/MagicArrowWand.cs +++ b/Projects/UOContent/Items/Wands/MagicArrowWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.First; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class MagicArrowWand : BaseWand - { - [Constructible] - public MagicArrowWand() : base(WandEffect.MagicArrow, 5, Core.ML ? 109 : 30) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new MagicArrowSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class MagicArrowWand : BaseWand +{ + [Constructible] + public MagicArrowWand() : base(WandEffect.MagicArrow, 5, Core.ML ? 109 : 30) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new MagicArrowSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/ManaDrainWand.cs b/Projects/UOContent/Items/Wands/ManaDrainWand.cs index 7e3c78885..20542d8d0 100644 --- a/Projects/UOContent/Items/Wands/ManaDrainWand.cs +++ b/Projects/UOContent/Items/Wands/ManaDrainWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.Fourth; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class ManaDrainWand : BaseWand - { - [Constructible] - public ManaDrainWand() : base(WandEffect.ManaDraining, 5, 30) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new ManaDrainSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class ManaDrainWand : BaseWand +{ + [Constructible] + public ManaDrainWand() : base(WandEffect.ManaDraining, 5, 30) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new ManaDrainSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/WandTarget.cs b/Projects/UOContent/Items/Wands/WandTarget.cs index de78937c5..3877c4026 100644 --- a/Projects/UOContent/Items/Wands/WandTarget.cs +++ b/Projects/UOContent/Items/Wands/WandTarget.cs @@ -1,16 +1,15 @@ using Server.Items; -namespace Server.Targeting +namespace Server.Targeting; + +public class WandTarget : Target { - public class WandTarget : Target + private readonly BaseWand m_Item; + + public WandTarget(BaseWand item) : base(6, false, TargetFlags.None) => m_Item = item; + + protected override void OnTarget(Mobile from, object targeted) { - private readonly BaseWand m_Item; - - public WandTarget(BaseWand item) : base(6, false, TargetFlags.None) => m_Item = item; - - protected override void OnTarget(Mobile from, object targeted) - { - m_Item.DoWandTarget(from, targeted); - } + m_Item.DoWandTarget(from, targeted); } -} +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Wands/WeaknessWand.cs b/Projects/UOContent/Items/Wands/WeaknessWand.cs index ff0fdeb5f..9d87513bf 100644 --- a/Projects/UOContent/Items/Wands/WeaknessWand.cs +++ b/Projects/UOContent/Items/Wands/WeaknessWand.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; using Server.Spells.First; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class WeaknessWand : BaseWand - { - [Constructible] - public WeaknessWand() : base(WandEffect.Weakness, 5, 30) - { - } +namespace Server.Items; - public override void OnWandUse(Mobile from) - { - Cast(new WeakenSpell(from, this)); - } +[SerializationGenerator(0, false)] +public partial class WeaknessWand : BaseWand +{ + [Constructible] + public WeaknessWand() : base(WandEffect.Weakness, 5, 30) + { } -} + + public override void OnWandUse(Mobile from) + { + Cast(new WeakenSpell(from, this)); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BaseTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.BaseTrap.v0.json new file mode 100644 index 000000000..5d4493331 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BaseTrap.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BaseTrap" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.FireColumnTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.FireColumnTrap.v0.json new file mode 100644 index 000000000..7ecddf600 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.FireColumnTrap.v0.json @@ -0,0 +1,30 @@ +{ + "version": 0, + "type": "Server.Items.FireColumnTrap", + "properties": [ + { + "name": "WarningFlame", + "type": "bool", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "MinDamage", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "MaxDamage", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.FlameSpurtTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.FlameSpurtTrap.v0.json new file mode 100644 index 000000000..27e1b2076 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.FlameSpurtTrap.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.FlameSpurtTrap" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.GasTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.GasTrap.v0.json new file mode 100644 index 000000000..ed2d2f194 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.GasTrap.v0.json @@ -0,0 +1,14 @@ +{ + "version": 0, + "type": "Server.Items.GasTrap", + "properties": [ + { + "name": "Poison", + "type": "Server.Poison", + "rule": "PrimitiveUOTypeMigrationRule", + "ruleArguments": [ + "Poison" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.GiantSpikeTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.GiantSpikeTrap.v0.json new file mode 100644 index 000000000..eebf0344a --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.GiantSpikeTrap.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.GiantSpikeTrap" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.MushroomTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.MushroomTrap.v0.json new file mode 100644 index 000000000..86cca56d1 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.MushroomTrap.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.MushroomTrap" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.SpikeTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.SpikeTrap.v0.json new file mode 100644 index 000000000..ea19a58a8 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.SpikeTrap.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.SpikeTrap" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.StoneFaceTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.StoneFaceTrap.v0.json new file mode 100644 index 000000000..bf3b13a57 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.StoneFaceTrap.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.StoneFaceTrap" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.StoneFaceTrapNoDamage.v0.json b/Projects/UOContent/Migrations/Server.Items.StoneFaceTrapNoDamage.v0.json new file mode 100644 index 000000000..012f134c1 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.StoneFaceTrapNoDamage.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.StoneFaceTrapNoDamage" +} \ No newline at end of file