29 lines
2.6 KiB
Python
29 lines
2.6 KiB
Python
"""Octo/Turtle emotes (IDs for DANCESPECIAL follow Codex dancespecial-native-route-20261120: Emotes 400/401->1160/1161, text 365->523, data 1762-1766) the client lacks: Emotes (same IDs), text emotes DANCESPECIAL/READYJOUST, their messages, slash strings.
|
|
Native IDs: Emotes = Turtle ID (all absent natively); EmotesText READYJOUST 366 (absent), DANCESPECIAL 900365 (native 365 is SERIOUS);
|
|
EmotesTextData 900000+octo id; GlobalStrings 9000001+ with free EMOTE172/173 token slots (chatemoteconstants defines 260 of 628)."""
|
|
import json
|
|
from compare import load
|
|
O=lambda t:load(f'dump/{t}.octo.tsv'); N=lambda t:load(f'dump/{t}.native.tsv')
|
|
eo,en=O('Emotes'),N('Emotes'); mapped={377:1067,383:1063,398:1124,402:1109,425:1099,427:1088}
|
|
remap={400:1160,401:1161}
|
|
emotes=[]
|
|
for i,r in sorted(eo.items()):
|
|
if i<377 or i in en or i in mapped: continue
|
|
ev=int(r['EventSoundID']); nid=remap.get(i,i); assert nid not in en; emotes.append(dict(ID=nid,EmoteSlashCommand=r['EmoteSlashCommand'],AnimID=int(r['AnimID']),EmoteFlags=int(r['EmoteFlags']),EmoteSpecProc=int(r['EmoteSpecProc']),EmoteSpecProcParam=int(r['EmoteSpecProcParam']),EventSoundID=max(ev,0),SpellVisualKitID=0,ClassMask=-1,RaceMasks=[-1,-1]))
|
|
to,tdo=O('EmotesText'),O('EmotesTextData'); tn,tdn,gn=N('EmotesText'),N('EmotesTextData'),N('GlobalStrings')
|
|
native_text={365:523,366:366}; data_ids={365:[1762,1763,1764,1765,1766],366:[1767,1768,1769,1770,1771]}; texts=[];data=[];gs=[];gid=9000001
|
|
for slot,(src,cmd) in zip((172,173),((365,'/dancespecial'),(366,'/readyjoust'))):
|
|
r=to[src]; nid=native_text[src]; assert nid not in tn
|
|
texts.append(dict(ID=nid,Name=r['Name'],EmoteID=remap.get(int(r['EmoteID']),int(r['EmoteID']))))
|
|
ids=iter(data_ids[src])
|
|
for pos,tid in enumerate(int(x) for x in r['EmoteText'].split(',')):
|
|
if tid:
|
|
did=next(ids); assert did not in tdn; data.append(dict(ID=did,Text_lang=tdo[tid]['Text_lang'],RelationshipFlags=pos,EmotesTextID=nid))
|
|
assert not any(g['BaseTag'].startswith(f'EMOTE{slot}_') for g in gn.values())
|
|
for tag,txt in ((f'EMOTE{slot}_TOKEN',r['Name']),(f'EMOTE{slot}_CMD1',cmd)):
|
|
gs.append(dict(ID=gid,BaseTag=tag,TagText_lang=txt,Flags=1)); gid+=1
|
|
for t,v in (('Emotes',emotes),('EmotesText',texts),('EmotesTextData',data),('GlobalStrings',gs)):
|
|
json.dump(v,open(f'rows-{t}.json','w'),indent=0,ensure_ascii=False); print(t,len(v))
|
|
json.dump(dict(animations=[(k,remap.get(k,k)) for k in sorted(i for i in eo if i>=377 and i not in en and i not in mapped)],texts=sorted(native_text.items())),open('emote-profile-additions.json','w'))
|
|
print(texts,data[:3],gs)
|