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

25 lines
2.1 KiB
Python

"""Row sets for the Octo-port content step (all IDs checked absent from the client tables)."""
import json
from compare import load
out={}
# AreaTrigger: server-used Octo triggers on maps the client has; one AreaTriggerActionSet (Flags 8) each, ids 900000+ (codec uses ~45939..46023).
at_o=load('dump/AreaTrigger.octo.tsv'); at_n=load('dump/AreaTrigger.native.tsv'); m_n=load('dump/Map.native.tsv'); atas=load('dump/AreaTriggerActionSet.native.tsv')
sv={int(x) for x in open('ref/at.txt').read().split() if x.isdigit()}
ats=[];sets=[];nid=900000
for a in sorted(sv):
if a in at_n or a not in at_o or int(at_o[a]['ContinentID']) not in m_n: continue
r=at_o[a]; assert nid not in atas
ats.append(dict(ID=a,ContinentID=int(r['ContinentID']),Pos=[float(v) for v in r['Pos'].split(',')],Radius=float(r['Radius']),Box_length=float(r['Box_length']),Box_width=float(r['Box_width']),Box_height=float(r['Box_height']),Box_yaw=float(r['Box_yaw']),ShapeType=1 if float(r['Box_length']) else 0,AreaTriggerActionSetID=nid))
sets.append(dict(ID=nid,Flags=8)); nid+=1
out['AreaTrigger']=ats; out['AreaTriggerActionSet']=sets
# NameGen: Octo High Elf (10) and Goblin (9) names; native has none for these races.
ng_o=load('dump/NameGen.octo.tsv'); ng_n=load('dump/NameGen.native.tsv')
out['NameGen']=[dict(ID=i,Name=r['Name'],RaceID=int(r['RaceID']),Sex=int(r['Sex']),NameType=0) for i,r in sorted(ng_o.items()) if r['RaceID'] in ('9','10') and i not in ng_n]
# GameTips: Octo tips whose text the client lacks.
gt_o=load('dump/GameTips.octo.tsv'); gt_n=load('dump/GameTips.native.tsv'); have={r['Text_lang'].strip() for r in gt_n.values()}
out['GameTips']=[dict(ID=i,Text_lang=r['Text_lang'],SortIndex=0,Min_level=0,Max_level=60,ContentTuningID=0) for i,r in sorted(gt_o.items()) if r['Text_lang'].strip() not in have and i not in gt_n]
# MailTemplate: Octo templates absent.
mt_o=load('dump/MailTemplate.octo.tsv'); mt_n=load('dump/MailTemplate.native.tsv')
out['MailTemplate']=[dict(ID=i,Body_lang=r['Body_lang']) for i,r in sorted(mt_o.items()) if i not in mt_n]
for t,v in out.items(): json.dump(v,open(f'rows-{t}.json','w'),indent=0,ensure_ascii=False); print(t,len(v))