forked from phenom/healer-man
Release Healer Man 0.1.13
This commit is contained in:
1 parent
65e24f644e
commit
67d7a8ebe7
324 files changed
+917
-48
No files matched your search
@@ -42,6 +42,17 @@ export function parseDbc(buffer, name = "DBC") {
|
||||
return { name, buffer, recordCount, fieldCount, recordSize, stringSize, row };
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode the WotLK SpellVisualKit field boundary. Fields 3..14 are visual
|
||||
* effect-name IDs; field 15 is SoundID and must never be resolved as a model.
|
||||
*/
|
||||
export function decodeWotlkSpellVisualKitRow(row) {
|
||||
return {
|
||||
effects: Array.from({ length: 12 }, (_, offset) => row.uint(3 + offset)).filter(Boolean),
|
||||
soundId: row.uint(15),
|
||||
};
|
||||
}
|
||||
|
||||
const M2_VALUE_TYPES = {
|
||||
float32: { byteLength: 4, read: (buffer, offset) => buffer.readFloatLE(offset) },
|
||||
uint32: { byteLength: 4, read: (buffer, offset) => buffer.readUInt32LE(offset) },
|
||||
@@ -379,10 +390,7 @@ function buildWowEntries(source, requestedIds, tables) {
|
||||
casterImpact: row.uint(14), targetImpact: row.uint(15), instantArea: row.uint(23), impactArea: row.uint(24), persistentArea: row.uint(25),
|
||||
}));
|
||||
const kitsTable = parseDbc(tables.SpellVisualKit, `${source} SpellVisualKit.dbc`);
|
||||
const kits = tableById(kitsTable, (row) => ({
|
||||
effects: Array.from({ length: 13 }, (_, offset) => row.uint(3 + offset)).filter(Boolean),
|
||||
soundId: row.uint(16),
|
||||
}));
|
||||
const kits = tableById(kitsTable, decodeWotlkSpellVisualKitRow);
|
||||
const effectNames = tableById(parseDbc(tables.SpellVisualEffectName, `${source} SpellVisualEffectName.dbc`), (row) => ({
|
||||
name: row.string(1),
|
||||
model: row.string(2).replaceAll("\\", "/"),
|
||||
@@ -579,6 +587,9 @@ function extractedAscensionTables(spellPath, supportRoot, baseSoundEntries) {
|
||||
|
||||
function openedWowAudioArchives(dataRoot) {
|
||||
const names = [
|
||||
"enUS/patch-enUS-3.MPQ", "enUS/patch-enUS-2.MPQ", "enUS/patch-enUS-N.MPQ",
|
||||
"enUS/patch-enUS-M.MPQ", "enUS/patch-enUS.MPQ", "enUS/lichking-speech-enUS.MPQ",
|
||||
"enUS/expansion-speech-enUS.MPQ", "enUS/speech-enUS.MPQ", "enUS/locale-enUS.MPQ",
|
||||
"patch-3.MPQ", "patch-2.MPQ", "patch.MPQ", "Patch-B.MPQ", "patch-A.MPQ",
|
||||
"lichking.MPQ", "expansion.MPQ", "common-2.MPQ", "common.MPQ",
|
||||
];
|
||||
@@ -611,13 +622,22 @@ function packageAudioAssets(entries, options) {
|
||||
if (fs.existsSync(candidate)) buffer = fs.readFileSync(candidate);
|
||||
} else {
|
||||
const archiveName = sourcePath.replaceAll("/", "\\");
|
||||
for (const { archive } of archives) {
|
||||
try {
|
||||
buffer = archive.extractFile(archiveName);
|
||||
if (buffer?.length) break;
|
||||
} catch {
|
||||
// The source archive stack is sparse by design; continue to the base archives.
|
||||
// Some WotLK SoundEntries use a historical Creature/*VO directory while
|
||||
// the matching non-voice line remained in Creature/* in common.MPQ.
|
||||
const archiveNames = [...new Set([
|
||||
archiveName,
|
||||
archiveName.replace(/^(Sound\\Creature\\[^\\]+)VO\\/i, "$1\\"),
|
||||
])];
|
||||
for (const candidateName of archiveNames) {
|
||||
for (const { archive } of archives) {
|
||||
try {
|
||||
buffer = archive.extractFile(candidateName);
|
||||
if (buffer?.length) break;
|
||||
} catch {
|
||||
// The source archive stack is sparse by design; continue to the base archives.
|
||||
}
|
||||
}
|
||||
if (buffer?.length) break;
|
||||
}
|
||||
}
|
||||
sourceCache.set(cacheKey, buffer);
|
||||
|
||||
Reference in new issue
Block a user