diff --git a/.agents/docs/cpp-scripts.md b/.agents/docs/cpp-scripts.md index c2aaa5ee7c..1bd4bac084 100644 --- a/.agents/docs/cpp-scripts.md +++ b/.agents/docs/cpp-scripts.md @@ -14,6 +14,7 @@ Then declare and call `AddSC_()` from the regional loader (`Spells/spells_ **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. +- In AI code, prefer the `DoCast` helpers (`DoCastSelf`, `DoCastVictim`, `DoCastAOE`, …) over raw `me->CastSpell` where possible (use `me->CastSpell` when you need positional casts or custom `CastSpellExtraArgs`). - A `SpellScript`/`AuraScript` without a matching `spell_script_names` row is inert — ship the binding SQL update in the same change as the C++ registration. - Never add `UNIT_FLAG*` / `UNIT_FLAG2*` / `UNIT_DYNFLAG*` values without sniff or upstream evidence; the same flag used in another script is not evidence. - Trigger NPCs (`creature_template.flags_extra` 0x80) have no threat list — `SelectTarget` / `AddThreat` / `UpdateVictim` chains on them silently do nothing. A never-evading helper NPC left on a boss's threatened-by list also stalls the boss's evade/reset forever; make such helpers `IMMUNE_TO_NPC`. diff --git a/.agents/docs/sql-guidelines.md b/.agents/docs/sql-guidelines.md index 54c48e5269..39ca19e138 100644 --- a/.agents/docs/sql-guidelines.md +++ b/.agents/docs/sql-guidelines.md @@ -11,6 +11,7 @@ Run the linter before claiming a change is done: `python apps/codestyle/codestyl ## Data conventions - `smart_scripts` edits always rewrite the full block — `DELETE` + `INSERT` of every row for the `(entryorguid, source_type)` pair, with the `DELETE` matching both columns — never a partial `UPDATE`, not even for a comment-only fix. +- Sniff-backed changes stamp `VerifiedBuild` (the sniff's client build) on every row the sniff validated, including rows the fix doesn't otherwise touch. - `creature_immunities`: negative ids are curated shared sets — reference them via `creature_template.CreatureImmunitiesId`, never edit them or allocate new ones. Positive ids are single-creature sets — reuse an existing set only on an exact match; to extend a creature's immunities, insert a superset under a new id and point the creature's `CreatureImmunitiesId` at it. ## The three databases