Files
WoW-Hybrid-gateway/ops/spell_client_attributes.py
praxisandClaude Fable 5.2 8a24c445b0 Content pipeline and operator tools
367 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

45 lines
2.4 KiB
Python

"""Explicit target-only spell context observed in the actual70334 client.
Attributes15/0x2000 is unnamed in the pinned headers. A controlled one-field
comparison fixes constant damage description scaling; that does not establish
all of the flag's engine semantics or grant any spell/gameplay effect.
"""
from copy import deepcopy
from octo_client_data import canonical_sha256
POLICY='observed-native-classic-spell-context-v1'
BUILD='1.60.1.70334'
def context(witnesses):
if not isinstance(witnesses,list)or not 2<=len(witnesses)<=16:
raise ValueError('Independent bounded target spell witnesses required')
seen=set()
for row in witnesses:
if not isinstance(row,dict):raise ValueError('Target SpellMisc witness required')
ident=row.get('SpellID');attrs=row.get('Attributes')
if type(ident)is not int or not 0<ident<2**31 or ident in seen or type(row.get('ID'))is not int or row['ID']<=0 or type(row.get('DifficultyID'))is not int or row['DifficultyID']!=0:
raise ValueError('Distinct native spell witness identities required')
seen.add(ident)
if not isinstance(attrs,list)or len(attrs)!=17 or any(type(v)is not int or not 0<=v<2**32 for v in attrs)or attrs[15]!=0x2000:
raise ValueError('Observed native attribute context differs')
if not any(r['Attributes'][:5]==[0]*5 for r in witnesses):
raise ValueError('A neutral source-prefix native witness is required')
rows=sorted(deepcopy(witnesses),key=lambda r:r['SpellID'])
return dict(policy=POLICY,build=BUILD,field='SpellMisc.Attributes[15]',value=0x2000,
native_witnesses=rows,native_witness_sha256=canonical_sha256(rows),
semantics='Unnamed bit; constant self-buff description verified by controlled real-client comparison')
def attributes(source,proof=None):
"""Source flags remain source flags; target context is separately declared."""
values=source.get('attributes')
if not isinstance(values,list)or len(values)!=5 or any(type(v)is not int or not 0<=v<2**32 for v in values):
raise ValueError('Five genuine source attribute words required')
result=values+[0]*12
if proof is not None:
if not isinstance(proof,dict)or proof!=context(proof.get('native_witnesses')):
raise ValueError('Reviewed target-only attribute context required')
result[15]=proof['value']
return result