Files
2026-11-23 03:28:32 +02:00

43 lines
3.0 KiB
Python

"""Mount space-bar sounds (owner 2026-11-23), on content 78fffb85.
Standing still + space on a mount plays special anim 94; its $FD1 event plays CreatureSoundFidget index 0.
- Horse set 65: fidget row 45026 730 (mhorsestand3a 'purr', 1.25 s) -> 729 (mhorseaggroa neigh, 1.65 s).
Horse mounts' anim 94 is 2.0 s.
- Drake set 508: the 1.25 s drakeaggro roar (4065) stopped long before the 5.33 s wing spread. New kit
1010600 = one native file 567347 event_deathwingattacks_roar_02.ogg (5.36 s); fidget row 65982 and
SoundStandID use it. SoundAggroID stays 4065 (combat unchanged)."""
import json, hashlib, struct, sys
from pathlib import Path
H = Path(__file__).resolve().parent; sys.path.insert(0, str(H))
import frozen_store as fs
md5 = lambda b: hashlib.md5(b).hexdigest(); sha = lambda b: hashlib.sha256(b).hexdigest()
S = Path('/tmp/claude-1000/-home-praxis-Projects/c41b4c2f-f4c2-4e21-8c6d-a961250d8864/scratchpad/snd/db2')
TABLES = [(1237434, 'dbfilesclient/soundkit.db2', 'SoundKit'),
(1237435, 'dbfilesclient/soundkitentry.db2', 'SoundKitEntry'),
(1344466, 'dbfilesclient/creaturesounddata.db2', 'CreatureSoundData'),
(4178576, 'dbfilesclient/creaturesoundfidget.db2', 'CreatureSoundFidget')]
WHY = 'Mount special (space while standing): horse neigh; drake 5.36 s roar matching the 5.33 s anim (owner request)'
store = fs.Store(); root = store.root; lay = store.layout; assert lay['root_md5'] == fs.ROOT
patched = bytearray(root); pins = []
for fid, name, table in TABLES:
cells = []
for g in lay['groups']:
f = 0
for i, (d,) in enumerate(struct.iter_unpack('<I', memoryview(root)[g['ids_offset']:g['ckeys_offset']])):
f += d
if f == fid: cells.append((g, g['ckeys_offset'] + i * 16))
f += 1
en = [(g, at) for g, at in cells if g['locale'] & 2 and not g.get('flags1')]; assert len(en) == 1, (fid, len(en))
g, at = en[0]; ck = root[at:at + 16].hex()
old = store.read(ck)[2]; assert old == (S / f'{table}.db2').read_bytes(), f'parent {name} differs from edited source'
new = (S / 'out' / f'{table}.db2').read_bytes(); patched[at:at + 16] = bytes.fromhex(md5(new))
d = H / 'pins' / str(fid); d.mkdir(parents=True, exist_ok=True)
(d / 'before.bin').write_bytes(old); (d / 'after.bin').write_bytes(new)
pin = dict(fdid=fid, table=name, parent_root=fs.ROOT, selected_group={}, original_decoded=dict(file='before.bin', md5=ck, sha256=sha(old)),
encrypted_original=False, after_decoded=dict(file='after.bin', md5=md5(new), sha256=sha(new)), reason=WHY)
(d / 'pin.json').write_text(json.dumps(pin, indent=1) + '\n')
pins.append(dict(file=str(d / 'pin.json'), sha256=sha((d / 'pin.json').read_bytes()), type='wdc_enus'))
(H / 'components.json').write_text(json.dumps(pins, indent=2) + '\n')
(H / 'selected-root.json').write_text(json.dumps(dict(parent_build=fs.BUILD, parent_root=fs.ROOT, decoded_root_sha256=sha(bytes(patched)), parent_root_sha256=sha(root)), indent=2) + '\n')
print('pins', len(pins))