From b006501535a88a913fef04477ff029988c33d489 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 24 Nov 2022 00:57:23 -0800 Subject: [PATCH] fix: Codegens blacksmith, camping, and carpenter skill items (#1278) --- .../Blacksmith Items/Misc/AnvilForge.cs | 67 +- .../Blacksmith Items/Misc/LargeForge.cs | 533 ++++------ .../Items/Skill Items/Camping/Bedroll.cs | 207 ++-- .../Items/Skill Items/Camping/Campfire.cs | 353 ++++--- .../Items/Skill Items/Camping/Kindling.cs | 163 ++-- .../Skill Items/Carpenter Items/Board.cs | 377 +++---- .../Carpenter Items/TaxidermyKit.cs | 920 ++++++++---------- .../Migrations/Server.Items.Anvil.v0.json | 4 + .../Migrations/Server.Items.AshBoard.v0.json | 4 + .../Migrations/Server.Items.Bedroll.v0.json | 4 + .../Server.Items.BloodwoodBoard.v0.json | 4 + .../Migrations/Server.Items.Board.v4.json | 11 + .../Migrations/Server.Items.Campfire.v0.json | 4 + .../Migrations/Server.Items.Forge.v0.json | 4 + .../Server.Items.FrostwoodBoard.v0.json | 4 + .../Server.Items.HeartwoodBoard.v0.json | 4 + .../Migrations/Server.Items.Kindling.v0.json | 4 + ....Items.LargeForgeEast.InternalItem.v0.json | 4 + ...Items.LargeForgeEast.InternalItem2.v0.json | 4 + .../Server.Items.LargeForgeEast.v0.json | 4 + ....Items.LargeForgeWest.InternalItem.v0.json | 4 + ...Items.LargeForgeWest.InternalItem2.v0.json | 4 + .../Server.Items.LargeForgeWest.v0.json | 16 + .../Migrations/Server.Items.OakBoard.v0.json | 4 + .../Server.Items.TaxidermyKit.v0.json | 4 + .../Server.Items.TrophyAddon.v2.json | 54 + .../Server.Items.TrophyDeed.v2.json | 54 + .../Migrations/Server.Items.YewBoard.v0.json | 4 + 28 files changed, 1272 insertions(+), 1551 deletions(-) create mode 100644 Projects/UOContent/Migrations/Server.Items.Anvil.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.AshBoard.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Bedroll.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.BloodwoodBoard.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Board.v4.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Campfire.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Forge.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.FrostwoodBoard.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.HeartwoodBoard.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.Kindling.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.LargeForgeEast.InternalItem.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.LargeForgeEast.InternalItem2.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.LargeForgeEast.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.LargeForgeWest.InternalItem.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.LargeForgeWest.InternalItem2.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.LargeForgeWest.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.OakBoard.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.TaxidermyKit.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.TrophyAddon.v2.json create mode 100644 Projects/UOContent/Migrations/Server.Items.TrophyDeed.v2.json create mode 100644 Projects/UOContent/Migrations/Server.Items.YewBoard.v0.json diff --git a/Projects/UOContent/Items/Skill Items/Blacksmith Items/Misc/AnvilForge.cs b/Projects/UOContent/Items/Skill Items/Blacksmith Items/Misc/AnvilForge.cs index 16a3e08a3..017471336 100644 --- a/Projects/UOContent/Items/Skill Items/Blacksmith Items/Misc/AnvilForge.cs +++ b/Projects/UOContent/Items/Skill Items/Blacksmith Items/Misc/AnvilForge.cs @@ -1,54 +1,21 @@ +using ModernUO.Serialization; using Server.Engines.Craft; -namespace Server.Items +namespace Server.Items; + +[Anvil] +[Flippable(0xFAF, 0xFB0)] +[SerializationGenerator(0, false)] +public partial class Anvil : Item { - [Flippable(0xFAF, 0xFB0), Anvil] - public class Anvil : Item - { - [Constructible] - public Anvil() : base(0xFAF) => Movable = false; - - public Anvil(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(); - } - } - - [Forge] - public class Forge : Item - { - [Constructible] - public Forge() : base(0xFB1) => Movable = false; - - public Forge(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(); - } - } + [Constructible] + public Anvil() : base(0xFAF) => Movable = false; +} + +[Forge] +[SerializationGenerator(0, false)] +public partial class Forge : Item +{ + [Constructible] + public Forge() : base(0xFB1) => Movable = false; } diff --git a/Projects/UOContent/Items/Skill Items/Blacksmith Items/Misc/LargeForge.cs b/Projects/UOContent/Items/Skill Items/Blacksmith Items/Misc/LargeForge.cs index 7c7cc5c35..ba3842a95 100644 --- a/Projects/UOContent/Items/Skill Items/Blacksmith Items/Misc/LargeForge.cs +++ b/Projects/UOContent/Items/Skill Items/Blacksmith Items/Misc/LargeForge.cs @@ -1,49 +1,87 @@ +using ModernUO.Serialization; using Server.Engines.Craft; -namespace Server.Items -{ - [Forge] - public class LargeForgeWest : Item - { - private InternalItem m_Item; - private InternalItem2 m_Item2; +namespace Server.Items; - [Constructible] - public LargeForgeWest() : base(0x199A) +[Forge] +[SerializationGenerator(0, false)] +public partial class LargeForgeWest : Item +{ + [SerializableField(0, getter: "private", setter: "private")] + private InternalItem _item; + + [SerializableField(1, getter: "private", setter: "private")] + private InternalItem2 _item2; + + [Constructible] + public LargeForgeWest() : base(0x199A) + { + Movable = false; + + _item = new InternalItem(this); + _item2 = new InternalItem2(this); + } + + public override void OnLocationChange(Point3D oldLocation) + { + if (_item != null) + { + _item.Location = new Point3D(X, Y + 1, Z); + } + + if (_item2 != null) + { + _item2.Location = new Point3D(X, Y + 2, Z); + } + } + + public override void OnMapChange() + { + if (_item != null) + { + _item.Map = Map; + } + + if (_item2 != null) + { + _item2.Map = Map; + } + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + _item?.Delete(); + _item2?.Delete(); + } + + [Forge] + [SerializationGenerator(0, false)] + private partial class InternalItem : Item + { + private LargeForgeWest _parent; + + public InternalItem(LargeForgeWest item) : base(0x1996) { Movable = false; - m_Item = new InternalItem(this); - m_Item2 = new InternalItem2(this); - } - - public LargeForgeWest(Serial serial) : base(serial) - { + _parent = item; } public override void OnLocationChange(Point3D oldLocation) { - if (m_Item != null) + if (_parent != null) { - m_Item.Location = new Point3D(X, Y + 1, Z); - } - - if (m_Item2 != null) - { - m_Item2.Location = new Point3D(X, Y + 2, Z); + _parent.Location = new Point3D(X, Y - 1, Z); } } public override void OnMapChange() { - if (m_Item != null) + if (_parent != null) { - m_Item.Map = Map; - } - - if (m_Item2 != null) - { - m_Item2.Map = Map; + _parent.Map = Map; } } @@ -51,189 +89,36 @@ namespace Server.Items { base.OnAfterDelete(); - m_Item?.Delete(); - m_Item2?.Delete(); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write(m_Item); - writer.Write(m_Item2); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - m_Item = reader.ReadEntity(); - m_Item2 = reader.ReadEntity(); - } - - [Forge] - private class InternalItem : Item - { - private LargeForgeWest m_Item; - - public InternalItem(LargeForgeWest item) : base(0x1996) - { - Movable = false; - - m_Item = item; - } - - public InternalItem(Serial serial) : base(serial) - { - } - - public override void OnLocationChange(Point3D oldLocation) - { - if (m_Item != null) - { - m_Item.Location = new Point3D(X, Y - 1, Z); - } - } - - public override void OnMapChange() - { - if (m_Item != null) - { - m_Item.Map = Map; - } - } - - public override void OnAfterDelete() - { - base.OnAfterDelete(); - - m_Item?.Delete(); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write(m_Item); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - m_Item = reader.ReadEntity(); - } - } - - [Forge] - private class InternalItem2 : Item - { - private LargeForgeWest m_Item; - - public InternalItem2(LargeForgeWest item) : base(0x1992) - { - Movable = false; - - m_Item = item; - } - - public InternalItem2(Serial serial) : base(serial) - { - } - - public override void OnLocationChange(Point3D oldLocation) - { - if (m_Item != null) - { - m_Item.Location = new Point3D(X, Y - 2, Z); - } - } - - public override void OnMapChange() - { - if (m_Item != null) - { - m_Item.Map = Map; - } - } - - public override void OnAfterDelete() - { - base.OnAfterDelete(); - - m_Item?.Delete(); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write(m_Item); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - m_Item = reader.ReadEntity(); - } + _parent?.Delete(); } } [Forge] - public class LargeForgeEast : Item + [SerializationGenerator(0, false)] + private partial class InternalItem2 : Item { - private InternalItem m_Item; - private InternalItem2 m_Item2; + private LargeForgeWest _parent; - [Constructible] - public LargeForgeEast() : base(0x197A) + public InternalItem2(LargeForgeWest item) : base(0x1992) { Movable = false; - m_Item = new InternalItem(this); - m_Item2 = new InternalItem2(this); - } - - public LargeForgeEast(Serial serial) : base(serial) - { + _parent = item; } public override void OnLocationChange(Point3D oldLocation) { - if (m_Item != null) + if (_parent != null) { - m_Item.Location = new Point3D(X + 1, Y, Z); - } - - if (m_Item2 != null) - { - m_Item2.Location = new Point3D(X + 2, Y, Z); + _parent.Location = new Point3D(X, Y - 2, Z); } } public override void OnMapChange() { - if (m_Item != null) + if (_parent != null) { - m_Item.Map = Map; - } - - if (m_Item2 != null) - { - m_Item2.Map = Map; + _parent.Map = Map; } } @@ -241,144 +126,132 @@ namespace Server.Items { base.OnAfterDelete(); - m_Item?.Delete(); - m_Item2?.Delete(); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write(m_Item); - writer.Write(m_Item2); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - m_Item = reader.ReadEntity(); - m_Item2 = reader.ReadEntity(); - } - - [Forge] - private class InternalItem : Item - { - private LargeForgeEast m_Item; - - public InternalItem(LargeForgeEast item) : base(0x197E) - { - Movable = false; - - m_Item = item; - } - - public InternalItem(Serial serial) : base(serial) - { - } - - public override void OnLocationChange(Point3D oldLocation) - { - if (m_Item != null) - { - m_Item.Location = new Point3D(X - 1, Y, Z); - } - } - - public override void OnMapChange() - { - if (m_Item != null) - { - m_Item.Map = Map; - } - } - - public override void OnAfterDelete() - { - base.OnAfterDelete(); - - m_Item?.Delete(); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write(m_Item); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - m_Item = reader.ReadEntity(); - } - } - - [Forge] - private class InternalItem2 : Item - { - private LargeForgeEast m_Item; - - public InternalItem2(LargeForgeEast item) : base(0x1982) - { - Movable = false; - - m_Item = item; - } - - public InternalItem2(Serial serial) : base(serial) - { - } - - public override void OnLocationChange(Point3D oldLocation) - { - if (m_Item != null) - { - m_Item.Location = new Point3D(X - 2, Y, Z); - } - } - - public override void OnMapChange() - { - if (m_Item != null) - { - m_Item.Map = Map; - } - } - - public override void OnAfterDelete() - { - base.OnAfterDelete(); - - m_Item?.Delete(); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write(m_Item); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - m_Item = reader.ReadEntity(); - } + _parent?.Delete(); + } + } +} + +[Forge] +[SerializationGenerator(0, false)] +public partial class LargeForgeEast : Item +{ + private InternalItem _item; + private InternalItem2 _item2; + + [Constructible] + public LargeForgeEast() : base(0x197A) + { + Movable = false; + + _item = new InternalItem(this); + _item2 = new InternalItem2(this); + } + + public override void OnLocationChange(Point3D oldLocation) + { + if (_item != null) + { + _item.Location = new Point3D(X + 1, Y, Z); + } + + if (_item2 != null) + { + _item2.Location = new Point3D(X + 2, Y, Z); + } + } + + public override void OnMapChange() + { + if (_item != null) + { + _item.Map = Map; + } + + if (_item2 != null) + { + _item2.Map = Map; + } + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + _item?.Delete(); + _item2?.Delete(); + } + + [Forge] + [SerializationGenerator(0, false)] + private partial class InternalItem : Item + { + private LargeForgeEast _parent; + + public InternalItem(LargeForgeEast item) : base(0x197E) + { + Movable = false; + + _parent = item; + } + + public override void OnLocationChange(Point3D oldLocation) + { + if (_parent != null) + { + _parent.Location = new Point3D(X - 1, Y, Z); + } + } + + public override void OnMapChange() + { + if (_parent != null) + { + _parent.Map = Map; + } + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + _parent?.Delete(); + } + } + + [Forge] + [SerializationGenerator(0, false)] + private partial class InternalItem2 : Item + { + private LargeForgeEast _parent; + + public InternalItem2(LargeForgeEast item) : base(0x1982) + { + Movable = false; + + _parent = item; + } + + public override void OnLocationChange(Point3D oldLocation) + { + if (_parent != null) + { + _parent.Location = new Point3D(X - 2, Y, Z); + } + } + + public override void OnMapChange() + { + if (_parent != null) + { + _parent.Map = Map; + } + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + _parent?.Delete(); } } } diff --git a/Projects/UOContent/Items/Skill Items/Camping/Bedroll.cs b/Projects/UOContent/Items/Skill Items/Camping/Bedroll.cs index 78fcbe3eb..cc14487ba 100644 --- a/Projects/UOContent/Items/Skill Items/Camping/Bedroll.cs +++ b/Projects/UOContent/Items/Skill Items/Camping/Bedroll.cs @@ -1,137 +1,120 @@ using System; +using ModernUO.Serialization; using Server.Gumps; using Server.Mobiles; using Server.Network; -namespace Server.Items +namespace Server.Items; + +[Flippable(0xA57, 0xA58, 0xA59)] +[SerializationGenerator(0)] +public partial class Bedroll : Item { - [Flippable(0xA57, 0xA58, 0xA59)] - public class Bedroll : Item + [Constructible] + public Bedroll() : base(0xA57) => Weight = 5.0; + + public override void OnDoubleClick(Mobile from) { - [Constructible] - public Bedroll() : base(0xA57) => Weight = 5.0; - - public Bedroll(Serial serial) : base(serial) + if (Parent != null || !VerifyMove(from)) { + return; } - public override void OnDoubleClick(Mobile from) + if (!from.InRange(this, 2)) { - if (Parent != null || !VerifyMove(from)) - { - return; - } - - if (!from.InRange(this, 2)) - { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. - return; - } - - if (ItemID == 0xA57) // rolled - { - var dir = PlayerMobile.GetDirection4(from.Location, Location); - - if (dir is Direction.North or Direction.South) - { - ItemID = 0xA55; - } - else - { - ItemID = 0xA56; - } - } - else // unrolled - { - ItemID = 0xA57; - - if (!from.HasGump()) - { - var entry = Campfire.GetEntry(from); - - if (entry?.Safe == true) - { - from.SendGump(new LogoutGump(entry, this)); - } - } - } + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; } - public override void Serialize(IGenericWriter writer) + if (ItemID == 0xA57) // rolled { - base.Serialize(writer); + var dir = PlayerMobile.GetDirection4(from.Location, Location); - writer.WriteEncodedInt(0); // version - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadEncodedInt(); - } - - private class LogoutGump : Gump - { - private readonly Bedroll m_Bedroll; - private TimerExecutionToken _closeTimerToken; - - private readonly CampfireEntry m_Entry; - - public LogoutGump(CampfireEntry entry, Bedroll bedroll) : base(100, 0) + if (dir is Direction.North or Direction.South) { - m_Entry = entry; - m_Bedroll = bedroll; - - Timer.StartTimer(TimeSpan.FromSeconds(10.0), CloseGump, out _closeTimerToken); - - AddBackground(0, 0, 400, 350, 0xA28); - - AddHtmlLocalized(100, 20, 200, 35, 1011015); //
Logging out via camping
- - /* Using a bedroll in the safety of a camp will log you out of the game safely. - * If this is what you wish to do choose CONTINUE and you will be logged out. - * Otherwise, select the CANCEL button to avoid logging out at this time. - * The camp will remain secure for 10 seconds at which time this window will close - * and you not be logged out. - */ - AddHtmlLocalized(50, 55, 300, 140, 1011016, true, true); - - AddButton(45, 298, 0xFA5, 0xFA7, 1); - AddHtmlLocalized(80, 300, 110, 35, 1011011); // CONTINUE - - AddButton(200, 298, 0xFA5, 0xFA7, 0); - AddHtmlLocalized(235, 300, 110, 35, 1011012); // CANCEL + ItemID = 0xA55; } - - public override void OnResponse(NetState sender, RelayInfo info) + else { - var pm = m_Entry.Player; - - _closeTimerToken.Cancel(); - - if (Campfire.GetEntry(pm) != m_Entry) - { - return; - } - - if (info.ButtonID == 1 && m_Entry.Safe && m_Bedroll.Parent == null && m_Bedroll.IsAccessibleTo(pm) - && m_Bedroll.VerifyMove(pm) && m_Bedroll.Map == pm.Map && pm.InRange(m_Bedroll, 2)) - { - pm.PlaceInBackpack(m_Bedroll); - - pm.BedrollLogout = true; - sender.Disconnect("Used a bedroll to log out."); - } - - Campfire.RemoveEntry(m_Entry); + ItemID = 0xA56; } + } + else // unrolled + { + ItemID = 0xA57; - private void CloseGump() + if (!from.HasGump()) { - Campfire.RemoveEntry(m_Entry); - m_Entry.Player.CloseGump(); + var entry = Campfire.GetEntry(from); + + if (entry?.Safe == true) + { + from.SendGump(new LogoutGump(entry, this)); + } } } } + + private class LogoutGump : Gump + { + private Bedroll _dedroll; + private TimerExecutionToken _closeTimerToken; + + private CampfireEntry _entry; + + public LogoutGump(CampfireEntry entry, Bedroll bedroll) : base(100, 0) + { + _entry = entry; + _dedroll = bedroll; + + Timer.StartTimer(TimeSpan.FromSeconds(10.0), CloseGump, out _closeTimerToken); + + AddBackground(0, 0, 400, 350, 0xA28); + + AddHtmlLocalized(100, 20, 200, 35, 1011015); //
Logging out via camping
+ + /* Using a bedroll in the safety of a camp will log you out of the game safely. + * If this is what you wish to do choose CONTINUE and you will be logged out. + * Otherwise, select the CANCEL button to avoid logging out at this time. + * The camp will remain secure for 10 seconds at which time this window will close + * and you not be logged out. + */ + AddHtmlLocalized(50, 55, 300, 140, 1011016, true, true); + + AddButton(45, 298, 0xFA5, 0xFA7, 1); + AddHtmlLocalized(80, 300, 110, 35, 1011011); // CONTINUE + + AddButton(200, 298, 0xFA5, 0xFA7, 0); + AddHtmlLocalized(235, 300, 110, 35, 1011012); // CANCEL + } + + public override void OnResponse(NetState sender, RelayInfo info) + { + var pm = _entry.Player; + + _closeTimerToken.Cancel(); + + if (Campfire.GetEntry(pm) != _entry) + { + return; + } + + if (info.ButtonID == 1 && _entry.Safe && _dedroll.Parent == null && _dedroll.IsAccessibleTo(pm) + && _dedroll.VerifyMove(pm) && _dedroll.Map == pm.Map && pm.InRange(_dedroll, 2)) + { + pm.PlaceInBackpack(_dedroll); + + pm.BedrollLogout = true; + sender.Disconnect("Used a bedroll to log out."); + } + + Campfire.RemoveEntry(_entry); + } + + private void CloseGump() + { + Campfire.RemoveEntry(_entry); + _entry.Player.CloseGump(); + } + } } diff --git a/Projects/UOContent/Items/Skill Items/Camping/Campfire.cs b/Projects/UOContent/Items/Skill Items/Camping/Campfire.cs index 54b4f0410..fecb74311 100644 --- a/Projects/UOContent/Items/Skill Items/Camping/Campfire.cs +++ b/Projects/UOContent/Items/Skill Items/Camping/Campfire.cs @@ -1,219 +1,204 @@ using System; using System.Collections.Generic; +using ModernUO.Serialization; using Server.Mobiles; -namespace Server.Items +namespace Server.Items; + +public enum CampfireStatus { - public enum CampfireStatus + Burning, + Extinguishing, + Off +} + +[SerializationGenerator(0, false)] +public partial class Campfire : Item +{ + public static readonly int SecureRange = 7; + + private static readonly Dictionary m_Table = new(); + + private readonly List m_Entries; + + private TimerExecutionToken _timerToken; + + public Campfire() : base(0xDE3) { - Burning, - Extinguishing, - Off + Movable = false; + Light = LightType.Circle300; + + m_Entries = new List(); + + Timer.StartTimer(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), OnTick, out _timerToken); } - public class Campfire : Item + [CommandProperty(AccessLevel.GameMaster)] + public CampfireStatus Status { - public static readonly int SecureRange = 7; - - private static readonly Dictionary m_Table = new(); - - private readonly List m_Entries; - - private TimerExecutionToken _timerToken; - - public Campfire() : base(0xDE3) + get { - Movable = false; - Light = LightType.Circle300; - - m_Entries = new List(); - - Timer.StartTimer(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), OnTick, out _timerToken); - } - - public Campfire(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public CampfireStatus Status - { - get + return ItemID switch { - return ItemID switch - { - 0xDE3 => CampfireStatus.Burning, - 0xDE9 => CampfireStatus.Extinguishing, - _ => CampfireStatus.Off - }; - } - set - { - if (Status == value) - { - return; - } - - switch (value) - { - case CampfireStatus.Burning: - { - ItemID = 0xDE3; - Light = LightType.Circle300; - break; - } - - case CampfireStatus.Extinguishing: - { - ItemID = 0xDE9; - Light = LightType.Circle150; - break; - } - - default: - { - ItemID = 0xDEA; - Light = LightType.ArchedWindowEast; - ClearEntries(); - break; - } - } - } + 0xDE3 => CampfireStatus.Burning, + 0xDE9 => CampfireStatus.Extinguishing, + _ => CampfireStatus.Off + }; } - - public static CampfireEntry GetEntry(Mobile player) + set { - m_Table.TryGetValue(player, out var value); - return value; - } - - public static void RemoveEntry(CampfireEntry entry) - { - m_Table.Remove(entry.Player); - entry.Fire.m_Entries.Remove(entry); - } - - private void OnTick() - { - var now = Core.Now; - var age = now - Created; - - if (age >= TimeSpan.FromSeconds(100.0)) - { - Delete(); - } - else if (age >= TimeSpan.FromSeconds(90.0)) - { - Status = CampfireStatus.Off; - } - else if (age >= TimeSpan.FromSeconds(60.0)) - { - Status = CampfireStatus.Extinguishing; - } - - if (Status == CampfireStatus.Off || Deleted) + if (Status == value) { return; } - for (var i = m_Entries.Count - 1; i >= 0; i--) + switch (value) { - var entry = m_Entries[i]; + case CampfireStatus.Burning: + { + ItemID = 0xDE3; + Light = LightType.Circle300; + break; + } - if (!entry.Valid || entry.Player.NetState == null) - { - RemoveEntry(entry); - } - else if (!entry.Safe && now - entry.Start >= TimeSpan.FromSeconds(30.0)) - { - entry.Safe = true; - entry.Player.SendLocalizedMessage(500621); // The camp is now secure. - } + case CampfireStatus.Extinguishing: + { + ItemID = 0xDE9; + Light = LightType.Circle150; + break; + } + + default: + { + ItemID = 0xDEA; + Light = LightType.ArchedWindowEast; + ClearEntries(); + break; + } } - - var eable = GetClientsInRange(SecureRange); - - foreach (var state in eable) - { - if (state.Mobile is PlayerMobile pm && GetEntry(pm) == null) - { - var entry = new CampfireEntry(pm, this); - - m_Table[pm] = entry; - m_Entries.Add(entry); - - pm.SendLocalizedMessage(500620); // You feel it would take a few moments to secure your camp. - } - } - - eable.Free(); } + } - private void ClearEntries() + public static CampfireEntry GetEntry(Mobile player) + { + m_Table.TryGetValue(player, out var value); + return value; + } + + public static void RemoveEntry(CampfireEntry entry) + { + m_Table.Remove(entry.Player); + entry.Fire.m_Entries.Remove(entry); + } + + private void OnTick() + { + var now = Core.Now; + var age = now - Created; + + if (age >= TimeSpan.FromSeconds(100.0)) { - if (m_Entries == null) - { - return; - } - - foreach (var entry in m_Entries) - { - m_Table.Remove(entry.Player); - } - - m_Entries.Clear(); - m_Entries.TrimExcess(); - } - - public override void OnAfterDelete() - { - _timerToken.Cancel(); - - ClearEntries(); - } - - 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(); - Delete(); } + else if (age >= TimeSpan.FromSeconds(90.0)) + { + Status = CampfireStatus.Off; + } + else if (age >= TimeSpan.FromSeconds(60.0)) + { + Status = CampfireStatus.Extinguishing; + } + + if (Status == CampfireStatus.Off || Deleted) + { + return; + } + + for (var i = m_Entries.Count - 1; i >= 0; i--) + { + var entry = m_Entries[i]; + + if (!entry.Valid || entry.Player.NetState == null) + { + RemoveEntry(entry); + } + else if (!entry.Safe && now - entry.Start >= TimeSpan.FromSeconds(30.0)) + { + entry.Safe = true; + entry.Player.SendLocalizedMessage(500621); // The camp is now secure. + } + } + + var eable = GetClientsInRange(SecureRange); + + foreach (var state in eable) + { + if (state.Mobile is PlayerMobile pm && GetEntry(pm) == null) + { + var entry = new CampfireEntry(pm, this); + + m_Table[pm] = entry; + m_Entries.Add(entry); + + pm.SendLocalizedMessage(500620); // You feel it would take a few moments to secure your camp. + } + } + + eable.Free(); } - public class CampfireEntry + private void ClearEntries() { - private bool m_Safe; - - public CampfireEntry(PlayerMobile player, Campfire fire) + if (m_Entries == null) { - Player = player; - Fire = fire; - Start = Core.Now; - m_Safe = false; + return; } - public PlayerMobile Player { get; } - - public Campfire Fire { get; } - - public DateTime Start { get; } - - public bool Valid => !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && - Player.InRange(Fire, Campfire.SecureRange); - - public bool Safe + foreach (var entry in m_Entries) { - get => Valid && m_Safe; - set => m_Safe = value; + m_Table.Remove(entry.Player); } + + m_Entries.Clear(); + m_Entries.TrimExcess(); + } + + public override void OnAfterDelete() + { + _timerToken.Cancel(); + + ClearEntries(); + } + + [AfterDeserialization(false)] + private void AfterDeserialization() + { + Delete(); + } +} + +public class CampfireEntry +{ + private bool _safe; + + public CampfireEntry(PlayerMobile player, Campfire fire) + { + Player = player; + Fire = fire; + Start = Core.Now; + _safe = false; + } + + public PlayerMobile Player { get; } + public Campfire Fire { get; } + public DateTime Start { get; } + + public bool Valid => !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && + Player.InRange(Fire, Campfire.SecureRange); + + public bool Safe + { + get => Valid && _safe; + set => _safe = value; } } diff --git a/Projects/UOContent/Items/Skill Items/Camping/Kindling.cs b/Projects/UOContent/Items/Skill Items/Camping/Kindling.cs index 3ee2cb6d5..62e1908ce 100644 --- a/Projects/UOContent/Items/Skill Items/Camping/Kindling.cs +++ b/Projects/UOContent/Items/Skill Items/Camping/Kindling.cs @@ -1,122 +1,105 @@ using System.Collections.Generic; +using ModernUO.Serialization; using Server.Network; using Server.Regions; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class Kindling : Item { - public class Kindling : Item + [Constructible] + public Kindling(int amount = 1) : base(0xDE1) { - [Constructible] - public Kindling(int amount = 1) : base(0xDE1) + Stackable = true; + Weight = 5.0; + Amount = amount; + } + + public override void OnDoubleClick(Mobile from) + { + if (!VerifyMove(from)) { - Stackable = true; - Weight = 5.0; - Amount = amount; + return; } - public Kindling(Serial serial) : base(serial) + if (!from.InRange(GetWorldLocation(), 2)) { + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; } - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); + var fireLocation = GetFireLocation(from); - writer.Write(0); // version + if (fireLocation == Point3D.Zero) + { + from.SendLocalizedMessage(501695); // There is not a spot nearby to place your campfire. + } + else if (!from.CheckSkill(SkillName.Camping, 0.0, 100.0)) + { + from.SendLocalizedMessage(501696); // You fail to ignite the campfire. + } + else + { + Consume(); + + if (!Deleted && Parent == null) + { + from.PlaceInBackpack(this); + } + + new Campfire().MoveToWorld(fireLocation, from.Map); + } + } + + private Point3D GetFireLocation(Mobile from) + { + if (from.Region.IsPartOf()) + { + return Point3D.Zero; } - public override void Deserialize(IGenericReader reader) + if (Parent == null) { - base.Deserialize(reader); - - var version = reader.ReadInt(); + return Location; } - public override void OnDoubleClick(Mobile from) + var list = new List(4); + + AddOffsetLocation(from, 0, -1, list); + AddOffsetLocation(from, -1, 0, list); + AddOffsetLocation(from, 0, 1, list); + AddOffsetLocation(from, 1, 0, list); + + if (list.Count == 0) { - if (!VerifyMove(from)) - { - return; - } - - if (!from.InRange(GetWorldLocation(), 2)) - { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. - return; - } - - var fireLocation = GetFireLocation(from); - - if (fireLocation == Point3D.Zero) - { - from.SendLocalizedMessage(501695); // There is not a spot nearby to place your campfire. - } - else if (!from.CheckSkill(SkillName.Camping, 0.0, 100.0)) - { - from.SendLocalizedMessage(501696); // You fail to ignite the campfire. - } - else - { - Consume(); - - if (!Deleted && Parent == null) - { - from.PlaceInBackpack(this); - } - - new Campfire().MoveToWorld(fireLocation, from.Map); - } + return Point3D.Zero; } - private Point3D GetFireLocation(Mobile from) + return list.RandomElement(); + } + + private static void AddOffsetLocation(Mobile from, int offsetX, int offsetY, List list) + { + var map = from.Map; + + var x = from.X + offsetX; + var y = from.Y + offsetY; + + var loc = new Point3D(x, y, from.Z); + + if (map.CanFit(loc, 1) && from.InLOS(loc)) { - if (from.Region.IsPartOf()) - { - return Point3D.Zero; - } - - if (Parent == null) - { - return Location; - } - - var list = new List(4); - - AddOffsetLocation(from, 0, -1, list); - AddOffsetLocation(from, -1, 0, list); - AddOffsetLocation(from, 0, 1, list); - AddOffsetLocation(from, 1, 0, list); - - if (list.Count == 0) - { - return Point3D.Zero; - } - - return list.RandomElement(); + list.Add(loc); } - - private void AddOffsetLocation(Mobile from, int offsetX, int offsetY, List list) + else { - var map = from.Map; - - var x = from.X + offsetX; - var y = from.Y + offsetY; - - var loc = new Point3D(x, y, from.Z); + loc = new Point3D(x, y, map.GetAverageZ(x, y)); if (map.CanFit(loc, 1) && from.InLOS(loc)) { list.Add(loc); } - else - { - loc = new Point3D(x, y, map.GetAverageZ(x, y)); - - if (map.CanFit(loc, 1) && from.InLOS(loc)) - { - list.Add(loc); - } - } } } } diff --git a/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs b/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs index c5185bb7d..0ba5e551b 100644 --- a/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs +++ b/Projects/UOContent/Items/Skill Items/Carpenter Items/Board.cs @@ -1,285 +1,126 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[Flippable(0x1BD7, 0x1BDA)] +[SerializationGenerator(4, false)] +public partial class Board : Item, ICommodity { - [Flippable(0x1BD7, 0x1BDA)] - public class Board : Item, ICommodity + [InvalidateProperties] + [SerializableField(0)] + private CraftResource _resource; + + [Constructible] + public Board(int amount = 1) : this(CraftResource.RegularWood, amount) { - private CraftResource m_Resource; + } - [Constructible] - public Board(int amount = 1) - : this(CraftResource.RegularWood, amount) + [Constructible] + public Board(CraftResource resource, int amount = 1) : base(0x1BD7) + { + Stackable = true; + Amount = amount; + + _resource = resource; + Hue = CraftResources.GetHue(resource); + } + + int ICommodity.DescriptionNumber + { + get { - } - - public Board(Serial serial) - : base(serial) - { - } - - [Constructible] - public Board(CraftResource resource, int amount = 1) - : base(0x1BD7) - { - Stackable = true; - Amount = amount; - - m_Resource = resource; - Hue = CraftResources.GetHue(resource); - } - - [CommandProperty(AccessLevel.GameMaster)] - public CraftResource Resource - { - get => m_Resource; - set + if (_resource >= CraftResource.OakWood && _resource <= CraftResource.YewWood) { - m_Resource = value; - InvalidateProperties(); - } - } - - int ICommodity.DescriptionNumber - { - get - { - if (m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.YewWood) - { - return 1075052 + ((int)m_Resource - (int)CraftResource.OakWood); - } - - return m_Resource switch - { - CraftResource.Bloodwood => 1075055, - CraftResource.Frostwood => 1075056, - CraftResource.Heartwood => 1075062, // WHY Osi. Why? - _ => LabelNumber - }; - } - } - - bool ICommodity.IsDeedable => true; - - 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 override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(3); - - writer.Write((int)m_Resource); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 3: - case 2: - { - m_Resource = (CraftResource)reader.ReadInt(); - break; - } + return 1075052 + ((int)_resource - (int)CraftResource.OakWood); } - if (version == 0 && Weight == 0.1 || version <= 2 && Weight == 2) + return _resource switch { - Weight = -1; - } + CraftResource.Bloodwood => 1075055, + CraftResource.Frostwood => 1075056, + CraftResource.Heartwood => 1075062, // WHY Osi. Why? + _ => LabelNumber + }; + } + } - if (version <= 1) + bool ICommodity.IsDeedable => true; + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (!CraftResources.IsStandard(_resource)) + { + var num = CraftResources.GetLocalizationNumber(_resource); + + if (num > 0) { - m_Resource = CraftResource.RegularWood; + list.Add(num); + } + else + { + list.Add(CraftResources.GetName(_resource)); } } } - public class HeartwoodBoard : Board + private void Deserialize(IGenericReader reader, int version) + { + _resource = (CraftResource)reader.ReadInt(); + } +} + +[SerializationGenerator(0, false)] +public partial class HeartwoodBoard : Board +{ + [Constructible] + public HeartwoodBoard(int amount = 1) : base(CraftResource.Heartwood, amount) + { + } +} + +[SerializationGenerator(0, false)] +public partial class BloodwoodBoard : Board +{ + [Constructible] + public BloodwoodBoard(int amount = 1) : base(CraftResource.Bloodwood, amount) + { + } +} + +[SerializationGenerator(0, false)] +public partial class FrostwoodBoard : Board +{ + [Constructible] + public FrostwoodBoard(int amount = 1) : base(CraftResource.Frostwood, amount) + { + } +} + +[SerializationGenerator(0, false)] +public partial class OakBoard : Board +{ + [Constructible] + public OakBoard(int amount = 1) : base(CraftResource.OakWood, amount) + { + } +} + +[SerializationGenerator(0, false)] +public partial class AshBoard : Board +{ + [Constructible] + public AshBoard(int amount = 1) : base(CraftResource.AshWood, amount) + { + } +} + +[SerializationGenerator(0, false)] +public partial class YewBoard : Board +{ + [Constructible] + public YewBoard(int amount = 1) : base(CraftResource.YewWood, amount) { - [Constructible] - public HeartwoodBoard(int amount = 1) - : base(CraftResource.Heartwood, amount) - { - } - - public HeartwoodBoard(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 BloodwoodBoard : Board - { - [Constructible] - public BloodwoodBoard(int amount = 1) - : base(CraftResource.Bloodwood, amount) - { - } - - public BloodwoodBoard(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 FrostwoodBoard : Board - { - [Constructible] - public FrostwoodBoard(int amount = 1) - : base(CraftResource.Frostwood, amount) - { - } - - public FrostwoodBoard(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 OakBoard : Board - { - [Constructible] - public OakBoard(int amount = 1) - : base(CraftResource.OakWood, amount) - { - } - - public OakBoard(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 AshBoard : Board - { - [Constructible] - public AshBoard(int amount = 1) - : base(CraftResource.AshWood, amount) - { - } - - public AshBoard(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 YewBoard : Board - { - [Constructible] - public YewBoard(int amount = 1) - : base(CraftResource.YewWood, amount) - { - } - - public YewBoard(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(); - } } } diff --git a/Projects/UOContent/Items/Skill Items/Carpenter Items/TaxidermyKit.cs b/Projects/UOContent/Items/Skill Items/Carpenter Items/TaxidermyKit.cs index 80b7713e4..47ea59937 100644 --- a/Projects/UOContent/Items/Skill Items/Carpenter Items/TaxidermyKit.cs +++ b/Projects/UOContent/Items/Skill Items/Carpenter Items/TaxidermyKit.cs @@ -1,560 +1,446 @@ using System; +using ModernUO.Serialization; using Server.Mobiles; using Server.Multis; using Server.Targeting; -namespace Server.Items +namespace Server.Items; + +[Flippable(0x1EBA, 0x1EBB)] +[SerializationGenerator(0, false)] +public partial class TaxidermyKit : Item { - [Flippable(0x1EBA, 0x1EBB)] - public class TaxidermyKit : Item + private static TrophyInfo[] _table = { - private static readonly TrophyInfo[] m_Table = - { - new(typeof(BrownBear), 0x1E60, 1041093, 1041107), - new(typeof(GreatHart), 0x1E61, 1041095, 1041109), - new(typeof(BigFish), 0x1E62, 1041096, 1041110), - new(typeof(Gorilla), 0x1E63, 1041091, 1041105), - new(typeof(Orc), 0x1E64, 1041090, 1041104), - new(typeof(PolarBear), 0x1E65, 1041094, 1041108), - new(typeof(Troll), 0x1E66, 1041092, 1041106) - }; + new(typeof(BrownBear), 0x1E60, 1041093, 1041107), + new(typeof(GreatHart), 0x1E61, 1041095, 1041109), + new(typeof(BigFish), 0x1E62, 1041096, 1041110), + new(typeof(Gorilla), 0x1E63, 1041091, 1041105), + new(typeof(Orc), 0x1E64, 1041090, 1041104), + new(typeof(PolarBear), 0x1E65, 1041094, 1041108), + new(typeof(Troll), 0x1E66, 1041092, 1041106) + }; - [Constructible] - public TaxidermyKit() : base(0x1EBA) => Weight = 1.0; + [Constructible] + public TaxidermyKit() : base(0x1EBA) => Weight = 1.0; - public TaxidermyKit(Serial serial) : base(serial) + public override int LabelNumber => 1041279; // a taxidermy kit + + public override void OnDoubleClick(Mobile from) + { + if (!IsChildOf(from.Backpack)) { + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } - - public override int LabelNumber => 1041279; // a taxidermy kit - - public override void Serialize(IGenericWriter writer) + else if (from.Skills.Carpentry.Base < 90.0) { - base.Serialize(writer); - - writer.Write(0); // version + from.SendLocalizedMessage(1042594); // You do not understand how to use this. } - - public override void Deserialize(IGenericReader reader) + else { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - - 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 (from.Skills.Carpentry.Base < 90.0) - { - from.SendLocalizedMessage(1042594); // You do not understand how to use this. - } - else - { - from.SendLocalizedMessage(1042595); // Target the corpse to make a trophy out of. - from.Target = new CorpseTarget(this); - } - } - - public class TrophyInfo - { - public TrophyInfo(Type type, int id, int deedNum, int addonNum) - { - CreatureType = type; - NorthID = id; - DeedNumber = deedNum; - AddonNumber = addonNum; - } - - public Type CreatureType { get; } - - public int NorthID { get; } - - public int DeedNumber { get; } - - public int AddonNumber { get; } - } - - private class CorpseTarget : Target - { - private readonly TaxidermyKit m_Kit; - - public CorpseTarget(TaxidermyKit kit) : base(3, false, TargetFlags.None) => m_Kit = kit; - - protected override void OnTarget(Mobile from, object targeted) - { - if (m_Kit.Deleted) - { - return; - } - - var corpse = targeted as Corpse; - - if (!(corpse != null || targeted is BigFish)) - { - from.SendLocalizedMessage(1042600); // That is not a corpse! - } - else if (corpse?.VisitedByTaxidermist == true) - { - from.SendLocalizedMessage(1042596); // That corpse seems to have been visited by a taxidermist already. - } - else if (!m_Kit.IsChildOf(from.Backpack)) - { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. - } - else if (from.Skills.Carpentry.Base < 90.0) - { - from.SendLocalizedMessage(1042603); // You would not understand how to use the kit. - } - else - { - var obj = corpse?.Owner ?? targeted; - - foreach (var t in m_Table) - { - if (t.CreatureType != obj.GetType()) - { - continue; - } - - var pack = from.Backpack; - - if (pack?.ConsumeTotal(typeof(Board), 10) == true) - { - from.SendLocalizedMessage( - 1042278 - ); // You review the corpse and find it worthy of a trophy. - from.SendLocalizedMessage(1042602); // You use your kit up making the trophy. - - Mobile hunter = null; - var weight = 0; - - if (targeted is BigFish fish) - { - hunter = fish.Fisher; - weight = (int)fish.Weight; - - fish.Consume(); - } - - from.AddToBackpack(new TrophyDeed(t, hunter, weight)); - - if (corpse != null) - { - corpse.VisitedByTaxidermist = true; - } - - m_Kit.Delete(); - return; - } - - from.SendLocalizedMessage(1042598); // You do not have enough boards. - return; - } - - from.SendLocalizedMessage(1042599); // That does not look like something you want hanging on a wall. - } - } + from.SendLocalizedMessage(1042595); // Target the corpse to make a trophy out of. + from.Target = new CorpseTarget(this); } } - public class TrophyAddon : Item, IAddon + public class TrophyInfo { - private int m_AddonNumber; - private int m_AnimalWeight; - - private Mobile m_Hunter; - - public TrophyAddon( - Mobile from, int itemID, int westID, int northID, int deedNumber, - int addonNumber, Mobile hunter = null, int animalWeight = 0 - ) : base(itemID) + public TrophyInfo(Type type, int id, int deedNum, int addonNum) { - WestID = westID; - NorthID = northID; - DeedNumber = deedNumber; - m_AddonNumber = addonNumber; - - m_Hunter = hunter; - m_AnimalWeight = animalWeight; - - Movable = false; - - MoveToWorld(from.Location, from.Map); + CreatureType = type; + NorthID = id; + DeedNumber = deedNum; + AddonNumber = addonNum; } - public TrophyAddon(Serial serial) : base(serial) + public Type CreatureType { get; } + + public int NorthID { get; } + + public int DeedNumber { get; } + + public int AddonNumber { get; } + } + + private class CorpseTarget : Target + { + private readonly TaxidermyKit _kit; + + public CorpseTarget(TaxidermyKit kit) : base(3, false, TargetFlags.None) => _kit = kit; + + protected override void OnTarget(Mobile from, object targeted) { - } - - public override bool ForceShowProperties => ObjectPropertyList.Enabled; - - [CommandProperty(AccessLevel.GameMaster)] - public int WestID { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public int NorthID { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public int DeedNumber { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public int AddonNumber - { - get => m_AddonNumber; - set - { - m_AddonNumber = value; - InvalidateProperties(); - } - } - - [CommandProperty(AccessLevel.GameMaster)] - public Mobile Hunter - { - get => m_Hunter; - set - { - m_Hunter = value; - InvalidateProperties(); - } - } - - [CommandProperty(AccessLevel.GameMaster)] - public int AnimalWeight - { - get => m_AnimalWeight; - set - { - m_AnimalWeight = value; - InvalidateProperties(); - } - } - - public override int LabelNumber => m_AddonNumber; - - public bool CouldFit(IPoint3D p, Map map) - { - if (!map.CanFit(p.X, p.Y, p.Z, ItemData.Height)) - { - return false; - } - - if (ItemID == NorthID) - { - return BaseAddon.IsWall(p.X, p.Y - 1, p.Z, map); // North wall - } - - return BaseAddon.IsWall(p.X - 1, p.Y, p.Z, map); // West wall - } - - public Item Deed => new TrophyDeed(WestID, NorthID, DeedNumber, m_AddonNumber, m_Hunter, m_AnimalWeight); - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (m_AnimalWeight >= 20) - { - if (m_Hunter != null) - { - list.Add(1070857, m_Hunter.Name); // Caught by ~1_fisherman~ - } - - list.Add(1070858, m_AnimalWeight); // ~1_weight~ stones - } - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(1); // version - - writer.Write(m_Hunter); - writer.Write(m_AnimalWeight); - - writer.Write(WestID); - writer.Write(NorthID); - writer.Write(DeedNumber); - writer.Write(m_AddonNumber); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 1: - { - m_Hunter = reader.ReadEntity(); - m_AnimalWeight = reader.ReadInt(); - goto case 0; - } - case 0: - { - WestID = reader.ReadInt(); - NorthID = reader.ReadInt(); - DeedNumber = reader.ReadInt(); - m_AddonNumber = reader.ReadInt(); - break; - } - } - - Timer.StartTimer(FixMovingCrate); - } - - private void FixMovingCrate() - { - if (Deleted) + if (_kit.Deleted) { return; } - if (Movable || IsLockedDown) + if (!_kit.IsChildOf(from.Backpack)) { - var deed = Deed; - - if (Parent is Item item) - { - item.AddItem(deed); - deed.Location = Location; - } - else - { - deed.MoveToWorld(Location, Map); - } - - Delete(); + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. + return; } - } - public override void OnDoubleClick(Mobile from) - { - var house = BaseHouse.FindHouseAt(this); - - if (house?.IsCoOwner(from) == true) + if (from.Skills.Carpentry.Base < 90.0) { - if (from.InRange(GetWorldLocation(), 1)) - { - from.AddToBackpack(Deed); - Delete(); - } - else - { - from.SendLocalizedMessage(500295); // You are too far away to do that. - } + from.SendLocalizedMessage(1042603); // You would not understand how to use the kit. + return; } - } - } - [Flippable(0x14F0, 0x14EF)] - public class TrophyDeed : Item - { - private int m_AnimalWeight; - private int m_DeedNumber; + var corpse = targeted as Corpse; + var fish = targeted as BigFish; - private Mobile m_Hunter; - - public TrophyDeed( - int westID, int northID, int deedNumber, int addonNumber, - Mobile hunter = null, int animalWeight = 0 - ) : base(0x14F0) - { - WestID = westID; - NorthID = northID; - m_DeedNumber = deedNumber; - AddonNumber = addonNumber; - m_Hunter = hunter; - m_AnimalWeight = animalWeight; - } - - public TrophyDeed(TaxidermyKit.TrophyInfo info, Mobile hunter, int animalWeight) - : this(info.NorthID + 7, info.NorthID, info.DeedNumber, info.AddonNumber, hunter, animalWeight) - { - } - - public TrophyDeed(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public int WestID { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public int NorthID { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public int DeedNumber - { - get => m_DeedNumber; - set + if (corpse == null && fish == null) { - m_DeedNumber = value; - InvalidateProperties(); + from.SendLocalizedMessage(1042600); // That is not a corpse! } - } - - [CommandProperty(AccessLevel.GameMaster)] - public int AddonNumber { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public Mobile Hunter - { - get => m_Hunter; - set + else if (corpse?.VisitedByTaxidermist == true) { - m_Hunter = value; - InvalidateProperties(); - } - } - - [CommandProperty(AccessLevel.GameMaster)] - public int AnimalWeight - { - get => m_AnimalWeight; - set - { - m_AnimalWeight = value; - InvalidateProperties(); - } - } - - public override int LabelNumber => m_DeedNumber; - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (m_AnimalWeight >= 20) - { - if (m_Hunter != null) - { - list.Add(1070857, m_Hunter.Name); // Caught by ~1_fisherman~ - } - - list.Add(1070858, m_AnimalWeight); // ~1_weight~ stones - } - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(1); // version - - writer.Write(m_Hunter); - writer.Write(m_AnimalWeight); - - writer.Write(WestID); - writer.Write(NorthID); - writer.Write(m_DeedNumber); - writer.Write(AddonNumber); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 1: - { - m_Hunter = reader.ReadEntity(); - m_AnimalWeight = reader.ReadInt(); - goto case 0; - } - case 0: - { - WestID = reader.ReadInt(); - NorthID = reader.ReadInt(); - m_DeedNumber = reader.ReadInt(); - AddonNumber = reader.ReadInt(); - break; - } - } - } - - public override void OnDoubleClick(Mobile from) - { - if (IsChildOf(from.Backpack)) - { - var house = BaseHouse.FindHouseAt(from); - - if (house?.IsCoOwner(from) == true) - { - var northWall = BaseAddon.IsWall(from.X, from.Y - 1, from.Z, from.Map); - var westWall = BaseAddon.IsWall(from.X - 1, from.Y, from.Z, from.Map); - - if (northWall && westWall) - { - switch (from.Direction & Direction.Mask) - { - case Direction.North: - case Direction.South: - westWall = false; - break; - - case Direction.East: - case Direction.West: - northWall = false; - break; - - default: - from.SendMessage("Turn to face the wall on which to hang this trophy."); - return; - } - } - - var itemID = 0; - - if (northWall) - { - itemID = NorthID; - } - else if (westWall) - { - itemID = WestID; - } - else - { - from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall. - } - - if (itemID > 0) - { - house.Addons.Add( - new TrophyAddon( - from, - itemID, - WestID, - NorthID, - m_DeedNumber, - AddonNumber, - m_Hunter, - m_AnimalWeight - ) - ); - Delete(); - } - } - else - { - from.SendLocalizedMessage(502092); // You must be in your house to do this. - } + from.SendLocalizedMessage(1042596); // That corpse seems to have been visited by a taxidermist already. } else { - from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. + var obj = corpse?.Owner ?? targeted; + var type = obj.GetType(); + + foreach (var t in _table) + { + if (t.CreatureType != type) + { + continue; + } + + if (from.Backpack?.ConsumeTotal(typeof(Board), 10) != true) + { + from.SendLocalizedMessage(1042598); // You do not have enough boards. + return; + } + + // You review the corpse and find it worthy of a trophy. + from.SendLocalizedMessage(1042278); + from.SendLocalizedMessage(1042602); // You use your kit up making the trophy. + + Mobile hunter = fish?.Fisher; + var weight = (int)(fish?.Weight ?? 0); + fish?.Consume(); + + from.AddToBackpack(new TrophyDeed(t, hunter?.RawName, weight)); + + if (corpse != null) + { + corpse.VisitedByTaxidermist = true; + } + + _kit.Delete(); + return; + } + + from.SendLocalizedMessage(1042599); // That does not look like something you want hanging on a wall. } } } } + +[SerializationGenerator(2, false)] +public partial class TrophyAddon : Item, IAddon +{ + [InvalidateProperties] + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private string _hunter; + + [InvalidateProperties] + [SerializableField(1)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _animalWeight; + + [SerializableField(2)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _westId; + + [SerializableField(3)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _northId; + + [SerializableField(4)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _deedNumber; + + [InvalidateProperties] + [SerializableField(5)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _addonNumber; + + public TrophyAddon( + Mobile from, int itemID, int westID, int northID, int deedNumber, + int addonNumber, string hunter = null, int animalWeight = 0 + ) : base(itemID) + { + _westId = westID; + _northId = northID; + _deedNumber = deedNumber; + _addonNumber = addonNumber; + + _hunter = hunter; + _animalWeight = animalWeight; + + Movable = false; + + MoveToWorld(from.Location, from.Map); + } + + public override bool ForceShowProperties => ObjectPropertyList.Enabled; + + public override int LabelNumber => _addonNumber; + + public bool CouldFit(IPoint3D p, Map map) + { + if (!map.CanFit(p.X, p.Y, p.Z, ItemData.Height)) + { + return false; + } + + if (ItemID == _northId) + { + return BaseAddon.IsWall(p.X, p.Y - 1, p.Z, map); // North wall + } + + return BaseAddon.IsWall(p.X - 1, p.Y, p.Z, map); // West wall + } + + public Item Deed => new TrophyDeed(_westId, _northId, DeedNumber, _addonNumber, _hunter, _animalWeight); + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (_animalWeight >= 20) + { + if (!string.IsNullOrWhiteSpace(_hunter)) + { + list.Add(1070857, _hunter); // Caught by ~1_fisherman~ + } + + list.Add(1070858, _animalWeight); // ~1_weight~ stones + } + } + + private void Deserialize(IGenericReader reader, int version) + { + _hunter = reader.ReadEntity()?.RawName; + _animalWeight = reader.ReadInt(); + _westId = reader.ReadInt(); + _northId = reader.ReadInt(); + _deedNumber = reader.ReadInt(); + _addonNumber = reader.ReadInt(); + } + + [AfterDeserialization(false)] + private void AfterDeserialization() + { + FixMovingCrate(); + } + + private void FixMovingCrate() + { + if (Deleted) + { + return; + } + + if (Movable || IsLockedDown) + { + var deed = Deed; + + if (Parent is Item item) + { + item.AddItem(deed); + deed.Location = Location; + } + else + { + deed.MoveToWorld(Location, Map); + } + + Delete(); + } + } + + public override void OnDoubleClick(Mobile from) + { + var house = BaseHouse.FindHouseAt(this); + + if (house?.IsCoOwner(from) != true) + { + return; + } + + if (from.InRange(GetWorldLocation(), 1)) + { + from.AddToBackpack(Deed); + Delete(); + } + else + { + from.SendLocalizedMessage(500295); // You are too far away to do that. + } + } +} + +[Flippable(0x14F0, 0x14EF)] +[SerializationGenerator(2, false)] +public partial class TrophyDeed : Item +{ + [InvalidateProperties] + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private string _hunter; + + [InvalidateProperties] + [SerializableField(1)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _animalWeight; + + [SerializableField(2)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _westId; + + [SerializableField(3)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _northId; + + [InvalidateProperties] + [SerializableField(4)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _deedNumber; + + [SerializableField(5)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _addonNumber; + + public TrophyDeed( + int westID, int northID, int deedNumber, int addonNumber, + string hunter = null, int animalWeight = 0 + ) : base(0x14F0) + { + _westId = westID; + _northId = northID; + _deedNumber = deedNumber; + _addonNumber = addonNumber; + _hunter = hunter; + _animalWeight = animalWeight; + } + + public TrophyDeed(TaxidermyKit.TrophyInfo info, string hunter, int animalWeight) + : this(info.NorthID + 7, info.NorthID, info.DeedNumber, info.AddonNumber, hunter, animalWeight) + { + } + + public override int LabelNumber => _deedNumber; + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (_animalWeight >= 20) + { + if (!string.IsNullOrWhiteSpace(_hunter)) + { + list.Add(1070857, _hunter); // Caught by ~1_fisherman~ + } + + list.Add(1070858, _animalWeight); // ~1_weight~ stones + } + } + + private void Deserialize(IGenericReader reader, int version) + { + _hunter = reader.ReadEntity()?.RawName; + _animalWeight = reader.ReadInt(); + _westId = reader.ReadInt(); + _northId = reader.ReadInt(); + _deedNumber = reader.ReadInt(); + _addonNumber = reader.ReadInt(); + } + + public override void OnDoubleClick(Mobile from) + { + if (IsChildOf(from.Backpack)) + { + var house = BaseHouse.FindHouseAt(from); + + if (house?.IsCoOwner(from) == true) + { + var northWall = BaseAddon.IsWall(from.X, from.Y - 1, from.Z, from.Map); + var westWall = BaseAddon.IsWall(from.X - 1, from.Y, from.Z, from.Map); + + if (northWall && westWall) + { + switch (from.Direction & Direction.Mask) + { + case Direction.North: + case Direction.South: + { + westWall = false; + break; + } + + case Direction.East: + case Direction.West: + { + northWall = false; + break; + } + + default: + { + from.SendMessage("Turn to face the wall on which to hang this trophy."); + return; + } + } + } + + var itemID = 0; + + if (northWall) + { + itemID = _northId; + } + else if (westWall) + { + itemID = _westId; + } + else + { + from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall. + } + + if (itemID > 0) + { + house.Addons.Add( + new TrophyAddon( + from, + itemID, + _westId, + _northId, + _deedNumber, + AddonNumber, + _hunter, + _animalWeight + ) + ); + + Delete(); + } + } + else + { + from.SendLocalizedMessage(502092); // You must be in your house to do this. + } + } + else + { + from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. + } + } +} diff --git a/Projects/UOContent/Migrations/Server.Items.Anvil.v0.json b/Projects/UOContent/Migrations/Server.Items.Anvil.v0.json new file mode 100644 index 000000000..e59aed024 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Anvil.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Anvil" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.AshBoard.v0.json b/Projects/UOContent/Migrations/Server.Items.AshBoard.v0.json new file mode 100644 index 000000000..6e1156f0c --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.AshBoard.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.AshBoard" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Bedroll.v0.json b/Projects/UOContent/Migrations/Server.Items.Bedroll.v0.json new file mode 100644 index 000000000..04fce3755 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Bedroll.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Bedroll" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BloodwoodBoard.v0.json b/Projects/UOContent/Migrations/Server.Items.BloodwoodBoard.v0.json new file mode 100644 index 000000000..3432e51cf --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BloodwoodBoard.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BloodwoodBoard" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Board.v4.json b/Projects/UOContent/Migrations/Server.Items.Board.v4.json new file mode 100644 index 000000000..3ab9ddb9f --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Board.v4.json @@ -0,0 +1,11 @@ +{ + "version": 4, + "type": "Server.Items.Board", + "properties": [ + { + "name": "Resource", + "type": "Server.Items.CraftResource", + "rule": "EnumMigrationRule" + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Campfire.v0.json b/Projects/UOContent/Migrations/Server.Items.Campfire.v0.json new file mode 100644 index 000000000..0cbb41cd0 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Campfire.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Campfire" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Forge.v0.json b/Projects/UOContent/Migrations/Server.Items.Forge.v0.json new file mode 100644 index 000000000..66b14fe5c --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Forge.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Forge" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.FrostwoodBoard.v0.json b/Projects/UOContent/Migrations/Server.Items.FrostwoodBoard.v0.json new file mode 100644 index 000000000..2908c0f01 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.FrostwoodBoard.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.FrostwoodBoard" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.HeartwoodBoard.v0.json b/Projects/UOContent/Migrations/Server.Items.HeartwoodBoard.v0.json new file mode 100644 index 000000000..6a0169fc4 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.HeartwoodBoard.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.HeartwoodBoard" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.Kindling.v0.json b/Projects/UOContent/Migrations/Server.Items.Kindling.v0.json new file mode 100644 index 000000000..f86a50f94 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.Kindling.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.Kindling" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.InternalItem.v0.json b/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.InternalItem.v0.json new file mode 100644 index 000000000..63a9da102 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.InternalItem.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.LargeForgeEast.InternalItem" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.InternalItem2.v0.json b/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.InternalItem2.v0.json new file mode 100644 index 000000000..3ea684819 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.InternalItem2.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.LargeForgeEast.InternalItem2" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.v0.json b/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.v0.json new file mode 100644 index 000000000..7fa870141 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.LargeForgeEast.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.LargeForgeEast" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.InternalItem.v0.json b/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.InternalItem.v0.json new file mode 100644 index 000000000..d29574c58 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.InternalItem.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.LargeForgeWest.InternalItem" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.InternalItem2.v0.json b/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.InternalItem2.v0.json new file mode 100644 index 000000000..669e10a98 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.InternalItem2.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.LargeForgeWest.InternalItem2" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.v0.json b/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.v0.json new file mode 100644 index 000000000..fbf61fdf3 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.LargeForgeWest.v0.json @@ -0,0 +1,16 @@ +{ + "version": 0, + "type": "Server.Items.LargeForgeWest", + "properties": [ + { + "name": "Item", + "type": "Server.Items.LargeForgeWest.InternalItem", + "rule": "SerializableInterfaceMigrationRule" + }, + { + "name": "Item2", + "type": "Server.Items.LargeForgeWest.InternalItem2", + "rule": "SerializableInterfaceMigrationRule" + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.OakBoard.v0.json b/Projects/UOContent/Migrations/Server.Items.OakBoard.v0.json new file mode 100644 index 000000000..4a25f89d1 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.OakBoard.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.OakBoard" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.TaxidermyKit.v0.json b/Projects/UOContent/Migrations/Server.Items.TaxidermyKit.v0.json new file mode 100644 index 000000000..b72c7d87f --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.TaxidermyKit.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.TaxidermyKit" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.TrophyAddon.v2.json b/Projects/UOContent/Migrations/Server.Items.TrophyAddon.v2.json new file mode 100644 index 000000000..ee10bec34 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.TrophyAddon.v2.json @@ -0,0 +1,54 @@ +{ + "version": 2, + "type": "Server.Items.TrophyAddon", + "properties": [ + { + "name": "Hunter", + "type": "string", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "AnimalWeight", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "WestId", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "NorthId", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "DeedNumber", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "AddonNumber", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.TrophyDeed.v2.json b/Projects/UOContent/Migrations/Server.Items.TrophyDeed.v2.json new file mode 100644 index 000000000..fe3e5a2c0 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.TrophyDeed.v2.json @@ -0,0 +1,54 @@ +{ + "version": 2, + "type": "Server.Items.TrophyDeed", + "properties": [ + { + "name": "Hunter", + "type": "string", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "AnimalWeight", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "WestId", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "NorthId", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "DeedNumber", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "AddonNumber", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.YewBoard.v0.json b/Projects/UOContent/Migrations/Server.Items.YewBoard.v0.json new file mode 100644 index 000000000..c9e1d40eb --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.YewBoard.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.YewBoard" +} \ No newline at end of file