22 lines
1.7 KiB
Python
22 lines
1.7 KiB
Python
"""#74 / Q103(2) (owner 2026-11-28: Benediction shows an extra first green line "healing up to 195 and damage up to 65").
|
|
70334 ItemSparse.Flags[4] bit 0x100 makes the client compute a caster-weapon bonus from the item budget: with 0x400 it
|
|
is drawn as "Equip: Increases healing done by up to X and damage done by up to X/3" (type-0 stat line, GetItemStats
|
|
SPELL_HEALING_DONE), with 0x200 as "Increases damage and healing done by magical spells by up to X" (LOCAL probe
|
|
2026-11-28: Dreamstaff 249454 0x500 -> 105/35, Radiant Staff 249453 0x300 -> damage+healing line). Turtle (1.12) items
|
|
carry their caster bonuses as explicit equip spells (Benediction: 23264 +106 healing, 56529 +69 Holy), so the native
|
|
computed bonus is counted on top. Rule over every Turtle item (tw_world.item_template entries): clear Flags[4] & 0x700.
|
|
Usage: itemcaster.py (reads in/ItemSparse.tsv = DBCD dump of in/ItemSparse.db2 [byte-identical to
|
|
build/q103-item-effects-20261128/ItemSparse.db2], in/tw_item_entries.txt; writes setrows-sparse.json)"""
|
|
import json
|
|
CASTER = 0x700
|
|
tw = {int(x) for x in open('in/tw_item_entries.txt').read().split() if x.isdigit()}
|
|
out = []
|
|
for line in open('in/ItemSparse.tsv', encoding='utf-8', errors='replace'):
|
|
r = dict(x.split('=', 1) for x in line.rstrip('\n').split('\t')[1:] if '=' in x)
|
|
if 'ID' not in r or 'Flags' not in r: continue # continuation of a multi-line description
|
|
i = int(r['ID']); f = [int(v) for v in r['Flags'].split(',')]
|
|
if i in tw and f[4] & CASTER:
|
|
f[4] &= ~CASTER; out.append(dict(ID=i, Flags=f))
|
|
json.dump(out, open('setrows-sparse.json', 'w'), indent=1)
|
|
print('turtle items', len(tw), 'rows changed', len(out), [o['ID'] for o in out][:20])
|