mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
docs(Agents): add script conventions to cpp-scripts.md (#26962)
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user