From cb1766139cc8ed267e17afcfdc9cde14a87d58d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 08:45:04 +0000 Subject: [PATCH 1/3] Initial plan From 5bbb157aa7de0d81213cd74beab5635d5a2bfccc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 09:02:40 +0000 Subject: [PATCH 2/3] docs: add creature_text_options and creature_text_option_sets wiki pages Add documentation for the two new DB tables introduced by azerothcore/azerothcore-wotlk#25188 (creature_text_options engine). - docs/creature_text_option_sets.md: documents the reusable ruleset table (SetID, Cooldown, TriggerChance, PlayerOnly, comment) - docs/creature_text_options.md: documents the per-(CreatureID,GroupID) assignment table and how SendChat() uses it - docs/database-world.md: adds both new tables to the world DB index - docs/creature_text.md: adds a Related Tables section pointing to the new option tables --- docs/creature_text.md | 5 ++++ docs/creature_text_option_sets.md | 45 +++++++++++++++++++++++++++++++ docs/creature_text_options.md | 40 +++++++++++++++++++++++++++ docs/database-world.md | 2 ++ 4 files changed, 92 insertions(+) create mode 100644 docs/creature_text_option_sets.md create mode 100644 docs/creature_text_options.md diff --git a/docs/creature_text.md b/docs/creature_text.md index 7bbe8cd5c..68e6e017e 100644 --- a/docs/creature_text.md +++ b/docs/creature_text.md @@ -174,3 +174,8 @@ Id of the equivalent text found in [broadcast\_text](broadcast_text) ### comment This field allows you to label a text entry. + +## Related Tables + +- [creature\_text\_options](creature_text_options) — assigns a reusable option ruleset to a (CreatureID, GroupID) pair to enforce cooldown, trigger chance, and player-only filtering. +- [creature\_text\_option\_sets](creature_text_option_sets) — defines the reusable rulesets referenced by `creature_text_options`. diff --git a/docs/creature_text_option_sets.md b/docs/creature_text_option_sets.md new file mode 100644 index 000000000..3ad62b8ae --- /dev/null +++ b/docs/creature_text_option_sets.md @@ -0,0 +1,45 @@ +# creature\_text\_option\_sets + +[<-Back-to:World](database-world) + +**The \`creature\_text\_option\_sets\` table** + +This table defines reusable option rulesets for creature text groups. Each ruleset controls cooldown, trigger chance, and player-only filtering for `SendChat()`. Rulesets are assigned to specific (CreatureID, GroupID) pairs via the [creature\_text\_options](creature_text_options) table. + +## Structure + +| Field | Type | Attributes | Key | Null | Default | Extra | Comment | +|------------------------|--------------|------------|-----|------|---------|-------|------------------------------------------| +| [SetID][1] | TINYINT | UNSIGNED | PRI | NO | | | | +| [Cooldown][2] | INT | UNSIGNED | | NO | 0 | | Group cooldown in ms before it can fire again | +| [TriggerChance][3] | TINYINT | UNSIGNED | | NO | 100 | | 0-100 pct chance to fire at all | +| [PlayerOnly][4] | TINYINT | UNSIGNED | | NO | 0 | | Only fire if target is a player | +| [comment][5] | VARCHAR(255) | | | YES | | | | + +[1]: #setid +[2]: #cooldown +[3]: #triggerchance +[4]: #playeronly +[5]: #comment + +## Description of the fields + +### SetID + +Unique identifier for this option ruleset. Referenced by [creature\_text\_options.OptionSetID](creature_text_options#optionsetid). + +### Cooldown + +The minimum time in milliseconds that must pass before the same text group can fire again on a given creature. Set to `0` to disable cooldown enforcement. + +### TriggerChance + +A percentage value from `0` to `100` that represents the chance the text group will be triggered at all. A value of `100` means the text always fires when called; a value of `30` means it fires approximately 30% of the time. + +### PlayerOnly + +When set to `1`, the text group will only fire if the target that triggered it is a player. When set to `0`, the text will fire regardless of target type (players, pets, guardians, etc.). + +### comment + +An optional human-readable label for this ruleset. diff --git a/docs/creature_text_options.md b/docs/creature_text_options.md new file mode 100644 index 000000000..4af8cd0c0 --- /dev/null +++ b/docs/creature_text_options.md @@ -0,0 +1,40 @@ +# creature\_text\_options + +[<-Back-to:World](database-world) + +**The \`creature\_text\_options\` table** + +This table assigns a reusable option ruleset (defined in [creature\_text\_option\_sets](creature_text_option_sets)) to a specific (CreatureID, GroupID) pair from [creature\_text](creature_text). This enables data-driven control of cooldown, trigger chance, and player-only filtering for `SendChat()` calls without requiring per-script boilerplate. + +When `SendChat()` is called for a creature text group, the engine automatically: +1. Checks whether the group is on cooldown (if `Cooldown > 0`). +2. Rolls against `TriggerChance` to decide whether the text fires. +3. Checks whether the target is a player (if `PlayerOnly = 1`). + +If any check fails, the text is silently skipped. If all checks pass, the text fires and the cooldown timer is started. + +## Structure + +| Field | Type | Attributes | Key | Null | Default | Extra | Comment | +|------------------------|---------|------------|-----|------|---------|-------|---------| +| [CreatureID][1] | INT | UNSIGNED | PRI | NO | | | | +| [GroupID][2] | TINYINT | UNSIGNED | PRI | NO | | | | +| [OptionSetID][3] | TINYINT | UNSIGNED | | NO | | | | + +[1]: #creatureid +[2]: #groupid +[3]: #optionsetid + +## Description of the fields + +### CreatureID + +The entry of the creature from [creature\_template.entry](creature_template#entry) to which this option assignment applies. + +### GroupID + +The text group ID from [creature\_text.GroupID](creature_text#groupid) to which this option assignment applies. + +### OptionSetID + +The ID of the ruleset from [creature\_text\_option\_sets.SetID](creature_text_option_sets#setid) that defines the cooldown, trigger chance, and player-only behaviour for this (CreatureID, GroupID) pair. diff --git a/docs/database-world.md b/docs/database-world.md index e9508754d..b9129e0d0 100644 --- a/docs/database-world.md +++ b/docs/database-world.md @@ -47,6 +47,8 @@ - [creature_template_spell](creature_template_spell) - [creature_text](creature_text) - [creature_text_locale](creature_text_locale) +- [creature_text_option_sets](creature_text_option_sets) +- [creature_text_options](creature_text_options) ## D - [disables](disables) From 55dac118bcd2c7ad4084cfbc47a62a92d4ae8422 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 09:03:08 +0000 Subject: [PATCH 3/3] docs: expand abbreviations in creature_text_option_sets table comments --- docs/creature_text_option_sets.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/creature_text_option_sets.md b/docs/creature_text_option_sets.md index 3ad62b8ae..ab75862d7 100644 --- a/docs/creature_text_option_sets.md +++ b/docs/creature_text_option_sets.md @@ -11,8 +11,8 @@ This table defines reusable option rulesets for creature text groups. Each rules | Field | Type | Attributes | Key | Null | Default | Extra | Comment | |------------------------|--------------|------------|-----|------|---------|-------|------------------------------------------| | [SetID][1] | TINYINT | UNSIGNED | PRI | NO | | | | -| [Cooldown][2] | INT | UNSIGNED | | NO | 0 | | Group cooldown in ms before it can fire again | -| [TriggerChance][3] | TINYINT | UNSIGNED | | NO | 100 | | 0-100 pct chance to fire at all | +| [Cooldown][2] | INT | UNSIGNED | | NO | 0 | | Group cooldown in milliseconds before it can fire again | +| [TriggerChance][3] | TINYINT | UNSIGNED | | NO | 100 | | 0-100 percent chance to fire at all | | [PlayerOnly][4] | TINYINT | UNSIGNED | | NO | 0 | | Only fire if target is a player | | [comment][5] | VARCHAR(255) | | | YES | | | |