Function: GetSpellDataIndex(spell, idx, secondfield)
Description: Reads an owned snapshot of one Lua-data record from the spell. Integer/float/string records have two values; boolean records have one.
Parameters:
spell(Spell) - Lua spell object whose backing template supplies the record.idx(int32) - Zero-based index. Negative or out-of-range indexes are rejected; indexes above 255 are not truncated.secondfield(bool, optional) - Read the second integer/float/string value when true; default false. Boolean records ignore this flag.
Returns: Integer, number, boolean or string according to the record type. Missing records or unsupported types return no values (nil in a single-result Lua call).
Record ownership: The backing template owns child values directly; readers receive copies and setters publish prepared edits. The instance must be admitted as described below; child-value ownership and VM execution are separate contracts. See Lua actor lifetime.