Back to 'skinning_loot_template' Return to world Go to 'spawn_group'
Manual editing smart_scripts table can be tedious and difficult, for easier writing scripts you can use additional TrinityCore tools like WoW Database Editor.
Field | Type | Attributes | Key | Null | Default | Extra | Comment |
---|---|---|---|---|---|---|---|
entryorguid | bigint | signed | PRI | NO | 0 | ||
source_type | tinyint | unsigned | PRI | NO | 0 | ||
id | smallint | unsigned | PRI | NO | 0 | ||
link | smallint | unsigned | PRI | NO | 0 | ||
event_type | tinyint | unsigned | NO | 0 | |||
event_phase_mask | smallint | unsigned | NO | 0 | |||
event_chance | tinyint | unsigned | NO | 100 | |||
event_flags | smallint | unsigned | NO | 0 | |||
event_param1 | int | unsigned | NO | 0 | |||
event_param2 | int | unsigned | NO | 0 | |||
event_param3 | int | unsigned | NO | 0 | |||
event_param4 | int | unsigned | NO | 0 | |||
event_param5 | int | unsigned | NO | 0 | |||
event_param_string | varchar(255) | NO | '' | ||||
action_type | tinyint | unsigned | NO | 0 | |||
action_param1 | int | unsigned | NO | 0 | |||
action_param2 | int | unsigned | NO | 0 | |||
action_param3 | int | unsigned | NO | 0 | |||
action_param4 | int | unsigned | NO | 0 | |||
action_param5 | int | unsigned | NO | 0 | |||
action_param6 | int | unsigned | NO | 0 | |||
action_param7 | int | unsigned | NO | 0 | |||
target_type | tinyint | unsigned | NO | 0 | |||
target_param1 | int | unsigned | NO | 0 | |||
target_param2 | int | unsigned | NO | 0 | |||
target_param3 | int | unsigned | NO | 0 | |||
target_param4 | int | unsigned | NO | 0 | |||
target_x | float | NO | 0 | ||||
target_y | float | NO | 0 | ||||
target_z | float | NO | 0 | ||||
target_o | float | NO | 0 | ||||
comment | mediumtext | NO | Event Comment |
Object type (creature, gameobject, quest, etc.).
Name | Value | Source | Script name | Base Object |
---|---|---|---|---|
SMART_SCRIPT_TYPE_CREATURE | 0 | creature_template.entry or creature.guid | SmartAI (creature_template.AIName) | Creature |
SMART_SCRIPT_TYPE_GAMEOBJECT | 1 | gameobject_template.entry or gameobject.guid | SmartGameObjectAI (gameobject_template.AIName) | GameObject |
SMART_SCRIPT_TYPE_AREATRIGGER | 2 | Areatrigger.db2 (ID) | SmartTrigger (areatrigger_scripts.ScriptName) | Player |
3 | ||||
4 | ||||
SMART_SCRIPT_TYPE_QUEST | 5 | quest_template.ID | SmartQuest (quest_template_addon.ScriptName) | Player |
6 | ||||
7 | ||||
8 | ||||
SMART_SCRIPT_TYPE_TIMED_ACTIONLIST | 9 | smart_scripts.entryorguid | Creature, GameObject or AreaTrigger | |
SMART_SCRIPT_TYPE_SCENE | 10 | scene_template.id | SmartScene (scene_template.ScriptName) | Player |
SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY | 11 | areatrigger_template.Id (IsServerSide = 0) | SmartAreaTriggerAI (areatrigger.ScriptName) | AreaTrigger |
SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY_SERVERSIDE | 12 | areatrigger_template.Id (IsServerSide = 1) | SmartAreaTriggerAI (areatrigger.ScriptName) | AreaTrigger |
Please note
means that the source_type is not (yet) implemented.
Incremental id bound to each entryorguid & source_type (0, 1, 2, ...).
Simple event linking.
The linked id must use event_type SMART_EVENT_LINK (61).
Example: If id = 0 and link = 1, id = 1 will only be able to occur if id = 0 was triggered.
Event can only occur if the source is in this event phase. The default event phase is SMART_EVENT_PHASE_ALWAYS (0).
Name | Flag | Hex | Comment |
---|---|---|---|
SMART_EVENT_PHASE_ALWAYS | 0 | 0x000 | Means all phases (1 ... 12) |
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. |
SMART_EVENT_PHASE_10 | 512 | 0x200 | Phase 10 only. |
SMART_EVENT_PHASE_11 | 1024 | 0x400 | Phase 11 only. |
SMART_EVENT_PHASE_12 | 2048 | 0x800 | Phase 12 only. |
Example: If we want an event to be able to occur only in event phases 1 and 4, event_phase_mask: 1 + 8 = 9.
Example: Event phase change:
- If the script is in phase 0 and we want it to go to event phase 1, we have two choices:
- SMART_ACTION_INC_PHASE by 1 or SMART_ACTION_SET_PHASE 1
- If the script is in phase 0 and we 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 andwe want to skip to phase 2:
- SMART_ACTION_INC_PHASE by 1 or SMART_ACTION_SET_PHASE 2
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.
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 instance difficulty 0 |
SMART_EVENT_FLAG_DIFFICULTY_1 | 4 | 0x04 | Event only occurs in instance difficulty 1 |
SMART_EVENT_FLAG_DIFFICULTY_2 | 8 | 0x08 | Event only occurs in instance difficulty 2 |
SMART_EVENT_FLAG_DIFFICULTY_3 | 16 | 0x10 | Event only occurs in instance difficulty 3 |
SMART_EVENT_FLAG_RESERVED_5 | 32 | 0x20 | |
SMART_EVENT_FLAG_RESERVED_6 | 64 | 0x40 | |
SMART_EVENT_FLAG_DEBUG_ONLY | 128 | 0x80 | Event only occurs in debug build |
SMART_EVENT_FLAG_DONT_RESET | 256 | 0x100 | Event will not reset in SmartScript::OnReset() |
SMART_EVENT_FLAG_WHILE_CHARMED | 512 | 0x200 | Event occurs even if AI owner is charmed |
Name | Value | Param1 | Param2 | Param3 | Param4 | Param5 | ParamString | Comment |
---|---|---|---|---|---|---|---|---|
SMART_EVENT_UPDATE_IC | 0 | InitialMin | InitialMax | RepeatMin | RepeatMax | In combat | ||
SMART_EVENT_UPDATE_OOC | 1 | InitialMin | InitialMax | RepeatMin | RepeatMax | Out of combat | ||
SMART_EVENT_HEALTH_PCT | 2 | MinHpPct | MaxHpPct | RepeatMin | RepeatMax | Health percentage | ||
SMART_EVENT_MANA_PCT | 3 | MinManaPct | MaxManaPct | RepeatMin | RepeatMax | Mana percentage | ||
SMART_EVENT_AGGRO | 4 | On creature aggro | ||||||
SMART_EVENT_KILL | 5 | CooldownMin | CooldownMax | Player only (0/1) | creature_template.entry (If Param3 is 0) |
On creature kill | ||
SMART_EVENT_DEATH | 6 | On creature death | ||||||
SMART_EVENT_EVADE | 7 | On creature evade attack | ||||||
SMART_EVENT_SPELLHIT | 8 | SpellID | School | CooldownMin | CooldownMax | On spell hit | ||
SMART_EVENT_RANGE | 9 | MinDist | MaxDist | RepeatMin | RepeatMax | On target in range | ||
SMART_EVENT_OOC_LOS | 10 | HostilityMode:
|
MaxRange | CooldownMin | CooldownMax | Player only (0/1) | On target in range (Out of combat) | |
SMART_EVENT_RESPAWN | 11 | Type:
|
MapId | ZoneId | On spawn/respawn/summon | |||
12 | UNUSED, DO NOT REUSE | |||||||
SMART_EVENT_VICTIM_CASTING | 13 | RepeatMin | RepeatMax | SpellID (0 any) | On target casting spell | |||
14 | UNUSED, DO NOT REUSE | |||||||
SMART_EVENT_FRIENDLY_IS_CC | 15 | Radius | RepeatMin | RepeatMax | On friendly in cc | |||
SMART_EVENT_FRIENDLY_MISSING_BUFF | 16 | SpellID | Radius | RepeatMin | RepeatMax | On friendly lost buff | ||
SMART_EVENT_SUMMONED_UNIT | 17 | creature_template.entry (0 any) | CooldownMin | CooldownMax | On summoned unit | |||
18 | UNUSED, DO NOT REUSE | |||||||
SMART_EVENT_ACCEPTED_QUEST | 19 | QuestID (0 any) | RepeatMin | RepeatMax | On target accepted quest | |||
SMART_EVENT_REWARD_QUEST | 20 | QuestID (0 any) | RepeatMin | RepeatMax | On target rewarded quest | |||
SMART_EVENT_REACHED_HOME | 21 | On creature reached home | ||||||
SMART_EVENT_RECEIVE_EMOTE | 22 | EmoteID (Emotes.db2) | CooldownMin | CooldownMax | On emote received | |||
SMART_EVENT_HAS_AURA | 23 | SpellID | Stacks | RepeatMin | RepeatMax | On creature has aura | ||
SMART_EVENT_TARGET_BUFFED | 24 | SpellID | Stacks | RepeatMin | RepeatMax | On target buffed with spell | ||
SMART_EVENT_RESET | 25 | After combat or on spawn/respawn | ||||||
SMART_EVENT_IC_LOS | 26 | HostilityMode:
|
MaxRange | CooldownMin | CooldownMax | Player only (0/1) | On target in range (In combat) | |
SMART_EVENT_PASSENGER_BOARDED | 27 | CooldownMin | CooldownMax | On passenger boarded | ||||
SMART_EVENT_PASSENGER_REMOVED | 28 | CooldownMin | CooldownMax | On passenger removed | ||||
SMART_EVENT_CHARMED | 29 | Event:
|
On creature charmed | |||||
30 | UNUSED, DO NOT REUSE | |||||||
SMART_EVENT_SPELLHIT_TARGET | 31 | SpellID | School | RepeatMin | RepeatMax | On target spell hit | ||
SMART_EVENT_DAMAGED | 32 | MinDmg | MaxDmg | RepeatMin | RepeatMax | On damaged | ||
SMART_EVENT_DAMAGED_TARGET | 33 | MinDmg | MaxDmg | RepeatMin | RepeatMax | On target damaged | ||
SMART_EVENT_MOVEMENTINFORM | 34 | MovementType:
|
PointID (0xFFFFFFFF any) | On movement inform | ||||
SMART_EVENT_SUMMON_DESPAWNED | 35 | creature_template.entry | CooldownMin | CooldownMax | On summoned unit despawned | |||
SMART_EVENT_CORPSE_REMOVED | 36 | On creature corpse removed | ||||||
SMART_EVENT_AI_INIT | 37 | On AI init | ||||||
SMART_EVENT_DATA_SET | 38 | Field | Value | CooldownMin | CooldownMax | On data set (See SMART_ACTION_SET_DATA) |
||
39 | UNUSED, DO NOT REUSE | |||||||
SMART_EVENT_WAYPOINT_REACHED | 40 | PointID (0 any) | PathID (0 any) | On creature waypoint ID reached | ||||
41 | Not yet implemented | |||||||
42 | Entry (0 any) | Not yet implemented | ||||||
43 | Not yet implemented | |||||||
44 | PointID | Not yet implemented | ||||||
45 | Team (0 any) | CooldownMin | CooldownMax | Not yet implemented | ||||
SMART_EVENT_AREATRIGGER_ONTRIGGER | 46 | TriggerId (0 any) | On areatrigger triggered | |||||
SMART_EVENT_QUEST_ACCEPTED | 47 | On target quest accepted | ||||||
SMART_EVENT_QUEST_OBJ_COMPLETION | 48 | quest_objectives.ID | On target quest objective completed | |||||
SMART_EVENT_QUEST_COMPLETION | 49 | On target quest completed | ||||||
SMART_EVENT_QUEST_REWARDED | 50 | On target quest rewarded | ||||||
SMART_EVENT_QUEST_FAIL | 51 | On target quest failed | ||||||
SMART_EVENT_TEXT_OVER | 52 | creature_text.GroupID | creature_text.CreatureID (0 any) | On text over event triggered after SMART_ACTION_TALK | ||||
SMART_EVENT_RECEIVE_HEAL | 53 | MinHeal | MaxHeal | CooldownMin | CooldownMax | On creature received healing | ||
SMART_EVENT_JUST_SUMMONED | 54 | On summon | ||||||
SMART_EVENT_WAYPOINT_PAUSED | 55 | PointID (0 any) | PathID (0 any) | On creature waypoint ID paused | ||||
SMART_EVENT_WAYPOINT_RESUMED | 56 | PointID (0 any) | PathID (0 any) | On creature waypoint ID resumed | ||||
SMART_EVENT_WAYPOINT_STOPPED | 57 | PointID (0 any) | PathID (0 any) | On creature waypoint ID stopped | ||||
SMART_EVENT_WAYPOINT_ENDED | 58 | PointID (0 any) | PathID (0 any) | On creature waypoint ID ended | ||||
SMART_EVENT_TIMED_EVENT_TRIGGERED | 59 | Id | On timed event triggered (See SMART_ACTION_TRIGGER_TIMED_EVENT) |
|||||
SMART_EVENT_UPDATE | 60 | InitialMin | InitialMax | RepeatMin | RepeatMax | On event update | ||
SMART_EVENT_LINK | 61 | Used to link together multiple events (smart_scripts.link) | ||||||
SMART_EVENT_GOSSIP_SELECT | 62 | gossip_menu_option.MenuID | gossip_menu_option.OptionID | On gossip option selected | ||||
SMART_EVENT_JUST_CREATED | 63 | On spawn/respawn/summon | ||||||
SMART_EVENT_GOSSIP_HELLO | 64 | NoReportUse (for GOs):
|
On gossip hello | |||||
SMART_EVENT_FOLLOW_COMPLETED | 65 | On follow completed | ||||||
66 | UNUSED, DO NOT REUSE | |||||||
67 | UNUSED, DO NOT REUSE | |||||||
SMART_EVENT_GAME_EVENT_START | 68 | game_event.eventEntry | On game_event started | |||||
SMART_EVENT_GAME_EVENT_END | 69 | game_event.eventEntry | On game_event ended | |||||
SMART_EVENT_GO_LOOT_STATE_CHANGED | 70 | State:
|
On go state changed | |||||
SMART_EVENT_GO_EVENT_INFORM | 71 | EventId | On go event inform | |||||
SMART_EVENT_ACTION_DONE | 72 | ActionId | On action done (See SMART_ACTION_DO_ACTION) |
|||||
SMART_EVENT_ON_SPELLCLICK | 73 | On spellclick | ||||||
SMART_EVENT_FRIENDLY_HEALTH_PCT | 74 | MinHpPct | MaxHpPct | RepeatMin | RepeatMax | Radius | On friendly health percentage | |
SMART_EVENT_DISTANCE_CREATURE | 75 | creature.guid | creature_template.entry | Distance | Repeat interval (ms) | On creature guid/entry is within distance | ||
SMART_EVENT_DISTANCE_GAMEOBJECT | 76 | gameobject.guid | gameobject_template.entry | Distance | Repeat interval (ms) | On gameobject guid/entry is within distance | ||
SMART_EVENT_COUNTER_SET | 77 | CounterID | Value | CooldownMin | CooldownMax | On CounterID value equal to a specified value (See SMART_ACTION_SET_COUNTER) |
||
SMART_EVENT_SCENE_START | 78 | On scene start | ||||||
SMART_EVENT_SCENE_TRIGGER | 79 | TriggerName | On scene trigger | |||||
SMART_EVENT_SCENE_CANCEL | 80 | On scene cancel | ||||||
SMART_EVENT_SCENE_COMPLETE | 81 | On scene complete | ||||||
SMART_EVENT_SUMMONED_UNIT_DIES | 82 | On summoned unit dies | ||||||
SMART_EVENT_ON_SPELL_CAST | 83 | SpellID | CooldownMin | CooldownMax | On spell cast | |||
SMART_EVENT_ON_SPELL_FAILED | 84 | SpellID | CooldownMin | CooldownMax | On spell failed | |||
SMART_EVENT_ON_SPELL_START | 85 | SpellID | CooldownMin | CooldownMax | On spell start | |||
SMART_EVENT_ON_DESPAWN | 86 | On despawn |
Please note
means that the event_type is deprecated and should not be used.
Please note
means that the event_type is not (yet) implemented.
- no description -
- no description -
Commenting on SAI uses a template which is the following: "Creature name - Event - Action"
Example: "Minion of Gurok - On spawn - Set Random Movement"
Back to 'skinning_loot_template' Return to world Go to 'spawn_group'