From a1e0786312896a696eaa1645a155244377c94276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Thu, 6 Aug 2020 23:19:12 -0700 Subject: [PATCH] WIP support for some inn/club mods --- MWSE/mods/celediel/NPCsGoHome/main.lua | 29 +++++++++++++++++---- MWSE/mods/celediel/NPCsGoHome/positions.lua | 13 +++++++-- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/main.lua b/MWSE/mods/celediel/NPCsGoHome/main.lua index f174e38..6a02454 100644 --- a/MWSE/mods/celediel/NPCsGoHome/main.lua +++ b/MWSE/mods/celediel/NPCsGoHome/main.lua @@ -36,6 +36,22 @@ local contextualNPCs = {"^AM_"} -- {{{ helper functions local function log(level, ...) if config.logLevel >= level then common.log(...) end end +local function checkModdedCell(cellId) + local id + + if cellId == "Balmora, South Wall Cornerclub" and tes3.isModActive("South Wall.ESP") then + id = "Balmora, South Wall Den Of Iniquity" + elseif cellId == "Balmora, Eight Plates" and tes3.isModActive("Eight Plates.esp") then + id = "Balmora, Seedy Eight Plates" + elseif cellId == "Hla Oad, Fatleg's Drop Off" and tes3.isModActive("Clean DR115_TheDropoff_HlaOadDocks.ESP") then + id = "Hla Oad, The Drop Off" + else + id = cellId + end + + return id +end + -- {{{ npc evaluators -- NPCs barter gold + value of all inventory items @@ -129,16 +145,19 @@ local function createHomedNPCTableEntry(npc, home, startingPlace, isHome) local pickedPosition, pickedOrientation, p, o + -- mod support for different positions in cells + local id = checkModdedCell(home.id) + if isHome and positions.npcs[npc.object.name] then p = positions.npcs[npc.object.name].position o = positions.npcs[npc.object.name].orientation pickedPosition = positions.npcs[npc.object.name] and tes3vector3.new(p[1], p[2], p[3]) or zeroVector:copy() pickedOrientation = positions.npcs[npc.object.name] and tes3vector3.new(o[1], o[2], o[3]) or zeroVector:copy() - elseif positions.cells[home.id] then - p = table.choice(positions.cells[home.id]).position - o = table.choice(positions.cells[home.id]).orientation - pickedPosition = positions.cells[home.id] and tes3vector3.new(p[1], p[2], p[3]) or zeroVector:copy() - pickedOrientation = positions.cells[home.id] and tes3vector3.new(o[1], o[2], o[3]) or zeroVector:copy() + elseif positions.cells[id] then + p = table.choice(positions.cells[id]).position + o = table.choice(positions.cells[id]).orientation + pickedPosition = positions.cells[id] and tes3vector3.new(p[1], p[2], p[3]) or zeroVector:copy() + pickedOrientation = positions.cells[id] and tes3vector3.new(o[1], o[2], o[3]) or zeroVector:copy() else pickedPosition = zeroVector:copy() pickedOrientation = zeroVector:copy() diff --git a/MWSE/mods/celediel/NPCsGoHome/positions.lua b/MWSE/mods/celediel/NPCsGoHome/positions.lua index 4af7734..6b15e37 100644 --- a/MWSE/mods/celediel/NPCsGoHome/positions.lua +++ b/MWSE/mods/celediel/NPCsGoHome/positions.lua @@ -64,7 +64,7 @@ return { {position = {337.37, 737.83, -249.00}, orientation = {0.00, 0.00, 3.09}} }, -- todo: add support for this: - ["Balmora, South Wall Cornerclub (mod)"] = { + ["Balmora, South Wall Den Of Iniquity"] = { {position = {239.72, 589.39, -249.00}, orientation = {0.00, 0.00, -2.86}}, {position = {241.20, 588.73, -249.00}, orientation = {0.00, 0.00, -1.62}}, {position = {245.71, 471.54, -249.00}, orientation = {0.00, 0.00, -1.52}}, @@ -272,7 +272,16 @@ return { {position = {-204.03, -281.63, 132.37}, orientation = {0.00, 0.00, -1.73}}, {position = {-192.90, -195.83, 132.37}, orientation = {0.00, 0.00, -1.66}}, {position = {-104.57, -418.53, 131.84}, orientation = {0.00, 0.00, 3.06}} - } + }, + -- }}} + + -- {{{ Hla Oad + ["Hla Oad, Fatleg's Drop Off"] = { + + }, + ["Hla Oad, The Drop Off"] = { + + }, -- }}} } }