Sources:
data/reference/json/ccb_eoc_conditions.json
data/reference/json/ccb_eoc_effects.json
tools/json_api/contract-inventory.schema.json
tools/json_api/generate_contracts.py
tools/json_api/test_generate_contracts.py
src/condition.cpp
src/npctalk.cpp
src/effect_on_condition.cpp
src/effect_on_condition.h
tests/eoc_test.cpp
doc/JSON/EFFECT_ON_CONDITION.md
commit c663ceb2c1bd
api-contract
EOC contracts and lifecycle¶
An EOC (effect on condition) combines condition parsing, effect parsing, and a trigger lifecycle. The machine inventories currently index 275 condition keys and 310 effect keys. Registration coverage is complete while handler-level parameter classification remains incomplete.
The effect_on_condition object¶
The source inventory classifies this object's fields as partial:
idhas explicit mandatory evidence.eoc_typeis optional; the loader follows activation by default withoutrecurrence, and the recurring rules whenrecurrenceexists.condition,deactivate_condition,effect, andfalse_effectare read behind presence branches.globalandrun_for_npcsdefault tofalse.required_eventis mandatory only inside theEVENTbranch; do not describe it as mandatory for every EOC.
Lifecycle types come from effect_on_condition.h/.cpp: ACTIVATION, RECURRING,
AVATAR_DEATH, NPC_DEATH, PREVENT_DEATH, and EVENT. Each receives talkers and context from
different trigger paths, which must be checked in the corresponding source and tests.
Parser boundaries¶
- Conditions use first-matching-parser dispatch. An unknown object condition throws
JsonError; an unknown string condition becomes a predicate that returns false. - Effect containers accept a string, object, or array and also use first-match dispatch; an unknown
effect throws
JsonError. - Only the logical
and,or, andnotcondition keys are fully classified; the other 272 arepartial. - All 310 effect keys are
partial. This does not mean they are unusable. It means parameters, defaults, nesting, talkers, variables, or context do not yet have complete source classification.
Continue with talker routing, variables and context, and nesting, then build a minimal validation chain with the complete example mod.