From 6f023acd1d24dd15b8244246191db56ea6981367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sun, 2 Aug 2020 23:49:21 -0700 Subject: [PATCH] ignore fargoth when his quest isn't done --- MWSE/mods/celediel/NPCsGoHome/config.lua | 3 +- MWSE/mods/celediel/NPCsGoHome/main.lua | 40 ++++++++++++++++++------ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/config.lua b/MWSE/mods/celediel/NPCsGoHome/config.lua index b8723eb..74d4655 100644 --- a/MWSE/mods/celediel/NPCsGoHome/config.lua +++ b/MWSE/mods/celediel/NPCsGoHome/config.lua @@ -7,10 +7,9 @@ local defaultConfig = { disableInteraction = true, timerInterval = 7, ignored = { - ["fargoth"] = true, ["Balmora, Caius Cosades' House"] = true, ["Publican"] = true, - ["Healer Service"] = true, + -- ["Healer Service"] = true, }, worstWeather = tes3.weather.thunder, keepBadWeatherNPCs = true, diff --git a/MWSE/mods/celediel/NPCsGoHome/main.lua b/MWSE/mods/celediel/NPCsGoHome/main.lua index 0feef4f..eb40d3f 100644 --- a/MWSE/mods/celediel/NPCsGoHome/main.lua +++ b/MWSE/mods/celediel/NPCsGoHome/main.lua @@ -200,13 +200,33 @@ end -- {{{ checks +local function fargothCheck() + --[[ + ID: MS_Lookout + index Finishes Entry + 10 Hrisskar Flat-Foot asked me to do him a favor. He believes that + Fargoth has been hiding money from the Imperials, and he'd like to + know where it's gone. If I will work for him, he will give me a share + of the bounty. + 20 I've agreed to help Hrisskar find the money that Fargoth has been + hiding away. I am supposed to keep an eye on him from atop the + lighthouse in town, and watch where he goes. Hrisskar believes I + should watch him at night. I'm not supposed to approach him at any + time. I should then retrace his footsteps and find out where he's + hidden the money. When I've found it, I should report back to + Hrisskar. + 30 ☑ I've decided not to help Hrisskar. + 40 I've found Fargoth's hidden stash. He keeps it in a hollow + treestump in a muck pond in town. + 100 ☑ Hrisskar was grateful that I found the money that Fargoth had been + hiding. He rewarded me with some gold, and told me I could keep + anything else I found in the bag besides the money he wanted. + ]] + return tes3.getJournalIndex("MS_Lookout") >= 30 +end + local function isIgnoredNPC(npc) - local obj - if npc.object.baseObject then - obj = npc.object.baseObject - else - obj = npc.object - end + local obj = npc.object.baseObject and npc.object.baseObject or npc.object -- ignore dead, attack on sight NPCs, and vampires local isDead = false @@ -218,20 +238,22 @@ local function isIgnoredNPC(npc) isVampire = tes3.isAffectedBy({reference = npc, effect = tes3.effect.vampirism}) end - -- local isVampire = mwscript.getSpellEffects({reference = npc, spell = "vampire sun damage"}) + local isFargothDone = obj.id == "fargoth" and fargothCheck() or false -- todo: non mwscript version of this local isWerewolf = mwscript.getSpellEffects({reference = npc, spell = "werewolf vision"}) + -- local isVampire = mwscript.getSpellEffects({reference = npc, spell = "vampire sun damage"}) log(common.logLevels.large, ("Checking NPC:%s (%s or %s): id blocked:%s, mod blocked:%s " .. "guard:%s dead:%s vampire:%s werewolf:%s dreamer:%s follower:%s hostile:%s"), obj.name, npc.object.id, npc.object.baseObject and npc.object.baseObject.id or "nil", config.ignored[obj.id], - config.ignored[obj.sourceMod], npc.object.isGuard, isDead, isVampire, isWerewolf, + config.ignored[obj.sourceMod], obj.isGuard, isDead, isVampire, isWerewolf, (obj.class and obj.class.id == "Dreamers"), followers[obj.id], isHostile) return config.ignored[obj.id] or -- config.ignored[obj.sourceMod] or -- - npc.object.isGuard or -- + obj.isGuard or -- + isFargothDone or -- isDead or -- don't move dead NPCS isHostile or -- followers[obj.id] or -- ignore followers