Skip to content

Commit

Permalink
Unite all smithed skills and goods into one category
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrim committed Aug 29, 2023
1 parent c72e307 commit 42a19b6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
29 changes: 28 additions & 1 deletion housing/construction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion housing/itemList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 42a19b6

Please sign in to comment.