28 lines
1.4 KiB
Python
28 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""Generate include/gateway/native_spell_focus_objects.hpp: every SpellFocusObject ID the installed 70334 client knows.
|
|
|
|
A type-8 (spell focus) game object template is published to the client only when its focus reference resolves
|
|
(src/gameobject_queries.cpp case 8). Octo/Turtle focus IDs are the vanilla IDs, which the native table keeps, so the
|
|
reference is the same number whenever the native table has it (2026-11-28: all 134 profile foci present). Without
|
|
this, every Moonwell/anvil/forge template was held and the client never saw a focus (Mooncloth stayed red).
|
|
Rerun after any client DB2 change that touches SpellFocusObject."""
|
|
import sys
|
|
from pathlib import Path
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'claude_recipe_parity'))
|
|
import effective as E
|
|
ids = sorted(E.table('SpellFocusObject')['rows'])
|
|
out = Path(__file__).resolve().parents[2] / 'include/gateway/native_spell_focus_objects.hpp'
|
|
body = ',\n'.join(','.join(map(str, ids[i:i + 20])) for i in range(0, len(ids), 20))
|
|
out.write_text(f'''#pragma once
|
|
// Generated by ops/go-authority/native_spell_focus.py from the installed client's SpellFocusObject ({len(ids)} rows).
|
|
#include <algorithm>
|
|
#include <cstdint>
|
|
#include <iterator>
|
|
namespace gateway::native_spell_focus {{
|
|
inline constexpr uint32_t Ids[]={{
|
|
{body}}};
|
|
inline bool exists(uint32_t id){{return std::binary_search(std::begin(Ids),std::end(Ids),id);}}
|
|
}}
|
|
''')
|
|
print(out, len(ids))
|