diff --git a/MWSE/mods/celediel/NPCsGoHome/config.lua b/MWSE/mods/celediel/NPCsGoHome/config.lua index ffc8e0d..fd03fa7 100644 --- a/MWSE/mods/celediel/NPCsGoHome/config.lua +++ b/MWSE/mods/celediel/NPCsGoHome/config.lua @@ -29,6 +29,7 @@ local defaultConfig = { minimumOccupancy = 4, homelessWanderersToPublicHouses = false, -- move NPCs to public houses if they don't have a home disableInteraction = true, + minimumTrespassDisposition = 50, -- if player's disposition with NPC is less than this value, interaction is disabled -- door settings lockDoors = true, waistWorks = common.waist.interior, diff --git a/MWSE/mods/celediel/NPCsGoHome/main.lua b/MWSE/mods/celediel/NPCsGoHome/main.lua index 9b81b1e..eee6b2e 100644 --- a/MWSE/mods/celediel/NPCsGoHome/main.lua +++ b/MWSE/mods/celediel/NPCsGoHome/main.lua @@ -122,9 +122,14 @@ local function onActivated(e) return end - if tes3.player.data.NPCsGoHome.intruding and not checks.isIgnoredNPC(e.target) then - tes3.messageBox(string.format("%s: Get out before I call the guards!", e.target.object.name)) - return false + local npc = e.target + + if tes3.player.data.NPCsGoHome.intruding and not checks.isIgnoredNPC(npc) then + if npc.disposition and npc.disposition <= config.minimumTrespassDisposition then + log(common.logLevels.medium, "Disabling dialogue with %s because trespass and disposition:%s", npc.object.name, npc.disposition) + tes3.messageBox(string.format("%s: Get out before I call the guards!", npc.object.name)) + return false + end end end diff --git a/MWSE/mods/celediel/NPCsGoHome/mcm.lua b/MWSE/mods/celediel/NPCsGoHome/mcm.lua index 0cfc535..440e4ca 100644 --- a/MWSE/mods/celediel/NPCsGoHome/mcm.lua +++ b/MWSE/mods/celediel/NPCsGoHome/mcm.lua @@ -64,6 +64,17 @@ category:createYesNoButton({ variable = createTableVar("disableInteraction") }) +category:createSlider({ + label = "NPC Disposition at which dialogue is prevented.", + description = "If the player's disposition with an NPC is less than this value, dialogue will be prevented " .. + "(if configured to do so). Set to 0 to disable disposition checking, and disable dialogue for all NPCs when applicable.", + min = 0, + max = 100, + step = 5, + jump = 10, + variable = createTableVar("minimumTrespassDisposition "), +}) + category:createDropdown({ label = "Treat Canton waistworks as exteriors, public spaces, or neither", description = "If canton cells are treated as exterior, inside NPCs will be disabled, and doors will be locked.\n" ..