Files
coa-exporter/CoaExporter/Collectors/MysticScrollProbe.lua
T
florian.berthold 2b97a68317 Initial CoaExporter: merge AscensionExporter + CoA skill/talent dumpers
Folds three previously-separate Lua addons into one for guild-member use:

  - ascension-char-exporter (per-character JSON/Wiki.js Markdown via /ascx)
  - CoA_SkillExporter      (skills/dispels/passives catalog via /skilldump)
  - CoA_TalentExporter     (talent-tree catalog via /talentdumpall)

The two CoA catalog dumpers were ~90% identical entry-walkers. Pulled the
shared C_CharacterAdvancement.GetAllEntries() loop into Catalogs/Common.lua
and have Skills.lua / Talents.lua register collectors that share a single
scan pass (so /coae catalog all walks the entry list once, not twice).

Per-character collectors (Talents, Gear, Enchants, MysticScrolls,
MysticScrollProbe) and the AtlasLootAscension-derived ScrollCatalog data
are kept verbatim, just rebranded.

Slash interface:

  /coae export {all|talents|gear|enchants|mdgear|mdenchants|md}
  /coae catalog {all|skills|talents|dispels [class]|passives [class]|status}
  /coae scrolls {scan|export|reset|status}
  /coae sv on|off | debug | help

Aliases: /coaexp, /ascx, /asxc, plus legacy /skilldump /talentdumpall
/dispels /passives that map to the catalog subcommands.

SavedVariables: CoaExporterSaved, CoaExporterConfig, CoaExporterScrollCache,
CoaExporterCatalog (skills/dispels/levelPassives/talents/_meta).
2026-05-07 10:43:16 +02:00

117 lines
3.8 KiB
Lua

-- CoaExporter - Mystic Scroll API probe + deep dump
-- Purpose: discover what data we can extract about mystic enchants on
-- Ascension's 3.3.5 client. Intentionally over-probes several API
-- signatures; failures are captured so we can see what's available.
CoaExporter = _G.CoaExporter or {}
_G.CoaExporter = CoaExporter
local AE = CoaExporter
local scanner
local function EnsureScanner()
if not scanner then
scanner = CreateFrame("GameTooltip", "CoaExpScrollProbe", nil, "GameTooltipTemplate")
scanner:SetOwner(WorldFrame, "ANCHOR_NONE")
end
return scanner
end
local function TipToLines(tooltipSetup)
local s = EnsureScanner()
s:ClearLines()
tooltipSetup(s)
local out = {}
for i = 1, s:NumLines() do
local left = _G["CoaExpScrollProbeTextLeft" .. i]
if left then
local t = left:GetText()
if t and t ~= "" then table.insert(out, t) end
end
end
return out
end
local function TryCall(fn, ...)
local ok, a, b, c, d, e, f, g = pcall(fn, ...)
if ok then return true, a, b, c, d, e, f, g end
return false, a
end
function AE.CollectMysticScrollProbe()
local result = {
api_surface = {},
slots = {},
enchants = {},
errors = {},
}
if C_MysticEnchant then
for k, v in pairs(C_MysticEnchant) do
if type(v) == "function" then
table.insert(result.api_surface, "C_MysticEnchant." .. k)
end
end
table.sort(result.api_surface)
else
table.insert(result.errors, "C_MysticEnchant global is nil")
end
local numSlots = NUM_MYSTIC_ENCHANT_SLOTS or 12
for i = 1, numSlots do
local slotData = { slot = i }
if C_MysticEnchant and C_MysticEnchant.GetAppliedEnchant then
local ok, spellID = TryCall(C_MysticEnchant.GetAppliedEnchant, "player", i)
if ok and spellID and spellID > 0 then
slotData.spellID = spellID
local name, _, icon = GetSpellInfo(spellID)
slotData.name = name
slotData.icon = icon and icon:match("Interface\\Icons\\(.+)"):lower() or nil
slotData.tooltip_lines = TipToLines(function(t)
t:SetHyperlink("spell:" .. spellID)
end)
end
end
for _, m in ipairs({ "GetSlotInfo", "GetSlotTier", "GetSlotQuality",
"GetEnchantSlotInfo", "GetSlotType" }) do
if C_MysticEnchant and C_MysticEnchant[m] then
local ok, r1, r2, r3 = TryCall(C_MysticEnchant[m], i)
if ok then
slotData[m] = { r1, r2, r3 }
end
end
end
table.insert(result.slots, slotData)
end
if C_MysticEnchant then
for _, fname in ipairs({
"GetKnownEnchants", "GetUnlockedEnchants", "GetAllEnchants",
"GetEnchants", "GetLearnedEnchants", "GetAvailableEnchants" }) do
if C_MysticEnchant[fname] then
local ok, list = TryCall(C_MysticEnchant[fname], "player")
if ok and type(list) == "table" then
result[fname] = list
end
end
end
end
for _, sd in ipairs(result.slots) do
if sd.spellID and C_MysticEnchant then
for _, m in ipairs({ "GetEnchantInfo", "GetEnchantQuality",
"GetEnchantTier", "GetEnchantDescription" }) do
if C_MysticEnchant[m] then
local ok, r1, r2, r3 = TryCall(C_MysticEnchant[m], sd.spellID)
if ok then
sd[m] = { r1, r2, r3 }
end
end
end
end
end
return result
end
AE._loadedMysticScrollProbe = true