WIP support for some inn/club mods

This commit is contained in:
Lilian Jónsdóttir 2020-08-06 23:19:12 -07:00
parent 49788c98eb
commit a1e0786312
2 changed files with 35 additions and 7 deletions

View file

@ -36,6 +36,22 @@ local contextualNPCs = {"^AM_"}
-- {{{ helper functions -- {{{ helper functions
local function log(level, ...) if config.logLevel >= level then common.log(...) end end 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 -- {{{ npc evaluators
-- NPCs barter gold + value of all inventory items -- NPCs barter gold + value of all inventory items
@ -129,16 +145,19 @@ local function createHomedNPCTableEntry(npc, home, startingPlace, isHome)
local pickedPosition, pickedOrientation, p, o 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 if isHome and positions.npcs[npc.object.name] then
p = positions.npcs[npc.object.name].position p = positions.npcs[npc.object.name].position
o = positions.npcs[npc.object.name].orientation 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() 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() pickedOrientation = positions.npcs[npc.object.name] and tes3vector3.new(o[1], o[2], o[3]) or zeroVector:copy()
elseif positions.cells[home.id] then elseif positions.cells[id] then
p = table.choice(positions.cells[home.id]).position p = table.choice(positions.cells[id]).position
o = table.choice(positions.cells[home.id]).orientation o = table.choice(positions.cells[id]).orientation
pickedPosition = positions.cells[home.id] and tes3vector3.new(p[1], p[2], p[3]) or zeroVector:copy() pickedPosition = positions.cells[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() pickedOrientation = positions.cells[id] and tes3vector3.new(o[1], o[2], o[3]) or zeroVector:copy()
else else
pickedPosition = zeroVector:copy() pickedPosition = zeroVector:copy()
pickedOrientation = zeroVector:copy() pickedOrientation = zeroVector:copy()

View file

@ -64,7 +64,7 @@ return {
{position = {337.37, 737.83, -249.00}, orientation = {0.00, 0.00, 3.09}} {position = {337.37, 737.83, -249.00}, orientation = {0.00, 0.00, 3.09}}
}, },
-- todo: add support for this: -- 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 = {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 = {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}}, {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 = {-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 = {-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}} {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"] = {
},
-- }}} -- }}}
} }
} }