Files

39 lines
2.3 KiB
Python

"""High Elf chat (2026-11-26): every say/party/guild line and GM command from a High Elf failed with
"You cannot speak that language". GetDefaultLanguage = Common (7), but GetNumLanguages() = 0. Turtle's High Elf is
native race 10 (Blood Elf, Horde), and native SkillRaceClassInfo row 40 (skill 98 Language: Common) leaves race 10
out, so the client never treats Common as a skill the character can have. Octo's client grants it (row 40 RaceMask 589).
Rule, catalogue-wide for the Turtle races that reuse native IDs (9 Goblin, 10 High Elf): for every skill that no native
SkillRaceClassInfo row grants to that race, while Octo's client does, set the race bit on each native row whose Octo row
(same ID) grants it. Skills the race already has on some native row keep Blizzard's class/race split untouched.
Usage: srci_turtle_races.py <native srci.dump (Db2Bake)> <SkillRaceClassInfo.octo.tsv> <rows.json>"""
import collections, json, sys
RACES = (9, 10)
def parse(path):
out = {}
for line in open(path):
f = line.rstrip('\n').split('\t')
d = dict(kv.split('=', 1) for kv in f[1:] if '=' in kv)
if 'SkillID' in d: out[int(d['ID'])] = d
return out
def main(native_dump, octo_tsv, out):
nat, octo = parse(native_dump), parse(octo_tsv)
nmask = lambda d: [int(x) for x in d['RaceMasks'].split(',')]
have = collections.defaultdict(int)
for d in nat.values(): have[int(d['SkillID'])] |= nmask(d)[0] & 0xffffffff
rows = []
for i, o in sorted(octo.items()):
if i not in nat: continue
skill, om = int(o['SkillID']), int(o['RaceMask']) & 0xffffffff
add = [r for r in RACES if om >> (r - 1) & 1 and not have[skill] >> (r - 1) & 1]
if not add: continue
d = nat[i]; m = nmask(d)
for r in add: m[0] |= 1 << (r - 1)
m[0] = m[0] - (1 << 32) if m[0] >= 1 << 31 else m[0]
rows.append(dict(ID=i, SkillID=skill, ClassMask=int(d['ClassMask']), Flags=int(d['Flags']), Availability=int(d['Availability']),
MinLevel=int(d['MinLevel']), SkillTierID=int(d['SkillTierID']), RaceMasks=m))
print(i, 'skill', skill, 'races +', add, file=sys.stderr)
json.dump(rows, open(out, 'w'), indent=1); print(len(rows), 'rows', file=sys.stderr)
if __name__ == '__main__': main(*sys.argv[1:4])