jerome@65: local dump = require 'dump' jerome@65: local path = require 'path' jerome@65: local registry = require 'registry' jerome@65: local casc = require 'casc' jerome@65: local dbc = require 'casc.dbc' jerome@65: jerome@65: jerome@65: local root = jerome@65: registry.HKLM.SOFTWARE['Blizzard Entertainment']['World of Warcraft'] 'InstallPath' or jerome@65: registry.HKLM.SOFTWARE.Wow6432Node['Blizzard Entertainment']['World of Warcraft'] 'InstallPath' jerome@65: root = path.split(root) jerome@65: jerome@65: -- load local build config jerome@65: local buildKey,cdnBase,cdnKey = assert(casc.localbuild(tostring(root / '.build.info'), casc.selectActiveBuild)) jerome@65: jerome@65: -- open the CASC jerome@65: local handle = casc.open(tostring(root / 'Data'), buildKey, cdnBase, cdnKey) jerome@65: jerome@65: -- read the mount database jerome@65: local Mount = handle:readFile("DBFilesClient/Mount.db2") jerome@65: jerome@65: -- create a mapping from mount ID to spell ID jerome@65: local map = {} jerome@65: for _,mount,spell in dbc.rows(Mount, 'u7.u.') do jerome@65: map[mount] = spell jerome@65: end jerome@65: jerome@65: -- save jerome@65: local file = assert(io.open("../MountMap.lua", 'wb')) jerome@65: assert(file:write("-- this is a generated file, do not edit, see support/gen-mount-db.lua\n")) jerome@65: assert(file:write("CyborgMMO_MountMap = "..dump.tostring(map).."\n")) jerome@65: assert(file:write("CyborgMMO_LocalMountMap = {}\n")) jerome@65: assert(file:close()) jerome@65: