docs(Agents): add script conventions to cpp-scripts.md (#26962)

This commit is contained in:
Francesco Borzì 2026-08-08 10:14:44 +02:00 committed by GitHub
parent 4974f0a333
commit a51bfee00e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,4 +11,8 @@ Then declare and call `AddSC_<name>()` from the regional loader (`Spells/spells_
**Module hooks** (e.g. `OnPlayerLogin`, `OnWorldUpdate`, `OnSpellCast`) are declared in `src/server/game/Scripting/ScriptDefines/*.h`. Implement by inheriting the matching base (`PlayerScript`, `WorldScript`, …) and registering with `new MyClass();` (or its `RegisterXxxScript` macro) inside `AddSC_<name>()`. Full list: https://www.azerothcore.org/wiki/hooks-script.
**Conventions:**
- Script ids (action/event/data/phase) get named enum entries — never raw literals, even when the file already uses them: add the entry and convert that literal's every call site and handler in the same change.
Custom (non-upstream) scripts go in `src/server/scripts/Custom/` (gitignored).