docs(Agents): add script conventions to cpp-scripts.md (#26962)
This commit is contained in:
parent
4974f0a333
commit
a51bfee00e
1 changed files with 4 additions and 0 deletions
|
|
@ -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).
|
||||
|
|
|
|||
Loading…
Reference in a new issue