smart_scripts
Manual editing smart_scripts table can be tedious and difficult, for easier writing scripts you can use additional TrinityCore tools like WoW Database Editor.
Table Structure
Field | Type | Attributes | Key | Null | Default | Extra | Comment |
bigint(20) | signed | PRI | NO | 0 |
|
| |
tinyint(3) | unsigned | PRI | NO | 0 |
|
| |
smallint(5) | unsigned | PRI | NO | 0 |
|
| |
smallint(5) | unsigned | PRI | NO | 0 |
|
| |
tinyint(3) | unsigned |
| NO | 0 |
|
| |
tinyint(3) | unsigned |
| NO | 0 |
|
| |
tinyint(3) | unsigned |
| NO | 100 |
|
| |
tinyint(3) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
tinyint(3) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
tinyint(3) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | 0 |
|
| |
int(10) | unsigned |
| NO | NO |
|
| |
int(10) | unsigned |
| NO | NO |
|
| |
float | signed |
| NO | 0 |
|
| |
float | signed |
| NO | 0 |
|
| |
float | signed |
| NO | 0 |
|
| |
float | signed |
| NO | 0 |
|
| |
text | signed |
| NO |
|
| Event Comment |
Description of the fields
Please note: means that the feature/option is not (yet) implemented.
entryorguid
EntryOrGuid > 0: entry of the creature / game object / etc.
EntryOrGuid < 0: guid of the creature / game object / etc.
Depends on source_type.
source_type
Object type: creature, game object, spell. see table below for values
id
Incremental id bound to each entryorguid & source_type (0, 1, 2, ...).
link
Simple event linking;
Example: if id = 0 and link = 1; id 1 will only be able to occur if id = 0 was triggered.
Smart_event to be used.
event_phase_mask
When dealing with phases, phase IDs have to be used. There are 10 (9+1) different phases: 1, 2, ... 9 and the default 0.
Example: The script is in phase 0 by default - If we want it to go to phase 1, we got two choices:
SMART_ACTION_INC_PHASE by 1 or SMART_ACTION_SET_PHASE 1
If the script is in phase 0 and want to skip to phase 2:
SMART_ACTION_INC_PHASE by 2 or SMART_ACTION_SET_PHASE 2
If the script is in phase 1 and want to skip to phase 2:
SMART_ACTION_INC_PHASE by 1 or SMART_ACTION_SET_PHASE 2
Name | Flag | Hex | Comment |
|---|---|---|---|
SMART_EVENT_PHASE_ALWAYS_BIT | 0 | 0x000 | Means all phases (1 ... 9) |
SMART_EVENT_PHASE_1 | 1 | 0x001 | Phase 1 only. |
SMART_EVENT_PHASE_2 | 2 | 0x002 | Phase 2 only. |
SMART_EVENT_PHASE_3 | 4 | 0x004 | Phase 3 only. |
SMART_EVENT_PHASE_4 | 8 | 0x008 | Phase 4 only. |
SMART_EVENT_PHASE_5 | 16 | 0x010 | Phase 5 only. |
SMART_EVENT_PHASE_6 | 32 | 0x020 | Phase 6 only. |
SMART_EVENT_PHASE_7 | 64 | 0x040 | Phase 7 only. |
SMART_EVENT_PHASE_8 | 128 | 0x080 | Phase 8 only. |
SMART_EVENT_PHASE_9 | 256 | 0x100 | Phase 9 only. |
Event will only be able to occur if creature/GO is in this phase.
Example: If we want an event to only be able to occure in phase 1 and 4, event_phase_mask = 1+8 = 9
(Inverse of EAI: event_inverse_phase_mask).
event_chance
This is the probability of the event to occur as a percentage from 0-100. So, if you want the event to occur roughly half of the time, then set this to 50.
event_flags
Name | Flag | Hex | Comment |
|---|---|---|---|
SMART_EVENT_FLAG_NOT_REPEATABLE | 1 | 0x01 | Event can not repeat |
SMART_EVENT_FLAG_DIFFICULTY_0 | 2 | 0x02 | Event only occurs in normal dungeon |
SMART_EVENT_FLAG_DIFFICULTY_1 | 4 | 0x04 | Event only occurs in heroic dungeon |