Skip to content

Commit

Permalink
Allow farmers to do gardening, not just herbalists
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrim committed Aug 29, 2023
1 parent 42a19b6 commit bded550
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions housing/construction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ local function craftItem(user, product, skill)

end

local function allSmithingCountedAsOne(user, skill, productLevel, hasSkillLevel, languageAppropriateSkillName)
local function multiSkillsThatAreCountedAsOne(user, skill, productLevel, hasSkillLevel, languageAppropriateSkillName)

local playerIsGerman = user:getPlayerLanguage() == Player.german

if skill.name == "blacksmithing" then

Expand All @@ -450,13 +452,29 @@ local function allSmithingCountedAsOne(user, skill, productLevel, hasSkillLevel,
hasSkillLevel = true
end

if user:getPlayerLanguage() == Player.german then
if playerIsGerman then
languageAppropriateSkillName = "GERMAN TRANSLATION"
else
languageAppropriateSkillName = "blacksmithing, finesmithing or armouring"
end
end

if skill.name == "herblore" then

local farming = loadSkill(user, "farming")

if productLevel <= farming then
hasSkillLevel = true
end

if playerIsGerman then
languageAppropriateSkillName = "GERMAN TRANSLATION"
else
languageAppropriateSkillName = "herblore or farming"
end
end


return hasSkillLevel, languageAppropriateSkillName

end
Expand Down Expand Up @@ -499,10 +517,10 @@ function M.showDialog(user, skillName, carpentryEstateCatalogue)

local languageAppropriateSkillName = user:getSkillName(Character[skill.name])

hasSkillLevel, languageAppropriateSkillName = allSmithingCountedAsOne(user, skill, product.level, hasSkillLevel, languageAppropriateSkillName)
hasSkillLevel, languageAppropriateSkillName = multiSkillsThatAreCountedAsOne(user, skill, product.level, hasSkillLevel, languageAppropriateSkillName)

if not hasSkillLevel then
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.")
common.HighInformNLS(user, "GERMAN TRANSLATION", "You need level "..product.level.." in "..languageAppropriateSkillName.." to do that. You could always seek out someone else to do it for you.")
return false
end

Expand Down

0 comments on commit bded550

Please sign in to comment.