18 lines
1.4 KiB
Python
18 lines
1.4 KiB
Python
"""Map.db2 rows for the 14 maps: 808 row as template; Octo Map.dbc gives name/type/area/loading screen; WDT from the build."""
|
|
import json
|
|
octo = {int(k): v for k, v in json.load(open('octo-map-rows.json')).items()}
|
|
rep = json.load(open('build-report.json'))
|
|
FLAGS = {0: [81425, 262144, 2277506], 1: [81425, 262144, 2277506], 2: [16858641, 262144, 131202], 3: [81425, 262152, 2277506]}
|
|
RAID_PLAYERS = {532: 10, 807: 40, 814: 10}
|
|
rows = []
|
|
for mid, r in sorted(rep['maps'].items(), key=lambda kv: int(kv[0])):
|
|
mid = int(mid); o = octo[mid]; it = int(o['InstanceType'])
|
|
players = int(o['MaxPlayers']) or RAID_PLAYERS.get(mid) or (5 if it == 1 else 0)
|
|
rows.append(dict(ID=mid, Directory=o['Directory'], MapName_lang=o['MapName_lang'], MapType=1, InstanceType=it, ExpansionID=0,
|
|
AreaTableID=int(o['ParentMapID']), LoadingScreenID=int(o['LoadingScreenID']), TimeOfDayOverride=-1,
|
|
ParentMapID=-1, CosmeticParentMapID=-1, TimeOffset=0, MinimapIconScale=1.0, CorpseMapID=-1, MaxPlayers=players,
|
|
WindSettingsID=0, ZmpFileDataID=0, WdtFileDataID=r['wdt'], OceanLiquidTypeID=2, NavigationMaxDistance=0,
|
|
PreloadFileDataID=0, Flags=FLAGS[it], Corpse=[0.0, 0.0]))
|
|
json.dump(rows, open('db2/map-rows.json', 'w'), indent=1)
|
|
print(len(rows), [(r['ID'], r['MapName_lang'], r['InstanceType'], r['MaxPlayers'], r['WdtFileDataID']) for r in rows])
|