mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Codex.git
synced 2026-11-03 21:57:02 +00:00
0.1.223: Start-Wegenetz aus Karten-Rohdaten (A* auf Raster), Questorte als Rueckfall
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
a69ac8131e
commit
c045446264
@@ -706,3 +706,33 @@ function Seed.Count()
|
||||
end
|
||||
return n(S.q), n(S.u), n(S.o), n(S.i)
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Orte von Geber und Abgabe aus der mitgelieferten Liste (Codex.QuestSeed, nur Rueckfall: eigene Daten gehen vor)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
local spotCache = {}
|
||||
local function SpotRef(a, b)
|
||||
local m, x, y = tonumber(a[2]), tonumber(a[3]), tonumber(a[4])
|
||||
if not m or not x or not y then return nil end
|
||||
return { n = (a[1] ~= "" and a[1]) or nil, m = m, x = x / 1000, y = y / 1000, seed = true }
|
||||
end
|
||||
|
||||
-- Rueckgabe: Geber, Abgabe (je { n, m, x, y } oder nil)
|
||||
function Codex.QuestSpot(id)
|
||||
local c = spotCache[id]
|
||||
if c == nil then
|
||||
local raw = Codex.QuestSeed and Codex.QuestSeed[id]
|
||||
if raw then
|
||||
local f = {}
|
||||
for part in string.gfind and string.gfind(raw .. "|", "([^|]*)|") or string.gmatch(raw .. "|", "([^|]*)|") do f[#f + 1] = part end
|
||||
c = { SpotRef({ f[1], f[2], f[3], f[4] }, nil), SpotRef({ f[5], f[6], f[7], f[8] }, nil) }
|
||||
c.n = true
|
||||
else
|
||||
c = false
|
||||
end
|
||||
spotCache[id] = c
|
||||
end
|
||||
if not c then return nil, nil end
|
||||
return c[1], c[2]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user