From 82637a77cd70077e4cd3d6814e1e3df917dfa610 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Wed, 23 Nov 2022 13:45:32 -0800 Subject: [PATCH] fix: Codegens resources (#1272) --- .../UOContent/Items/Resources/Arrows/Arrow.cs | 44 +- .../UOContent/Items/Resources/Arrows/Bolt.cs | 44 +- .../Items/Resources/Arrows/Feather.cs | 44 +- .../UOContent/Items/Resources/Arrows/Shaft.cs | 44 +- .../Items/Resources/Blacksmithing/Ingots.cs | 287 ++++--- .../Items/Resources/Blacksmithing/Ore.cs | 725 +++++++++-------- .../Items/Resources/Blacksmithing/Scales.cs | 407 +++++----- .../Items/Resources/Fishing/BigFish.cs | 73 +- .../UOContent/Items/Resources/Fishing/Fish.cs | 33 +- .../Items/Resources/Fishing/MagicFish.cs | 167 ++-- .../Items/Resources/Masonry/Granite.cs | 423 +++------- .../Items/Resources/MiscMLResources.cs | 759 +++++++++--------- .../Resources/Reagents/BagOfAllReagents.cs | 58 +- .../Resources/Reagents/BagOfNecroReagents.cs | 42 +- .../Items/Resources/Reagents/BagOfReagents.cs | 48 +- .../Items/Resources/Reagents/BaseReagent.cs | 23 +- .../Items/Resources/Reagents/BatWing.cs | 23 +- .../Items/Resources/Reagents/BlackPearl.cs | 23 +- .../Items/Resources/Reagents/Bloodmoss.cs | 23 +- .../Items/Resources/Reagents/DaemonBlood.cs | 23 +- .../Items/Resources/Reagents/DaemonBone.cs | 25 +- .../Items/Resources/Reagents/DeadWood.cs | 23 +- .../Items/Resources/Reagents/DragonsBlood.cs | 23 +- .../Items/Resources/Reagents/Garlic.cs | 23 +- .../Items/Resources/Reagents/Ginseng.cs | 23 +- .../Items/Resources/Reagents/GraveDust.cs | 23 +- .../Items/Resources/Reagents/MandrakeRoot.cs | 23 +- .../Items/Resources/Reagents/Nightshade.cs | 23 +- .../Items/Resources/Reagents/NoxCrystal.cs | 23 +- .../Items/Resources/Reagents/PigIron.cs | 23 +- .../Items/Resources/Reagents/SpidersSilk.cs | 23 +- .../Items/Resources/Reagents/SulfurousAsh.cs | 23 +- .../Items/Resources/Tailor/BoltOfCloth.cs | 91 ++- .../UOContent/Items/Resources/Tailor/Bone.cs | 29 +- .../UOContent/Items/Resources/Tailor/Cloth.cs | 91 ++- .../Items/Resources/Tailor/Cotton.cs | 145 ++-- .../UOContent/Items/Resources/Tailor/Flax.cs | 133 ++- .../UOContent/Items/Resources/Tailor/Hides.cs | 329 ++++---- .../Items/Resources/Tailor/Leathers.cs | 185 +++-- .../Items/Resources/Tailor/UncutCloth.cs | 91 ++- .../UOContent/Items/Resources/Tailor/Wool.cs | 175 ++-- .../Items/Resources/Tailor/YarnsAndThreads.cs | 195 +++-- .../Server.Items.AgapiteGranite.v0.json | 4 + .../Migrations/Server.Items.Arrow.v0.json | 4 + .../Server.Items.BagOfAllReagents.v0.json | 4 + .../Server.Items.BagOfNecroReagents.v0.json | 4 + .../Server.Items.BagOfReagents.v0.json | 4 + .../Server.Items.BaseGranite.v2.json | 11 + .../Migrations/Server.Items.Bolt.v0.json | 4 + .../Server.Items.BronzeGranite.v0.json | 4 + .../Server.Items.CopperGranite.v0.json | 4 + .../Server.Items.DullCopperGranite.v0.json | 4 + .../Migrations/Server.Items.Feather.v0.json | 4 + .../Server.Items.GoldGranite.v0.json | 4 + .../Migrations/Server.Items.Granite.v0.json | 4 + .../Server.Items.ShadowIronGranite.v0.json | 4 + .../Migrations/Server.Items.Shaft.v0.json | 4 + .../Server.Items.ValoriteGranite.v0.json | 4 + .../Server.Items.VeriteGranite.v0.json | 4 + 59 files changed, 2435 insertions(+), 2695 deletions(-) create mode 100644 Projects/UOContent/Migrations/Server.Items.AgapiteGranite.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Arrow.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.BagOfAllReagents.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.BagOfNecroReagents.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.BagOfReagents.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.BaseGranite.v2.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Bolt.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.BronzeGranite.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.CopperGranite.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.DullCopperGranite.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Feather.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.GoldGranite.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Granite.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.ShadowIronGranite.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Shaft.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.ValoriteGranite.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.VeriteGranite.v0.json diff --git a/Projects/UOContent/Items/Resources/Arrows/Arrow.cs b/Projects/UOContent/Items/Resources/Arrows/Arrow.cs index 404d0a652..0478b8d6e 100644 --- a/Projects/UOContent/Items/Resources/Arrows/Arrow.cs +++ b/Projects/UOContent/Items/Resources/Arrows/Arrow.cs @@ -1,34 +1,18 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0)] +public partial class Arrow : Item, ICommodity { - public class Arrow : Item, ICommodity + [Constructible] + public Arrow(int amount = 1) : base(0xF3F) { - [Constructible] - public Arrow(int amount = 1) : base(0xF3F) - { - Stackable = true; - Amount = amount; - } - - public Arrow(Serial serial) : base(serial) - { - } - - public override double DefaultWeight => 0.1; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; - - 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(); - } + Stackable = true; + Amount = amount; } + + public override double DefaultWeight => 0.1; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; } diff --git a/Projects/UOContent/Items/Resources/Arrows/Bolt.cs b/Projects/UOContent/Items/Resources/Arrows/Bolt.cs index e10125a05..21e43d734 100644 --- a/Projects/UOContent/Items/Resources/Arrows/Bolt.cs +++ b/Projects/UOContent/Items/Resources/Arrows/Bolt.cs @@ -1,34 +1,18 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0)] +public partial class Bolt : Item, ICommodity { - public class Bolt : Item, ICommodity + [Constructible] + public Bolt(int amount = 1) : base(0x1BFB) { - [Constructible] - public Bolt(int amount = 1) : base(0x1BFB) - { - Stackable = true; - Amount = amount; - } - - public Bolt(Serial serial) : base(serial) - { - } - - public override double DefaultWeight => 0.1; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; - - 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(); - } + Stackable = true; + Amount = amount; } + + public override double DefaultWeight => 0.1; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; } diff --git a/Projects/UOContent/Items/Resources/Arrows/Feather.cs b/Projects/UOContent/Items/Resources/Arrows/Feather.cs index 7dcafa12e..755d35b41 100644 --- a/Projects/UOContent/Items/Resources/Arrows/Feather.cs +++ b/Projects/UOContent/Items/Resources/Arrows/Feather.cs @@ -1,34 +1,18 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0)] +public partial class Feather : Item, ICommodity { - public class Feather : Item, ICommodity + [Constructible] + public Feather(int amount = 1) : base(0x1BD1) { - [Constructible] - public Feather(int amount = 1) : base(0x1BD1) - { - Stackable = true; - Amount = amount; - } - - public Feather(Serial serial) : base(serial) - { - } - - public override double DefaultWeight => 0.1; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; - - 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(); - } + Stackable = true; + Amount = amount; } + + public override double DefaultWeight => 0.1; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; } diff --git a/Projects/UOContent/Items/Resources/Arrows/Shaft.cs b/Projects/UOContent/Items/Resources/Arrows/Shaft.cs index d8ef6ba2e..165aca730 100644 --- a/Projects/UOContent/Items/Resources/Arrows/Shaft.cs +++ b/Projects/UOContent/Items/Resources/Arrows/Shaft.cs @@ -1,34 +1,18 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0)] +public partial class Shaft : Item, ICommodity { - public class Shaft : Item, ICommodity + [Constructible] + public Shaft(int amount = 1) : base(0x1BD4) { - [Constructible] - public Shaft(int amount = 1) : base(0x1BD4) - { - Stackable = true; - Amount = amount; - } - - public Shaft(Serial serial) : base(serial) - { - } - - public override double DefaultWeight => 0.1; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; - - 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(); - } + Stackable = true; + Amount = amount; } + + public override double DefaultWeight => 0.1; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; } diff --git a/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs b/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs index b8206e8bd..fbc16f88d 100644 --- a/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs +++ b/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs @@ -1,166 +1,165 @@ using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(2, false)] +public abstract partial class BaseIngot : Item, ICommodity { - [SerializationGenerator(2, false)] - public abstract partial class BaseIngot : Item, ICommodity + [InvalidateProperties] + [SerializedCommandProperty(AccessLevel.GameMaster)] + [SerializableField(0)] + private CraftResource _resource; + + public BaseIngot(CraftResource resource, int amount = 1) : base(0x1BF2) { - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(0)] - private CraftResource _resource; + Stackable = true; + Amount = amount; + Hue = CraftResources.GetHue(resource); - public BaseIngot(CraftResource resource, int amount = 1) : base(0x1BF2) + _resource = resource; + } + + public override double DefaultWeight => 0.1; + + public override int LabelNumber + { + get { - Stackable = true; - Amount = amount; - Hue = CraftResources.GetHue(resource); - - _resource = resource; - } - - public override double DefaultWeight => 0.1; - - public override int LabelNumber - { - get + if (_resource >= CraftResource.DullCopper && _resource <= CraftResource.Valorite) { - if (_resource >= CraftResource.DullCopper && _resource <= CraftResource.Valorite) - { - return 1042684 + (_resource - CraftResource.DullCopper); - } - - return 1042692; + return 1042684 + (_resource - CraftResource.DullCopper); } + + return 1042692; } + } - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; - private void Deserialize(IGenericReader reader, int version) + private void Deserialize(IGenericReader reader, int version) + { + _resource = (CraftResource)reader.ReadInt(); + } + + public override void AddNameProperty(IPropertyList list) + { + if (Amount > 1) { - _resource = (CraftResource)reader.ReadInt(); + list.Add(1050039, $"{Amount}\t{1027154:#}"); // ~1_NUMBER~ ~2_ITEMNAME~ } - - public override void AddNameProperty(IPropertyList list) + else { - if (Amount > 1) + list.Add(1027154); // ingots + } + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (!CraftResources.IsStandard(_resource)) + { + var num = CraftResources.GetLocalizationNumber(_resource); + + if (num > 0) { - list.Add(1050039, $"{Amount}\t{1027154:#}"); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(num); } else { - list.Add(1027154); // ingots + list.Add(CraftResources.GetName(_resource)); } } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (!CraftResources.IsStandard(_resource)) - { - var num = CraftResources.GetLocalizationNumber(_resource); - - if (num > 0) - { - list.Add(num); - } - else - { - list.Add(CraftResources.GetName(_resource)); - } - } - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class IronIngot : BaseIngot - { - [Constructible] - public IronIngot(int amount = 1) : base(CraftResource.Iron, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class DullCopperIngot : BaseIngot - { - [Constructible] - public DullCopperIngot(int amount = 1) : base(CraftResource.DullCopper, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class ShadowIronIngot : BaseIngot - { - [Constructible] - public ShadowIronIngot(int amount = 1) : base(CraftResource.ShadowIron, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class CopperIngot : BaseIngot - { - [Constructible] - public CopperIngot(int amount = 1) : base(CraftResource.Copper, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class BronzeIngot : BaseIngot - { - [Constructible] - public BronzeIngot(int amount = 1) : base(CraftResource.Bronze, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class GoldIngot : BaseIngot - { - [Constructible] - public GoldIngot(int amount = 1) : base(CraftResource.Gold, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class AgapiteIngot : BaseIngot - { - [Constructible] - public AgapiteIngot(int amount = 1) : base(CraftResource.Agapite, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class VeriteIngot : BaseIngot - { - [Constructible] - public VeriteIngot(int amount = 1) : base(CraftResource.Verite, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1BF2, 0x1BEF)] - public partial class ValoriteIngot : BaseIngot - { - [Constructible] - public ValoriteIngot(int amount = 1) : base(CraftResource.Valorite, amount) - { - } } } + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class IronIngot : BaseIngot +{ + [Constructible] + public IronIngot(int amount = 1) : base(CraftResource.Iron, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class DullCopperIngot : BaseIngot +{ + [Constructible] + public DullCopperIngot(int amount = 1) : base(CraftResource.DullCopper, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class ShadowIronIngot : BaseIngot +{ + [Constructible] + public ShadowIronIngot(int amount = 1) : base(CraftResource.ShadowIron, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class CopperIngot : BaseIngot +{ + [Constructible] + public CopperIngot(int amount = 1) : base(CraftResource.Copper, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class BronzeIngot : BaseIngot +{ + [Constructible] + public BronzeIngot(int amount = 1) : base(CraftResource.Bronze, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class GoldIngot : BaseIngot +{ + [Constructible] + public GoldIngot(int amount = 1) : base(CraftResource.Gold, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class AgapiteIngot : BaseIngot +{ + [Constructible] + public AgapiteIngot(int amount = 1) : base(CraftResource.Agapite, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class VeriteIngot : BaseIngot +{ + [Constructible] + public VeriteIngot(int amount = 1) : base(CraftResource.Verite, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1BF2, 0x1BEF)] +public partial class ValoriteIngot : BaseIngot +{ + [Constructible] + public ValoriteIngot(int amount = 1) : base(CraftResource.Valorite, amount) + { + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs b/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs index 59999eab7..f9896bab2 100644 --- a/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs +++ b/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs @@ -3,446 +3,445 @@ using Server.Engines.Craft; using Server.Mobiles; using Server.Targeting; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(2, false)] +public abstract partial class BaseOre : Item { - [SerializationGenerator(2, false)] - public abstract partial class BaseOre : Item + public BaseOre(CraftResource resource, int amount = 1) : base(RandomSize()) { - public BaseOre(CraftResource resource, int amount = 1) : base(RandomSize()) + Stackable = true; + Amount = amount; + Hue = CraftResources.GetHue(resource); + + _resource = resource; + } + + [InvalidateProperties] + [SerializedCommandProperty(AccessLevel.GameMaster)] + [SerializableField(0)] + private CraftResource _resource; + + public override int LabelNumber + { + get { - Stackable = true; - Amount = amount; - Hue = CraftResources.GetHue(resource); - - _resource = resource; - } - - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(0)] - private CraftResource _resource; - - public override int LabelNumber - { - get + if (_resource is >= CraftResource.DullCopper and <= CraftResource.Valorite) { - if (_resource is >= CraftResource.DullCopper and <= CraftResource.Valorite) - { - return 1042845 + (_resource - CraftResource.DullCopper); - } - - return 1042853; // iron ore; + return 1042845 + (_resource - CraftResource.DullCopper); } + + return 1042853; // iron ore; } + } - public abstract BaseIngot GetIngot(); + public abstract BaseIngot GetIngot(); - private void Deserialize(IGenericReader reader, int version) + private void Deserialize(IGenericReader reader, int version) + { + // Use this line instead if you are getting world loading issues + _resource = (CraftResource)reader.ReadByte(); + // _resource = (CraftResource)reader.ReadInt(); + } + + private static int RandomSize() => + Utility.RandomDouble() switch { - // Use this line instead if you are getting world loading issues - _resource = (CraftResource)reader.ReadByte(); - // _resource = (CraftResource)reader.ReadInt(); + < 0.125 => 0x19B7, // Small + < 0.1875 => 0x19B8, // Medium clump + < 0.25 => 0x19BA, // Medium + _ => 0x19B9 // Large + }; + + public override bool CanStackWith(Item dropped) => + dropped.Stackable && Stackable && dropped.Hue == Hue && + dropped.GetType() == GetType() && dropped.ItemID == ItemID && + (dropped as BaseOre)?._resource == _resource && dropped.Name == Name && + dropped.Amount + Amount <= 60000 && dropped != this; + + public override void AddNameProperty(IPropertyList list) + { + if (Amount > 1) + { + list.Add(1050039, $"{Amount}\t{1026583:#}"); // ~1_NUMBER~ ~2_ITEMNAME~ } - - private static int RandomSize() => - Utility.RandomDouble() switch - { - < 0.125 => 0x19B7, // Small - < 0.1875 => 0x19B8, // Medium clump - < 0.25 => 0x19BA, // Medium - _ => 0x19B9 // Large - }; - - public override bool CanStackWith(Item dropped) => - dropped.Stackable && Stackable && dropped.Hue == Hue && - dropped.GetType() == GetType() && dropped.ItemID == ItemID && - (dropped as BaseOre)?._resource == _resource && dropped.Name == Name && - dropped.Amount + Amount <= 60000 && dropped != this; - - public override void AddNameProperty(IPropertyList list) + else { - if (Amount > 1) + list.Add(1026583); // ore + } + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (!CraftResources.IsStandard(_resource)) + { + var num = CraftResources.GetLocalizationNumber(_resource); + + if (num > 0) { - list.Add(1050039, $"{Amount}\t{1026583:#}"); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(num); } else { - list.Add(1026583); // ore + list.Add(CraftResources.GetName(_resource)); } } + } - public override void GetProperties(IPropertyList list) + public override void OnDoubleClick(Mobile from) + { + if (!Movable) { - base.GetProperties(list); + return; + } - if (!CraftResources.IsStandard(_resource)) + if (RootParent is BaseCreature) + { + from.SendLocalizedMessage(500447); // That is not accessible + } + else if (from.InRange(GetWorldLocation(), 2)) + { + // Select the forge on which to smelt the ore, or another pile of ore with which to combine it. + from.SendLocalizedMessage(501971); + from.Target = new InternalTarget(this); + } + else + { + from.SendLocalizedMessage(501976); // The ore is too far away. + } + } + + private class InternalTarget : Target + { + private readonly BaseOre m_Ore; + + public InternalTarget(BaseOre ore) : base(2, false, TargetFlags.None) => m_Ore = ore; + + private bool IsForge(object obj) + { + if (Core.ML && obj is Mobile { IsDeadBondedPet: true }) { - var num = CraftResources.GetLocalizationNumber(_resource); - - if (num > 0) - { - list.Add(num); - } - else - { - list.Add(CraftResources.GetName(_resource)); - } + return false; } + + if (obj.GetType().IsDefined(typeof(ForgeAttribute), false)) + { + return true; + } + + var itemID = obj switch + { + Item item => item.ItemID, + StaticTarget target => target.ItemID, + _ => 0 + }; + + return itemID is 4017 or >= 6522 and <= 6569 or 11736; } - public override void OnDoubleClick(Mobile from) + protected override void OnTarget(Mobile from, object targeted) { - if (!Movable) + if (m_Ore.Deleted) { return; } - if (RootParent is BaseCreature) - { - from.SendLocalizedMessage(500447); // That is not accessible - } - else if (from.InRange(GetWorldLocation(), 2)) - { - // Select the forge on which to smelt the ore, or another pile of ore with which to combine it. - from.SendLocalizedMessage(501971); - from.Target = new InternalTarget(this); - } - else + if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendLocalizedMessage(501976); // The ore is too far away. + return; } - } - private class InternalTarget : Target - { - private readonly BaseOre m_Ore; - - public InternalTarget(BaseOre ore) : base(2, false, TargetFlags.None) => m_Ore = ore; - - private bool IsForge(object obj) + if (targeted is BaseOre ore) { - if (Core.ML && obj is Mobile { IsDeadBondedPet: true }) - { - return false; - } + OnTargetOre(from, ore); + return; + } - if (obj.GetType().IsDefined(typeof(ForgeAttribute), false)) + if (IsForge(targeted)) + { + var difficulty = m_Ore._resource switch { - return true; - } - - var itemID = obj switch - { - Item item => item.ItemID, - StaticTarget target => target.ItemID, - _ => 0 + CraftResource.DullCopper => 65.0, + CraftResource.ShadowIron => 70.0, + CraftResource.Copper => 75.0, + CraftResource.Bronze => 80.0, + CraftResource.Gold => 85.0, + CraftResource.Agapite => 90.0, + CraftResource.Verite => 95.0, + CraftResource.Valorite => 99.0, + _ => 50.0 }; - return itemID is 4017 or >= 6522 and <= 6569 or 11736; - } + var minSkill = difficulty - 25.0; + var maxSkill = difficulty + 25.0; - protected override void OnTarget(Mobile from, object targeted) - { - if (m_Ore.Deleted) + if (difficulty > 50.0 && difficulty > from.Skills.Mining.Value) { + from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } - if (!from.InRange(m_Ore.GetWorldLocation(), 2)) + if (m_Ore.ItemID == 0x19B7 && m_Ore.Amount < 2) { - from.SendLocalizedMessage(501976); // The ore is too far away. + // There is not enough metal-bearing ore in this pile to make an ingot. + from.SendLocalizedMessage(501987); return; } - if (targeted is BaseOre ore) + if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { - OnTargetOre(from, ore); - return; - } + var toConsume = m_Ore.Amount; - if (IsForge(targeted)) - { - var difficulty = m_Ore._resource switch - { - CraftResource.DullCopper => 65.0, - CraftResource.ShadowIron => 70.0, - CraftResource.Copper => 75.0, - CraftResource.Bronze => 80.0, - CraftResource.Gold => 85.0, - CraftResource.Agapite => 90.0, - CraftResource.Verite => 95.0, - CraftResource.Valorite => 99.0, - _ => 50.0 - }; - - var minSkill = difficulty - 25.0; - var maxSkill = difficulty + 25.0; - - if (difficulty > 50.0 && difficulty > from.Skills.Mining.Value) - { - from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! - return; - } - - if (m_Ore.ItemID == 0x19B7 && m_Ore.Amount < 2) + if (toConsume <= 0) { // There is not enough metal-bearing ore in this pile to make an ingot. from.SendLocalizedMessage(501987); return; } - if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) + if (toConsume > 30000) { - var toConsume = m_Ore.Amount; + toConsume = 30000; + } - if (toConsume <= 0) + int ingotAmount; + + if (m_Ore.ItemID == 0x19B7) + { + ingotAmount = toConsume / 2; + + if (toConsume % 2 != 0) { - // There is not enough metal-bearing ore in this pile to make an ingot. - from.SendLocalizedMessage(501987); - return; + --toConsume; } - - if (toConsume > 30000) - { - toConsume = 30000; - } - - int ingotAmount; - - if (m_Ore.ItemID == 0x19B7) - { - ingotAmount = toConsume / 2; - - if (toConsume % 2 != 0) - { - --toConsume; - } - } - else if (m_Ore.ItemID == 0x19B9) - { - ingotAmount = toConsume * 2; - } - else - { - ingotAmount = toConsume; - } - - var ingot = m_Ore.GetIngot(); - ingot.Amount = ingotAmount; - - m_Ore.Consume(toConsume); - from.AddToBackpack(ingot); - // from.PlaySound( 0x57 ); - - // You smelt the ore removing the impurities and put the metal in your backpack. - from.SendLocalizedMessage(501988); + } + else if (m_Ore.ItemID == 0x19B9) + { + ingotAmount = toConsume * 2; } else { - if (m_Ore.Amount < 2) - { - m_Ore.ItemID = m_Ore.ItemID == 0x19B9 ? 0x19B8 : 0x19B7; - } - else - { - m_Ore.Amount /= 2; - } - - // You burn away the impurities but are left with less useable metal. - from.SendLocalizedMessage(501990); + ingotAmount = toConsume; } + + var ingot = m_Ore.GetIngot(); + ingot.Amount = ingotAmount; + + m_Ore.Consume(toConsume); + from.AddToBackpack(ingot); + // from.PlaySound( 0x57 ); + + // You smelt the ore removing the impurities and put the metal in your backpack. + from.SendLocalizedMessage(501988); } - } - - private void OnTargetOre(Mobile from, BaseOre ore) - { - if (!ore.Movable) + else { - return; - } - - if (m_Ore == ore) - { - from.SendLocalizedMessage(501972); // Select another pile or ore with which to combine this. - from.Target = new InternalTarget(ore); - return; - } - - if (ore._resource != m_Ore._resource) - { - from.SendLocalizedMessage(501979); // You cannot combine ores of different metals. - return; - } - - var worth = ore.Amount * ore.ItemID switch - { - 0x19B9 => 8, - 0x19B7 => 2, - _ => 4 - }; - - var sourceWorth = m_Ore.Amount * m_Ore.ItemID switch - { - 0x19B9 => 8, - 0x19B7 => 2, - _ => 4 - }; - - worth += sourceWorth; - - var plusWeight = 0; - var newID = ore.ItemID; - - if (ore.DefaultWeight != m_Ore.DefaultWeight) - { - if (ore.ItemID == 0x19B7 || m_Ore.ItemID == 0x19B7) + if (m_Ore.Amount < 2) { - newID = 0x19B7; - } - else if (ore.ItemID == 0x19B9) - { - newID = m_Ore.ItemID; - plusWeight = ore.Amount * 2; + m_Ore.ItemID = m_Ore.ItemID == 0x19B9 ? 0x19B8 : 0x19B7; } else { - plusWeight = m_Ore.Amount * 2; + m_Ore.Amount /= 2; } + + // You burn away the impurities but are left with less useable metal. + from.SendLocalizedMessage(501990); } - - if (ore.ItemID == 0x19B9 && worth > 120000 || - ore.ItemID is 0x19B8 or 0x19BA && worth > 60000 || - ore.ItemID == 0x19B7 && worth > 30000) - { - from.SendLocalizedMessage(1062844); // There is too much ore to combine. - return; - } - - if (ore.RootParent is Mobile mobile && - plusWeight + mobile.Backpack.TotalWeight > mobile.Backpack.MaxWeight) - { - from.SendLocalizedMessage(501978); // The weight is too great to combine in a container. - return; - } - - ore.ItemID = newID; - - ore.Amount = ore.ItemID switch - { - 0x19B9 => worth / 8, - 0x19B7 => worth / 2, - _ => worth / 4 - }; - - m_Ore.Delete(); } } - } - [SerializationGenerator(0, false)] - public partial class IronOre : BaseOre - { - [Constructible] - public IronOre(int amount = 1) : base(CraftResource.Iron, amount) + private void OnTargetOre(Mobile from, BaseOre ore) { - } - - public IronOre(bool fixedSize) : this() - { - if (fixedSize) + if (!ore.Movable) { - ItemID = 0x19B8; + return; } + + if (m_Ore == ore) + { + from.SendLocalizedMessage(501972); // Select another pile or ore with which to combine this. + from.Target = new InternalTarget(ore); + return; + } + + if (ore._resource != m_Ore._resource) + { + from.SendLocalizedMessage(501979); // You cannot combine ores of different metals. + return; + } + + var worth = ore.Amount * ore.ItemID switch + { + 0x19B9 => 8, + 0x19B7 => 2, + _ => 4 + }; + + var sourceWorth = m_Ore.Amount * m_Ore.ItemID switch + { + 0x19B9 => 8, + 0x19B7 => 2, + _ => 4 + }; + + worth += sourceWorth; + + var plusWeight = 0; + var newID = ore.ItemID; + + if (ore.DefaultWeight != m_Ore.DefaultWeight) + { + if (ore.ItemID == 0x19B7 || m_Ore.ItemID == 0x19B7) + { + newID = 0x19B7; + } + else if (ore.ItemID == 0x19B9) + { + newID = m_Ore.ItemID; + plusWeight = ore.Amount * 2; + } + else + { + plusWeight = m_Ore.Amount * 2; + } + } + + if (ore.ItemID == 0x19B9 && worth > 120000 || + ore.ItemID is 0x19B8 or 0x19BA && worth > 60000 || + ore.ItemID == 0x19B7 && worth > 30000) + { + from.SendLocalizedMessage(1062844); // There is too much ore to combine. + return; + } + + if (ore.RootParent is Mobile mobile && + plusWeight + mobile.Backpack.TotalWeight > mobile.Backpack.MaxWeight) + { + from.SendLocalizedMessage(501978); // The weight is too great to combine in a container. + return; + } + + ore.ItemID = newID; + + ore.Amount = ore.ItemID switch + { + 0x19B9 => worth / 8, + 0x19B7 => worth / 2, + _ => worth / 4 + }; + + m_Ore.Delete(); } - - public override BaseIngot GetIngot() => new IronIngot(); - } - - [SerializationGenerator(0, false)] - public partial class DullCopperOre : BaseOre - { - [Constructible] - public DullCopperOre(int amount = 1) : base(CraftResource.DullCopper, amount) - { - } - - public override BaseIngot GetIngot() => new DullCopperIngot(); - } - - [SerializationGenerator(0, false)] - public partial class ShadowIronOre : BaseOre - { - [Constructible] - public ShadowIronOre(int amount = 1) : base(CraftResource.ShadowIron, amount) - { - } - - public override BaseIngot GetIngot() => new ShadowIronIngot(); - } - - [SerializationGenerator(0, false)] - public partial class CopperOre : BaseOre - { - [Constructible] - public CopperOre(int amount = 1) : base(CraftResource.Copper, amount) - { - } - - public override BaseIngot GetIngot() => new CopperIngot(); - } - - [SerializationGenerator(0, false)] - public partial class BronzeOre : BaseOre - { - [Constructible] - public BronzeOre(int amount = 1) : base(CraftResource.Bronze, amount) - { - } - - public override BaseIngot GetIngot() => new BronzeIngot(); - } - - [SerializationGenerator(0, false)] - public partial class GoldOre : BaseOre - { - [Constructible] - public GoldOre(int amount = 1) : base(CraftResource.Gold, amount) - { - } - - public override BaseIngot GetIngot() => new GoldIngot(); - } - - [SerializationGenerator(0, false)] - public partial class AgapiteOre : BaseOre - { - [Constructible] - public AgapiteOre(int amount = 1) : base(CraftResource.Agapite, amount) - { - } - - public override BaseIngot GetIngot() => new AgapiteIngot(); - } - - [SerializationGenerator(0, false)] - public partial class VeriteOre : BaseOre - { - [Constructible] - public VeriteOre(int amount = 1) : base(CraftResource.Verite, amount) - { - } - - public override BaseIngot GetIngot() => new VeriteIngot(); - } - - [SerializationGenerator(0, false)] - public partial class ValoriteOre : BaseOre - { - [Constructible] - public ValoriteOre(int amount = 1) : base(CraftResource.Valorite, amount) - { - } - - public override BaseIngot GetIngot() => new ValoriteIngot(); } } + +[SerializationGenerator(0, false)] +public partial class IronOre : BaseOre +{ + [Constructible] + public IronOre(int amount = 1) : base(CraftResource.Iron, amount) + { + } + + public IronOre(bool fixedSize) : this() + { + if (fixedSize) + { + ItemID = 0x19B8; + } + } + + public override BaseIngot GetIngot() => new IronIngot(); +} + +[SerializationGenerator(0, false)] +public partial class DullCopperOre : BaseOre +{ + [Constructible] + public DullCopperOre(int amount = 1) : base(CraftResource.DullCopper, amount) + { + } + + public override BaseIngot GetIngot() => new DullCopperIngot(); +} + +[SerializationGenerator(0, false)] +public partial class ShadowIronOre : BaseOre +{ + [Constructible] + public ShadowIronOre(int amount = 1) : base(CraftResource.ShadowIron, amount) + { + } + + public override BaseIngot GetIngot() => new ShadowIronIngot(); +} + +[SerializationGenerator(0, false)] +public partial class CopperOre : BaseOre +{ + [Constructible] + public CopperOre(int amount = 1) : base(CraftResource.Copper, amount) + { + } + + public override BaseIngot GetIngot() => new CopperIngot(); +} + +[SerializationGenerator(0, false)] +public partial class BronzeOre : BaseOre +{ + [Constructible] + public BronzeOre(int amount = 1) : base(CraftResource.Bronze, amount) + { + } + + public override BaseIngot GetIngot() => new BronzeIngot(); +} + +[SerializationGenerator(0, false)] +public partial class GoldOre : BaseOre +{ + [Constructible] + public GoldOre(int amount = 1) : base(CraftResource.Gold, amount) + { + } + + public override BaseIngot GetIngot() => new GoldIngot(); +} + +[SerializationGenerator(0, false)] +public partial class AgapiteOre : BaseOre +{ + [Constructible] + public AgapiteOre(int amount = 1) : base(CraftResource.Agapite, amount) + { + } + + public override BaseIngot GetIngot() => new AgapiteIngot(); +} + +[SerializationGenerator(0, false)] +public partial class VeriteOre : BaseOre +{ + [Constructible] + public VeriteOre(int amount = 1) : base(CraftResource.Verite, amount) + { + } + + public override BaseIngot GetIngot() => new VeriteIngot(); +} + +[SerializationGenerator(0, false)] +public partial class ValoriteOre : BaseOre +{ + [Constructible] + public ValoriteOre(int amount = 1) : base(CraftResource.Valorite, amount) + { + } + + public override BaseIngot GetIngot() => new ValoriteIngot(); +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Blacksmithing/Scales.cs b/Projects/UOContent/Items/Resources/Blacksmithing/Scales.cs index 130370adc..858d401e4 100644 --- a/Projects/UOContent/Items/Resources/Blacksmithing/Scales.cs +++ b/Projects/UOContent/Items/Resources/Blacksmithing/Scales.cs @@ -1,221 +1,220 @@ -namespace Server.Items +namespace Server.Items; + +public abstract class BaseScales : Item, ICommodity { - public abstract class BaseScales : Item, ICommodity + private CraftResource m_Resource; + + public BaseScales(CraftResource resource, int amount = 1) : base(0x26B4) { - private CraftResource m_Resource; + Stackable = true; + Amount = amount; + Hue = CraftResources.GetHue(resource); - public BaseScales(CraftResource resource, int amount = 1) : base(0x26B4) + m_Resource = resource; + } + + public BaseScales(Serial serial) : base(serial) + { + } + + public override int LabelNumber => 1053139; // dragon scales + + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => m_Resource; + set { - Stackable = true; - Amount = amount; - Hue = CraftResources.GetHue(resource); - - m_Resource = resource; - } - - public BaseScales(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1053139; // dragon scales - - [CommandProperty(AccessLevel.GameMaster)] - public CraftResource Resource - { - get => m_Resource; - set - { - m_Resource = value; - InvalidateProperties(); - } - } - - public override double DefaultWeight => 0.1; - - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write((int)m_Resource); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 0: - { - m_Resource = (CraftResource)reader.ReadInt(); - break; - } - } + m_Resource = value; + InvalidateProperties(); } } - public class RedScales : BaseScales + public override double DefaultWeight => 0.1; + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; + + public override void Serialize(IGenericWriter writer) { - [Constructible] - public RedScales(int amount = 1) : base(CraftResource.RedScales, amount) - { - } + base.Serialize(writer); - public RedScales(Serial serial) : base(serial) - { - } + writer.Write(0); // version - 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(); - } + writer.Write((int)m_Resource); } - public class YellowScales : BaseScales + public override void Deserialize(IGenericReader reader) { - [Constructible] - public YellowScales(int amount = 1) : base(CraftResource.YellowScales, amount) + base.Deserialize(reader); + + var version = reader.ReadInt(); + + switch (version) { - } - - public YellowScales(Serial serial) : base(serial) - { - } - - 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 class BlackScales : BaseScales - { - [Constructible] - public BlackScales(int amount = 1) : base(CraftResource.BlackScales, amount) - { - } - - public BlackScales(Serial serial) : base(serial) - { - } - - 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 class GreenScales : BaseScales - { - [Constructible] - public GreenScales(int amount = 1) : base(CraftResource.GreenScales, amount) - { - } - - public GreenScales(Serial serial) : base(serial) - { - } - - 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 class WhiteScales : BaseScales - { - [Constructible] - public WhiteScales(int amount = 1) : base(CraftResource.WhiteScales, amount) - { - } - - public WhiteScales(Serial serial) : base(serial) - { - } - - 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 class BlueScales : BaseScales - { - [Constructible] - public BlueScales(int amount = 1) : base(CraftResource.BlueScales, amount) - { - } - - public BlueScales(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1053140; // sea serpent scales - - 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(); + case 0: + { + m_Resource = (CraftResource)reader.ReadInt(); + break; + } } } } + +public class RedScales : BaseScales +{ + [Constructible] + public RedScales(int amount = 1) : base(CraftResource.RedScales, amount) + { + } + + public RedScales(Serial serial) : base(serial) + { + } + + 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 class YellowScales : BaseScales +{ + [Constructible] + public YellowScales(int amount = 1) : base(CraftResource.YellowScales, amount) + { + } + + public YellowScales(Serial serial) : base(serial) + { + } + + 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 class BlackScales : BaseScales +{ + [Constructible] + public BlackScales(int amount = 1) : base(CraftResource.BlackScales, amount) + { + } + + public BlackScales(Serial serial) : base(serial) + { + } + + 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 class GreenScales : BaseScales +{ + [Constructible] + public GreenScales(int amount = 1) : base(CraftResource.GreenScales, amount) + { + } + + public GreenScales(Serial serial) : base(serial) + { + } + + 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 class WhiteScales : BaseScales +{ + [Constructible] + public WhiteScales(int amount = 1) : base(CraftResource.WhiteScales, amount) + { + } + + public WhiteScales(Serial serial) : base(serial) + { + } + + 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 class BlueScales : BaseScales +{ + [Constructible] + public BlueScales(int amount = 1) : base(CraftResource.BlueScales, amount) + { + } + + public BlueScales(Serial serial) : base(serial) + { + } + + public override int LabelNumber => 1053140; // sea serpent scales + + 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/Resources/Fishing/BigFish.cs b/Projects/UOContent/Items/Resources/Fishing/BigFish.cs index e6c488b45..e97c88239 100644 --- a/Projects/UOContent/Items/Resources/Fishing/BigFish.cs +++ b/Projects/UOContent/Items/Resources/Fishing/BigFish.cs @@ -1,49 +1,48 @@ using System; using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(1, false)] +public partial class BigFish : Item, ICarvable { - [SerializationGenerator(1, false)] - public partial class BigFish : Item, ICarvable + [InvalidateProperties] + [SerializedCommandProperty(AccessLevel.GameMaster)] + [SerializableField(0)] + private Mobile _fisher; + + [Constructible] + public BigFish() : base(0x09CC) { - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(0)] - private Mobile _fisher; + // TODO: Find correct formula. max on OSI currently 200, OSI dev says it's not 200 as max, and ~ 1/1,000,000 chance to get highest + Weight = Utility.RandomMinMax(3, 200); + Hue = Utility.RandomBool() ? 0x847 : 0x58C; + } - [Constructible] - public BigFish() : base(0x09CC) + public override int LabelNumber => 1041112; // a big fish + + public void Carve(Mobile from, Item item) + { + ScissorHelper(from, new RawFishSteak(), Math.Max(16, (int)Weight) / 4, false); + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (Weight >= 20) { - // TODO: Find correct formula. max on OSI currently 200, OSI dev says it's not 200 as max, and ~ 1/1,000,000 chance to get highest - Weight = Utility.RandomMinMax(3, 200); - Hue = Utility.RandomBool() ? 0x847 : 0x58C; - } - - public override int LabelNumber => 1041112; // a big fish - - public void Carve(Mobile from, Item item) - { - ScissorHelper(from, new RawFishSteak(), Math.Max(16, (int)Weight) / 4, false); - } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (Weight >= 20) + if (_fisher != null) { - if (_fisher != null) - { - list.Add(1070857, _fisher.Name); // Caught by ~1_fisherman~ - } - - list.Add(1070858, $"{(int)Weight}"); // ~1_weight~ stones + list.Add(1070857, _fisher.Name); // Caught by ~1_fisherman~ } - } - private void Deserialize(IGenericReader reader, int version) - { - Weight = Utility.RandomMinMax(3, 200); + list.Add(1070858, $"{(int)Weight}"); // ~1_weight~ stones } } -} + + private void Deserialize(IGenericReader reader, int version) + { + Weight = Utility.RandomMinMax(3, 200); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Fishing/Fish.cs b/Projects/UOContent/Items/Resources/Fishing/Fish.cs index 0007f92b7..49f93eedd 100644 --- a/Projects/UOContent/Items/Resources/Fishing/Fish.cs +++ b/Projects/UOContent/Items/Resources/Fishing/Fish.cs @@ -1,21 +1,20 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class Fish : Item, ICarvable - { - [Constructible] - public Fish(int amount = 1) : base(Utility.Random(0x09CC, 4)) - { - Stackable = true; - Weight = 1.0; - Amount = amount; - } +namespace Server.Items; - public void Carve(Mobile from, Item item) - { - ScissorHelper(from, new RawFishSteak(), 4); - } +[SerializationGenerator(0, false)] +public partial class Fish : Item, ICarvable +{ + [Constructible] + public Fish(int amount = 1) : base(Utility.Random(0x09CC, 4)) + { + Stackable = true; + Weight = 1.0; + Amount = amount; } -} + + public void Carve(Mobile from, Item item) + { + ScissorHelper(from, new RawFishSteak(), 4); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Fishing/MagicFish.cs b/Projects/UOContent/Items/Resources/Fishing/MagicFish.cs index e89d7b6ac..d9d53eb64 100644 --- a/Projects/UOContent/Items/Resources/Fishing/MagicFish.cs +++ b/Projects/UOContent/Items/Resources/Fishing/MagicFish.cs @@ -3,102 +3,101 @@ using ModernUO.Serialization; using Server.Network; using Server.Spells; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public abstract partial class BaseMagicFish : Item { - [SerializationGenerator(0, false)] - public abstract partial class BaseMagicFish : Item + public BaseMagicFish(int hue) : base(0xDD6) => Hue = hue; + + public virtual int Bonus => 0; + public virtual StatType Type => StatType.Str; + + public override double DefaultWeight => 1.0; + + public virtual bool Apply(Mobile from) { - public BaseMagicFish(int hue) : base(0xDD6) => Hue = hue; + var applied = SpellHelper.AddStatOffset(from, Type, Bonus, TimeSpan.FromMinutes(1.0)); - public virtual int Bonus => 0; - public virtual StatType Type => StatType.Str; - - public override double DefaultWeight => 1.0; - - public virtual bool Apply(Mobile from) + if (!applied) { - var applied = SpellHelper.AddStatOffset(from, Type, Bonus, TimeSpan.FromMinutes(1.0)); - - if (!applied) - { - from.SendLocalizedMessage(502173); // You are already under a similar effect. - } - - return applied; + from.SendLocalizedMessage(502173); // You are already under a similar effect. } - public override void OnDoubleClick(Mobile from) - { - if (!IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. - } - else if (Apply(from)) - { - from.FixedEffect(0x375A, 10, 15); - from.PlaySound(0x1E7); - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501774); // You swallow the fish whole! - Delete(); - } - } + return applied; } - [SerializationGenerator(0, false)] - public partial class PrizedFish : BaseMagicFish + public override void OnDoubleClick(Mobile from) { - [Constructible] - public PrizedFish() : base(51) + if (!IsChildOf(from.Backpack)) { + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } - - public override int Bonus => 5; - public override StatType Type => StatType.Int; - - public override int LabelNumber => 1041073; // prized fish - } - - [SerializationGenerator(0, false)] - public partial class WondrousFish : BaseMagicFish - { - [Constructible] - public WondrousFish() : base(86) + else if (Apply(from)) { - } - - public override int Bonus => 5; - public override StatType Type => StatType.Dex; - - public override int LabelNumber => 1041074; // wondrous fish - } - - [SerializationGenerator(0, false)] - public partial class TrulyRareFish : BaseMagicFish - { - [Constructible] - public TrulyRareFish() : base(76) - { - } - - public override int Bonus => 5; - public override StatType Type => StatType.Str; - - public override int LabelNumber => 1041075; // truly rare fish - } - - [SerializationGenerator(0, false)] - public partial class PeculiarFish : BaseMagicFish - { - [Constructible] - public PeculiarFish() : base(66) - { - } - - public override int LabelNumber => 1041076; // highly peculiar fish - - public override bool Apply(Mobile from) - { - from.Stam += 10; - return true; + from.FixedEffect(0x375A, 10, 15); + from.PlaySound(0x1E7); + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501774); // You swallow the fish whole! + Delete(); } } } + +[SerializationGenerator(0, false)] +public partial class PrizedFish : BaseMagicFish +{ + [Constructible] + public PrizedFish() : base(51) + { + } + + public override int Bonus => 5; + public override StatType Type => StatType.Int; + + public override int LabelNumber => 1041073; // prized fish +} + +[SerializationGenerator(0, false)] +public partial class WondrousFish : BaseMagicFish +{ + [Constructible] + public WondrousFish() : base(86) + { + } + + public override int Bonus => 5; + public override StatType Type => StatType.Dex; + + public override int LabelNumber => 1041074; // wondrous fish +} + +[SerializationGenerator(0, false)] +public partial class TrulyRareFish : BaseMagicFish +{ + [Constructible] + public TrulyRareFish() : base(76) + { + } + + public override int Bonus => 5; + public override StatType Type => StatType.Str; + + public override int LabelNumber => 1041075; // truly rare fish +} + +[SerializationGenerator(0, false)] +public partial class PeculiarFish : BaseMagicFish +{ + [Constructible] + public PeculiarFish() : base(66) + { + } + + public override int LabelNumber => 1041076; // highly peculiar fish + + public override bool Apply(Mobile from) + { + from.Stam += 10; + return true; + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Masonry/Granite.cs b/Projects/UOContent/Items/Resources/Masonry/Granite.cs index c24cb757f..b94ed4745 100644 --- a/Projects/UOContent/Items/Resources/Masonry/Granite.cs +++ b/Projects/UOContent/Items/Resources/Masonry/Granite.cs @@ -1,318 +1,129 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(2, false)] +public abstract partial class BaseGranite : Item { - public abstract class BaseGranite : Item + [InvalidateProperties] + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private CraftResource _resource; + + public BaseGranite(CraftResource resource) : base(0x1779) { - private CraftResource m_Resource; + Hue = CraftResources.GetHue(resource); + Stackable = Core.ML; - public BaseGranite(CraftResource resource) : base(0x1779) + _resource = resource; + } + + public override double DefaultWeight => Core.ML ? 1.0 : 10.0; + + public override int LabelNumber => 1044607; // high quality granite + + private void Deserialize(IGenericReader reader, int version) + { + _resource = (CraftResource)reader.ReadInt(); + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (!CraftResources.IsStandard(_resource)) { - Hue = CraftResources.GetHue(resource); - Stackable = Core.ML; + var num = CraftResources.GetLocalizationNumber(_resource); - m_Resource = resource; - } - - public BaseGranite(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public CraftResource Resource - { - get => m_Resource; - set + if (num > 0) { - m_Resource = value; - InvalidateProperties(); + list.Add(num); } - } - - public override double DefaultWeight => Core.ML ? 1.0 : 10.0; - - public override int LabelNumber => 1044607; // high quality granite - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(1); // version - - writer.Write((int)m_Resource); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) + else { - case 1: - case 0: - { - m_Resource = (CraftResource)reader.ReadInt(); - break; - } + list.Add(CraftResources.GetName(_resource)); } - - if (version < 1) - { - Stackable = Core.ML; - } - } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (!CraftResources.IsStandard(m_Resource)) - { - var num = CraftResources.GetLocalizationNumber(m_Resource); - - if (num > 0) - { - list.Add(num); - } - else - { - list.Add(CraftResources.GetName(m_Resource)); - } - } - } - } - - public class Granite : BaseGranite - { - [Constructible] - public Granite() : base(CraftResource.Iron) - { - } - - public Granite(Serial serial) : base(serial) - { - } - - 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 class DullCopperGranite : BaseGranite - { - [Constructible] - public DullCopperGranite() : base(CraftResource.DullCopper) - { - } - - public DullCopperGranite(Serial serial) : base(serial) - { - } - - 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 class ShadowIronGranite : BaseGranite - { - [Constructible] - public ShadowIronGranite() : base(CraftResource.ShadowIron) - { - } - - public ShadowIronGranite(Serial serial) : base(serial) - { - } - - 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 class CopperGranite : BaseGranite - { - [Constructible] - public CopperGranite() : base(CraftResource.Copper) - { - } - - public CopperGranite(Serial serial) : base(serial) - { - } - - 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 class BronzeGranite : BaseGranite - { - [Constructible] - public BronzeGranite() : base(CraftResource.Bronze) - { - } - - public BronzeGranite(Serial serial) : base(serial) - { - } - - 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 class GoldGranite : BaseGranite - { - [Constructible] - public GoldGranite() : base(CraftResource.Gold) - { - } - - public GoldGranite(Serial serial) : base(serial) - { - } - - 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 class AgapiteGranite : BaseGranite - { - [Constructible] - public AgapiteGranite() : base(CraftResource.Agapite) - { - } - - public AgapiteGranite(Serial serial) : base(serial) - { - } - - 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 class VeriteGranite : BaseGranite - { - [Constructible] - public VeriteGranite() : base(CraftResource.Verite) - { - } - - public VeriteGranite(Serial serial) : base(serial) - { - } - - 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 class ValoriteGranite : BaseGranite - { - [Constructible] - public ValoriteGranite() : base(CraftResource.Valorite) - { - } - - public ValoriteGranite(Serial serial) : base(serial) - { - } - - 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(); } } } + +[SerializationGenerator(0, false)] +public partial class Granite : BaseGranite +{ + [Constructible] + public Granite() : base(CraftResource.Iron) + { + } +} + +[SerializationGenerator(0, false)] +public partial class DullCopperGranite : BaseGranite +{ + [Constructible] + public DullCopperGranite() : base(CraftResource.DullCopper) + { + } +} + +[SerializationGenerator(0, false)] +public partial class ShadowIronGranite : BaseGranite +{ + [Constructible] + public ShadowIronGranite() : base(CraftResource.ShadowIron) + { + } +} + +[SerializationGenerator(0, false)] +public partial class CopperGranite : BaseGranite +{ + [Constructible] + public CopperGranite() : base(CraftResource.Copper) + { + } +} + +[SerializationGenerator(0, false)] +public partial class BronzeGranite : BaseGranite +{ + [Constructible] + public BronzeGranite() : base(CraftResource.Bronze) + { + } +} + +[SerializationGenerator(0, false)] +public partial class GoldGranite : BaseGranite +{ + [Constructible] + public GoldGranite() : base(CraftResource.Gold) + { + } +} + +[SerializationGenerator(0, false)] +public partial class AgapiteGranite : BaseGranite +{ + [Constructible] + public AgapiteGranite() : base(CraftResource.Agapite) + { + } +} + +[SerializationGenerator(0, false)] +public partial class VeriteGranite : BaseGranite +{ + [Constructible] + public VeriteGranite() : base(CraftResource.Verite) + { + } +} + +[SerializationGenerator(0, false)] +public partial class ValoriteGranite : BaseGranite +{ + [Constructible] + public ValoriteGranite() : base(CraftResource.Valorite) + { + } +} diff --git a/Projects/UOContent/Items/Resources/MiscMLResources.cs b/Projects/UOContent/Items/Resources/MiscMLResources.cs index f72b20447..837bf9b24 100644 --- a/Projects/UOContent/Items/Resources/MiscMLResources.cs +++ b/Projects/UOContent/Items/Resources/MiscMLResources.cs @@ -1,386 +1,385 @@ using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class Blight : Item { - [SerializationGenerator(0, false)] - public partial class Blight : Item + [Constructible] + public Blight(int amount = 1) : base(0x3183) { - [Constructible] - public Blight(int amount = 1) : base(0x3183) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class LuminescentFungi : Item - { - [Constructible] - public LuminescentFungi(int amount = 1) : base(0x3191) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class CapturedEssence : Item - { - [Constructible] - public CapturedEssence(int amount = 1) : base(0x318E) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class EyeOfTheTravesty : Item - { - [Constructible] - public EyeOfTheTravesty(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public EyeOfTheTravesty(int amount = 1) : base(0x318D) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class Corruption : Item - { - [Constructible] - public Corruption(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public Corruption(int amount = 1) : base(0x3184) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class DreadHornMane : Item - { - [Constructible] - public DreadHornMane(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public DreadHornMane(int amount = 1) : base(0x318A) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class ParasiticPlant : Item - { - [Constructible] - public ParasiticPlant(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public ParasiticPlant(int amount = 1) : base(0x3190) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class Muculent : Item - { - [Constructible] - public Muculent(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public Muculent(int amount = 1) : base(0x3188) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class DiseasedBark : Item - { - [Constructible] - public DiseasedBark(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public DiseasedBark(int amount = 1) : base(0x318B) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class BarkFragment : Item - { - [Constructible] - public BarkFragment(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public BarkFragment(int amount = 1) : base(0x318F) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class GrizzledBones : Item - { - [Constructible] - public GrizzledBones(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public GrizzledBones(int amount = 1) : base(0x318C) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class LardOfParoxysmus : Item - { - [Constructible] - public LardOfParoxysmus(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public LardOfParoxysmus(int amount = 1) : base(0x3189) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class PerfectEmerald : Item - { - [Constructible] - public PerfectEmerald(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public PerfectEmerald(int amount = 1) : base(0x3194) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class DarkSapphire : Item - { - [Constructible] - public DarkSapphire(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public DarkSapphire(int amount = 1) : base(0x3192) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class Turquoise : Item - { - [Constructible] - public Turquoise(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public Turquoise(int amount = 1) : base(0x3193) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class EcruCitrine : Item - { - [Constructible] - public EcruCitrine(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public EcruCitrine(int amount = 1) : base(0x3195) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class WhitePearl : Item - { - [Constructible] - public WhitePearl(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public WhitePearl(int amount = 1) : base(0x3196) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class FireRuby : Item - { - [Constructible] - public FireRuby(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public FireRuby(int amount = 1) : base(0x3197) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class BlueDiamond : Item - { - [Constructible] - public BlueDiamond(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public BlueDiamond(int amount = 1) : base(0x3198) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class BrilliantAmber : Item - { - [Constructible] - public BrilliantAmber(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public BrilliantAmber(int amount = 1) : base(0x3199) - { - Stackable = true; - Amount = amount; - } - } - - [SerializationGenerator(0, false)] - public partial class Scourge : Item - { - [Constructible] - public Scourge(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public Scourge(int amount = 1) : base(0x3185) - { - Stackable = true; - Amount = amount; - Hue = 150; - } - } - - [SerializationGenerator(0, false)] - public partial class Putrefication : Item - { - [Constructible] - public Putrefication(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public Putrefication(int amount = 1) : base(0x3186) - { - Stackable = true; - Amount = amount; - Hue = 883; - } - } - - [SerializationGenerator(0, false)] - public partial class Taint : Item - { - [Constructible] - public Taint(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public Taint(int amount = 1) : base(0x3187) - { - Stackable = true; - Amount = amount; - Hue = 731; - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x315A, 0x315B)] - public partial class PristineDreadHorn : Item - { - [Constructible] - public PristineDreadHorn() : base(0x315A) - { - } - } - - [SerializationGenerator(0, false)] - public partial class SwitchItem : Item - { - [Constructible] - public SwitchItem(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) - { - } - - [Constructible] - public SwitchItem(int amount = 1) : base(0x2F5F) - { - Stackable = true; - Amount = amount; - } + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class LuminescentFungi : Item +{ + [Constructible] + public LuminescentFungi(int amount = 1) : base(0x3191) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class CapturedEssence : Item +{ + [Constructible] + public CapturedEssence(int amount = 1) : base(0x318E) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class EyeOfTheTravesty : Item +{ + [Constructible] + public EyeOfTheTravesty(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public EyeOfTheTravesty(int amount = 1) : base(0x318D) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class Corruption : Item +{ + [Constructible] + public Corruption(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public Corruption(int amount = 1) : base(0x3184) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class DreadHornMane : Item +{ + [Constructible] + public DreadHornMane(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public DreadHornMane(int amount = 1) : base(0x318A) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class ParasiticPlant : Item +{ + [Constructible] + public ParasiticPlant(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public ParasiticPlant(int amount = 1) : base(0x3190) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class Muculent : Item +{ + [Constructible] + public Muculent(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public Muculent(int amount = 1) : base(0x3188) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class DiseasedBark : Item +{ + [Constructible] + public DiseasedBark(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public DiseasedBark(int amount = 1) : base(0x318B) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class BarkFragment : Item +{ + [Constructible] + public BarkFragment(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public BarkFragment(int amount = 1) : base(0x318F) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class GrizzledBones : Item +{ + [Constructible] + public GrizzledBones(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public GrizzledBones(int amount = 1) : base(0x318C) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class LardOfParoxysmus : Item +{ + [Constructible] + public LardOfParoxysmus(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public LardOfParoxysmus(int amount = 1) : base(0x3189) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class PerfectEmerald : Item +{ + [Constructible] + public PerfectEmerald(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public PerfectEmerald(int amount = 1) : base(0x3194) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class DarkSapphire : Item +{ + [Constructible] + public DarkSapphire(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public DarkSapphire(int amount = 1) : base(0x3192) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class Turquoise : Item +{ + [Constructible] + public Turquoise(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public Turquoise(int amount = 1) : base(0x3193) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class EcruCitrine : Item +{ + [Constructible] + public EcruCitrine(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public EcruCitrine(int amount = 1) : base(0x3195) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class WhitePearl : Item +{ + [Constructible] + public WhitePearl(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public WhitePearl(int amount = 1) : base(0x3196) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class FireRuby : Item +{ + [Constructible] + public FireRuby(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public FireRuby(int amount = 1) : base(0x3197) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class BlueDiamond : Item +{ + [Constructible] + public BlueDiamond(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public BlueDiamond(int amount = 1) : base(0x3198) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class BrilliantAmber : Item +{ + [Constructible] + public BrilliantAmber(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public BrilliantAmber(int amount = 1) : base(0x3199) + { + Stackable = true; + Amount = amount; + } +} + +[SerializationGenerator(0, false)] +public partial class Scourge : Item +{ + [Constructible] + public Scourge(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public Scourge(int amount = 1) : base(0x3185) + { + Stackable = true; + Amount = amount; + Hue = 150; + } +} + +[SerializationGenerator(0, false)] +public partial class Putrefication : Item +{ + [Constructible] + public Putrefication(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public Putrefication(int amount = 1) : base(0x3186) + { + Stackable = true; + Amount = amount; + Hue = 883; + } +} + +[SerializationGenerator(0, false)] +public partial class Taint : Item +{ + [Constructible] + public Taint(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public Taint(int amount = 1) : base(0x3187) + { + Stackable = true; + Amount = amount; + Hue = 731; + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x315A, 0x315B)] +public partial class PristineDreadHorn : Item +{ + [Constructible] + public PristineDreadHorn() : base(0x315A) + { + } +} + +[SerializationGenerator(0, false)] +public partial class SwitchItem : Item +{ + [Constructible] + public SwitchItem(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo)) + { + } + + [Constructible] + public SwitchItem(int amount = 1) : base(0x2F5F) + { + Stackable = true; + Amount = amount; } } diff --git a/Projects/UOContent/Items/Resources/Reagents/BagOfAllReagents.cs b/Projects/UOContent/Items/Resources/Reagents/BagOfAllReagents.cs index 95c8e28e2..8a9511ed9 100644 --- a/Projects/UOContent/Items/Resources/Reagents/BagOfAllReagents.cs +++ b/Projects/UOContent/Items/Resources/Reagents/BagOfAllReagents.cs @@ -1,41 +1,25 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class BagOfAllReagents : Bag { - public class BagOfAllReagents : Bag + [Constructible] + public BagOfAllReagents(int amount = 50) { - [Constructible] - public BagOfAllReagents(int amount = 50) - { - DropItem(new BlackPearl(amount)); - DropItem(new Bloodmoss(amount)); - DropItem(new Garlic(amount)); - DropItem(new Ginseng(amount)); - DropItem(new MandrakeRoot(amount)); - DropItem(new Nightshade(amount)); - DropItem(new SulfurousAsh(amount)); - DropItem(new SpidersSilk(amount)); - DropItem(new BatWing(amount)); - DropItem(new GraveDust(amount)); - DropItem(new DaemonBlood(amount)); - DropItem(new NoxCrystal(amount)); - DropItem(new PigIron(amount)); - } - - public BagOfAllReagents(Serial serial) : base(serial) - { - } - - 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(); - } + DropItem(new BlackPearl(amount)); + DropItem(new Bloodmoss(amount)); + DropItem(new Garlic(amount)); + DropItem(new Ginseng(amount)); + DropItem(new MandrakeRoot(amount)); + DropItem(new Nightshade(amount)); + DropItem(new SulfurousAsh(amount)); + DropItem(new SpidersSilk(amount)); + DropItem(new BatWing(amount)); + DropItem(new GraveDust(amount)); + DropItem(new DaemonBlood(amount)); + DropItem(new NoxCrystal(amount)); + DropItem(new PigIron(amount)); } } diff --git a/Projects/UOContent/Items/Resources/Reagents/BagOfNecroReagents.cs b/Projects/UOContent/Items/Resources/Reagents/BagOfNecroReagents.cs index 8ae93d53d..66900b474 100644 --- a/Projects/UOContent/Items/Resources/Reagents/BagOfNecroReagents.cs +++ b/Projects/UOContent/Items/Resources/Reagents/BagOfNecroReagents.cs @@ -1,33 +1,17 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class BagOfNecroReagents : Bag { - public class BagOfNecroReagents : Bag + [Constructible] + public BagOfNecroReagents(int amount = 50) { - [Constructible] - public BagOfNecroReagents(int amount = 50) - { - DropItem(new BatWing(amount)); - DropItem(new GraveDust(amount)); - DropItem(new DaemonBlood(amount)); - DropItem(new NoxCrystal(amount)); - DropItem(new PigIron(amount)); - } - - public BagOfNecroReagents(Serial serial) : base(serial) - { - } - - 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(); - } + DropItem(new BatWing(amount)); + DropItem(new GraveDust(amount)); + DropItem(new DaemonBlood(amount)); + DropItem(new NoxCrystal(amount)); + DropItem(new PigIron(amount)); } } diff --git a/Projects/UOContent/Items/Resources/Reagents/BagOfReagents.cs b/Projects/UOContent/Items/Resources/Reagents/BagOfReagents.cs index 30cd467f8..194507b9b 100644 --- a/Projects/UOContent/Items/Resources/Reagents/BagOfReagents.cs +++ b/Projects/UOContent/Items/Resources/Reagents/BagOfReagents.cs @@ -1,36 +1,20 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class BagOfReagents : Bag { - public class BagOfReagents : Bag + [Constructible] + public BagOfReagents(int amount = 50) { - [Constructible] - public BagOfReagents(int amount = 50) - { - DropItem(new BlackPearl(amount)); - DropItem(new Bloodmoss(amount)); - DropItem(new Garlic(amount)); - DropItem(new Ginseng(amount)); - DropItem(new MandrakeRoot(amount)); - DropItem(new Nightshade(amount)); - DropItem(new SulfurousAsh(amount)); - DropItem(new SpidersSilk(amount)); - } - - public BagOfReagents(Serial serial) : base(serial) - { - } - - 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(); - } + DropItem(new BlackPearl(amount)); + DropItem(new Bloodmoss(amount)); + DropItem(new Garlic(amount)); + DropItem(new Ginseng(amount)); + DropItem(new MandrakeRoot(amount)); + DropItem(new Nightshade(amount)); + DropItem(new SulfurousAsh(amount)); + DropItem(new SpidersSilk(amount)); } } diff --git a/Projects/UOContent/Items/Resources/Reagents/BaseReagent.cs b/Projects/UOContent/Items/Resources/Reagents/BaseReagent.cs index 32bfdb4cc..7ea05ad49 100644 --- a/Projects/UOContent/Items/Resources/Reagents/BaseReagent.cs +++ b/Projects/UOContent/Items/Resources/Reagents/BaseReagent.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public abstract partial class BaseReagent : Item - { - public BaseReagent(int itemID, int amount = 1) : base(itemID) - { - Stackable = true; - Amount = amount; - } +namespace Server.Items; - public override double DefaultWeight => 0.1; +[SerializationGenerator(0, false)] +public abstract partial class BaseReagent : Item +{ + public BaseReagent(int itemID, int amount = 1) : base(itemID) + { + Stackable = true; + Amount = amount; } -} + + public override double DefaultWeight => 0.1; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/BatWing.cs b/Projects/UOContent/Items/Resources/Reagents/BatWing.cs index 474284936..b3ab7189b 100644 --- a/Projects/UOContent/Items/Resources/Reagents/BatWing.cs +++ b/Projects/UOContent/Items/Resources/Reagents/BatWing.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class BatWing : BaseReagent, ICommodity - { - [Constructible] - public BatWing(int amount = 1) : base(0xF78, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class BatWing : BaseReagent, ICommodity +{ + [Constructible] + public BatWing(int amount = 1) : base(0xF78, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/BlackPearl.cs b/Projects/UOContent/Items/Resources/Reagents/BlackPearl.cs index d2d32f419..20d890ea5 100644 --- a/Projects/UOContent/Items/Resources/Reagents/BlackPearl.cs +++ b/Projects/UOContent/Items/Resources/Reagents/BlackPearl.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class BlackPearl : BaseReagent, ICommodity - { - [Constructible] - public BlackPearl(int amount = 1) : base(0xF7A, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class BlackPearl : BaseReagent, ICommodity +{ + [Constructible] + public BlackPearl(int amount = 1) : base(0xF7A, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/Bloodmoss.cs b/Projects/UOContent/Items/Resources/Reagents/Bloodmoss.cs index 70559a3b3..558b1706f 100644 --- a/Projects/UOContent/Items/Resources/Reagents/Bloodmoss.cs +++ b/Projects/UOContent/Items/Resources/Reagents/Bloodmoss.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class Bloodmoss : BaseReagent, ICommodity - { - [Constructible] - public Bloodmoss(int amount = 1) : base(0xF7B, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class Bloodmoss : BaseReagent, ICommodity +{ + [Constructible] + public Bloodmoss(int amount = 1) : base(0xF7B, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/DaemonBlood.cs b/Projects/UOContent/Items/Resources/Reagents/DaemonBlood.cs index 10350ebed..4a33c4bd5 100644 --- a/Projects/UOContent/Items/Resources/Reagents/DaemonBlood.cs +++ b/Projects/UOContent/Items/Resources/Reagents/DaemonBlood.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class DaemonBlood : BaseReagent, ICommodity - { - [Constructible] - public DaemonBlood(int amount = 1) : base(0xF7D, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class DaemonBlood : BaseReagent, ICommodity +{ + [Constructible] + public DaemonBlood(int amount = 1) : base(0xF7D, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/DaemonBone.cs b/Projects/UOContent/Items/Resources/Reagents/DaemonBone.cs index 6c8b9a818..fd00d8ad6 100644 --- a/Projects/UOContent/Items/Resources/Reagents/DaemonBone.cs +++ b/Projects/UOContent/Items/Resources/Reagents/DaemonBone.cs @@ -1,18 +1,17 @@ using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class DaemonBone : BaseReagent, ICommodity { - [SerializationGenerator(0, false)] - public partial class DaemonBone : BaseReagent, ICommodity + [Constructible] + public DaemonBone(int amount = 1) : base(0xF80, amount) { - [Constructible] - public DaemonBone(int amount = 1) : base(0xF80, amount) - { - } - - public override double DefaultWeight => 1.0; - - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => Core.ML; } -} + + public override double DefaultWeight => 1.0; + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => Core.ML; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/DeadWood.cs b/Projects/UOContent/Items/Resources/Reagents/DeadWood.cs index 39e9e6459..14b950acd 100644 --- a/Projects/UOContent/Items/Resources/Reagents/DeadWood.cs +++ b/Projects/UOContent/Items/Resources/Reagents/DeadWood.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class DeadWood : BaseReagent, ICommodity - { - [Constructible] - public DeadWood(int amount = 1) : base(0xF90, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class DeadWood : BaseReagent, ICommodity +{ + [Constructible] + public DeadWood(int amount = 1) : base(0xF90, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/DragonsBlood.cs b/Projects/UOContent/Items/Resources/Reagents/DragonsBlood.cs index 0e695ab43..09aeacd74 100644 --- a/Projects/UOContent/Items/Resources/Reagents/DragonsBlood.cs +++ b/Projects/UOContent/Items/Resources/Reagents/DragonsBlood.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class DragonsBlood : BaseReagent, ICommodity - { - [Constructible] - public DragonsBlood(int amount = 1) : base(0x4077, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => Core.ML; +[SerializationGenerator(0, false)] +public partial class DragonsBlood : BaseReagent, ICommodity +{ + [Constructible] + public DragonsBlood(int amount = 1) : base(0x4077, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => Core.ML; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/Garlic.cs b/Projects/UOContent/Items/Resources/Reagents/Garlic.cs index fb616980b..b1a11550d 100644 --- a/Projects/UOContent/Items/Resources/Reagents/Garlic.cs +++ b/Projects/UOContent/Items/Resources/Reagents/Garlic.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class Garlic : BaseReagent, ICommodity - { - [Constructible] - public Garlic(int amount = 1) : base(0xF84, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class Garlic : BaseReagent, ICommodity +{ + [Constructible] + public Garlic(int amount = 1) : base(0xF84, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/Ginseng.cs b/Projects/UOContent/Items/Resources/Reagents/Ginseng.cs index 60df8c379..8b976654c 100644 --- a/Projects/UOContent/Items/Resources/Reagents/Ginseng.cs +++ b/Projects/UOContent/Items/Resources/Reagents/Ginseng.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class Ginseng : BaseReagent, ICommodity - { - [Constructible] - public Ginseng(int amount = 1) : base(0xF85, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class Ginseng : BaseReagent, ICommodity +{ + [Constructible] + public Ginseng(int amount = 1) : base(0xF85, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/GraveDust.cs b/Projects/UOContent/Items/Resources/Reagents/GraveDust.cs index f87cf5bf0..e6f00327c 100644 --- a/Projects/UOContent/Items/Resources/Reagents/GraveDust.cs +++ b/Projects/UOContent/Items/Resources/Reagents/GraveDust.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class GraveDust : BaseReagent, ICommodity - { - [Constructible] - public GraveDust(int amount = 1) : base(0xF8F, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class GraveDust : BaseReagent, ICommodity +{ + [Constructible] + public GraveDust(int amount = 1) : base(0xF8F, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/MandrakeRoot.cs b/Projects/UOContent/Items/Resources/Reagents/MandrakeRoot.cs index 8493e2991..6c7e48551 100644 --- a/Projects/UOContent/Items/Resources/Reagents/MandrakeRoot.cs +++ b/Projects/UOContent/Items/Resources/Reagents/MandrakeRoot.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class MandrakeRoot : BaseReagent, ICommodity - { - [Constructible] - public MandrakeRoot(int amount = 1) : base(0xF86, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class MandrakeRoot : BaseReagent, ICommodity +{ + [Constructible] + public MandrakeRoot(int amount = 1) : base(0xF86, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/Nightshade.cs b/Projects/UOContent/Items/Resources/Reagents/Nightshade.cs index d39535bb8..09d26f32e 100644 --- a/Projects/UOContent/Items/Resources/Reagents/Nightshade.cs +++ b/Projects/UOContent/Items/Resources/Reagents/Nightshade.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class Nightshade : BaseReagent, ICommodity - { - [Constructible] - public Nightshade(int amount = 1) : base(0xF88, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class Nightshade : BaseReagent, ICommodity +{ + [Constructible] + public Nightshade(int amount = 1) : base(0xF88, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/NoxCrystal.cs b/Projects/UOContent/Items/Resources/Reagents/NoxCrystal.cs index 6380167b0..86e3c8045 100644 --- a/Projects/UOContent/Items/Resources/Reagents/NoxCrystal.cs +++ b/Projects/UOContent/Items/Resources/Reagents/NoxCrystal.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class NoxCrystal : BaseReagent, ICommodity - { - [Constructible] - public NoxCrystal(int amount = 1) : base(0xF8E, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class NoxCrystal : BaseReagent, ICommodity +{ + [Constructible] + public NoxCrystal(int amount = 1) : base(0xF8E, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/PigIron.cs b/Projects/UOContent/Items/Resources/Reagents/PigIron.cs index 3b8f81711..66b33cbbd 100644 --- a/Projects/UOContent/Items/Resources/Reagents/PigIron.cs +++ b/Projects/UOContent/Items/Resources/Reagents/PigIron.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class PigIron : BaseReagent, ICommodity - { - [Constructible] - public PigIron(int amount = 1) : base(0xF8A, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class PigIron : BaseReagent, ICommodity +{ + [Constructible] + public PigIron(int amount = 1) : base(0xF8A, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/SpidersSilk.cs b/Projects/UOContent/Items/Resources/Reagents/SpidersSilk.cs index 9f97f37ea..952192258 100644 --- a/Projects/UOContent/Items/Resources/Reagents/SpidersSilk.cs +++ b/Projects/UOContent/Items/Resources/Reagents/SpidersSilk.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class SpidersSilk : BaseReagent, ICommodity - { - [Constructible] - public SpidersSilk(int amount = 1) : base(0xF8D, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class SpidersSilk : BaseReagent, ICommodity +{ + [Constructible] + public SpidersSilk(int amount = 1) : base(0xF8D, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Reagents/SulfurousAsh.cs b/Projects/UOContent/Items/Resources/Reagents/SulfurousAsh.cs index 40de7e27c..4d6bee892 100644 --- a/Projects/UOContent/Items/Resources/Reagents/SulfurousAsh.cs +++ b/Projects/UOContent/Items/Resources/Reagents/SulfurousAsh.cs @@ -1,16 +1,15 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class SulfurousAsh : BaseReagent, ICommodity - { - [Constructible] - public SulfurousAsh(int amount = 1) : base(0xF8C, amount) - { - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class SulfurousAsh : BaseReagent, ICommodity +{ + [Constructible] + public SulfurousAsh(int amount = 1) : base(0xF8C, amount) + { } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/BoltOfCloth.cs b/Projects/UOContent/Items/Resources/Tailor/BoltOfCloth.cs index e87b0f521..6d3638145 100644 --- a/Projects/UOContent/Items/Resources/Tailor/BoltOfCloth.cs +++ b/Projects/UOContent/Items/Resources/Tailor/BoltOfCloth.cs @@ -1,52 +1,51 @@ using ModernUO.Serialization; using Server.Network; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +[Flippable(0xF95, 0xF96, 0xF97, 0xF98, 0xF99, 0xF9A, 0xF9B, 0xF9C)] +public partial class BoltOfCloth : Item, IScissorable, IDyable, ICommodity { - [SerializationGenerator(0, false)] - [Flippable(0xF95, 0xF96, 0xF97, 0xF98, 0xF99, 0xF9A, 0xF9B, 0xF9C)] - public partial class BoltOfCloth : Item, IScissorable, IDyable, ICommodity + [Constructible] + public BoltOfCloth(int amount = 1) : base(0xF95) { - [Constructible] - public BoltOfCloth(int amount = 1) : base(0xF95) - { - Stackable = true; - Weight = 5.0; - Amount = amount; - } - - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; - - public bool Dye(Mobile from, DyeTub sender) - { - if (Deleted) - { - return false; - } - - Hue = sender.DyedHue; - - return true; - } - - public bool Scissor(Mobile from, Scissors scissors) - { - if (Deleted || !from.CanSee(this)) - { - return false; - } - - ScissorHelper(from, new Cloth(), 50); - - return true; - } - - public override void OnSingleClick(Mobile from) - { - var number = Amount == 1 ? 1049122 : 1049121; - var amount = (Amount * 50).ToString(); - from.NetState.SendMessageLocalized(Serial, ItemID, MessageType.Label, 0x3B2, 3, number, "", amount); - } + Stackable = true; + Weight = 5.0; + Amount = amount; } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; + + public bool Dye(Mobile from, DyeTub sender) + { + if (Deleted) + { + return false; + } + + Hue = sender.DyedHue; + + return true; + } + + public bool Scissor(Mobile from, Scissors scissors) + { + if (Deleted || !from.CanSee(this)) + { + return false; + } + + ScissorHelper(from, new Cloth(), 50); + + return true; + } + + public override void OnSingleClick(Mobile from) + { + var number = Amount == 1 ? 1049122 : 1049121; + var amount = (Amount * 50).ToString(); + from.NetState.SendMessageLocalized(Serial, ItemID, MessageType.Label, 0x3B2, 3, number, "", amount); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/Bone.cs b/Projects/UOContent/Items/Resources/Tailor/Bone.cs index 5b27f8cbe..590b71a37 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Bone.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Bone.cs @@ -1,19 +1,18 @@ using ModernUO.Serialization; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class Bone : Item, ICommodity - { - [Constructible] - public Bone(int amount = 1) : base(0xf7e) - { - Stackable = true; - Amount = amount; - Weight = 1.0; - } +namespace Server.Items; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; +[SerializationGenerator(0, false)] +public partial class Bone : Item, ICommodity +{ + [Constructible] + public Bone(int amount = 1) : base(0xf7e) + { + Stackable = true; + Amount = amount; + Weight = 1.0; } -} + + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/Cloth.cs b/Projects/UOContent/Items/Resources/Tailor/Cloth.cs index b8f49714d..c768a2930 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Cloth.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Cloth.cs @@ -1,52 +1,51 @@ using ModernUO.Serialization; using Server.Network; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +[Flippable(0x1766, 0x1768)] +public partial class Cloth : Item, IScissorable, IDyable, ICommodity { - [SerializationGenerator(0, false)] - [Flippable(0x1766, 0x1768)] - public partial class Cloth : Item, IScissorable, IDyable, ICommodity + [Constructible] + public Cloth(int amount = 1) : base(0x1766) { - [Constructible] - public Cloth(int amount = 1) : base(0x1766) - { - Stackable = true; - Amount = amount; - } - - public override double DefaultWeight => 0.1; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; - - public bool Dye(Mobile from, DyeTub sender) - { - if (Deleted) - { - return false; - } - - Hue = sender.DyedHue; - - return true; - } - - public bool Scissor(Mobile from, Scissors scissors) - { - if (Deleted || !from.CanSee(this)) - { - return false; - } - - ScissorHelper(from, new Bandage(), 1); - - return true; - } - - public override void OnSingleClick(Mobile from) - { - var number = Amount == 1 ? 1049124 : 1049123; - - from.NetState.SendMessageLocalized(Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString()); - } + Stackable = true; + Amount = amount; } -} + + public override double DefaultWeight => 0.1; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; + + public bool Dye(Mobile from, DyeTub sender) + { + if (Deleted) + { + return false; + } + + Hue = sender.DyedHue; + + return true; + } + + public bool Scissor(Mobile from, Scissors scissors) + { + if (Deleted || !from.CanSee(this)) + { + return false; + } + + ScissorHelper(from, new Bandage(), 1); + + return true; + } + + public override void OnSingleClick(Mobile from) + { + var number = Amount == 1 ? 1049124 : 1049123; + + from.NetState.SendMessageLocalized(Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString()); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/Cotton.cs b/Projects/UOContent/Items/Resources/Tailor/Cotton.cs index 61d6c64fc..01b4712db 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Cotton.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Cotton.cs @@ -1,93 +1,92 @@ using ModernUO.Serialization; using Server.Targeting; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class Cotton : Item, IDyable { - [SerializationGenerator(0, false)] - public partial class Cotton : Item, IDyable + [Constructible] + public Cotton(int amount = 1) : base(0xDF9) { - [Constructible] - public Cotton(int amount = 1) : base(0xDF9) + Stackable = true; + Weight = 4.0; + Amount = amount; + } + + public bool Dye(Mobile from, DyeTub sender) + { + if (Deleted) { - Stackable = true; - Weight = 4.0; - Amount = amount; + return false; } - public bool Dye(Mobile from, DyeTub sender) + Hue = sender.DyedHue; + + return true; + } + + public override void OnDoubleClick(Mobile from) + { + if (IsChildOf(from.Backpack)) { - if (Deleted) - { - return false; - } - - Hue = sender.DyedHue; - - return true; + from.SendLocalizedMessage(502655); // What spinning wheel do you wish to spin this on? + from.Target = new PickWheelTarget(this); } - - public override void OnDoubleClick(Mobile from) + else { - if (IsChildOf(from.Backpack)) + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. + } + } + + public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) + { + Item item = new SpoolOfThread(6); + item.Hue = hue; + + from.AddToBackpack(item); + from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack. + } + + private class PickWheelTarget : Target + { + private readonly Cotton m_Cotton; + + public PickWheelTarget(Cotton cotton) : base(3, false, TargetFlags.None) => m_Cotton = cotton; + + protected override void OnTarget(Mobile from, object targeted) + { + if (m_Cotton.Deleted) { - from.SendLocalizedMessage(502655); // What spinning wheel do you wish to spin this on? - from.Target = new PickWheelTarget(this); + return; } - else + + var wheel = targeted as ISpinningWheel; + + if (wheel == null && targeted is AddonComponent component) + { + wheel = component.Addon as ISpinningWheel; + } + + if (wheel is not Item) + { + from.SendLocalizedMessage(502658); // Use that on a spinning wheel. + return; + } + + if (!m_Cotton.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } - } - - public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) - { - Item item = new SpoolOfThread(6); - item.Hue = hue; - - from.AddToBackpack(item); - from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack. - } - - private class PickWheelTarget : Target - { - private readonly Cotton m_Cotton; - - public PickWheelTarget(Cotton cotton) : base(3, false, TargetFlags.None) => m_Cotton = cotton; - - protected override void OnTarget(Mobile from, object targeted) + else if (wheel.Spinning) { - if (m_Cotton.Deleted) - { - return; - } - - var wheel = targeted as ISpinningWheel; - - if (wheel == null && targeted is AddonComponent component) - { - wheel = component.Addon as ISpinningWheel; - } - - if (wheel is not Item) - { - from.SendLocalizedMessage(502658); // Use that on a spinning wheel. - return; - } - - if (!m_Cotton.IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. - } - else if (wheel.Spinning) - { - from.SendLocalizedMessage(502656); // That spinning wheel is being used. - } - else - { - m_Cotton.Consume(); - wheel.BeginSpin(m_Cotton.OnSpun, from, m_Cotton.Hue); - } + from.SendLocalizedMessage(502656); // That spinning wheel is being used. + } + else + { + m_Cotton.Consume(); + wheel.BeginSpin(m_Cotton.OnSpun, from, m_Cotton.Hue); } } } -} +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/Flax.cs b/Projects/UOContent/Items/Resources/Tailor/Flax.cs index ec40e4ee6..ee44d6f8b 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Flax.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Flax.cs @@ -1,81 +1,80 @@ using ModernUO.Serialization; using Server.Targeting; -namespace Server.Items -{ - [SerializationGenerator(0, false)] - public partial class Flax : Item - { - [Constructible] - public Flax(int amount = 1) : base(0x1A9C) - { - Stackable = true; - Weight = 1.0; - Amount = amount; - } +namespace Server.Items; - public override void OnDoubleClick(Mobile from) +[SerializationGenerator(0, false)] +public partial class Flax : Item +{ + [Constructible] + public Flax(int amount = 1) : base(0x1A9C) + { + Stackable = true; + Weight = 1.0; + Amount = amount; + } + + public override void OnDoubleClick(Mobile from) + { + if (IsChildOf(from.Backpack)) { - if (IsChildOf(from.Backpack)) + from.SendLocalizedMessage(502655); // What spinning wheel do you wish to spin this on? + from.Target = new PickWheelTarget(this); + } + else + { + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. + } + } + + public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) + { + Item item = new SpoolOfThread(6); + item.Hue = hue; + + from.AddToBackpack(item); + from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack. + } + + private class PickWheelTarget : Target + { + private readonly Flax m_Flax; + + public PickWheelTarget(Flax flax) : base(3, false, TargetFlags.None) => m_Flax = flax; + + protected override void OnTarget(Mobile from, object targeted) + { + if (m_Flax.Deleted) { - from.SendLocalizedMessage(502655); // What spinning wheel do you wish to spin this on? - from.Target = new PickWheelTarget(this); + return; } - else + + var wheel = targeted as ISpinningWheel; + + if (wheel == null && targeted is AddonComponent component) + { + wheel = component.Addon as ISpinningWheel; + } + + if (wheel is not Item) + { + from.SendLocalizedMessage(502658); // Use that on a spinning wheel. + return; + } + + if (!m_Flax.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } - } - - public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) - { - Item item = new SpoolOfThread(6); - item.Hue = hue; - - from.AddToBackpack(item); - from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack. - } - - private class PickWheelTarget : Target - { - private readonly Flax m_Flax; - - public PickWheelTarget(Flax flax) : base(3, false, TargetFlags.None) => m_Flax = flax; - - protected override void OnTarget(Mobile from, object targeted) + else if (wheel.Spinning) { - if (m_Flax.Deleted) - { - return; - } - - var wheel = targeted as ISpinningWheel; - - if (wheel == null && targeted is AddonComponent component) - { - wheel = component.Addon as ISpinningWheel; - } - - if (wheel is not Item) - { - from.SendLocalizedMessage(502658); // Use that on a spinning wheel. - return; - } - - if (!m_Flax.IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. - } - else if (wheel.Spinning) - { - from.SendLocalizedMessage(502656); // That spinning wheel is being used. - } - else - { - m_Flax.Consume(); - wheel.BeginSpin(m_Flax.OnSpun, from, m_Flax.Hue); - } + from.SendLocalizedMessage(502656); // That spinning wheel is being used. + } + else + { + m_Flax.Consume(); + wheel.BeginSpin(m_Flax.OnSpun, from, m_Flax.Hue); } } } -} +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/Hides.cs b/Projects/UOContent/Items/Resources/Tailor/Hides.cs index a026322ef..9366ce20b 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Hides.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Hides.cs @@ -1,187 +1,186 @@ using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(2, false)] +public abstract partial class BaseHides : Item, ICommodity { - [SerializationGenerator(2, false)] - public abstract partial class BaseHides : Item, ICommodity + [InvalidateProperties] + [SerializedCommandProperty(AccessLevel.GameMaster)] + [SerializableField(0)] + private CraftResource _resource; + + public BaseHides(CraftResource resource, int amount = 1) : base(0x1079) { - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(0)] - private CraftResource _resource; + Stackable = true; + Weight = 5.0; + Amount = amount; + Hue = CraftResources.GetHue(resource); - public BaseHides(CraftResource resource, int amount = 1) : base(0x1079) + _resource = resource; + } + + public override int LabelNumber + { + get { - Stackable = true; - Weight = 5.0; - Amount = amount; - Hue = CraftResources.GetHue(resource); - - _resource = resource; - } - - public override int LabelNumber - { - get + if (_resource >= CraftResource.SpinedLeather && _resource <= CraftResource.BarbedLeather) { - if (_resource >= CraftResource.SpinedLeather && _resource <= CraftResource.BarbedLeather) - { - return 1049687 + (_resource - CraftResource.SpinedLeather); - } - - return 1047023; + return 1049687 + (_resource - CraftResource.SpinedLeather); } + + return 1047023; } + } - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; - private void Deserialize(IGenericReader reader, int version) + private void Deserialize(IGenericReader reader, int version) + { + _resource = (CraftResource)reader.ReadInt(); + } + + public override void AddNameProperty(IPropertyList list) + { + if (Amount > 1) { - _resource = (CraftResource)reader.ReadInt(); + list.Add(1050039, $"{Amount}\t{1024216:#}"); // ~1_NUMBER~ ~2_ITEMNAME~ } - - public override void AddNameProperty(IPropertyList list) + else { - if (Amount > 1) + list.Add(1024216); // pile of hides + } + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (!CraftResources.IsStandard(_resource)) + { + var num = CraftResources.GetLocalizationNumber(_resource); + + if (num > 0) { - list.Add(1050039, $"{Amount}\t{1024216:#}"); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(num); } else { - list.Add(1024216); // pile of hides + list.Add(CraftResources.GetName(_resource)); } } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (!CraftResources.IsStandard(_resource)) - { - var num = CraftResources.GetLocalizationNumber(_resource); - - if (num > 0) - { - list.Add(num); - } - else - { - list.Add(CraftResources.GetName(_resource)); - } - } - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1079, 0x1078)] - public partial class Hides : BaseHides, IScissorable - { - [Constructible] - public Hides(int amount = 1) : base(CraftResource.RegularLeather, amount) - { - } - - public bool Scissor(Mobile from, Scissors scissors) - { - if (Deleted || !from.CanSee(this)) - { - return false; - } - - if (Core.AOS && !IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack - return false; - } - - ScissorHelper(from, new Leather(), 1); - - return true; - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1079, 0x1078)] - public partial class SpinedHides : BaseHides, IScissorable - { - [Constructible] - public SpinedHides(int amount = 1) : base(CraftResource.SpinedLeather, amount) - { - } - - public bool Scissor(Mobile from, Scissors scissors) - { - if (Deleted || !from.CanSee(this)) - { - return false; - } - - if (Core.AOS && !IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack - return false; - } - - ScissorHelper(from, new SpinedLeather(), 1); - - return true; - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1079, 0x1078)] - public partial class HornedHides : BaseHides, IScissorable - { - [Constructible] - public HornedHides(int amount = 1) : base(CraftResource.HornedLeather, amount) - { - } - - public bool Scissor(Mobile from, Scissors scissors) - { - if (Deleted || !from.CanSee(this)) - { - return false; - } - - if (Core.AOS && !IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack - return false; - } - - ScissorHelper(from, new HornedLeather(), 1); - - return true; - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1079, 0x1078)] - public partial class BarbedHides : BaseHides, IScissorable - { - [Constructible] - public BarbedHides(int amount = 1) : base(CraftResource.BarbedLeather, amount) - { - } - - public bool Scissor(Mobile from, Scissors scissors) - { - if (Deleted || !from.CanSee(this)) - { - return false; - } - - if (Core.AOS && !IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack - return false; - } - - ScissorHelper(from, new BarbedLeather(), 1); - - return true; - } } } + +[SerializationGenerator(0, false)] +[Flippable(0x1079, 0x1078)] +public partial class Hides : BaseHides, IScissorable +{ + [Constructible] + public Hides(int amount = 1) : base(CraftResource.RegularLeather, amount) + { + } + + public bool Scissor(Mobile from, Scissors scissors) + { + if (Deleted || !from.CanSee(this)) + { + return false; + } + + if (Core.AOS && !IsChildOf(from.Backpack)) + { + from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack + return false; + } + + ScissorHelper(from, new Leather(), 1); + + return true; + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1079, 0x1078)] +public partial class SpinedHides : BaseHides, IScissorable +{ + [Constructible] + public SpinedHides(int amount = 1) : base(CraftResource.SpinedLeather, amount) + { + } + + public bool Scissor(Mobile from, Scissors scissors) + { + if (Deleted || !from.CanSee(this)) + { + return false; + } + + if (Core.AOS && !IsChildOf(from.Backpack)) + { + from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack + return false; + } + + ScissorHelper(from, new SpinedLeather(), 1); + + return true; + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1079, 0x1078)] +public partial class HornedHides : BaseHides, IScissorable +{ + [Constructible] + public HornedHides(int amount = 1) : base(CraftResource.HornedLeather, amount) + { + } + + public bool Scissor(Mobile from, Scissors scissors) + { + if (Deleted || !from.CanSee(this)) + { + return false; + } + + if (Core.AOS && !IsChildOf(from.Backpack)) + { + from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack + return false; + } + + ScissorHelper(from, new HornedLeather(), 1); + + return true; + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1079, 0x1078)] +public partial class BarbedHides : BaseHides, IScissorable +{ + [Constructible] + public BarbedHides(int amount = 1) : base(CraftResource.BarbedLeather, amount) + { + } + + public bool Scissor(Mobile from, Scissors scissors) + { + if (Deleted || !from.CanSee(this)) + { + return false; + } + + if (Core.AOS && !IsChildOf(from.Backpack)) + { + from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack + return false; + } + + ScissorHelper(from, new BarbedLeather(), 1); + + return true; + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/Leathers.cs b/Projects/UOContent/Items/Resources/Tailor/Leathers.cs index bc4f46291..48d10aa09 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Leathers.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Leathers.cs @@ -1,115 +1,114 @@ using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(2, false)] +public abstract partial class BaseLeather : Item, ICommodity { - [SerializationGenerator(2, false)] - public abstract partial class BaseLeather : Item, ICommodity + [InvalidateProperties] + [SerializedCommandProperty(AccessLevel.GameMaster)] + [SerializableField(0)] + private CraftResource _resource; + + public BaseLeather(CraftResource resource, int amount = 1) : base(0x1081) { - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(0)] - private CraftResource _resource; + Stackable = true; + Weight = 1.0; + Amount = amount; + Hue = CraftResources.GetHue(resource); - public BaseLeather(CraftResource resource, int amount = 1) : base(0x1081) + _resource = resource; + } + + public override int LabelNumber + { + get { - Stackable = true; - Weight = 1.0; - Amount = amount; - Hue = CraftResources.GetHue(resource); - - _resource = resource; - } - - public override int LabelNumber - { - get + if (_resource >= CraftResource.SpinedLeather && _resource <= CraftResource.BarbedLeather) { - if (_resource >= CraftResource.SpinedLeather && _resource <= CraftResource.BarbedLeather) - { - return 1049684 + (_resource - CraftResource.SpinedLeather); - } - - return 1047022; + return 1049684 + (_resource - CraftResource.SpinedLeather); } + + return 1047022; } + } - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; - private void Deserialize(IGenericReader reader, int version) + private void Deserialize(IGenericReader reader, int version) + { + _resource = (CraftResource)reader.ReadInt(); + } + + public override void AddNameProperty(IPropertyList list) + { + if (Amount > 1) { - _resource = (CraftResource)reader.ReadInt(); + list.Add(1050039, $"{Amount}\t{1024199:#}"); // ~1_NUMBER~ ~2_ITEMNAME~ } - - public override void AddNameProperty(IPropertyList list) + else { - if (Amount > 1) + list.Add(1024199); // cut leather + } + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (!CraftResources.IsStandard(_resource)) + { + var num = CraftResources.GetLocalizationNumber(_resource); + + if (num > 0) { - list.Add(1050039, $"{Amount}\t{1024199:#}"); // ~1_NUMBER~ ~2_ITEMNAME~ + list.Add(num); } else { - list.Add(1024199); // cut leather + list.Add(CraftResources.GetName(_resource)); } } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (!CraftResources.IsStandard(_resource)) - { - var num = CraftResources.GetLocalizationNumber(_resource); - - if (num > 0) - { - list.Add(num); - } - else - { - list.Add(CraftResources.GetName(_resource)); - } - } - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1081, 0x1082)] - public partial class Leather : BaseLeather - { - [Constructible] - public Leather(int amount = 1) : base(CraftResource.RegularLeather, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1081, 0x1082)] - public partial class SpinedLeather : BaseLeather - { - [Constructible] - public SpinedLeather(int amount = 1) : base(CraftResource.SpinedLeather, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1081, 0x1082)] - public partial class HornedLeather : BaseLeather - { - [Constructible] - public HornedLeather(int amount = 1) : base(CraftResource.HornedLeather, amount) - { - } - } - - [SerializationGenerator(0, false)] - [Flippable(0x1081, 0x1082)] - public partial class BarbedLeather : BaseLeather - { - [Constructible] - public BarbedLeather(int amount = 1) : base(CraftResource.BarbedLeather, amount) - { - } } } + +[SerializationGenerator(0, false)] +[Flippable(0x1081, 0x1082)] +public partial class Leather : BaseLeather +{ + [Constructible] + public Leather(int amount = 1) : base(CraftResource.RegularLeather, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1081, 0x1082)] +public partial class SpinedLeather : BaseLeather +{ + [Constructible] + public SpinedLeather(int amount = 1) : base(CraftResource.SpinedLeather, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1081, 0x1082)] +public partial class HornedLeather : BaseLeather +{ + [Constructible] + public HornedLeather(int amount = 1) : base(CraftResource.HornedLeather, amount) + { + } +} + +[SerializationGenerator(0, false)] +[Flippable(0x1081, 0x1082)] +public partial class BarbedLeather : BaseLeather +{ + [Constructible] + public BarbedLeather(int amount = 1) : base(CraftResource.BarbedLeather, amount) + { + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/UncutCloth.cs b/Projects/UOContent/Items/Resources/Tailor/UncutCloth.cs index 05ed011f7..f79623e01 100644 --- a/Projects/UOContent/Items/Resources/Tailor/UncutCloth.cs +++ b/Projects/UOContent/Items/Resources/Tailor/UncutCloth.cs @@ -1,52 +1,51 @@ using ModernUO.Serialization; using Server.Network; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +[Flippable(0x1765, 0x1767)] +public partial class UncutCloth : Item, IScissorable, IDyable, ICommodity { - [SerializationGenerator(0, false)] - [Flippable(0x1765, 0x1767)] - public partial class UncutCloth : Item, IScissorable, IDyable, ICommodity + [Constructible] + public UncutCloth(int amount = 1) : base(0x1767) { - [Constructible] - public UncutCloth(int amount = 1) : base(0x1767) - { - Stackable = true; - Amount = amount; - } - - public override double DefaultWeight => 0.1; - int ICommodity.DescriptionNumber => LabelNumber; - bool ICommodity.IsDeedable => true; - - public bool Dye(Mobile from, DyeTub sender) - { - if (Deleted) - { - return false; - } - - Hue = sender.DyedHue; - - return true; - } - - public bool Scissor(Mobile from, Scissors scissors) - { - if (Deleted || !from.CanSee(this)) - { - return false; - } - - ScissorHelper(from, new Bandage(), 1); - - return true; - } - - public override void OnSingleClick(Mobile from) - { - var number = Amount == 1 ? 1049124 : 1049123; - - from.NetState.SendMessageLocalized(Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString()); - } + Stackable = true; + Amount = amount; } -} + + public override double DefaultWeight => 0.1; + int ICommodity.DescriptionNumber => LabelNumber; + bool ICommodity.IsDeedable => true; + + public bool Dye(Mobile from, DyeTub sender) + { + if (Deleted) + { + return false; + } + + Hue = sender.DyedHue; + + return true; + } + + public bool Scissor(Mobile from, Scissors scissors) + { + if (Deleted || !from.CanSee(this)) + { + return false; + } + + ScissorHelper(from, new Bandage(), 1); + + return true; + } + + public override void OnSingleClick(Mobile from) + { + var number = Amount == 1 ? 1049124 : 1049123; + + from.NetState.SendMessageLocalized(Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString()); + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/Wool.cs b/Projects/UOContent/Items/Resources/Tailor/Wool.cs index 578de9600..0dcec170d 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Wool.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Wool.cs @@ -1,115 +1,114 @@ using ModernUO.Serialization; using Server.Targeting; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class Wool : Item, IDyable { - [SerializationGenerator(0, false)] - public partial class Wool : Item, IDyable + [Constructible] + public Wool(int amount = 1) : base(0xDF8) { - [Constructible] - public Wool(int amount = 1) : base(0xDF8) + Stackable = true; + Weight = 4.0; + Amount = amount; + } + + public bool Dye(Mobile from, DyeTub sender) + { + if (Deleted) { - Stackable = true; - Weight = 4.0; - Amount = amount; + return false; } - public bool Dye(Mobile from, DyeTub sender) + Hue = sender.DyedHue; + + return true; + } + + public override void OnDoubleClick(Mobile from) + { + if (IsChildOf(from.Backpack)) { - if (Deleted) + from.SendLocalizedMessage(502655); // What spinning wheel do you wish to spin this on? + from.Target = new PickWheelTarget(this); + } + else + { + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. + } + } + + public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) + { + Item item = new DarkYarn(3); + item.Hue = hue; + + from.AddToBackpack(item); + from.SendLocalizedMessage(1010576); // You put the balls of yarn in your backpack. + } + + private class PickWheelTarget : Target + { + private readonly Wool m_Wool; + + public PickWheelTarget(Wool wool) : base(3, false, TargetFlags.None) => m_Wool = wool; + + protected override void OnTarget(Mobile from, object targeted) + { + if (m_Wool.Deleted) { - return false; + return; } - Hue = sender.DyedHue; + var wheel = targeted as ISpinningWheel; - return true; - } - - public override void OnDoubleClick(Mobile from) - { - if (IsChildOf(from.Backpack)) + if (wheel == null && targeted is AddonComponent component) { - from.SendLocalizedMessage(502655); // What spinning wheel do you wish to spin this on? - from.Target = new PickWheelTarget(this); + wheel = component.Addon as ISpinningWheel; } - else + + if (wheel is Item) { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. - } - } - - public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) - { - Item item = new DarkYarn(3); - item.Hue = hue; - - from.AddToBackpack(item); - from.SendLocalizedMessage(1010576); // You put the balls of yarn in your backpack. - } - - private class PickWheelTarget : Target - { - private readonly Wool m_Wool; - - public PickWheelTarget(Wool wool) : base(3, false, TargetFlags.None) => m_Wool = wool; - - protected override void OnTarget(Mobile from, object targeted) - { - if (m_Wool.Deleted) + if (!m_Wool.IsChildOf(from.Backpack)) { - return; + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } - - var wheel = targeted as ISpinningWheel; - - if (wheel == null && targeted is AddonComponent component) + else if (wheel.Spinning) { - wheel = component.Addon as ISpinningWheel; - } - - if (wheel is Item) - { - if (!m_Wool.IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. - } - else if (wheel.Spinning) - { - from.SendLocalizedMessage(502656); // That spinning wheel is being used. - } - else - { - m_Wool.Consume(); - wheel.BeginSpin(m_Wool.OnSpun, from, m_Wool.Hue); - } + from.SendLocalizedMessage(502656); // That spinning wheel is being used. } else { - from.SendLocalizedMessage(502658); // Use that on a spinning wheel. + m_Wool.Consume(); + wheel.BeginSpin(m_Wool.OnSpun, from, m_Wool.Hue); } } + else + { + from.SendLocalizedMessage(502658); // Use that on a spinning wheel. + } } } - - [SerializationGenerator(0, false)] - public partial class TaintedWool : Wool - { - [Constructible] - public TaintedWool(int amount = 1) : base(0x101F) - { - Stackable = true; - Weight = 4.0; - Amount = amount; - } - - public override void OnSpun(ISpinningWheel wheel, Mobile from, int hue) - { - Item item = new DarkYarn(); - item.Hue = hue; - - from.AddToBackpack(item); - from.SendLocalizedMessage(1010574); // You put a ball of yarn in your backpack. - } - } } + +[SerializationGenerator(0, false)] +public partial class TaintedWool : Wool +{ + [Constructible] + public TaintedWool(int amount = 1) : base(0x101F) + { + Stackable = true; + Weight = 4.0; + Amount = amount; + } + + public override void OnSpun(ISpinningWheel wheel, Mobile from, int hue) + { + Item item = new DarkYarn(); + item.Hue = hue; + + from.AddToBackpack(item); + from.SendLocalizedMessage(1010574); // You put a ball of yarn in your backpack. + } +} \ No newline at end of file diff --git a/Projects/UOContent/Items/Resources/Tailor/YarnsAndThreads.cs b/Projects/UOContent/Items/Resources/Tailor/YarnsAndThreads.cs index f5fef0825..9d8e2766d 100644 --- a/Projects/UOContent/Items/Resources/Tailor/YarnsAndThreads.cs +++ b/Projects/UOContent/Items/Resources/Tailor/YarnsAndThreads.cs @@ -1,130 +1,129 @@ using ModernUO.Serialization; using Server.Targeting; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public abstract partial class BaseClothMaterial : Item, IDyable { - [SerializationGenerator(0, false)] - public abstract partial class BaseClothMaterial : Item, IDyable + public BaseClothMaterial(int itemID, int amount = 1) : base(itemID) { - public BaseClothMaterial(int itemID, int amount = 1) : base(itemID) + Stackable = true; + Weight = 1.0; + Amount = amount; + } + + public bool Dye(Mobile from, DyeTub sender) + { + if (Deleted) { - Stackable = true; - Weight = 1.0; - Amount = amount; + return false; } - public bool Dye(Mobile from, DyeTub sender) + Hue = sender.DyedHue; + + return true; + } + + public override void OnDoubleClick(Mobile from) + { + if (IsChildOf(from.Backpack)) { - if (Deleted) - { - return false; - } - - Hue = sender.DyedHue; - - return true; + from.SendLocalizedMessage(500366); // Select a loom to use that on. + from.Target = new PickLoomTarget(this); } - - public override void OnDoubleClick(Mobile from) + else { - if (IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(500366); // Select a loom to use that on. - from.Target = new PickLoomTarget(this); - } - else - { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. - } + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } + } - private class PickLoomTarget : Target + private class PickLoomTarget : Target + { + private readonly BaseClothMaterial m_Material; + + public PickLoomTarget(BaseClothMaterial material) : base(3, false, TargetFlags.None) => m_Material = material; + + protected override void OnTarget(Mobile from, object targeted) { - private readonly BaseClothMaterial m_Material; - - public PickLoomTarget(BaseClothMaterial material) : base(3, false, TargetFlags.None) => m_Material = material; - - protected override void OnTarget(Mobile from, object targeted) + if (m_Material.Deleted) { - if (m_Material.Deleted) + return; + } + + var loom = targeted as ILoom; + + if (loom == null && targeted is AddonComponent component) + { + loom = component.Addon as ILoom; + } + + if (loom != null) + { + if (!m_Material.IsChildOf(from.Backpack)) { - return; + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } - - var loom = targeted as ILoom; - - if (loom == null && targeted is AddonComponent component) + else if (loom.Phase < 4) { - loom = component.Addon as ILoom; - } + m_Material.Consume(); - if (loom != null) - { - if (!m_Material.IsChildOf(from.Backpack)) + if (targeted is Item item) { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. - } - else if (loom.Phase < 4) - { - m_Material.Consume(); - - if (targeted is Item item) - { - item.SendLocalizedMessageTo(from, 1010001 + loom.Phase++); - } - } - else - { - Item create = new BoltOfCloth(); - create.Hue = m_Material.Hue; - - m_Material.Consume(); - loom.Phase = 0; - from.SendLocalizedMessage(500368); // You create some cloth and put it in your backpack. - from.AddToBackpack(create); + item.SendLocalizedMessageTo(from, 1010001 + loom.Phase++); } } else { - from.SendLocalizedMessage(500367); // Try using that on a loom. + Item create = new BoltOfCloth(); + create.Hue = m_Material.Hue; + + m_Material.Consume(); + loom.Phase = 0; + from.SendLocalizedMessage(500368); // You create some cloth and put it in your backpack. + from.AddToBackpack(create); } } + else + { + from.SendLocalizedMessage(500367); // Try using that on a loom. + } } } +} - [SerializationGenerator(0, false)] - public partial class DarkYarn : BaseClothMaterial +[SerializationGenerator(0, false)] +public partial class DarkYarn : BaseClothMaterial +{ + [Constructible] + public DarkYarn(int amount = 1) : base(0xE1D, amount) { - [Constructible] - public DarkYarn(int amount = 1) : base(0xE1D, amount) - { - } - } - - [SerializationGenerator(0, false)] - public partial class LightYarn : BaseClothMaterial - { - [Constructible] - public LightYarn(int amount = 1) : base(0xE1E, amount) - { - } - } - - [SerializationGenerator(0, false)] - public partial class LightYarnUnraveled : BaseClothMaterial - { - [Constructible] - public LightYarnUnraveled(int amount = 1) : base(0xE1F, amount) - { - } - } - - [SerializationGenerator(0, false)] - public partial class SpoolOfThread : BaseClothMaterial - { - [Constructible] - public SpoolOfThread(int amount = 1) : base(0xFA0, amount) - { - } } } + +[SerializationGenerator(0, false)] +public partial class LightYarn : BaseClothMaterial +{ + [Constructible] + public LightYarn(int amount = 1) : base(0xE1E, amount) + { + } +} + +[SerializationGenerator(0, false)] +public partial class LightYarnUnraveled : BaseClothMaterial +{ + [Constructible] + public LightYarnUnraveled(int amount = 1) : base(0xE1F, amount) + { + } +} + +[SerializationGenerator(0, false)] +public partial class SpoolOfThread : BaseClothMaterial +{ + [Constructible] + public SpoolOfThread(int amount = 1) : base(0xFA0, amount) + { + } +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.AgapiteGranite.v0.json b/Projects/UOContent/Migrations/Server.Items.AgapiteGranite.v0.json new file mode 100644 index 000000000..4059daffe --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.AgapiteGranite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.AgapiteGranite" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Arrow.v0.json b/Projects/UOContent/Migrations/Server.Items.Arrow.v0.json new file mode 100644 index 000000000..53df0a5e0 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Arrow.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Arrow" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BagOfAllReagents.v0.json b/Projects/UOContent/Migrations/Server.Items.BagOfAllReagents.v0.json new file mode 100644 index 000000000..36d8d7675 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BagOfAllReagents.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BagOfAllReagents" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BagOfNecroReagents.v0.json b/Projects/UOContent/Migrations/Server.Items.BagOfNecroReagents.v0.json new file mode 100644 index 000000000..beb90e2ca --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BagOfNecroReagents.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BagOfNecroReagents" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BagOfReagents.v0.json b/Projects/UOContent/Migrations/Server.Items.BagOfReagents.v0.json new file mode 100644 index 000000000..56aaa4993 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BagOfReagents.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BagOfReagents" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BaseGranite.v2.json b/Projects/UOContent/Migrations/Server.Items.BaseGranite.v2.json new file mode 100644 index 000000000..809e0a102 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BaseGranite.v2.json @@ -0,0 +1,11 @@ +{ + "version": 2, + "type": "Server.Items.BaseGranite", + "properties": [ + { + "name": "Resource", + "type": "Server.Items.CraftResource", + "rule": "EnumMigrationRule" + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Bolt.v0.json b/Projects/UOContent/Migrations/Server.Items.Bolt.v0.json new file mode 100644 index 000000000..0297ecd27 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Bolt.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Bolt" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BronzeGranite.v0.json b/Projects/UOContent/Migrations/Server.Items.BronzeGranite.v0.json new file mode 100644 index 000000000..198b439b0 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BronzeGranite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BronzeGranite" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.CopperGranite.v0.json b/Projects/UOContent/Migrations/Server.Items.CopperGranite.v0.json new file mode 100644 index 000000000..2dcff72a7 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.CopperGranite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.CopperGranite" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.DullCopperGranite.v0.json b/Projects/UOContent/Migrations/Server.Items.DullCopperGranite.v0.json new file mode 100644 index 000000000..5d6755b25 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.DullCopperGranite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.DullCopperGranite" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Feather.v0.json b/Projects/UOContent/Migrations/Server.Items.Feather.v0.json new file mode 100644 index 000000000..710ab947f --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Feather.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Feather" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.GoldGranite.v0.json b/Projects/UOContent/Migrations/Server.Items.GoldGranite.v0.json new file mode 100644 index 000000000..771c4c677 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.GoldGranite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.GoldGranite" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Granite.v0.json b/Projects/UOContent/Migrations/Server.Items.Granite.v0.json new file mode 100644 index 000000000..a0b0cbe61 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Granite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Granite" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.ShadowIronGranite.v0.json b/Projects/UOContent/Migrations/Server.Items.ShadowIronGranite.v0.json new file mode 100644 index 000000000..0adb962d4 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.ShadowIronGranite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.ShadowIronGranite" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Shaft.v0.json b/Projects/UOContent/Migrations/Server.Items.Shaft.v0.json new file mode 100644 index 000000000..e03a4e43b --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Shaft.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Shaft" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.ValoriteGranite.v0.json b/Projects/UOContent/Migrations/Server.Items.ValoriteGranite.v0.json new file mode 100644 index 000000000..2dd11adc8 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.ValoriteGranite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.ValoriteGranite" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.VeriteGranite.v0.json b/Projects/UOContent/Migrations/Server.Items.VeriteGranite.v0.json new file mode 100644 index 000000000..cf580c260 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.VeriteGranite.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.VeriteGranite" +} \ No newline at end of file