Race 8 claw motion mode, skill motions 170-175, claw weapon attach, ANTI_WOLFMAN item flag; tools/server/wolfman/make_items.py writes the server item rows. ENABLE_VIEW_TARGET_DECIMAL_HP back to 0: GC_TARGET only carries bHPPercent, so the 4-argument root SetHPTargetBoard raised a TypeError on every target. Version gate stays mt20261027 (no packet change). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 lines
3.0 KiB
Python
60 lines
3.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Server item rows for the wolfman (server ENABLE_WOLFMAN_CHARACTER), taken from the client item_proto.
|
|
|
|
The 40250 client proto already carries the whole wolfman set (claws, armor, helmets, costumes) and ANTI_WOLFMAN on
|
|
every other class's gear; the 203 server proto has neither. This writes items-server.tsv for
|
|
../ava2-items/install_items.py: the wolfman-only rows the server lacks, converted from the client's numeric fields,
|
|
plus every existing server row whose client twin is ANTI_WOLFMAN, with that flag added.
|
|
Client costume subtype 4 is COSTUME_WEAPON, our server's 4 is COSTUME_MOUNT_SKIN: those weapon skins are skipped.
|
|
|
|
usage: make_items.py <client item_proto> <server item_proto.txt> <ProtoReader.cpp> <out dir>
|
|
"""
|
|
import subprocess,sys
|
|
from pathlib import Path
|
|
HERE=Path(__file__).resolve().parent
|
|
sys.path.insert(0,str(HERE.parent/'ava2-items'))
|
|
from make_items import enums
|
|
|
|
ANTI_OTHER_CLASSES=0b111100 # ANTI_MUSA | ANTI_ASSASSIN | ANTI_SURA | ANTI_MUDANG
|
|
ANTI_WOLFMAN=1<<18
|
|
SKIP={(28,4)}
|
|
|
|
def client_rows(proto):
|
|
tool=HERE.parents[2]/'build/release/src/port/item_proto_patch'
|
|
out=subprocess.run([str(tool),'--dump',str(proto)],check=True,capture_output=True).stdout
|
|
rows={}
|
|
for line in out.splitlines():
|
|
fields,_,name=line.partition(b'\t')
|
|
f=list(map(int,fields.split()))
|
|
rows[f[0]]=(f,name)
|
|
return rows
|
|
|
|
def server_rows(path):
|
|
return {int(l.split(b'\t',1)[0]):l.rstrip(b'\r') for l in path.read_bytes().splitlines() if l.split(b'\t',1)[0].isdigit()}
|
|
|
|
def convert(f,name,E):
|
|
flags=lambda bits,k:' | '.join(n for i,n in enumerate(E[k]) if bits>>i&1) or 'NONE'
|
|
row=[str(f[0]),name.decode('gbk'),E['type'][f[1]],E['sub'][f[1]][f[2]] if E['sub'][f[1]] else str(f[2]),str(f[3]),
|
|
flags(f[4],'anti'),flags(f[5],'flag'),flags(f[6],'wear'),flags(f[7],'imm')]+[str(v) for v in f[8:13]]
|
|
for k in range(2):row+=[E['limit'][f[13+2*k]],str(f[14+2*k])]
|
|
for k in range(3):row+=[E['apply'][f[17+2*k]],str(f[18+2*k])]
|
|
return '\t'.join(row+[str(v) for v in f[23:31]]+['0']).encode('gbk')
|
|
|
|
def main():
|
|
client,server_path,reader,out=Path(sys.argv[1]),Path(sys.argv[2]),Path(sys.argv[3]),Path(sys.argv[4])
|
|
E=enums(reader);cli=client_rows(client);srv=server_rows(server_path)
|
|
assert E['anti'][18]=='ANTI_WOLFMAN',E['anti']
|
|
added=[convert(f,n,E) for v,(f,n) in sorted(cli.items()) if v not in srv and f[4]&ANTI_OTHER_CLASSES==ANTI_OTHER_CLASSES
|
|
and not f[4]&ANTI_WOLFMAN and (f[1],f[2]) not in SKIP]
|
|
flagged=[]
|
|
for v,line in sorted(srv.items()):
|
|
c=line.split(b'\t')
|
|
if v in cli and cli[v][0][4]&ANTI_WOLFMAN and b'ANTI_WOLFMAN' not in c[5]:
|
|
c[5]=b'ANTI_WOLFMAN' if c[5].strip() in (b'NONE',b'0',b'') else c[5]+b' | ANTI_WOLFMAN'
|
|
flagged.append(b'\t'.join(c))
|
|
out.mkdir(parents=True,exist_ok=True)
|
|
(out/'items-server.tsv').write_bytes(b'\n'.join(added+flagged)+b'\n')
|
|
print('wolfman rows added:',len(added),'ANTI_WOLFMAN added:',len(flagged))
|
|
|
|
main()
|