From f56cb31db6302e1deef289ccc315e3f29a4d22be Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Wed, 23 Aug 2023 20:02:46 -0700 Subject: [PATCH] fix: Codegens rest of special items (#1467) --- .../UOContent/Items/Special/HeritageToken.cs | 73 +- .../UOContent/Items/Special/MiniHouses.cs | 427 ++-- .../Items/Special/MonsterStatuette.cs | 522 +++-- .../UOContent/Items/Special/RewardCake.cs | 95 +- Projects/UOContent/Items/Special/SoulStone.cs | 1861 ++++++++--------- .../Items/Special/Veteran Rewards/Banner.cs | 163 +- .../Special/Veteran Rewards/StoneAnkh.cs | 4 - .../Server.Items.BannerDeed.v0.json | 14 + .../Server.Items.BlueSoulstone.v0.json | 4 + .../Server.Items.HeritageToken.v0.json | 4 + .../Server.Items.MiniHouseAddon.v1.json | 11 + .../Server.Items.MiniHouseDeed.v1.json | 11 + .../Server.Items.MonsterStatuette.v0.json | 27 + .../Server.Items.RedSoulstone.v0.json | 14 + .../Server.Items.RewardCake.v0.json | 4 + .../Migrations/Server.Items.SoulStone.v4.json | 56 + .../Server.Items.SoulstoneFragment.v0.json | 14 + 17 files changed, 1540 insertions(+), 1764 deletions(-) create mode 100644 Projects/UOContent/Migrations/Server.Items.BannerDeed.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.BlueSoulstone.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.HeritageToken.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.MiniHouseAddon.v1.json create mode 100644 Projects/UOContent/Migrations/Server.Items.MiniHouseDeed.v1.json create mode 100644 Projects/UOContent/Migrations/Server.Items.MonsterStatuette.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.RedSoulstone.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.RewardCake.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.SoulStone.v4.json create mode 100644 Projects/UOContent/Migrations/Server.Items.SoulstoneFragment.v0.json diff --git a/Projects/UOContent/Items/Special/HeritageToken.cs b/Projects/UOContent/Items/Special/HeritageToken.cs index b08a07409..b5dccc340 100644 --- a/Projects/UOContent/Items/Special/HeritageToken.cs +++ b/Projects/UOContent/Items/Special/HeritageToken.cs @@ -1,54 +1,37 @@ -using Server.Gumps; +using ModernUO.Serialization; +using Server.Gumps; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(0)] +public partial class HeritageToken : Item { - public class HeritageToken : Item + [Constructible] + public HeritageToken() : base(0x367A) { - [Constructible] - public HeritageToken() : base(0x367A) + LootType = LootType.Blessed; + Weight = 5.0; + } + + public override int LabelNumber => 1076596; // A Heritage Token + + public override void OnDoubleClick(Mobile from) + { + if (IsChildOf(from.Backpack)) { - LootType = LootType.Blessed; - Weight = 5.0; + from.CloseGump(); + from.SendGump(new HeritageTokenGump(this)); } - - public HeritageToken(Serial serial) : base(serial) + else { - } - - public override int LabelNumber => 1076596; // A Heritage Token - - public override void OnDoubleClick(Mobile from) - { - if (IsChildOf(from.Backpack)) - { - from.CloseGump(); - from.SendGump(new HeritageTokenGump(this)); - } - else - { - from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used. - } - } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - list.AddLocalized(1070998, 1076595); // Use this to redeem
Your Heritage Items - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.WriteEncodedInt(0); // version - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadEncodedInt(); + from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used. } } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + list.AddLocalized(1070998, 1076595); // Use this to redeem
Your Heritage Items + } } diff --git a/Projects/UOContent/Items/Special/MiniHouses.cs b/Projects/UOContent/Items/Special/MiniHouses.cs index cf18f61d4..f42ca5565 100644 --- a/Projects/UOContent/Items/Special/MiniHouses.cs +++ b/Projects/UOContent/Items/Special/MiniHouses.cs @@ -1,263 +1,204 @@ using System; +using ModernUO.Serialization; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(1, false)] +public partial class MiniHouseAddon : BaseAddon { - public class MiniHouseAddon : BaseAddon + [Constructible] + public MiniHouseAddon(MiniHouseType type = MiniHouseType.StoneAndPlaster) { - private MiniHouseType m_Type; + _type = type; - [Constructible] - public MiniHouseAddon(MiniHouseType type = MiniHouseType.StoneAndPlaster) + Construct(); + } + + [CommandProperty(AccessLevel.GameMaster)] + [SerializableProperty(0)] + public MiniHouseType Type + { + get => _type; + set { - m_Type = type; - + _type = value; Construct(); + this.MarkDirty(); + } + } + + public override BaseAddonDeed Deed => new MiniHouseDeed(_type); + + public void Construct() + { + foreach (var c in Components) + { + c.Addon = null; + c.Delete(); } - public MiniHouseAddon(Serial serial) : base(serial) + this.Clear(Components); + + var info = MiniHouseInfo.GetInfo(_type); + + var size = (int)Math.Sqrt(info.Graphics.Length); + var num = 0; + + for (var y = 0; y < size; ++y) { - } - - [CommandProperty(AccessLevel.GameMaster)] - public MiniHouseType Type - { - get => m_Type; - set + for (var x = 0; x < size; ++x) { - m_Type = value; - Construct(); - } - } - - public override BaseAddonDeed Deed => new MiniHouseDeed(m_Type); - - public void Construct() - { - foreach (var c in Components) - { - c.Addon = null; - c.Delete(); - } - - this.Clear(Components); - - var info = MiniHouseInfo.GetInfo(m_Type); - - var size = (int)Math.Sqrt(info.Graphics.Length); - var num = 0; - - for (var y = 0; y < size; ++y) - { - for (var x = 0; x < size; ++x) + if (info.Graphics[num] != 0x1) // Veteran Rewards Mod { - if (info.Graphics[num] != 0x1) // Veteran Rewards Mod - { - AddComponent(new AddonComponent(info.Graphics[num++]), size - x - 1, size - y - 1, 0); - } + AddComponent(new AddonComponent(info.Graphics[num++]), size - x - 1, size - y - 1, 0); } } } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write((int)m_Type); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 0: - { - m_Type = (MiniHouseType)reader.ReadInt(); - break; - } - } - } } - public class MiniHouseDeed : BaseAddonDeed + private void Deserialize(IGenericReader reader, int version) { - private MiniHouseType m_Type; - - [Constructible] - public MiniHouseDeed(MiniHouseType type = MiniHouseType.StoneAndPlaster) - { - m_Type = type; - - Weight = 1.0; - LootType = LootType.Blessed; - } - - public MiniHouseDeed(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public MiniHouseType Type - { - get => m_Type; - set - { - m_Type = value; - InvalidateProperties(); - } - } - - public override BaseAddon Addon => new MiniHouseAddon(m_Type); - public override int LabelNumber => 1062096; // a mini house deed - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - list.Add(MiniHouseInfo.GetInfo(m_Type).LabelNumber); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.Write((int)m_Type); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 0: - { - m_Type = (MiniHouseType)reader.ReadInt(); - break; - } - } - - if (Weight == 0.0) - { - Weight = 1.0; - } - } - } - - public enum MiniHouseType - { - StoneAndPlaster, - FieldStone, - SmallBrick, - Wooden, - WoodAndPlaster, - ThatchedRoof, - Brick, - TwoStoryWoodAndPlaster, - TwoStoryStoneAndPlaster, - Tower, - SmallStoneKeep, - Castle, - LargeHouseWithPatio, - MarbleHouseWithPatio, - SmallStoneTower, - TwoStoryLogCabin, - TwoStoryVilla, - SandstoneHouseWithPatio, - SmallStoneWorkshop, - SmallMarbleWorkshop, - MalasMountainPass, // Veteran reward house - ChurchAtNight // Veteran reward house - } - - public class MiniHouseInfo - { - private static readonly MiniHouseInfo[] m_Info = - { - /* Stone and plaster house */ new(0x22C4, 1, 1011303), - /* Field stone house */ new(0x22DE, 1, 1011304), - /* Small brick house */ new(0x22DF, 1, 1011305), - /* Wooden house */ new(0x22C9, 1, 1011306), - /* Wood and plaster house */ new(0x22E0, 1, 1011307), - /* Thatched-roof cottage */ new(0x22E1, 1, 1011308), - /* Brick house */ new(1011309, 0x22CD, 0x22CB, 0x22CC, 0x22CA), - /* Two-story wood and plaster house */ new(1011310, 0x2301, 0x2302, 0x2304, 0x2303), - /* Two-story stone and plaster house */ new(1011311, 0x22FC, 0x22FD, 0x22FF, 0x22FE), - /* Tower */ new(1011312, 0x22F7, 0x22F8, 0x22FA, 0x22F9), - /* Small stone keep */ new(0x22E6, 9, 1011313), - /* Castle */ - new( - 1011314, - 0x22CE, - 0x22D0, - 0x22D2, - 0x22D7, - 0x22CF, - 0x22D1, - 0x22D4, - 0x22D9, - 0x22D3, - 0x22D5, - 0x22D6, - 0x22DB, - 0x22D8, - 0x22DA, - 0x22DC, - 0x22DD - ), - /* Large house with patio */ new(0x22E2, 4, 1011315), - /* Marble house with patio */ new(0x22EF, 4, 1011316), - /* Small stone tower */ new(0x22F5, 1, 1011317), - /* Two-story log cabin */ new(0x22FB, 1, 1011318), - /* Two-story villa */ new(0x2300, 1, 1011319), - /* Sandstone house with patio */ new(0x22F3, 1, 1011320), - /* Small stone workshop */ new(0x22F6, 1, 1011321), - /* Small marble workshop */ new(0x22F4, 1, 1011322), - /* Malas Mountain Pass */ new(1062692, 0x2316, 0x2315, 0x2314, 0x2313), - /* Church At Night */ new(1072215, 0x2318, 0x2317, 0x2319, 0x1) - }; - - public MiniHouseInfo(int start, int count, int labelNumber) - { - Graphics = new int[count]; - - for (var i = 0; i < count; ++i) - { - Graphics[i] = start + i; - } - - LabelNumber = labelNumber; - } - - public MiniHouseInfo(int labelNumber, params int[] graphics) - { - LabelNumber = labelNumber; - Graphics = graphics; - } - - public int[] Graphics { get; } - - public int LabelNumber { get; } - - public static MiniHouseInfo GetInfo(MiniHouseType type) - { - var v = (int)type; - - if (v < 0 || v >= m_Info.Length) - { - v = 0; - } - - return m_Info[v]; - } + _type = (MiniHouseType)reader.ReadInt(); + } +} + +[SerializationGenerator(1, false)] +public partial class MiniHouseDeed : BaseAddonDeed +{ + [InvalidateProperties] + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private MiniHouseType _type; + + [Constructible] + public MiniHouseDeed(MiniHouseType type = MiniHouseType.StoneAndPlaster) + { + _type = type; + + Weight = 1.0; + LootType = LootType.Blessed; + } + + public override BaseAddon Addon => new MiniHouseAddon(_type); + public override int LabelNumber => 1062096; // a mini house deed + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + list.Add(MiniHouseInfo.GetInfo(_type).LabelNumber); + } + + private void Deserialize(IGenericReader reader, int version) + { + _type = (MiniHouseType)reader.ReadInt(); + } +} + +public enum MiniHouseType +{ + StoneAndPlaster, + FieldStone, + SmallBrick, + Wooden, + WoodAndPlaster, + ThatchedRoof, + Brick, + TwoStoryWoodAndPlaster, + TwoStoryStoneAndPlaster, + Tower, + SmallStoneKeep, + Castle, + LargeHouseWithPatio, + MarbleHouseWithPatio, + SmallStoneTower, + TwoStoryLogCabin, + TwoStoryVilla, + SandstoneHouseWithPatio, + SmallStoneWorkshop, + SmallMarbleWorkshop, + MalasMountainPass, // Veteran reward house + ChurchAtNight // Veteran reward house +} + +public class MiniHouseInfo +{ + private static readonly MiniHouseInfo[] m_Info = + { + /* Stone and plaster house */ new(0x22C4, 1, 1011303), + /* Field stone house */ new(0x22DE, 1, 1011304), + /* Small brick house */ new(0x22DF, 1, 1011305), + /* Wooden house */ new(0x22C9, 1, 1011306), + /* Wood and plaster house */ new(0x22E0, 1, 1011307), + /* Thatched-roof cottage */ new(0x22E1, 1, 1011308), + /* Brick house */ new(1011309, 0x22CD, 0x22CB, 0x22CC, 0x22CA), + /* Two-story wood and plaster house */ new(1011310, 0x2301, 0x2302, 0x2304, 0x2303), + /* Two-story stone and plaster house */ new(1011311, 0x22FC, 0x22FD, 0x22FF, 0x22FE), + /* Tower */ new(1011312, 0x22F7, 0x22F8, 0x22FA, 0x22F9), + /* Small stone keep */ new(0x22E6, 9, 1011313), + /* Castle */ + new( + 1011314, + 0x22CE, + 0x22D0, + 0x22D2, + 0x22D7, + 0x22CF, + 0x22D1, + 0x22D4, + 0x22D9, + 0x22D3, + 0x22D5, + 0x22D6, + 0x22DB, + 0x22D8, + 0x22DA, + 0x22DC, + 0x22DD + ), + /* Large house with patio */ new(0x22E2, 4, 1011315), + /* Marble house with patio */ new(0x22EF, 4, 1011316), + /* Small stone tower */ new(0x22F5, 1, 1011317), + /* Two-story log cabin */ new(0x22FB, 1, 1011318), + /* Two-story villa */ new(0x2300, 1, 1011319), + /* Sandstone house with patio */ new(0x22F3, 1, 1011320), + /* Small stone workshop */ new(0x22F6, 1, 1011321), + /* Small marble workshop */ new(0x22F4, 1, 1011322), + /* Malas Mountain Pass */ new(1062692, 0x2316, 0x2315, 0x2314, 0x2313), + /* Church At Night */ new(1072215, 0x2318, 0x2317, 0x2319, 0x1) + }; + + public MiniHouseInfo(int start, int count, int labelNumber) + { + Graphics = new int[count]; + + for (var i = 0; i < count; ++i) + { + Graphics[i] = start + i; + } + + LabelNumber = labelNumber; + } + + public MiniHouseInfo(int labelNumber, params int[] graphics) + { + LabelNumber = labelNumber; + Graphics = graphics; + } + + public int[] Graphics { get; } + + public int LabelNumber { get; } + + public static MiniHouseInfo GetInfo(MiniHouseType type) + { + var v = (int)type; + + if (v < 0 || v >= m_Info.Length) + { + v = 0; + } + + return m_Info[v]; } } diff --git a/Projects/UOContent/Items/Special/MonsterStatuette.cs b/Projects/UOContent/Items/Special/MonsterStatuette.cs index ec7c8e887..59065d060 100644 --- a/Projects/UOContent/Items/Special/MonsterStatuette.cs +++ b/Projects/UOContent/Items/Special/MonsterStatuette.cs @@ -1,332 +1,278 @@ using System; +using ModernUO.Serialization; using Server.Engines.VeteranRewards; using Server.Gumps; using Server.Multis; using Server.Network; -namespace Server.Items +namespace Server.Items; + +public enum MonsterStatuetteType { - public enum MonsterStatuetteType + Crocodile, + Daemon, + Dragon, + EarthElemental, + Ettin, + Gargoyle, + Gorilla, + Lich, + Lizardman, + Ogre, + Orc, + Ratman, + Skeleton, + Troll, + Cow, + Zombie, + Llama, + Ophidian, + Reaper, + Mongbat, + Gazer, + FireElemental, + Wolf, + PhillipsWoodenSteed, + Seahorse, + Harrower, + Efreet, + Slime, + PlagueBeast, + RedDeath, + Spider, + OphidianArchMage, + OphidianWarrior, + OphidianKnight, + OphidianMage, + DreadHorn, + Minotaur, + BlackCat, + HalloweenGhoul, + Santa +} + +public class MonsterStatuetteInfo +{ + private static readonly MonsterStatuetteInfo[] m_Table = { - Crocodile, - Daemon, - Dragon, - EarthElemental, - Ettin, - Gargoyle, - Gorilla, - Lich, - Lizardman, - Ogre, - Orc, - Ratman, - Skeleton, - Troll, - Cow, - Zombie, - Llama, - Ophidian, - Reaper, - Mongbat, - Gazer, - FireElemental, - Wolf, - PhillipsWoodenSteed, - Seahorse, - Harrower, - Efreet, - Slime, - PlagueBeast, - RedDeath, - Spider, - OphidianArchMage, - OphidianWarrior, - OphidianKnight, - OphidianMage, - DreadHorn, - Minotaur, - BlackCat, - HalloweenGhoul, - Santa + /* Crocodile */ new(1041249, 0x20DA, 660), + /* Daemon */ new(1041250, 0x20D3, 357), + /* Dragon */ new(1041251, 0x20D6, 362), + /* EarthElemental */ new(1041252, 0x20D7, 268), + /* Ettin */ new(1041253, 0x20D8, 367), + /* Gargoyle */ new(1041254, 0x20D9, 372), + /* Gorilla */ new(1041255, 0x20F5, 158), + /* Lich */ new(1041256, 0x20F8, 1001), + /* Lizardman */ new(1041257, 0x20DE, 417), + /* Ogre */ new(1041258, 0x20DF, 427), + /* Orc */ new(1041259, 0x20E0, 1114), + /* Ratman */ new(1041260, 0x20E3, 437), + /* Skeleton */ new(1041261, 0x20E7, 1165), + /* Troll */ new(1041262, 0x20E9, 461), + /* Cow */ new(1041263, 0x2103, 120), + /* Zombie */ new(1041264, 0x20EC, 471), + /* Llama */ new(1041265, 0x20F6, 1011), + /* Ophidian */ new(1049742, 0x2133, 634), + /* Reaper */ new(1049743, 0x20FA, 442), + /* Mongbat */ new(1049744, 0x20F9, 422), + /* Gazer */ new(1049768, 0x20F4, 377), + /* FireElemental */ new(1049769, 0x20F3, 838), + /* Wolf */ new(1049770, 0x2122, 229), + /* Phillip's Steed */ new(1063488, 0x3FFE, 168), + /* Seahorse */ new(1070819, 0x25BA, 138), + /* Harrower */ new(1080520, 0x25BB, new[] { 0x289, 0x28A, 0x28B }), + /* Efreet */ new(1080521, 0x2590, 0x300), + /* Slime */ new(1015246, 0x20E8, 456), + /* PlagueBeast */ new(1029747, 0x2613, 0x1BF), + /* RedDeath */ new(1094932, 0x2617, Array.Empty()), + /* Spider */ new(1029668, 0x25C4, 1170), + /* OphidianArchMage */ new(1029641, 0x25A9, 639), + /* OphidianWarrior */ new(1029645, 0x25AD, 634), + /* OphidianKnight */ new(1029642, 0x25aa, 634), + /* OphidianMage */ new(1029643, 0x25ab, 639), + /* DreadHorn */ new(1031651, 0x2D83, 0xA8), + /* Minotaur */ new(1031657, 0x2D89, 0x596), + /* Black Cat */ new(1096928, 0x4688, 0x69), + /* HalloweenGhoul */ new(1076782, 0x2109, 0x482), + /* Santa */ new(1097968, 0x4A98, 0x669) + }; + + public MonsterStatuetteInfo(int labelNumber, int itemID, int baseSoundID) + { + LabelNumber = labelNumber; + ItemID = itemID; + Sounds = new[] { baseSoundID, baseSoundID + 1, baseSoundID + 2, baseSoundID + 3, baseSoundID + 4 }; } - public class MonsterStatuetteInfo + public MonsterStatuetteInfo(int labelNumber, int itemID, int[] sounds) { - private static readonly MonsterStatuetteInfo[] m_Table = + LabelNumber = labelNumber; + ItemID = itemID; + Sounds = sounds; + } + + public int LabelNumber { get; } + + public int ItemID { get; } + + public int[] Sounds { get; } + + public static MonsterStatuetteInfo GetInfo(MonsterStatuetteType type) + { + var v = (int)type; + + if (v < 0 || v >= m_Table.Length) { - /* Crocodile */ new(1041249, 0x20DA, 660), - /* Daemon */ new(1041250, 0x20D3, 357), - /* Dragon */ new(1041251, 0x20D6, 362), - /* EarthElemental */ new(1041252, 0x20D7, 268), - /* Ettin */ new(1041253, 0x20D8, 367), - /* Gargoyle */ new(1041254, 0x20D9, 372), - /* Gorilla */ new(1041255, 0x20F5, 158), - /* Lich */ new(1041256, 0x20F8, 1001), - /* Lizardman */ new(1041257, 0x20DE, 417), - /* Ogre */ new(1041258, 0x20DF, 427), - /* Orc */ new(1041259, 0x20E0, 1114), - /* Ratman */ new(1041260, 0x20E3, 437), - /* Skeleton */ new(1041261, 0x20E7, 1165), - /* Troll */ new(1041262, 0x20E9, 461), - /* Cow */ new(1041263, 0x2103, 120), - /* Zombie */ new(1041264, 0x20EC, 471), - /* Llama */ new(1041265, 0x20F6, 1011), - /* Ophidian */ new(1049742, 0x2133, 634), - /* Reaper */ new(1049743, 0x20FA, 442), - /* Mongbat */ new(1049744, 0x20F9, 422), - /* Gazer */ new(1049768, 0x20F4, 377), - /* FireElemental */ new(1049769, 0x20F3, 838), - /* Wolf */ new(1049770, 0x2122, 229), - /* Phillip's Steed */ new(1063488, 0x3FFE, 168), - /* Seahorse */ new(1070819, 0x25BA, 138), - /* Harrower */ new(1080520, 0x25BB, new[] { 0x289, 0x28A, 0x28B }), - /* Efreet */ new(1080521, 0x2590, 0x300), - /* Slime */ new(1015246, 0x20E8, 456), - /* PlagueBeast */ new(1029747, 0x2613, 0x1BF), - /* RedDeath */ new(1094932, 0x2617, Array.Empty()), - /* Spider */ new(1029668, 0x25C4, 1170), - /* OphidianArchMage */ new(1029641, 0x25A9, 639), - /* OphidianWarrior */ new(1029645, 0x25AD, 634), - /* OphidianKnight */ new(1029642, 0x25aa, 634), - /* OphidianMage */ new(1029643, 0x25ab, 639), - /* DreadHorn */ new(1031651, 0x2D83, 0xA8), - /* Minotaur */ new(1031657, 0x2D89, 0x596), - /* Black Cat */ new(1096928, 0x4688, 0x69), - /* HalloweenGhoul */ new(1076782, 0x2109, 0x482), - /* Santa */ new(1097968, 0x4A98, 0x669) + v = 0; + } + + return m_Table[v]; + } +} + +[SerializationGenerator(0, false)] +public partial class MonsterStatuette : Item, IRewardItem +{ + [InvalidateProperties] + [SerializableField(1)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private bool _turnedOn; + + [InvalidateProperties] + [SerializableField(2)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private bool _isRewardItem; + + [Constructible] + public MonsterStatuette(MonsterStatuetteType type = MonsterStatuetteType.Crocodile) : base( + MonsterStatuetteInfo.GetInfo(type).ItemID + ) + { + LootType = LootType.Blessed; + + _type = type; + + Hue = GetStatuetteHue(type); + } + + public static int GetStatuetteHue(MonsterStatuetteType type, int fallback = 0) => + type switch + { + MonsterStatuetteType.Slime => Utility.RandomSlimeHue(), + MonsterStatuetteType.RedDeath => 0x21, + MonsterStatuetteType.HalloweenGhoul => 0xF4, + _ => fallback }; - public MonsterStatuetteInfo(int labelNumber, int itemID, int baseSoundID) + [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] + public MonsterStatuetteType Type + { + get => _type; + set { - LabelNumber = labelNumber; - ItemID = itemID; - Sounds = new[] { baseSoundID, baseSoundID + 1, baseSoundID + 2, baseSoundID + 3, baseSoundID + 4 }; - } + _type = value; + ItemID = MonsterStatuetteInfo.GetInfo(_type).ItemID; - public MonsterStatuetteInfo(int labelNumber, int itemID, int[] sounds) - { - LabelNumber = labelNumber; - ItemID = itemID; - Sounds = sounds; - } + Hue = GetStatuetteHue(_type, Hue); - public int LabelNumber { get; } - - public int ItemID { get; } - - public int[] Sounds { get; } - - public static MonsterStatuetteInfo GetInfo(MonsterStatuetteType type) - { - var v = (int)type; - - if (v < 0 || v >= m_Table.Length) - { - v = 0; - } - - return m_Table[v]; + InvalidateProperties(); + this.MarkDirty(); } } - public class MonsterStatuette : Item, IRewardItem + public override int LabelNumber => MonsterStatuetteInfo.GetInfo(_type).LabelNumber; + + public override double DefaultWeight => 1.0; + + public override bool HandlesOnMovement => _turnedOn && IsLockedDown; + + public override void OnMovement(Mobile m, Point3D oldLocation) { - private bool m_TurnedOn; - private MonsterStatuetteType m_Type; - - [Constructible] - public MonsterStatuette(MonsterStatuetteType type = MonsterStatuetteType.Crocodile) : base( - MonsterStatuetteInfo.GetInfo(type).ItemID - ) + if (_turnedOn && IsLockedDown && (!m.Hidden || m.AccessLevel == AccessLevel.Player) && + Utility.InRange(m.Location, Location, 2) && !Utility.InRange(oldLocation, Location, 2)) { - LootType = LootType.Blessed; + var sounds = MonsterStatuetteInfo.GetInfo(_type).Sounds; - m_Type = type; - - if (m_Type == MonsterStatuetteType.Slime) + if (sounds.Length > 0) { - Hue = Utility.RandomSlimeHue(); - } - else if (m_Type == MonsterStatuetteType.RedDeath) - { - Hue = 0x21; - } - else if (m_Type == MonsterStatuetteType.HalloweenGhoul) - { - Hue = 0xF4; + Effects.PlaySound(Location, Map, sounds.RandomElement()); } } - public MonsterStatuette(Serial serial) : base(serial) + base.OnMovement(m, oldLocation); + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (Core.ML && IsRewardItem) { + list.Add(RewardSystem.GetRewardYearLabel(this, new object[] { _type })); // X Year Veteran Reward } - [CommandProperty(AccessLevel.GameMaster)] - public bool TurnedOn + if (_turnedOn) { - get => m_TurnedOn; - set - { - m_TurnedOn = value; - InvalidateProperties(); - } + list.Add(502695); // turned on + } + else + { + list.Add(502696); // turned off + } + } + + public bool IsOwner(Mobile mob) => BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true; + + public override void OnDoubleClick(Mobile from) + { + if (IsOwner(from)) + { + var onOffGump = new OnOffGump(this); + from.SendGump(onOffGump); + } + else + { + from.SendLocalizedMessage(502691); // You must be the owner to use this. + } + } + + private class OnOffGump : Gump + { + private readonly MonsterStatuette m_Statuette; + + public OnOffGump(MonsterStatuette statuette) : base(150, 200) + { + m_Statuette = statuette; + + AddBackground(0, 0, 300, 150, 0xA28); + + AddHtmlLocalized(45, 20, 300, 35, statuette.TurnedOn ? 1011035 : 1011034); // [De]Activate this item + + AddButton(40, 53, 0xFA5, 0xFA7, 1); + AddHtmlLocalized(80, 55, 65, 35, 1011036); // OKAY + + AddButton(150, 53, 0xFA5, 0xFA7, 0); + AddHtmlLocalized(190, 55, 100, 35, 1011012); // CANCEL } - [CommandProperty(AccessLevel.GameMaster)] - public MonsterStatuetteType Type + public override void OnResponse(NetState sender, RelayInfo info) { - get => m_Type; - set + var from = sender.Mobile; + + if (info.ButtonID == 1) { - m_Type = value; - ItemID = MonsterStatuetteInfo.GetInfo(m_Type).ItemID; + var newValue = !m_Statuette.TurnedOn; + m_Statuette.TurnedOn = newValue; - if (m_Type == MonsterStatuetteType.Slime) + if (newValue && !m_Statuette.IsLockedDown) { - Hue = Utility.RandomSlimeHue(); + from.SendLocalizedMessage(502693); // Remember, this only works when locked down. } - else if (m_Type == MonsterStatuetteType.RedDeath) - { - Hue = 0x21; - } - else if (m_Type == MonsterStatuetteType.HalloweenGhoul) - { - Hue = 0xF4; - } - else - { - Hue = 0; - } - - InvalidateProperties(); - } - } - - public override int LabelNumber => MonsterStatuetteInfo.GetInfo(m_Type).LabelNumber; - - public override double DefaultWeight => 1.0; - - public override bool HandlesOnMovement => m_TurnedOn && IsLockedDown; - - [CommandProperty(AccessLevel.GameMaster)] - public bool IsRewardItem { get; set; } - - public override void OnMovement(Mobile m, Point3D oldLocation) - { - if (m_TurnedOn && IsLockedDown && (!m.Hidden || m.AccessLevel == AccessLevel.Player) && - Utility.InRange(m.Location, Location, 2) && !Utility.InRange(oldLocation, Location, 2)) - { - var sounds = MonsterStatuetteInfo.GetInfo(m_Type).Sounds; - - if (sounds.Length > 0) - { - Effects.PlaySound(Location, Map, sounds.RandomElement()); - } - } - - base.OnMovement(m, oldLocation); - } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (Core.ML && IsRewardItem) - { - list.Add(RewardSystem.GetRewardYearLabel(this, new object[] { m_Type })); // X Year Veteran Reward - } - - if (m_TurnedOn) - { - list.Add(502695); // turned on } else { - list.Add(502696); // turned off - } - } - - public bool IsOwner(Mobile mob) => BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true; - - public override void OnDoubleClick(Mobile from) - { - if (IsOwner(from)) - { - var onOffGump = new OnOffGump(this); - from.SendGump(onOffGump); - } - else - { - from.SendLocalizedMessage(502691); // You must be the owner to use this. - } - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - - writer.WriteEncodedInt((int)m_Type); - writer.Write(m_TurnedOn); - writer.Write(IsRewardItem); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 0: - { - m_Type = (MonsterStatuetteType)reader.ReadEncodedInt(); - m_TurnedOn = reader.ReadBool(); - IsRewardItem = reader.ReadBool(); - break; - } - } - } - - private class OnOffGump : Gump - { - private readonly MonsterStatuette m_Statuette; - - public OnOffGump(MonsterStatuette statuette) : base(150, 200) - { - m_Statuette = statuette; - - AddBackground(0, 0, 300, 150, 0xA28); - - AddHtmlLocalized(45, 20, 300, 35, statuette.TurnedOn ? 1011035 : 1011034); // [De]Activate this item - - AddButton(40, 53, 0xFA5, 0xFA7, 1); - AddHtmlLocalized(80, 55, 65, 35, 1011036); // OKAY - - AddButton(150, 53, 0xFA5, 0xFA7, 0); - AddHtmlLocalized(190, 55, 100, 35, 1011012); // CANCEL - } - - public override void OnResponse(NetState sender, RelayInfo info) - { - var from = sender.Mobile; - - if (info.ButtonID == 1) - { - var newValue = !m_Statuette.TurnedOn; - m_Statuette.TurnedOn = newValue; - - if (newValue && !m_Statuette.IsLockedDown) - { - from.SendLocalizedMessage(502693); // Remember, this only works when locked down. - } - } - else - { - from.SendLocalizedMessage(502694); // Cancelled action. - } + from.SendLocalizedMessage(502694); // Cancelled action. } } } diff --git a/Projects/UOContent/Items/Special/RewardCake.cs b/Projects/UOContent/Items/Special/RewardCake.cs index 0b6f9a689..88d7f3f95 100644 --- a/Projects/UOContent/Items/Special/RewardCake.cs +++ b/Projects/UOContent/Items/Special/RewardCake.cs @@ -1,62 +1,45 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class RewardCake : Item { - public class RewardCake : Item + [Constructible] + public RewardCake() : base(0x9e9) { - [Constructible] - public RewardCake() : base(0x9e9) + Stackable = false; + Weight = 1.0; + Hue = Utility.RandomList( + 0x135, + 0xcd, + 0x38, + 0x3b, + 0x42, + 0x4f, + 0x11e, + 0x60, + 0x317, + 0x10, + 0x136, + 0x1f9, + 0x1a, + 0xeb, + 0x86, + 0x2e + ); + LootType = LootType.Blessed; + } + + public override int LabelNumber => 1049786; // Happy Birthday! ... + + public override bool DisplayLootType => false; + + public override void OnDoubleClick(Mobile from) + { + if (!from.InRange(GetWorldLocation(), 1)) { - Stackable = false; - Weight = 1.0; - Hue = Utility.RandomList( - 0x135, - 0xcd, - 0x38, - 0x3b, - 0x42, - 0x4f, - 0x11e, - 0x60, - 0x317, - 0x10, - 0x136, - 0x1f9, - 0x1a, - 0xeb, - 0x86, - 0x2e - ); - LootType = LootType.Blessed; - } - - public RewardCake(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1049786; // Happy Birthday! ... - - public override bool DisplayLootType => false; - - public override void OnDoubleClick(Mobile from) - { - if (!from.InRange(GetWorldLocation(), 1)) - { - from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that. - } - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - LootType = LootType.Blessed; - - var version = reader.ReadInt(); + from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that. } } } diff --git a/Projects/UOContent/Items/Special/SoulStone.cs b/Projects/UOContent/Items/Special/SoulStone.cs index f3658fc87..32a70093c 100644 --- a/Projects/UOContent/Items/Special/SoulStone.cs +++ b/Projects/UOContent/Items/Special/SoulStone.cs @@ -1,4 +1,5 @@ using System; +using ModernUO.Serialization; using Server.Engines.VeteranRewards; using Server.Factions; using Server.Gumps; @@ -6,1130 +7,930 @@ using Server.Mobiles; using Server.Multis; using Server.Network; -namespace Server.Items +namespace Server.Items; + +[SerializationGenerator(4)] +public partial class SoulStone : Item, ISecurable { - public class SoulStone : Item, ISecurable + [InvalidateProperties] + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private string _lastUserName; + + [SerializableField(1)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private SecureLevel _level; + + [SerializableField(4)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private string _account; + + [InvalidateProperties] + [SerializableField(5)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private SkillName _skill; + + [Constructible] + public SoulStone(string account = null, int inactiveItemID = 0x2A93, int activeItemID = 0x2A94) : base( + inactiveItemID + ) { - private int m_ActiveItemID; - private int m_InactiveItemID; + Light = LightType.Circle300; + LootType = LootType.Blessed; - private string m_LastUserName; - private DateTime m_NextUse; // TODO: unused, it's here not to break serialize/deserialize + _inactiveItemID = inactiveItemID; + _activeItemID = activeItemID; - private SkillName m_Skill; - private double m_SkillValue; + _account = account; + } - [Constructible] - public SoulStone(string account = null, int inactiveItemID = 0x2A93, int activeItemID = 0x2A94) : base( - inactiveItemID - ) + public override int LabelNumber => 1030899; // soulstone + + [SerializableProperty(2)] + [CommandProperty(AccessLevel.GameMaster)] + public virtual int ActiveItemID + { + get => _activeItemID; + set { - Light = LightType.Circle300; - LootType = LootType.Blessed; - - m_InactiveItemID = inactiveItemID; - m_ActiveItemID = activeItemID; - - Account = account; - } - - public SoulStone(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1030899; // soulstone - - [CommandProperty(AccessLevel.GameMaster)] - public virtual int ActiveItemID - { - get => m_ActiveItemID; - set - { - m_ActiveItemID = value; - - if (!IsEmpty) - { - ItemID = m_ActiveItemID; - } - } - } - - [CommandProperty(AccessLevel.GameMaster)] - public virtual int InactiveItemID - { - get => m_InactiveItemID; - set - { - m_InactiveItemID = value; - - if (IsEmpty) - { - ItemID = m_InactiveItemID; - } - } - } - - [CommandProperty(AccessLevel.GameMaster)] - public string Account { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public string LastUserName - { - get => m_LastUserName; - set - { - m_LastUserName = value; - InvalidateProperties(); - } - } - - [CommandProperty(AccessLevel.GameMaster)] - public SkillName Skill - { - get => m_Skill; - set - { - m_Skill = value; - InvalidateProperties(); - } - } - - [CommandProperty(AccessLevel.GameMaster)] - public double SkillValue - { - get => m_SkillValue; - set - { - m_SkillValue = value; - - if (!IsEmpty) - { - ItemID = m_ActiveItemID; - } - else - { - ItemID = m_InactiveItemID; - } - - InvalidateProperties(); - } - } - - [CommandProperty(AccessLevel.GameMaster)] - public bool IsEmpty => m_SkillValue <= 0.0; - - [CommandProperty(AccessLevel.GameMaster)] - public SecureLevel Level { get; set; } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); + _activeItemID = value; if (!IsEmpty) { - // Skill stored: ~1_skillname~ ~2_skillamount~ - list.Add(1070721, $"{AosSkillBonuses.GetLabel(Skill):#}\t{SkillValue:F1}"); + ItemID = _activeItemID; } - if (LastUserName != null) + this.MarkDirty(); + } + } + + [SerializableProperty(3)] + [CommandProperty(AccessLevel.GameMaster)] + public virtual int InactiveItemID + { + get => _inactiveItemID; + set + { + _inactiveItemID = value; + + if (IsEmpty) { - list.Add(1041602, LastUserName); // Owner: ~1_val~ + ItemID = _inactiveItemID; } - else + + this.MarkDirty(); + } + } + + [SerializableProperty(6)] + [CommandProperty(AccessLevel.GameMaster)] + public double SkillValue + { + get => _skillValue; + set + { + _skillValue = value; + + ItemID = IsEmpty ? _inactiveItemID : _activeItemID; + + InvalidateProperties(); + this.MarkDirty(); + } + } + + [CommandProperty(AccessLevel.GameMaster)] + public bool IsEmpty => _skillValue <= 0.0; + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (!IsEmpty) + { + // Skill stored: ~1_skillname~ ~2_skillamount~ + list.Add(1070721, $"{AosSkillBonuses.GetLabel(Skill):#}\t{SkillValue:F1}"); + } + + if (LastUserName != null) + { + list.Add(1041602, LastUserName); // Owner: ~1_val~ + } + else + { + list.AddLocalized(1041602, 1074235); // Owner: ~1_val~ + } + } + + private static bool CheckCombat(Mobile m, TimeSpan time) + { + for (var i = 0; i < m.Aggressed.Count; ++i) + { + var info = m.Aggressed[i]; + + if (Core.Now - info.LastCombatTime < time) { - list.AddLocalized(1041602, 1074235); // Owner: ~1_val~ + return true; } } - private static bool CheckCombat(Mobile m, TimeSpan time) + return false; + } + + protected virtual bool CheckUse(Mobile from) + { + if (Deleted || !IsAccessibleTo(from)) { - for (var i = 0; i < m.Aggressed.Count; ++i) - { - var info = m.Aggressed[i]; - - if (Core.Now - info.LastCombatTime < time) - { - return true; - } - } - return false; } - protected virtual bool CheckUse(Mobile from) + if (from.Map != Map || !from.InRange(GetWorldLocation(), 2)) { - if (Deleted || !IsAccessibleTo(from)) - { - return false; - } - - if (from.Map != Map || !from.InRange(GetWorldLocation(), 2)) - { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. - return false; - } - - if (Account != null && (from.Account is not Accounting.Account || from.Account.Username != Account)) - { - from.SendLocalizedMessage( - 1070714 - ); // This is an Account Bound Soulstone, and your character is not bound to it. You cannot use this Soulstone. - return false; - } - - if (CheckCombat(from, TimeSpan.FromMinutes(2.0))) - { - from.SendLocalizedMessage( - 1070727 - ); // You must wait two minutes after engaging in combat before you can use a Soulstone. - return false; - } - - if (from.Criminal) - { - from.SendLocalizedMessage( - 1070728 - ); // You must wait two minutes after committing a criminal act before you can use a Soulstone. - return false; - } - - if (from.Region.GetLogoutDelay(from) > TimeSpan.Zero) - { - from.SendLocalizedMessage( - 1070729 - ); // In order to use your Soulstone, you must be in a safe log-out location. - return false; - } - - if (!from.Alive) - { - from.SendLocalizedMessage(1070730); // You may not use a Soulstone while your character is dead. - return false; - } - - if (Sigil.ExistsOn(from)) - { - from.SendLocalizedMessage( - 1070731 - ); // You may not use a Soulstone while your character has a faction town sigil. - return false; - } - - if (from.Spell?.IsCasting == true) - { - from.SendLocalizedMessage(1070733); // You may not use a Soulstone while your character is casting a spell. - return false; - } - - if (from.Poisoned) - { - from.SendLocalizedMessage(1070734); // You may not use a Soulstone while your character is poisoned. - return false; - } - - if (from.Paralyzed) - { - from.SendLocalizedMessage(1070735); // You may not use a Soulstone while your character is paralyzed. - return false; - } - - if ((from as PlayerMobile)?.AcceleratedStart > Core.Now) - { - // You may not use a soulstone while your character is under the effects of a Scroll of Alacrity. - from.SendLocalizedMessage(1078115); - return false; - } - - return true; + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return false; } - public override void OnDoubleClick(Mobile from) + if (Account != null && (from.Account is not Accounting.Account || from.Account.Username != Account)) { - if (!CheckUse(from)) + // This is an Account Bound Soulstone, and your character is not bound to it. You cannot use this Soulstone. + from.SendLocalizedMessage(1070714); + return false; + } + + if (CheckCombat(from, TimeSpan.FromMinutes(2.0))) + { + // You must wait two minutes after engaging in combat before you can use a Soulstone. + from.SendLocalizedMessage(1070727); + return false; + } + + if (from.Criminal) + { + // You must wait two minutes after committing a criminal act before you can use a Soulstone. + from.SendLocalizedMessage(1070728); + return false; + } + + if (from.Region.GetLogoutDelay(from) > TimeSpan.Zero) + { + // In order to use your Soulstone, you must be in a safe log-out location. + from.SendLocalizedMessage(1070729); + return false; + } + + if (!from.Alive) + { + from.SendLocalizedMessage(1070730); // You may not use a Soulstone while your character is dead. + return false; + } + + if (Sigil.ExistsOn(from)) + { + // You may not use a Soulstone while your character has a faction town sigil. + from.SendLocalizedMessage(1070731); + return false; + } + + if (from.Spell?.IsCasting == true) + { + from.SendLocalizedMessage(1070733); // You may not use a Soulstone while your character is casting a spell. + return false; + } + + if (from.Poisoned) + { + from.SendLocalizedMessage(1070734); // You may not use a Soulstone while your character is poisoned. + return false; + } + + if (from.Paralyzed) + { + from.SendLocalizedMessage(1070735); // You may not use a Soulstone while your character is paralyzed. + return false; + } + + if ((from as PlayerMobile)?.AcceleratedStart > Core.Now) + { + // You may not use a soulstone while your character is under the effects of a Scroll of Alacrity. + from.SendLocalizedMessage(1078115); + return false; + } + + return true; + } + + public override void OnDoubleClick(Mobile from) + { + if (!CheckUse(from)) + { + return; + } + + from.CloseGump(); + from.CloseGump(); + from.CloseGump(); + from.CloseGump(); + from.CloseGump(); + + if (IsEmpty) + { + from.SendGump(new SelectSkillGump(this, from)); + } + else + { + from.SendGump(new ConfirmTransferGump(this, from)); + } + } + + private void Deserialize(IGenericReader reader, int version) + { + _lastUserName = reader.ReadString(); + Level = (SecureLevel)reader.ReadInt(); + _activeItemID = reader.ReadInt(); + _inactiveItemID = reader.ReadInt(); + Account = reader.ReadString(); + reader.ReadDateTime(); // m_NextUse - Not used + + _skill = (SkillName)reader.ReadEncodedInt(); + _skillValue = reader.ReadDouble(); + } + + private class SelectSkillGump : Gump + { + private readonly SoulStone _stone; + + public SelectSkillGump(SoulStone stone, Mobile from) : base(50, 50) + { + _stone = stone; + + AddPage(0); + + AddBackground(0, 0, 520, 440, 0x13BE); + + AddImageTiled(10, 10, 500, 20, 0xA40); + AddImageTiled(10, 40, 500, 360, 0xA40); + AddImageTiled(10, 410, 500, 20, 0xA40); + + AddAlphaRegion(10, 10, 500, 420); + + AddHtmlLocalized(10, 12, 500, 20, 1061087, 0x7FFF); // Which skill do you wish to transfer to the Soulstone? + + AddButton(10, 410, 0xFB1, 0xFB2, 0); + AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL + + for (int i = 0, n = 0; i < from.Skills.Length; i++) + { + var skill = from.Skills[i]; + + if (skill.Base > 0.0) + { + var p = n % 30; + + if (p == 0) + { + var page = n / 30; + + if (page > 0) + { + AddButton(260, 380, 0xFA5, 0xFA6, 0, GumpButtonType.Page, page + 1); + AddHtmlLocalized(305, 382, 200, 20, 1011066, 0x7FFF); // Next page + } + + AddPage(page + 1); + + if (page > 0) + { + AddButton(10, 380, 0xFAE, 0xFAF, 0, GumpButtonType.Page, page); + AddHtmlLocalized(55, 382, 200, 20, 1011067, 0x7FFF); // Previous page + } + } + + var x = p % 2 == 0 ? 10 : 260; + var y = p / 2 * 20 + 40; + + AddButton(x, y, 0xFA5, 0xFA6, i + 1); + AddHtmlLocalized(x + 45, y + 2, 200, 20, AosSkillBonuses.GetLabel(skill.SkillName), 0x7FFF); + + n++; + } + } + } + + public override void OnResponse(NetState sender, RelayInfo info) + { + if (info.ButtonID == 0 || !_stone.IsEmpty) { return; } - from.CloseGump(); - from.CloseGump(); - from.CloseGump(); - from.CloseGump(); - from.CloseGump(); + var from = sender.Mobile; - if (IsEmpty) + var iSkill = info.ButtonID - 1; + if (iSkill < 0 || iSkill >= from.Skills.Length) { - from.SendGump(new SelectSkillGump(this, from)); + return; } - else + + var skill = from.Skills[iSkill]; + if (skill.Base <= 0.0) { - from.SendGump(new ConfirmTransferGump(this, from)); + return; } + + if (!_stone.CheckUse(from)) + { + return; + } + + from.SendGump(new ConfirmSkillGump(_stone, skill)); + } + } + + private class ConfirmSkillGump : Gump + { + private readonly Skill _skill; + private readonly SoulStone _stone; + + public ConfirmSkillGump(SoulStone stone, Skill skill) : base(50, 50) + { + _stone = stone; + _skill = skill; + + AddBackground(0, 0, 520, 440, 0x13BE); + + AddImageTiled(10, 10, 500, 20, 0xA40); + AddImageTiled(10, 40, 500, 360, 0xA40); + AddImageTiled(10, 410, 500, 20, 0xA40); + + AddAlphaRegion(10, 10, 500, 420); + + AddHtmlLocalized(10, 12, 500, 20, 1070709, 0x7FFF); //
Confirm Soulstone Transfer
+ + /*
Soulstone

+ * You are using a Soulstone. This powerful artifact allows you to remove skill points + * from your character and store them in the stone for later retrieval. In order to use + * the stone, you must make sure your Skill Lock for the indicated skill is pointed downward. + * Click the "Skills" button on your Paperdoll to access the Skill List, and double-check + * your skill lock.

+ * + * Once you activate the stone, all skill points in the indicated skill will be removed from + * your character. These skill points can later be retrieved. IMPORTANT: When retrieving + * skill points from a Soulstone, the Soulstone WILL REPLACE any existing skill points + * already on your character!

+ * + * This is an Account Bound Soulstone. Skill pointsstored inside can be retrieved by any + * character on the same account as the character who placed them into the stone. + */ + AddHtmlLocalized(10, 42, 500, 110, 1061067, 0x7FFF, false, true); + + AddHtmlLocalized(10, 200, 390, 20, 1062297, 0x7FFF); // Skill Chosen: + AddHtmlLocalized(210, 200, 390, 20, AosSkillBonuses.GetLabel(skill.SkillName), 0x7FFF); + + AddHtmlLocalized(10, 220, 390, 20, 1062298, 0x7FFF); // Current Value: + AddLabel(210, 220, 0x481, skill.Base.ToString("F1")); + + AddHtmlLocalized(10, 240, 390, 20, 1062299, 0x7FFF); // Current Cap: + AddLabel(210, 240, 0x481, skill.Cap.ToString("F1")); + + AddHtmlLocalized(10, 260, 390, 20, 1062300, 0x7FFF); // New Value: + AddLabel(210, 260, 0x481, "0.0"); + + AddButton(10, 360, 0xFA5, 0xFA6, 2); + + // Activate the stone. I am ready to transfer the skill points to it. + AddHtmlLocalized(45,362,450,20,1070720,0x7FFF); + + AddButton(10, 380, 0xFA5, 0xFA6, 1); + AddHtmlLocalized(45, 382, 450, 20, 1062279, 0x7FFF); // No, let me make another selection. + + AddButton(10, 410, 0xFB1, 0xFB2, 0); + AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL } - public override void Serialize(IGenericWriter writer) + public override void OnResponse(NetState sender, RelayInfo info) { - base.Serialize(writer); - - writer.WriteEncodedInt(3); // version - - // version 3 - writer.Write(m_LastUserName); - - // version 2 - writer.Write((int)Level); - - writer.Write(m_ActiveItemID); - writer.Write(m_InactiveItemID); - - writer.Write(Account); - writer.Write(m_NextUse); // TODO: delete it in a harmless way - - writer.WriteEncodedInt((int)m_Skill); - writer.Write(m_SkillValue); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadEncodedInt(); - - switch (version) + if (info.ButtonID == 0 || !_stone.IsEmpty) { - case 3: - { - m_LastUserName = reader.ReadString(); - goto case 2; - } - case 2: - { - Level = (SecureLevel)reader.ReadInt(); - goto case 1; - } - case 1: - { - m_ActiveItemID = reader.ReadInt(); - m_InactiveItemID = reader.ReadInt(); - - goto case 0; - } - case 0: - { - Account = reader.ReadString(); - m_NextUse = reader.ReadDateTime(); // TODO: delete it in a harmless way - - m_Skill = (SkillName)reader.ReadEncodedInt(); - m_SkillValue = reader.ReadDouble(); - break; - } + return; } - if (version == 0) + var from = sender.Mobile; + + if (!_stone.CheckUse(from)) { - m_ActiveItemID = 0x2A94; - m_InactiveItemID = 0x2A93; - } - } - - private class SelectSkillGump : Gump - { - private readonly SoulStone m_Stone; - - public SelectSkillGump(SoulStone stone, Mobile from) : base(50, 50) - { - m_Stone = stone; - - AddPage(0); - - AddBackground(0, 0, 520, 440, 0x13BE); - - AddImageTiled(10, 10, 500, 20, 0xA40); - AddImageTiled(10, 40, 500, 360, 0xA40); - AddImageTiled(10, 410, 500, 20, 0xA40); - - AddAlphaRegion(10, 10, 500, 420); - - AddHtmlLocalized(10, 12, 500, 20, 1061087, 0x7FFF); // Which skill do you wish to transfer to the Soulstone? - - AddButton(10, 410, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL - - for (int i = 0, n = 0; i < from.Skills.Length; i++) - { - var skill = from.Skills[i]; - - if (skill.Base > 0.0) - { - var p = n % 30; - - if (p == 0) - { - var page = n / 30; - - if (page > 0) - { - AddButton(260, 380, 0xFA5, 0xFA6, 0, GumpButtonType.Page, page + 1); - AddHtmlLocalized(305, 382, 200, 20, 1011066, 0x7FFF); // Next page - } - - AddPage(page + 1); - - if (page > 0) - { - AddButton(10, 380, 0xFAE, 0xFAF, 0, GumpButtonType.Page, page); - AddHtmlLocalized(55, 382, 200, 20, 1011067, 0x7FFF); // Previous page - } - } - - var x = p % 2 == 0 ? 10 : 260; - var y = p / 2 * 20 + 40; - - AddButton(x, y, 0xFA5, 0xFA6, i + 1); - AddHtmlLocalized(x + 45, y + 2, 200, 20, AosSkillBonuses.GetLabel(skill.SkillName), 0x7FFF); - - n++; - } - } + return; } - public override void OnResponse(NetState sender, RelayInfo info) + if (info.ButtonID == 1) // Is asking for another selection { - if (info.ButtonID == 0 || !m_Stone.IsEmpty) - { - return; - } - - var from = sender.Mobile; - - var iSkill = info.ButtonID - 1; - if (iSkill < 0 || iSkill >= from.Skills.Length) - { - return; - } - - var skill = from.Skills[iSkill]; - if (skill.Base <= 0.0) - { - return; - } - - if (!m_Stone.CheckUse(from)) - { - return; - } - - from.SendGump(new ConfirmSkillGump(m_Stone, skill)); + from.SendGump(new SelectSkillGump(_stone, from)); + return; } - } - private class ConfirmSkillGump : Gump - { - private readonly Skill m_Skill; - private readonly SoulStone m_Stone; - - public ConfirmSkillGump(SoulStone stone, Skill skill) : base(50, 50) + if (_skill.Base <= 0.0) { - m_Stone = stone; - m_Skill = skill; + return; + } - AddBackground(0, 0, 520, 440, 0x13BE); + if (_skill.Lock != SkillLock.Down) + { + //
Unable to Transfer Selected Skill to Soulstone
- AddImageTiled(10, 10, 500, 20, 0xA40); - AddImageTiled(10, 40, 500, 360, 0xA40); - AddImageTiled(10, 410, 500, 20, 0xA40); - - AddAlphaRegion(10, 10, 500, 420); - - AddHtmlLocalized(10, 12, 500, 20, 1070709, 0x7FFF); //
Confirm Soulstone Transfer
- - /*
Soulstone

- * You are using a Soulstone. This powerful artifact allows you to remove skill points - * from your character and store them in the stone for later retrieval. In order to use - * the stone, you must make sure your Skill Lock for the indicated skill is pointed downward. - * Click the "Skills" button on your Paperdoll to access the Skill List, and double-check - * your skill lock.

- * - * Once you activate the stone, all skill points in the indicated skill will be removed from - * your character. These skill points can later be retrieved. IMPORTANT: When retrieving - * skill points from a Soulstone, the Soulstone WILL REPLACE any existing skill points - * already on your character!

- * - * This is an Account Bound Soulstone. Skill pointsstored inside can be retrieved by any - * character on the same account as the character who placed them into the stone. + /* You cannot transfer the selected skill to the Soulstone at this time. The selected + * skill may be locked or set to raise in your skill menu. Click on "Skills" in your + * paperdoll menu to check your raise/locked/lower settings and your total skills. + * Make any needed adjustments, then click "Continue". If you do not wish to transfer + * the selected skill at this time, click "Cancel". */ - AddHtmlLocalized(10, 42, 500, 110, 1061067, 0x7FFF, false, true); - AddHtmlLocalized(10, 200, 390, 20, 1062297, 0x7FFF); // Skill Chosen: - AddHtmlLocalized(210, 200, 390, 20, AosSkillBonuses.GetLabel(skill.SkillName), 0x7FFF); - - AddHtmlLocalized(10, 220, 390, 20, 1062298, 0x7FFF); // Current Value: - AddLabel(210, 220, 0x481, skill.Base.ToString("F1")); - - AddHtmlLocalized(10, 240, 390, 20, 1062299, 0x7FFF); // Current Cap: - AddLabel(210, 240, 0x481, skill.Cap.ToString("F1")); - - AddHtmlLocalized(10, 260, 390, 20, 1062300, 0x7FFF); // New Value: - AddLabel(210, 260, 0x481, "0.0"); - - AddButton(10, 360, 0xFA5, 0xFA6, 2); - AddHtmlLocalized( - 45, - 362, - 450, - 20, - 1070720, - 0x7FFF - ); // Activate the stone. I am ready to transfer the skill points to it. - - AddButton(10, 380, 0xFA5, 0xFA6, 1); - AddHtmlLocalized(45, 382, 450, 20, 1062279, 0x7FFF); // No, let me make another selection. - - AddButton(10, 410, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL + from.SendGump(new ErrorGump(_stone, 1070710, 1070711)); + return; } - public override void OnResponse(NetState sender, RelayInfo info) - { - if (info.ButtonID == 0 || !m_Stone.IsEmpty) - { - return; - } + _stone.Skill = _skill.SkillName; + _stone.SkillValue = _skill.Base; - var from = sender.Mobile; + _skill.Base = 0.0; - if (!m_Stone.CheckUse(from)) - { - return; - } + // You have successfully transferred your skill points into the Soulstone. + from.SendLocalizedMessage(1070712); - if (info.ButtonID == 1) // Is asking for another selection - { - from.SendGump(new SelectSkillGump(m_Stone, from)); - return; - } + _stone.LastUserName = from.RawName; - if (m_Skill.Base <= 0.0) - { - return; - } + Effects.SendLocationParticles( + EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), + 0, + 0, + 0, + 0, + 0, + 5060, + 0 + ); + Effects.PlaySound(from.Location, from.Map, 0x243); - if (m_Skill.Lock != SkillLock.Down) - { - //
Unable to Transfer Selected Skill to Soulstone
+ Effects.SendMovingParticles( + new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), + from, + 0x36D4, + 7, + 0, + false, + true, + 0x497, + 0, + 9502, + 1, + 0, + (EffectLayer)255, + 0x100 + ); - /* You cannot transfer the selected skill to the Soulstone at this time. The selected - * skill may be locked or set to raise in your skill menu. Click on "Skills" in your - * paperdoll menu to check your raise/locked/lower settings and your total skills. - * Make any needed adjustments, then click "Continue". If you do not wish to transfer - * the selected skill at this time, click "Cancel". - */ + Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); + } + } - from.SendGump(new ErrorGump(m_Stone, 1070710, 1070711)); - return; - } + private class ConfirmTransferGump : Gump + { + private readonly SoulStone _stone; - m_Stone.Skill = m_Skill.SkillName; - m_Stone.SkillValue = m_Skill.Base; + public ConfirmTransferGump(SoulStone stone, Mobile from) : base(50, 50) + { + _stone = stone; - m_Skill.Base = 0.0; + AddBackground(0, 0, 520, 440, 0x13BE); - from.SendLocalizedMessage( - 1070712 - ); // You have successfully transferred your skill points into the Soulstone. + AddImageTiled(10, 10, 500, 20, 0xA40); + AddImageTiled(10, 40, 500, 360, 0xA40); + AddImageTiled(10, 410, 500, 20, 0xA40); - m_Stone.LastUserName = from.Name; + AddAlphaRegion(10, 10, 500, 420); - Effects.SendLocationParticles( - EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), - 0, - 0, - 0, - 0, - 0, - 5060, - 0 - ); - Effects.PlaySound(from.Location, from.Map, 0x243); + AddHtmlLocalized(10, 12, 500, 20, 1070709, 0x7FFF); //
Confirm Soulstone Transfer
- Effects.SendMovingParticles( - new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), - from, - 0x36D4, - 7, - 0, - false, - true, - 0x497, - 0, - 9502, - 1, - 0, - (EffectLayer)255, - 0x100 - ); + /*
Soulstone

+ * You are using a Soulstone. This powerful artifact allows you to remove skill points + * from your character and store them in the stone for later retrieval. In order to use + * the stone, you must make sure your Skill Lock for the indicated skill is pointed downward. + * Click the "Skills" button on your Paperdoll to access the Skill List, and double-check + * your skill lock.

+ * + * Once you activate the stone, all skill points in the indicated skill will be removed from + * your character. These skill points can later be retrieved. IMPORTANT: When retrieving + * skill points from a Soulstone, the Soulstone WILL REPLACE any existing skill points + * already on your character!

+ * + * This is an Account Bound Soulstone. Skill pointsstored inside can be retrieved by any + * character on the same account as the character who placed them into the stone. + */ + AddHtmlLocalized(10, 42, 500, 110, 1061067, 0x7FFF, false, true); - Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); - } + AddHtmlLocalized(10, 200, 390, 20, 1070718, 0x7FFF); // Skill Stored: + AddHtmlLocalized(210, 200, 390, 20, AosSkillBonuses.GetLabel(stone.Skill), 0x7FFF); + + var fromSkill = from.Skills[stone.Skill]; + + AddHtmlLocalized(10, 220, 390, 20, 1062298, 0x7FFF); // Current Value: + AddLabel(210, 220, 0x481, fromSkill.Base.ToString("F1")); + + AddHtmlLocalized(10, 240, 390, 20, 1062299, 0x7FFF); // Current Cap: + AddLabel(210, 240, 0x481, fromSkill.Cap.ToString("F1")); + + AddHtmlLocalized(10, 260, 390, 20, 1062300, 0x7FFF); // New Value: + AddLabel(210, 260, 0x481, stone.SkillValue.ToString("F1")); + + AddButton(10, 360, 0xFA5, 0xFA6, 2); + + // Activate the stone. I am ready to retrieve the skill points from it. + AddHtmlLocalized(45,362,450,20,1070719,0x7FFF); + + AddButton(10, 380, 0xFA5, 0xFA6, 1); + + // Remove all skill points from this stone and DO NOT absorb them. + AddHtmlLocalized(45,382,450,20,1070723,0x7FFF); + + AddButton(10, 410, 0xFB1, 0xFB2, 0); + AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL } - private class ConfirmTransferGump : Gump + public override void OnResponse(NetState sender, RelayInfo info) { - private readonly SoulStone m_Stone; - - public ConfirmTransferGump(SoulStone stone, Mobile from) : base(50, 50) + if (info.ButtonID == 0 || _stone.IsEmpty) { - m_Stone = stone; - - AddBackground(0, 0, 520, 440, 0x13BE); - - AddImageTiled(10, 10, 500, 20, 0xA40); - AddImageTiled(10, 40, 500, 360, 0xA40); - AddImageTiled(10, 410, 500, 20, 0xA40); - - AddAlphaRegion(10, 10, 500, 420); - - AddHtmlLocalized(10, 12, 500, 20, 1070709, 0x7FFF); //
Confirm Soulstone Transfer
- - /*
Soulstone

- * You are using a Soulstone. This powerful artifact allows you to remove skill points - * from your character and store them in the stone for later retrieval. In order to use - * the stone, you must make sure your Skill Lock for the indicated skill is pointed downward. - * Click the "Skills" button on your Paperdoll to access the Skill List, and double-check - * your skill lock.

- * - * Once you activate the stone, all skill points in the indicated skill will be removed from - * your character. These skill points can later be retrieved. IMPORTANT: When retrieving - * skill points from a Soulstone, the Soulstone WILL REPLACE any existing skill points - * already on your character!

- * - * This is an Account Bound Soulstone. Skill pointsstored inside can be retrieved by any - * character on the same account as the character who placed them into the stone. - */ - AddHtmlLocalized(10, 42, 500, 110, 1061067, 0x7FFF, false, true); - - AddHtmlLocalized(10, 200, 390, 20, 1070718, 0x7FFF); // Skill Stored: - AddHtmlLocalized(210, 200, 390, 20, AosSkillBonuses.GetLabel(stone.Skill), 0x7FFF); - - var fromSkill = from.Skills[stone.Skill]; - - AddHtmlLocalized(10, 220, 390, 20, 1062298, 0x7FFF); // Current Value: - AddLabel(210, 220, 0x481, fromSkill.Base.ToString("F1")); - - AddHtmlLocalized(10, 240, 390, 20, 1062299, 0x7FFF); // Current Cap: - AddLabel(210, 240, 0x481, fromSkill.Cap.ToString("F1")); - - AddHtmlLocalized(10, 260, 390, 20, 1062300, 0x7FFF); // New Value: - AddLabel(210, 260, 0x481, stone.SkillValue.ToString("F1")); - - AddButton(10, 360, 0xFA5, 0xFA6, 2); - AddHtmlLocalized( - 45, - 362, - 450, - 20, - 1070719, - 0x7FFF - ); // Activate the stone. I am ready to retrieve the skill points from it. - - AddButton(10, 380, 0xFA5, 0xFA6, 1); - AddHtmlLocalized( - 45, - 382, - 450, - 20, - 1070723, - 0x7FFF - ); // Remove all skill points from this stone and DO NOT absorb them. - - AddButton(10, 410, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL + return; } - public override void OnResponse(NetState sender, RelayInfo info) + var from = sender.Mobile; + + if (!_stone.CheckUse(from)) { - if (info.ButtonID == 0 || m_Stone.IsEmpty) + return; + } + + if (info.ButtonID == 1) // Remove skill points + { + from.SendGump(new ConfirmRemovalGump(_stone)); + return; + } + + var skillValue = _stone.SkillValue; + var fromSkill = from.Skills[_stone.Skill]; + + /* If we have, say, 88.4 in our skill and the stone holds 100, we need + * 11.6 free points. Also, if we're below our skillcap by, say, 8.2 points, + * we only need 11.6 - 8.2 = 3.4 points. + */ + var requiredAmount = (int)(skillValue * 10) - fromSkill.BaseFixedPoint - (from.SkillsCap - from.SkillsTotal); + + var cannotAbsorb = false; + + if (fromSkill.Lock != SkillLock.Up) + { + cannotAbsorb = true; + } + else if (requiredAmount > 0) + { + var available = 0; + + for (var i = 0; i < from.Skills.Length; ++i) { - return; + if (from.Skills[i].Lock != SkillLock.Down) + { + continue; + } + + available += from.Skills[i].BaseFixedPoint; } - var from = sender.Mobile; - - if (!m_Stone.CheckUse(from)) - { - return; - } - - if (info.ButtonID == 1) // Remove skill points - { - from.SendGump(new ConfirmRemovalGump(m_Stone)); - return; - } - - var skill = m_Stone.Skill; - var skillValue = m_Stone.SkillValue; - var fromSkill = from.Skills[m_Stone.Skill]; - - /* If we have, say, 88.4 in our skill and the stone holds 100, we need - * 11.6 free points. Also, if we're below our skillcap by, say, 8.2 points, - * we only need 11.6 - 8.2 = 3.4 points. - */ - var requiredAmount = (int)(skillValue * 10) - fromSkill.BaseFixedPoint - (from.SkillsCap - from.SkillsTotal); - - var cannotAbsorb = false; - - if (fromSkill.Lock != SkillLock.Up) + if (requiredAmount > available) { cannotAbsorb = true; } - else if (requiredAmount > 0) - { - var available = 0; - - for (var i = 0; i < from.Skills.Length; ++i) - { - if (from.Skills[i].Lock != SkillLock.Down) - { - continue; - } - - available += from.Skills[i].BaseFixedPoint; - } - - if (requiredAmount > available) - { - cannotAbsorb = true; - } - } - - if (cannotAbsorb) - { - //
Unable to Absorb Selected Skill from Soulstone
- - /* You cannot absorb the selected skill from the Soulstone at this time. The selected - * skill may be locked or set to lower in your skill menu. You may also be at your - * total skill cap. Click on "Skills" in your paperdoll menu to check your - * raise/locked/lower settings and your total skills. Make any needed adjustments, - * then click "Continue". If you do not wish to transfer the selected skill at this - * time, click "Cancel". - */ - - from.SendGump(new ErrorGump(m_Stone, 1070717, 1070716)); - return; - } - - if (skillValue > fromSkill.Cap) - { - //
Unable to Absorb Selected Skill from Soulstone
- - /* The amount of skill stored in this stone exceeds your individual skill cap for - * that skill. In order to retrieve the skill points stored in this stone, you must - * obtain a Power Scroll of the appropriate type and level in order to increase your - * skill cap. You cannot currently retrieve the skill points stored in this stone. - */ - - from.SendGump(new ErrorGump(m_Stone, 1070717, 1070715)); - return; - } - - if (fromSkill.Base >= skillValue) - { - //
Unable to Absorb Selected Skill from Soulstone
- - /* You cannot transfer the selected skill to the Soulstone at this time. The selected - * skill has a skill level higher than what is stored in the Soulstone. - */ - - // Wrong message?! - - from.SendGump(new ErrorGump(m_Stone, 1070717, 1070802)); - return; - } - - if ((from as PlayerMobile)?.AcceleratedStart > Core.Now) - { - //
Unable to Absorb Selected Skill from Soulstone
- - /*You may not use a soulstone while your character is under the effects of a Scroll of Alacrity.*/ - - // Wrong message?! - - from.SendGump(new ErrorGump(m_Stone, 1070717, 1078115)); - return; - } - - if (requiredAmount > 0) - { - for (var i = 0; i < from.Skills.Length; ++i) - { - if (from.Skills[i].Lock != SkillLock.Down) - { - continue; - } - - if (requiredAmount >= from.Skills[i].BaseFixedPoint) - { - requiredAmount -= from.Skills[i].BaseFixedPoint; - from.Skills[i].Base = 0.0; - } - else - { - from.Skills[i].BaseFixedPoint -= requiredAmount; - break; - } - } - } - - fromSkill.Base = skillValue; - m_Stone.SkillValue = 0.0; - - from.SendLocalizedMessage(1070713); // You have successfully absorbed the Soulstone's skill points. - - m_Stone.LastUserName = from.Name; - - Effects.SendLocationParticles( - EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), - 0, - 0, - 0, - 0, - 0, - 5060, - 0 - ); - Effects.PlaySound(from.Location, from.Map, 0x243); - - Effects.SendMovingParticles( - new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), - from, - 0x36D4, - 7, - 0, - false, - true, - 0x497, - 0, - 9502, - 1, - 0, - (EffectLayer)255, - 0x100 - ); - - Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); - - if (m_Stone is SoulstoneFragment frag) - { - if (--frag.UsesRemaining <= 0) - { - from.SendLocalizedMessage(1070974); // You have used up your soulstone fragment. - } - } } - } - private class ConfirmRemovalGump : Gump - { - private readonly SoulStone m_Stone; - - public ConfirmRemovalGump(SoulStone stone) : base(50, 50) + if (cannotAbsorb) { - m_Stone = stone; + //
Unable to Absorb Selected Skill from Soulstone
- AddBackground(0, 0, 520, 440, 0x13BE); - - AddImageTiled(10, 10, 500, 20, 0xA40); - AddImageTiled(10, 40, 500, 360, 0xA40); - AddImageTiled(10, 410, 500, 20, 0xA40); - - AddAlphaRegion(10, 10, 500, 420); - - AddHtmlLocalized(10, 12, 500, 20, 1070725, 0x7FFF); //
Confirm Soulstone Skill Removal
- - /* WARNING!

- * - * You are about to permanently remove all skill points stored in this Soulstone. - * You WILL NOT absorb these skill points. They will be DELETED.

- * - * Are you sure you wish to do this? If not, press the Cancel button. + /* You cannot absorb the selected skill from the Soulstone at this time. The selected + * skill may be locked or set to lower in your skill menu. You may also be at your + * total skill cap. Click on "Skills" in your paperdoll menu to check your + * raise/locked/lower settings and your total skills. Make any needed adjustments, + * then click "Continue". If you do not wish to transfer the selected skill at this + * time, click "Cancel". */ - AddHtmlLocalized(10, 42, 500, 110, 1070724, 0x7FFF, false, true); - AddButton(10, 380, 0xFA5, 0xFA6, 1); - AddHtmlLocalized(45, 382, 450, 20, 1052072, 0x7FFF); // Continue - - AddButton(10, 410, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL + from.SendGump(new ErrorGump(_stone, 1070717, 1070716)); + return; } - public override void OnResponse(NetState sender, RelayInfo info) + if (skillValue > fromSkill.Cap) { - if (info.ButtonID == 0 || m_Stone.IsEmpty) + //
Unable to Absorb Selected Skill from Soulstone
+ + /* The amount of skill stored in this stone exceeds your individual skill cap for + * that skill. In order to retrieve the skill points stored in this stone, you must + * obtain a Power Scroll of the appropriate type and level in order to increase your + * skill cap. You cannot currently retrieve the skill points stored in this stone. + */ + + from.SendGump(new ErrorGump(_stone, 1070717, 1070715)); + return; + } + + if (fromSkill.Base >= skillValue) + { + //
Unable to Absorb Selected Skill from Soulstone
+ + /* You cannot transfer the selected skill to the Soulstone at this time. The selected + * skill has a skill level higher than what is stored in the Soulstone. + */ + + // Wrong message?! + + from.SendGump(new ErrorGump(_stone, 1070717, 1070802)); + return; + } + + if ((from as PlayerMobile)?.AcceleratedStart > Core.Now) + { + //
Unable to Absorb Selected Skill from Soulstone
+ + /*You may not use a soulstone while your character is under the effects of a Scroll of Alacrity.*/ + + // Wrong message?! + + from.SendGump(new ErrorGump(_stone, 1070717, 1078115)); + return; + } + + if (requiredAmount > 0) + { + for (var i = 0; i < from.Skills.Length; ++i) { - return; - } - - var from = sender.Mobile; - - if (!m_Stone.CheckUse(from)) - { - return; - } - - m_Stone.SkillValue = 0.0; - from.SendLocalizedMessage(1070726); // You have successfully deleted the Soulstone's skill points. - } - } - - private class ErrorGump : Gump - { - private readonly SoulStone m_Stone; - - public ErrorGump(SoulStone stone, int title, int message) : base(50, 50) - { - m_Stone = stone; - - AddBackground(0, 0, 520, 440, 0x13BE); - - AddImageTiled(10, 10, 500, 20, 0xA40); - AddImageTiled(10, 40, 500, 360, 0xA40); - AddImageTiled(10, 410, 500, 20, 0xA40); - - AddAlphaRegion(10, 10, 500, 420); - - AddHtmlLocalized(10, 12, 500, 20, title, 0x7FFF); - - AddHtmlLocalized(10, 42, 500, 110, message, 0x7FFF, false, true); - - AddButton(10, 380, 0xFA5, 0xFA6, 1); - AddHtmlLocalized(45, 382, 450, 20, 1052072, 0x7FFF); // Continue - - AddButton(10, 410, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL - } - - public override void OnResponse(NetState sender, RelayInfo info) - { - if (info.ButtonID == 0) - { - return; - } - - var from = sender.Mobile; - - if (!m_Stone.CheckUse(from)) - { - return; - } - - if (m_Stone.IsEmpty) - { - from.SendGump(new SelectSkillGump(m_Stone, from)); - } - else - { - from.SendGump(new ConfirmTransferGump(m_Stone, from)); - } - } - } - } - - public class SoulstoneFragment : SoulStone, IUsesRemaining - { - private int m_UsesRemaining; - - [Constructible] - public SoulstoneFragment(string account) : this(5, account) - { - } - - [Constructible] - public SoulstoneFragment(int usesRemaining = 5, string account = null) : base(account, Utility.Random(0x2AA1, 9)) => - m_UsesRemaining = usesRemaining; - - public SoulstoneFragment(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1071000; // soulstone fragment - - [CommandProperty(AccessLevel.GameMaster)] - public int UsesRemaining - { - get => m_UsesRemaining; - set - { - m_UsesRemaining = value; - InvalidateProperties(); - } - } - - bool IUsesRemaining.ShowUsesRemaining - { - get => true; - set { } - } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - list.Add(1060584, m_UsesRemaining); // uses remaining: ~1_val~ - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.WriteEncodedInt(2); // version - - writer.WriteEncodedInt(m_UsesRemaining); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadEncodedInt(); - - m_UsesRemaining = reader.ReadEncodedInt(); - - if (version <= 1) - { - if (ItemID is 0x2A93 or 0x2A94) - { - ActiveItemID = Utility.Random(0x2AA1, 9); - } - else - { - ActiveItemID = ItemID; - } - - InactiveItemID = ActiveItemID; - } - - if (version == 0 && Weight == 1) - { - Weight = -1; - } - } - - protected override bool CheckUse(Mobile from) - { - var canUse = base.CheckUse(from); - - if (canUse) - { - if (m_UsesRemaining <= 0) - { - from.SendLocalizedMessage(1070975); // That soulstone fragment has no more uses. - return false; - } - } - - return canUse; - } - } - - [Flippable] - public class BlueSoulstone : SoulStone - { - [Constructible] - public BlueSoulstone(string account = null) - : base(account, 0x2ADC, 0x2ADD) - { - } - - public BlueSoulstone(Serial serial) - : base(serial) - { - } - - public void Flip() - { - ItemID = ItemID switch - { - 0x2ADC => 0x2AEC, - 0x2ADD => 0x2AED, - 0x2AEC => 0x2ADC, - 0x2AED => 0x2ADD, - _ => ItemID - }; - } - - 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 RedSoulstone : SoulStone, IRewardItem - { - private bool m_IsRewardItem; - - [Constructible] - public RedSoulstone(string account = null) - : base(account, 0x32F3, 0x32F4) - { - } - - public RedSoulstone(Serial serial) - : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public bool IsRewardItem - { - get => m_IsRewardItem; - set - { - m_IsRewardItem = value; - InvalidateProperties(); - } - } - - public override void GetProperties(IPropertyList list) - { - base.GetProperties(list); - - if (m_IsRewardItem) - { - list.Add(1076217); // 1st Year Veteran Reward - } - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(1); // version - - writer.Write(m_IsRewardItem); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 1: + if (from.Skills[i].Lock != SkillLock.Down) { - m_IsRewardItem = reader.ReadBool(); + continue; + } + + if (requiredAmount >= from.Skills[i].BaseFixedPoint) + { + requiredAmount -= from.Skills[i].BaseFixedPoint; + from.Skills[i].Base = 0.0; + } + else + { + from.Skills[i].BaseFixedPoint -= requiredAmount; break; } + } + } + + fromSkill.Base = skillValue; + _stone.SkillValue = 0.0; + + from.SendLocalizedMessage(1070713); // You have successfully absorbed the Soulstone's skill points. + + _stone.LastUserName = from.RawName; + + Effects.SendLocationParticles( + EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), + 0, + 0, + 0, + 0, + 0, + 5060, + 0 + ); + Effects.PlaySound(from.Location, from.Map, 0x243); + + Effects.SendMovingParticles( + new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), + from, + 0x36D4, + 7, + 0, + false, + true, + 0x497, + 0, + 9502, + 1, + 0, + (EffectLayer)255, + 0x100 + ); + + Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); + + if (_stone is SoulstoneFragment frag) + { + if (--frag.UsesRemaining <= 0) + { + from.SendLocalizedMessage(1070974); // You have used up your soulstone fragment. + } + } + } + } + + private class ConfirmRemovalGump : Gump + { + private readonly SoulStone _stone; + + public ConfirmRemovalGump(SoulStone stone) : base(50, 50) + { + _stone = stone; + + AddBackground(0, 0, 520, 440, 0x13BE); + + AddImageTiled(10, 10, 500, 20, 0xA40); + AddImageTiled(10, 40, 500, 360, 0xA40); + AddImageTiled(10, 410, 500, 20, 0xA40); + + AddAlphaRegion(10, 10, 500, 420); + + AddHtmlLocalized(10, 12, 500, 20, 1070725, 0x7FFF); //
Confirm Soulstone Skill Removal
+ + /* WARNING!

+ * + * You are about to permanently remove all skill points stored in this Soulstone. + * You WILL NOT absorb these skill points. They will be DELETED.

+ * + * Are you sure you wish to do this? If not, press the Cancel button. + */ + AddHtmlLocalized(10, 42, 500, 110, 1070724, 0x7FFF, false, true); + + AddButton(10, 380, 0xFA5, 0xFA6, 1); + AddHtmlLocalized(45, 382, 450, 20, 1052072, 0x7FFF); // Continue + + AddButton(10, 410, 0xFB1, 0xFB2, 0); + AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL + } + + public override void OnResponse(NetState sender, RelayInfo info) + { + if (info.ButtonID == 0 || _stone.IsEmpty) + { + return; + } + + var from = sender.Mobile; + + if (!_stone.CheckUse(from)) + { + return; + } + + _stone.SkillValue = 0.0; + from.SendLocalizedMessage(1070726); // You have successfully deleted the Soulstone's skill points. + } + } + + private class ErrorGump : Gump + { + private readonly SoulStone _stone; + + public ErrorGump(SoulStone stone, int title, int message) : base(50, 50) + { + _stone = stone; + + AddBackground(0, 0, 520, 440, 0x13BE); + + AddImageTiled(10, 10, 500, 20, 0xA40); + AddImageTiled(10, 40, 500, 360, 0xA40); + AddImageTiled(10, 410, 500, 20, 0xA40); + + AddAlphaRegion(10, 10, 500, 420); + + AddHtmlLocalized(10, 12, 500, 20, title, 0x7FFF); + + AddHtmlLocalized(10, 42, 500, 110, message, 0x7FFF, false, true); + + AddButton(10, 380, 0xFA5, 0xFA6, 1); + AddHtmlLocalized(45, 382, 450, 20, 1052072, 0x7FFF); // Continue + + AddButton(10, 410, 0xFB1, 0xFB2, 0); + AddHtmlLocalized(45, 412, 450, 20, 1060051, 0x7FFF); // CANCEL + } + + public override void OnResponse(NetState sender, RelayInfo info) + { + if (info.ButtonID == 0) + { + return; + } + + var from = sender.Mobile; + + if (!_stone.CheckUse(from)) + { + return; + } + + if (_stone.IsEmpty) + { + from.SendGump(new SelectSkillGump(_stone, from)); + } + else + { + from.SendGump(new ConfirmTransferGump(_stone, from)); } } } } + +[SerializationGenerator(0)] +public partial class SoulstoneFragment : SoulStone, IUsesRemaining +{ + [EncodedInt] + [InvalidateProperties] + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private int _usesRemaining; + + [Constructible] + public SoulstoneFragment(string account) : this(5, account) + { + } + + [Constructible] + public SoulstoneFragment(int usesRemaining = 5, string account = null) : base(account, Utility.Random(0x2AA1, 9)) => + _usesRemaining = usesRemaining; + + public override int LabelNumber => 1071000; // soulstone fragment + + bool IUsesRemaining.ShowUsesRemaining + { + get => true; + set { } + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + list.Add(1060584, _usesRemaining); // uses remaining: ~1_val~ + } + + protected override bool CheckUse(Mobile from) + { + var canUse = base.CheckUse(from); + + if (canUse) + { + if (_usesRemaining <= 0) + { + from.SendLocalizedMessage(1070975); // That soulstone fragment has no more uses. + return false; + } + } + + return canUse; + } +} + +[Flippable] +[SerializationGenerator(0, false)] +public partial class BlueSoulstone : SoulStone +{ + [Constructible] + public BlueSoulstone(string account = null) : base(account, 0x2ADC, 0x2ADD) + { + } + + public void Flip() + { + ItemID = ItemID switch + { + 0x2ADC => 0x2AEC, + 0x2ADD => 0x2AED, + 0x2AEC => 0x2ADC, + 0x2AED => 0x2ADD, + _ => ItemID + }; + } +} + +[SerializationGenerator(0, false)] +public partial class RedSoulstone : SoulStone, IRewardItem +{ + [InvalidateProperties] + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private bool _isRewardItem; + + [Constructible] + public RedSoulstone(string account = null): base(account, 0x32F3, 0x32F4) + { + } + + public override void GetProperties(IPropertyList list) + { + base.GetProperties(list); + + if (_isRewardItem) + { + list.Add(1076217); // 1st Year Veteran Reward + } + } +} diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs b/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs index 1bdb16b8e..567c0bfc3 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs @@ -93,9 +93,13 @@ public partial class Banner : Item, IAddon, IDyable, IRewardItem } } -public class BannerDeed : Item, IRewardItem +[SerializationGenerator(0)] +public partial class BannerDeed : Item, IRewardItem { - private bool m_IsRewardItem; + [InvalidateProperties] + [SerializableField(0)] + [SerializedCommandProperty(AccessLevel.GameMaster)] + private bool _isRewardItem; [Constructible] public BannerDeed() : base(0x14F0) @@ -104,28 +108,13 @@ public class BannerDeed : Item, IRewardItem Weight = 1.0; } - public BannerDeed(Serial serial) : base(serial) - { - } - public override int LabelNumber => 1041007; // a banner deed - [CommandProperty(AccessLevel.GameMaster)] - public bool IsRewardItem - { - get => m_IsRewardItem; - set - { - m_IsRewardItem = value; - InvalidateProperties(); - } - } - public override void GetProperties(IPropertyList list) { base.GetProperties(list); - if (m_IsRewardItem) + if (_isRewardItem) { list.Add(1076218); // 2nd Year Veteran Reward } @@ -133,7 +122,7 @@ public class BannerDeed : Item, IRewardItem public override void OnDoubleClick(Mobile from) { - if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this)) + if (_isRewardItem && !RewardSystem.CheckIsUsableBy(from, this)) { return; } @@ -158,34 +147,16 @@ public class BannerDeed : Item, IRewardItem } } - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.WriteEncodedInt(0); // version - - writer.Write(m_IsRewardItem); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadEncodedInt(); - - m_IsRewardItem = reader.ReadBool(); - } - private class InternalGump : Gump { public const int Start = 0x15AE; public const int End = 0x15F4; - private readonly BannerDeed m_Banner; + private readonly BannerDeed _banner; public InternalGump(BannerDeed banner) : base(100, 200) { - m_Banner = banner; + _banner = banner; Closable = true; Disposable = true; @@ -224,7 +195,7 @@ public class BannerDeed : Item, IRewardItem public override void OnResponse(NetState sender, RelayInfo info) { - if (m_Banner?.Deleted != false) + if (_banner?.Deleted != false) { return; } @@ -237,93 +208,89 @@ public class BannerDeed : Item, IRewardItem } m.SendLocalizedMessage(1042037); // Where would you like to place this banner? - m.Target = new InternalTarget(m_Banner, info.ButtonID); + m.Target = new InternalTarget(_banner, info.ButtonID); } } private class InternalTarget : Target { - private readonly BannerDeed m_Banner; - private readonly int m_ItemID; + private readonly BannerDeed _banner; + private readonly int _itemID; public InternalTarget(BannerDeed banner, int itemID) : base(-1, true, TargetFlags.None) { - m_Banner = banner; - m_ItemID = itemID; + _banner = banner; + _itemID = itemID; } protected override void OnTarget(Mobile from, object targeted) { - if (m_Banner?.Deleted != false) + if (_banner?.Deleted != false) { return; } - if (m_Banner.IsChildOf(from.Backpack)) + if (!_banner.IsChildOf(from.Backpack)) { - var house = BaseHouse.FindHouseAt(from); + from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it. + return; + } - if (house?.IsOwner(from) == true) - { - var p = targeted as IPoint3D; - var map = from.Map; + var house = BaseHouse.FindHouseAt(from); - if (p == null || map == null) - { - return; - } + if (house?.IsOwner(from) != true) + { + from.SendLocalizedMessage(502092); // You must be in your house to do this. + return; + } - var p3d = new Point3D(p); - var id = TileData.ItemTable[m_ItemID & TileData.MaxItemValue]; + var p = targeted as IPoint3D; + var map = from.Map; - if (map.CanFit(p3d, id.Height)) - { - house = BaseHouse.FindHouseAt(p3d, map, id.Height); + if (p == null || map == null) + { + return; + } - if (house?.IsOwner(from) == true) - { - var north = BaseAddon.IsWall(p3d.X, p3d.Y - 1, p3d.Z, map); - var west = BaseAddon.IsWall(p3d.X - 1, p3d.Y, p3d.Z, map); + var p3d = new Point3D(p); + var id = TileData.ItemTable[_itemID & TileData.MaxItemValue]; - if (north && west) - { - from.CloseGump(); - from.SendGump(new FacingGump(m_Banner, m_ItemID, p3d, house)); - } - else if (north || west) - { - var banner = new Banner(m_ItemID + (west ? 0 : 1)); + if (!map.CanFit(p3d, id.Height)) + { + from.SendLocalizedMessage(500269); // You cannot build that there. + return; + } - house.Addons.Add(banner); + house = BaseHouse.FindHouseAt(p3d, map, id.Height); - banner.IsRewardItem = m_Banner.IsRewardItem; - banner.MoveToWorld(p3d, map); + if (house?.IsOwner(from) != true) + { + from.SendLocalizedMessage(1042036); // That location is not in your house. + return; + } - m_Banner.Delete(); - } - else - { - from.SendLocalizedMessage(1042039); // The banner must be placed next to a wall. - } - } - else - { - from.SendLocalizedMessage(1042036); // That location is not in your house. - } - } - else - { - from.SendLocalizedMessage(500269); // You cannot build that there. - } - } - else - { - from.SendLocalizedMessage(502092); // You must be in your house to do this. - } + var north = BaseAddon.IsWall(p3d.X, p3d.Y - 1, p3d.Z, map); + var west = BaseAddon.IsWall(p3d.X - 1, p3d.Y, p3d.Z, map); + + if (north && west) + { + from.CloseGump(); + from.SendGump(new FacingGump(_banner, _itemID, p3d, house)); + } + else if (north || west) + { + var banner = new Banner(_itemID + (west ? 0 : 1)); + + house.Addons.Add(banner); + + banner.IsRewardItem = _banner.IsRewardItem; + banner.MoveToWorld(p3d, map); + + _banner.Delete(); } else { - from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it. + from.SendLocalizedMessage(1042039); // The banner must be placed next to a wall. } } diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs b/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs index 347b04bdb..cc43f570b 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs @@ -47,10 +47,6 @@ public partial class StoneAnkh : BaseAddon, IRewardItem } } - public StoneAnkh(Serial serial) : base(serial) - { - } - public override BaseAddonDeed Deed => new StoneAnkhDeed { diff --git a/Projects/UOContent/Migrations/Server.Items.BannerDeed.v0.json b/Projects/UOContent/Migrations/Server.Items.BannerDeed.v0.json new file mode 100644 index 000000000..c29e12ff3 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BannerDeed.v0.json @@ -0,0 +1,14 @@ +{ + "version": 0, + "type": "Server.Items.BannerDeed", + "properties": [ + { + "name": "IsRewardItem", + "type": "bool", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BlueSoulstone.v0.json b/Projects/UOContent/Migrations/Server.Items.BlueSoulstone.v0.json new file mode 100644 index 000000000..8f8bd7631 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BlueSoulstone.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BlueSoulstone" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.HeritageToken.v0.json b/Projects/UOContent/Migrations/Server.Items.HeritageToken.v0.json new file mode 100644 index 000000000..56cfb5db3 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.HeritageToken.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.HeritageToken" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.MiniHouseAddon.v1.json b/Projects/UOContent/Migrations/Server.Items.MiniHouseAddon.v1.json new file mode 100644 index 000000000..1c0717ffe --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.MiniHouseAddon.v1.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "type": "Server.Items.MiniHouseAddon", + "properties": [ + { + "name": "Type", + "type": "Server.Items.MiniHouseType", + "rule": "EnumMigrationRule" + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.MiniHouseDeed.v1.json b/Projects/UOContent/Migrations/Server.Items.MiniHouseDeed.v1.json new file mode 100644 index 000000000..2e9054a5e --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.MiniHouseDeed.v1.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "type": "Server.Items.MiniHouseDeed", + "properties": [ + { + "name": "Type", + "type": "Server.Items.MiniHouseType", + "rule": "EnumMigrationRule" + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.MonsterStatuette.v0.json b/Projects/UOContent/Migrations/Server.Items.MonsterStatuette.v0.json new file mode 100644 index 000000000..75fd09d0f --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.MonsterStatuette.v0.json @@ -0,0 +1,27 @@ +{ + "version": 0, + "type": "Server.Items.MonsterStatuette", + "properties": [ + { + "name": "Type", + "type": "Server.Items.MonsterStatuetteType", + "rule": "EnumMigrationRule" + }, + { + "name": "TurnedOn", + "type": "bool", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "IsRewardItem", + "type": "bool", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.RedSoulstone.v0.json b/Projects/UOContent/Migrations/Server.Items.RedSoulstone.v0.json new file mode 100644 index 000000000..f31845e3c --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.RedSoulstone.v0.json @@ -0,0 +1,14 @@ +{ + "version": 0, + "type": "Server.Items.RedSoulstone", + "properties": [ + { + "name": "IsRewardItem", + "type": "bool", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.RewardCake.v0.json b/Projects/UOContent/Migrations/Server.Items.RewardCake.v0.json new file mode 100644 index 000000000..61b662ec5 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.RewardCake.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.RewardCake" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.SoulStone.v4.json b/Projects/UOContent/Migrations/Server.Items.SoulStone.v4.json new file mode 100644 index 000000000..5f3eb85ce --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.SoulStone.v4.json @@ -0,0 +1,56 @@ +{ + "version": 4, + "type": "Server.Items.SoulStone", + "properties": [ + { + "name": "LastUserName", + "type": "string", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "Level", + "type": "Server.Multis.SecureLevel", + "rule": "EnumMigrationRule" + }, + { + "name": "ActiveItemID", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "InactiveItemID", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "Account", + "type": "string", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "Skill", + "type": "Server.SkillName", + "rule": "EnumMigrationRule" + }, + { + "name": "SkillValue", + "type": "double", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.SoulstoneFragment.v0.json b/Projects/UOContent/Migrations/Server.Items.SoulstoneFragment.v0.json new file mode 100644 index 000000000..a26426376 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.SoulstoneFragment.v0.json @@ -0,0 +1,14 @@ +{ + "version": 0, + "type": "Server.Items.SoulstoneFragment", + "properties": [ + { + "name": "UsesRemaining", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "EncodedInt" + ] + } + ] +} \ No newline at end of file