diff --git a/Projects/UOContent/Items/Food/Cooking.cs b/Projects/UOContent/Items/Food/Cooking.cs index 73a68a4fb..9701772dd 100644 --- a/Projects/UOContent/Items/Food/Cooking.cs +++ b/Projects/UOContent/Items/Food/Cooking.cs @@ -65,8 +65,8 @@ public partial class SackFlour : Item, IHasQuantity _quantity = 20; } - [CommandProperty(AccessLevel.GameMaster)] [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] public int Quantity { get => _quantity; diff --git a/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs b/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs index fbc16f88d..ce772da40 100644 --- a/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs +++ b/Projects/UOContent/Items/Resources/Blacksmithing/Ingots.cs @@ -5,11 +5,6 @@ namespace Server.Items; [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) { Stackable = true; @@ -21,6 +16,24 @@ public abstract partial class BaseIngot : Item, ICommodity public override double DefaultWeight => 0.1; + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => _resource; + set + { + if (_resource != value) + { + _resource = value; + Hue = CraftResources.GetHue(value); + + InvalidateProperties(); + this.MarkDirty(); + } + } + } + public override int LabelNumber { get @@ -162,4 +175,4 @@ public partial class ValoriteIngot : BaseIngot 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 809d76474..3116d7136 100644 --- a/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs +++ b/Projects/UOContent/Items/Resources/Blacksmithing/Ore.cs @@ -17,10 +17,23 @@ public abstract partial class BaseOre : Item _resource = resource; } - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(0)] - private CraftResource _resource; + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => _resource; + set + { + if (_resource != value) + { + _resource = value; + Hue = CraftResources.GetHue(value); + + InvalidateProperties(); + this.MarkDirty(); + } + } + } public override int LabelNumber { diff --git a/Projects/UOContent/Items/Resources/Blacksmithing/Scales.cs b/Projects/UOContent/Items/Resources/Blacksmithing/Scales.cs index 8b304579e..fa63d902c 100644 --- a/Projects/UOContent/Items/Resources/Blacksmithing/Scales.cs +++ b/Projects/UOContent/Items/Resources/Blacksmithing/Scales.cs @@ -5,11 +5,6 @@ namespace Server.Items; [SerializationGenerator(1, false)] public abstract partial class BaseScales : Item, ICommodity { - [InvalidateProperties] - [SerializableField(0)] - [SerializedCommandProperty(AccessLevel.GameMaster)] - private CraftResource _resource; - public BaseScales(CraftResource resource, int amount = 1) : base(0x26B4) { Stackable = true; @@ -19,6 +14,24 @@ public abstract partial class BaseScales : Item, ICommodity _resource = resource; } + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => _resource; + set + { + if (_resource != value) + { + _resource = value; + Hue = CraftResources.GetHue(value); + + InvalidateProperties(); + this.MarkDirty(); + } + } + } + public override int LabelNumber => 1053139; // dragon scales public override double DefaultWeight => 0.1; diff --git a/Projects/UOContent/Items/Resources/Masonry/Granite.cs b/Projects/UOContent/Items/Resources/Masonry/Granite.cs index b94ed4745..ae4f215d7 100644 --- a/Projects/UOContent/Items/Resources/Masonry/Granite.cs +++ b/Projects/UOContent/Items/Resources/Masonry/Granite.cs @@ -5,11 +5,6 @@ namespace Server.Items; [SerializationGenerator(2, false)] public abstract partial class BaseGranite : Item { - [InvalidateProperties] - [SerializableField(0)] - [SerializedCommandProperty(AccessLevel.GameMaster)] - private CraftResource _resource; - public BaseGranite(CraftResource resource) : base(0x1779) { Hue = CraftResources.GetHue(resource); @@ -20,6 +15,24 @@ public abstract partial class BaseGranite : Item public override double DefaultWeight => Core.ML ? 1.0 : 10.0; + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => _resource; + set + { + if (_resource != value) + { + _resource = value; + Hue = CraftResources.GetHue(value); + + InvalidateProperties(); + this.MarkDirty(); + } + } + } + public override int LabelNumber => 1044607; // high quality granite private void Deserialize(IGenericReader reader, int version) diff --git a/Projects/UOContent/Items/Resources/Tailor/Hides.cs b/Projects/UOContent/Items/Resources/Tailor/Hides.cs index 9366ce20b..8068659b1 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Hides.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Hides.cs @@ -1,15 +1,11 @@ using ModernUO.Serialization; +using Server.Engines.Craft; namespace Server.Items; [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) { Stackable = true; @@ -20,6 +16,24 @@ public abstract partial class BaseHides : Item, ICommodity _resource = resource; } + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => _resource; + set + { + if (_resource != value) + { + _resource = value; + Hue = CraftResources.GetHue(value); + + InvalidateProperties(); + this.MarkDirty(); + } + } + } + public override int LabelNumber { get @@ -183,4 +197,4 @@ public partial class BarbedHides : BaseHides, IScissorable 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 48d10aa09..86d1861ec 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Leathers.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Leathers.cs @@ -5,11 +5,6 @@ namespace Server.Items; [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) { Stackable = true; @@ -20,6 +15,24 @@ public abstract partial class BaseLeather : Item, ICommodity _resource = resource; } + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => _resource; + set + { + if (_resource != value) + { + _resource = value; + Hue = CraftResources.GetHue(value); + + InvalidateProperties(); + this.MarkDirty(); + } + } + } + public override int LabelNumber { get @@ -111,4 +124,4 @@ public partial class BarbedLeather : BaseLeather public BarbedLeather(int amount = 1) : base(CraftResource.BarbedLeather, amount) { } -} \ No newline at end of file +} diff --git a/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs b/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs index 0ba5e551b..9ff0d8386 100644 --- a/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs +++ b/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs @@ -6,10 +6,6 @@ namespace Server.Items; [SerializationGenerator(4, false)] public partial class Board : Item, ICommodity { - [InvalidateProperties] - [SerializableField(0)] - private CraftResource _resource; - [Constructible] public Board(int amount = 1) : this(CraftResource.RegularWood, amount) { @@ -25,6 +21,24 @@ public partial class Board : Item, ICommodity Hue = CraftResources.GetHue(resource); } + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => _resource; + set + { + if (_resource != value) + { + _resource = value; + Hue = CraftResources.GetHue(value); + + InvalidateProperties(); + this.MarkDirty(); + } + } + } + int ICommodity.DescriptionNumber { get diff --git a/Projects/UOContent/Items/Skill Items/Fishing/Misc/MessageInABottle.cs b/Projects/UOContent/Items/Skill Items/Fishing/Misc/MessageInABottle.cs index f176ec98c..8f5603a5c 100644 --- a/Projects/UOContent/Items/Skill Items/Fishing/Misc/MessageInABottle.cs +++ b/Projects/UOContent/Items/Skill Items/Fishing/Misc/MessageInABottle.cs @@ -24,8 +24,8 @@ public partial class MessageInABottle : Item public override int LabelNumber => 1041080; // a message in a bottle - [CommandProperty(AccessLevel.GameMaster)] [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] public int Level { get => _level; diff --git a/Projects/UOContent/Items/Skill Items/Fishing/Misc/SOS.cs b/Projects/UOContent/Items/Skill Items/Fishing/Misc/SOS.cs index 788fd92d7..0ae8f7956 100644 --- a/Projects/UOContent/Items/Skill Items/Fishing/Misc/SOS.cs +++ b/Projects/UOContent/Items/Skill Items/Fishing/Misc/SOS.cs @@ -103,8 +103,8 @@ public partial class SOS : Item [CommandProperty(AccessLevel.GameMaster)] public bool IsAncient => _level >= 4; - [CommandProperty(AccessLevel.GameMaster)] [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] public int Level { get => _level; diff --git a/Projects/UOContent/Items/Skill Items/Lumberjack/Log.cs b/Projects/UOContent/Items/Skill Items/Lumberjack/Log.cs index 17f8f3ee6..5b372abd5 100644 --- a/Projects/UOContent/Items/Skill Items/Lumberjack/Log.cs +++ b/Projects/UOContent/Items/Skill Items/Lumberjack/Log.cs @@ -6,11 +6,6 @@ namespace Server.Items; [Flippable(0x1bdd, 0x1be0)] public partial class Log : Item, ICommodity, IAxe { - [InvalidateProperties] - [SerializedCommandProperty(AccessLevel.GameMaster)] - [SerializableField(0)] - private CraftResource _resource; - [Constructible] public Log(int amount = 1) : this(CraftResource.RegularWood, amount) { @@ -32,6 +27,24 @@ public partial class Log : Item, ICommodity, IAxe Hue = CraftResources.GetHue(resource); } + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public CraftResource Resource + { + get => _resource; + set + { + if (_resource != value) + { + _resource = value; + Hue = CraftResources.GetHue(value); + + InvalidateProperties(); + this.MarkDirty(); + } + } + } + public virtual bool Axe(Mobile from, BaseAxe axe) => TryCreateBoards(from, 0, new Board()); int ICommodity.DescriptionNumber => CraftResources.IsStandard(_resource) diff --git a/Projects/UOContent/Items/Special/MiniHouses.cs b/Projects/UOContent/Items/Special/MiniHouses.cs index 5366094bb..5104dad33 100644 --- a/Projects/UOContent/Items/Special/MiniHouses.cs +++ b/Projects/UOContent/Items/Special/MiniHouses.cs @@ -14,8 +14,8 @@ public partial class MiniHouseAddon : BaseAddon Construct(); } - [CommandProperty(AccessLevel.GameMaster)] [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] public MiniHouseType Type { get => _type;