From d6823309d44ecde4735cd32f502246280fac9aae Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 29 Sep 2023 21:38:06 -0700 Subject: [PATCH] fix: Fixes missing inscription message (#1518) --- Projects/UOContent/Engines/Craft/Core/CraftItem.cs | 12 +++++++++--- Projects/UOContent/Engines/Craft/Core/CraftSystem.cs | 9 ++++++--- Projects/UOContent/Engines/Craft/DefInscription.cs | 6 +++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Projects/UOContent/Engines/Craft/Core/CraftItem.cs b/Projects/UOContent/Engines/Craft/Core/CraftItem.cs index f16bbed90..a7e4d9904 100644 --- a/Projects/UOContent/Engines/Craft/Core/CraftItem.cs +++ b/Projects/UOContent/Engines/Craft/Core/CraftItem.cs @@ -150,10 +150,16 @@ namespace Server.Engines.Craft public int Mana { get; set; } + public TextDefinition NeedManaLabel { get; set; } + public int Hits { get; set; } + public TextDefinition NeedHitsLabel { get; set; } + public int Stam { get; set; } + public TextDefinition NeedStamLabel { get; set; } + public bool UseSubRes2 { get; set; } public bool UseAllRes { get; set; } @@ -281,19 +287,19 @@ namespace Server.Engines.Craft { if (Hits > 0 && from.Hits < Hits) { - message = "You lack the required hit points to make that."; + message = NeedHitsLabel; return false; } if (Mana > 0 && from.Mana < Mana) { - message = "You lack the required mana to make that."; + message = NeedManaLabel; return false; } if (Stam > 0 && from.Stam < Stam) { - message = "You lack the required stamina to make that."; + message = NeedStamLabel; return false; } diff --git a/Projects/UOContent/Engines/Craft/Core/CraftSystem.cs b/Projects/UOContent/Engines/Craft/Core/CraftSystem.cs index feae132a6..1f4250bbb 100644 --- a/Projects/UOContent/Engines/Craft/Core/CraftSystem.cs +++ b/Projects/UOContent/Engines/Craft/Core/CraftSystem.cs @@ -202,19 +202,22 @@ namespace Server.Engines.Craft CraftItems[index].ItemHue = hue; } - public void SetManaReq(int index, int mana) + public void SetManaReq(int index, int mana, int cliloc = 0) { CraftItems[index].Mana = mana; + CraftItems[index].NeedManaLabel = TextDefinition.Of(cliloc, "You lack the required mana to make that."); } - public void SetStamReq(int index, int stam) + public void SetStamReq(int index, int stam, int cliloc = 0) { CraftItems[index].Stam = stam; + CraftItems[index].NeedStamLabel = TextDefinition.Of(cliloc, "You lack the required stamina to make that."); } - public void SetHitsReq(int index, int hits) + public void SetHitsReq(int index, int hits, int cliloc = 0) { CraftItems[index].Hits = hits; + CraftItems[index].NeedHitsLabel = TextDefinition.Of(cliloc, "You lack the required hit points to make that."); } public void SetUseAllRes(int index, bool useAll) diff --git a/Projects/UOContent/Engines/Craft/DefInscription.cs b/Projects/UOContent/Engines/Craft/DefInscription.cs index a65aebee5..c9fbe0eae 100644 --- a/Projects/UOContent/Engines/Craft/DefInscription.cs +++ b/Projects/UOContent/Engines/Craft/DefInscription.cs @@ -196,7 +196,7 @@ public class DefInscription : CraftSystem AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378); - SetManaReq(index, _mana); + SetManaReq(index, _mana, 1042403); } private void AddNecroSpell(int spell, int mana, double minSkill, Type type, params Type[] regs) @@ -219,7 +219,7 @@ public class DefInscription : CraftSystem } AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378); - SetManaReq(index, mana); + SetManaReq(index, mana, 1042403); } private void AddMysticismSpell(int spell, int mana, double minSkill, double maxSkill, Type type, params Type[] regs) @@ -242,7 +242,7 @@ public class DefInscription : CraftSystem } AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378); - SetManaReq(index, mana); + SetManaReq(index, mana, 1042403); } public override void InitCraftList()