From 38dd2a08e67e275b9bf70d427e4ab4abd9269855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Thu, 30 Jul 2020 00:12:37 -0700 Subject: [PATCH] add npc/creature ignore list --- MWSE/mods/celediel/MoreAttentiveGuards/combat.lua | 5 +++++ MWSE/mods/celediel/MoreAttentiveGuards/config.lua | 3 ++- MWSE/mods/celediel/MoreAttentiveGuards/mcm.lua | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/MWSE/mods/celediel/MoreAttentiveGuards/combat.lua b/MWSE/mods/celediel/MoreAttentiveGuards/combat.lua index 5bba2c1..7154d1f 100644 --- a/MWSE/mods/celediel/MoreAttentiveGuards/combat.lua +++ b/MWSE/mods/celediel/MoreAttentiveGuards/combat.lua @@ -62,6 +62,11 @@ this.onCombatStart = function(e) return end + if config.ignored[e.actor.object.id] or config.ignored[e.actor.object.baseObject.id] then + log("Ignored NPC or creature detected, not helping.") + return + end + if isFriendlyActor(e.actor) then log("Friendly actor, not helping.") return diff --git a/MWSE/mods/celediel/MoreAttentiveGuards/config.lua b/MWSE/mods/celediel/MoreAttentiveGuards/config.lua index 482df06..8ba145d 100644 --- a/MWSE/mods/celediel/MoreAttentiveGuards/config.lua +++ b/MWSE/mods/celediel/MoreAttentiveGuards/config.lua @@ -15,7 +15,8 @@ this.default = { -- combat combatEnable = true, combatDistance = 850, - combatDialogue = true + combatDialogue = true, + ignored = {} } function this.getConfig() diff --git a/MWSE/mods/celediel/MoreAttentiveGuards/mcm.lua b/MWSE/mods/celediel/MoreAttentiveGuards/mcm.lua index 3bae032..a815a63 100644 --- a/MWSE/mods/celediel/MoreAttentiveGuards/mcm.lua +++ b/MWSE/mods/celediel/MoreAttentiveGuards/mcm.lua @@ -116,6 +116,17 @@ combatCategory:createYesNoButton({ -- }}} +template:createExclusionsPage({ + label = "Ignored NPCs/Creatures", + description = "Guards will not respond to these NPCs or creatures attacking the player.", + showAllBlocked = false, + filters = { + {label = "NPCs", type = "Object", objectType = tes3.objectType.npc}, + {label = "Creatures", type = "Object", objectType = tes3.objectType.creature} + }, + variable = createTableVar("ignored") +}) + return template -- vim:fdm=marker