From 42a19b6b831a5af38a2d9e4aaddcd15f35ea5983 Mon Sep 17 00:00:00 2001 From: brightrim Date: Tue, 29 Aug 2023 20:42:36 +0200 Subject: [PATCH] Unite all smithed skills and goods into one category --- housing/construction.lua | 29 ++++++++++++++++++++++++++++- housing/itemList.lua | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/housing/construction.lua b/housing/construction.lua index 6391b40c7..4189d8ec7 100644 --- a/housing/construction.lua +++ b/housing/construction.lua @@ -438,6 +438,29 @@ local function craftItem(user, product, skill) end +local function allSmithingCountedAsOne(user, skill, productLevel, hasSkillLevel, languageAppropriateSkillName) + + if skill.name == "blacksmithing" then + + local finesmithing = loadSkill(user, "finesmithing") + + local armourer = loadSkill(user, "armourer") + + if productLevel <= armourer or productLevel <= finesmithing then + hasSkillLevel = true + end + + if user:getPlayerLanguage() == Player.german then + languageAppropriateSkillName = "GERMAN TRANSLATION" + else + languageAppropriateSkillName = "blacksmithing, finesmithing or armouring" + end + end + + return hasSkillLevel, languageAppropriateSkillName + +end + function M.showDialog(user, skillName, carpentryEstateCatalogue) local skill = {} @@ -474,8 +497,12 @@ function M.showDialog(user, skillName, carpentryEstateCatalogue) local frontPos = common.GetFrontPosition(user) + local languageAppropriateSkillName = user:getSkillName(Character[skill.name]) + + hasSkillLevel, languageAppropriateSkillName = allSmithingCountedAsOne(user, skill, product.level, hasSkillLevel, languageAppropriateSkillName) + if not hasSkillLevel then - common.HighInformNLS(user, "GERMAN TRANSLATION", "You need level "..product.level.." in "..user:getSkillName(Character[skill.name]).." to craft that. You could always seek out someone else to build it for you.") + common.HighInformNLS(user, "GERMAN TRANSLATION", "You need level "..product.level.." in "..languageAppropriateSkillName.." to craft that. You could always seek out someone else to build it for you.") return false end diff --git a/housing/itemList.lua b/housing/itemList.lua index f28dfd5aa..37beed230 100644 --- a/housing/itemList.lua +++ b/housing/itemList.lua @@ -1133,7 +1133,7 @@ table.insert(M.categories, {categoryEn = "Mirrors", categoryDe = "Spiegel"}) M.skills = {} table.insert(M.skills, {name = "carpentry", displayDe = "Schreinern", displayEn = "Carpentry", sfx = 14, level = 1 }) table.insert(M.skills, {name = "tailoring", displayDe = "Schneidern", displayEn = "Tailoring", sfx = 0, level = 1 }) -table.insert(M.skills, {name = "blacksmithing", displayDe = "Schmieden", displayEn = "Blacksmithing", sfx = 8, level = 1 }) +table.insert(M.skills, {name = "blacksmithing", displayDe = "Schmieden", displayEn = "Smithing", sfx = 8, level = 1 }) table.insert(M.skills, {name = "mining", displayDe = "Steinmetzkunst", displayEn = "Stone Masonry", sfx = 8, level = 1 }) table.insert(M.skills, {name = "pottery", displayDe = "Maurern", displayEn = "Clay Masonry", sfx = 7, level = 1 }) table.insert(M.skills, {name = "digging", displayDe = "Graben", displayEn = "Digging", sfx = 0, level = 1, estate = true})