summaryrefslogtreecommitdiff
path: root/docs/smart_scripts.md
blob: ce7c017db3c77ef590b896cf679deb523357409d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# smart\_scripts

[<-Back-to:World](database-world.md)

The `smart_scripts` table has 30 attributes. It serves to make scripts in SQL language. The important thing is always to analyze, who is the event that motivates the execution of an action and of course, who is the objective. As a recommendation, you can review the scripts that are already inside the table, to understand how it works. The advantage, for which several use this method, is that it is not required to compile, when adding records, with restarting the server, if it is well programmed, you can appreciate the changes. Another reason is the portability, but it depends on the point of view of the developer, the response you can get.

**Table Structure**

| Field                 | Type     | Attributes | Key | Null | Default | Extra | Comment       |
| --------------------- | -------- | ---------- | --- | ---- | ------- | ----- | ------------- |
| [entryorguid][1]      | INT      | SIGNED     | PRI | NO   |         |       |               |
| [source_type][2]      | TINYINT  | UNSIGNED   | PRI | NO   | 0       |       |               |
| [id][3]               | SMALLINT | UNSIGNED   | PRI | NO   | 0       |       |               |
| [link][4]             | SMALLINT | UNSIGNED   | PRI | NO   | 0       |       |               |
| [event_type][5]       | TINYINT  | UNSIGNED   |     | NO   | 0       |       |               |
| [event_phase_mask][6] | SMALLINT | UNSIGNED   |     | NO   | 0       |       |               |
| [event_chance][7]     | TINYINT  | UNSIGNED   |     | NO   | 100     |       |               |
| [event_flags][8]      | SMALLINT | UNSIGNED   |     | NO   | 0       |       |               |
| [event_param1][5]     | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [event_param2][5]     | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [event_param3][5]     | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [event_param4][5]     | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [event_param5][5]     | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [action_type][9]      | TINYINT  | UNSIGNED   |     | NO   | 0       |       |               |
| [action_param1][9]    | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [action_param2][9]    | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [action_param3][9]    | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [action_param4][9]    | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [action_param5][9]    | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [action_param6][9]    | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [target_type][10]     | TINYINT  | UNSIGNED   |     | NO   | 0       |       |               |
| [target_param1][10]   | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [target_param2][10]   | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [target_param3][10]   | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [target_param4][10]   | INT      | UNSIGNED   |     | NO   | 0       |       |               |
| [target_x][10]        | FLOAT    | SIGNED     |     | NO   | 0       |       |               |
| [target_y][10]        | FLOAT    | SIGNED     |     | NO   | 0       |       |               |
| [target_z][10]        | FLOAT    | SIGNED     |     | NO   | 0       |       |               |
| [target_o][10]        | FLOAT    | SIGNED     |     | NO   | 0       |       |               |
| [comment][11]         | text     |            |     | NO   |         |       | Event Comment |

[1]: #entryorguid
[2]: #sourcetype
[3]: #id
[4]: #link
[5]: #eventtype
[6]: #eventphasemask
[7]: #eventchance
[8]: #eventflags
[9]: #actiontype
[10]: #targettype
[11]: #comment

**Description of the fields**

### 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

| Name                                   | Value |
| -------------------------------------- | ----- |
| SMART\_SCRIPT\_TYPE\_CREATURE          | 0     |
| SMART\_SCRIPT\_TYPE\_GAMEOBJECT        | 1     |
| SMART\_SCRIPT\_TYPE\_AREATRIGGER       | 2     |
| SMART\_SCRIPT\_TYPE\_TIMED\_ACTIONLIST | 9     |

### 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 (id 1 has to use event\_type SMART\_EVENT\_LINK).
- Smart\_event to be used.

**Thanks to the use of links, you can execute several actions, keeping the same event.**

### event\_phase\_mask

When dealing with phases, *phase IDs* have to be used. There are 13 (12+1) different phases: 1, 2, ... 12 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 ... 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.              |

- 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

### 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            |
| SMART_EVENT_FLAG_DIFFICULTY_2   | 8    | 0x08  | Event only occurs in normal raid               |
| SMART_EVENT_FLAG_DIFFICULTY_3   | 16   | 0x10  | Event only occurs in heroic raid               |
| 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       |

- Sets if the event should not repeat or should only happen in a given instance/dungeon difficulty (if applicable);
- Values can be added together (bitwise math).

### event\_type

| Name                              | Value | Param1                                                | Param2                      | Param3            | Param4                          | Param5               | 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     | HPMin%                                                | HPMax%                      | RepeatMin         | RepeatMax                       |                      | Health Percentage                                                            |
| SMART_EVENT_MANA_PCT              | 3     | ManaMin%                                              | ManaMax%                    | RepeatMin         | RepeatMax                       |                      | Mana Percentage                                                              |
| SMART_EVENT_AGGRO                 | 4     |                                                       |                             |                   |                                 |                      | On Creature Aggro                                                            |
| SMART_EVENT_KILL                  | 5     | CooldownMin                                           | CooldownMax                 | Player only (0/1) | Creature 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 Creature/Gameobject Spell Hit                                             |
| SMART_EVENT_RANGE                 | 9     | MinDist                                               | MaxDist                     | RepeatMin         | RepeatMax                       | 0/1 onlyFireOnRepeat | On Target In Range                                                           |
| SMART_EVENT_OOC_LOS               | 10    | NoHostile                                             | MaxRange                    | CooldownMin       | CooldownMax                     | 0/1 Player Only      | On Target In Distance Out of Combat                                          |
| SMART_EVENT_RESPAWN               | 11    | type (None = 0, Map = 1, Area = 2)                    | MapId                       | ZoneId            |                                 |                      | On Creature/Gameobject Respawn                                               |
| SMART_EVENT_TARGET_HEALTH_PCT     | 12    | HPMin%                                                | HPMax%                      | RepeatMin         | RepeatMax                       |                      | On Target Health Percentage                                                  |
| SMART_EVENT_VICTIM_CASTING        | 13    | RepeatMin                                             | RepeatMax                   | Spell id (0 any)  |                                 |                      | On Target Casting Spell                                                      |
| SMART_EVENT_FRIENDLY_HEALTH       | 14    | HPDeficit                                             | Radius                      | RepeatMin         | RepeatMax                       |                      | On Friendly Health Deficit                                                   |
| SMART_EVENT_FRIENDLY_IS_CC        | 15    | Radius                                                | RepeatMin                   | RepeatMax         |                                 |                      |                                                                              |
| SMART_EVENT_FRIENDLY_MISSING_BUFF | 16    | SpellId                                               | Radius                      | RepeatMin         | RepeatMax                       | onlyInCombat         | On Friendly Lost Buff                                                        |
| SMART_EVENT_SUMMONED_UNIT         | 17    | CretureId (0 all)                                     | CooldownMin                 | CooldownMax       |                                 |                      | On Creature/Gameobject Summoned Unit                                         |
| SMART_EVENT_TARGET_MANA_PCT       | 18    | ManaMin%                                              | ManaMax%                    | RepeatMin         | RepeatMax                       |                      | On Target Mana Percentage                                                    |
| SMART_EVENT_ACCEPTED_QUEST        | 19    | QuestID (0 any)                                       |                             |                   |                                 |                      | On Target Accepted Quest                                                     |
| SMART_EVENT_REWARD_QUEST          | 20    | QuestID (0 any)                                       |                             |                   |                                 |                      | On Target Rewarded Quest                                                     |
| SMART_EVENT_REACHED_HOME          | 21    |                                                       |                             |                   |                                 |                      | On Creature Reached Home                                                     |
| SMART_EVENT_RECEIVE_EMOTE         | 22    | EmoteId                                               | CooldownMin                 | CooldownMax       |                                 |                      | On Receive Emote.                                                            |
| 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, On Respawn or Spawn                                            |
| SMART_EVENT_IC_LOS                | 26    | NoHostile                                             | MaxRange                    | CooldownMin       | CooldownMax                     | 0/1 Player Only      | On Target In Distance In Combat                                              |
| SMART_EVENT_PASSENGER_BOARDED     | 27    | CooldownMin                                           | CooldownMax                 |                   |                                 |                      |                                                                              |
| SMART_EVENT_PASSENGER_REMOVED     | 28    | CooldownMin                                           | CooldownMax                 |                   |                                 |                      |                                                                              |
| SMART_EVENT_CHARMED               | 29    |                                                       |                             |                   |                                 |                      | On Creature Charmed                                                          |
| SMART_EVENT_CHARMED_TARGET        | 30    |                                                       |                             |                   |                                 |                      | On Target Charmed                                                            |
| SMART_EVENT_SPELLHIT_TARGET       | 31    | SpellId                                               | School                      | RepeatMin         | RepeatMax                       |                      | On Target Spell Hit                                                          |
| SMART_EVENT_DAMAGED               | 32    | MinDmg                                                | MaxDmg                      | RepeatMin         | RepeatMax                       |                      | On Creature Damaged                                                          |
| SMART_EVENT_DAMAGED_TARGET        | 33    | MinDmg                                                | MaxDmg                      | RepeatMin         | RepeatMax                       |                      | On Target Damaged                                                            |
| SMART_EVENT_MOVEMENTINFORM        | 34    | MovementType (0=any)                                  | PointID                     |                   |                                 |                      | ESCORT_MOTION_TYPE = 17, POINT_MOTION_TYPE = 8                               |
| SMART_EVENT_SUMMON_DESPAWNED      | 35    | Entry                                                 | CooldownMin                 | CooldownMax       |                                 |                      | On Summoned Unit Despawned                                                   |
| SMART_EVENT_CORPSE_REMOVED        | 36    |                                                       |                             |                   |                                 |                      | On Creature Corpse Removed                                                   |
| SMART_EVENT_AI_INIT               | 37    |                                                       |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_DATA_SET              | 38    | Field                                                 | Value                       | CooldownMin       | CooldownMax                     |                      | On Creature/Gameobject Data Set, Can be used with SMART_ACTION_SET_DATA      |
| SMART_EVENT_WAYPOINT_START        | 39    | PointId (0 any)                                       | pathId (0 any)              |                   |                                 |                      | On Creature Waypoint ID Started                                              |
| SMART_EVENT_WAYPOINT_REACHED      | 40    | PointId (0 any)                                       | pathId (0 any)              |                   |                                 |                      | On Creature Waypoint ID Reached                                              |
| SMART_EVENT_AREATRIGGER_ONTRIGGER | 46    | TriggerId (0 any)                                     |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_TEXT_OVER             | 52    | creature_text.GroupID                                 | creature.id (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 Creature Just spawned                                                     |
| SMART_EVENT_WAYPOINT_PAUSED       | 55    | PointId (0 any)                                       | pathID (0 any)              |                   |                                 |                      | On Creature Paused at Waypoint ID                                            |
| SMART_EVENT_WAYPOINT_RESUMED      | 56    | PointId (0 any)                                       | pathID (0 any)              |                   |                                 |                      | On Creature Resumed after Waypoint ID                                        |
| SMART_EVENT_WAYPOINT_STOPPED      | 57    | PointId (0 any)                                       | pathID (0 any)              |                   |                                 |                      | On Creature Stopped On Waypoint ID                                           |
| SMART_EVENT_WAYPOINT_ENDED        | 58    | PointId (0 any)                                       | pathID (0 any)              |                   |                                 |                      | On Creature Waypoint Path Ended                                              |
| SMART_EVENT_TIMED_EVENT_TRIGGERED | 59    | Id                                                    |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_UPDATE                | 60    | InitialMin                                            | InitialMax                  | RepeatMin         | RepeatMax                       |                      |                                                                              |
| SMART_EVENT_LINK                  | 61    |                                                       |                             |                   |                                 |                      | Used to link together multiple events as a chain of events.                  |
| SMART_EVENT_GOSSIP_SELECT         | 62    | gossip_menu_option.MenuID                             | gossip_menu_option.OptionID |                   |                                 |                      | On gossip clicked (gossip_menu_option).                                      |
| SMART_EVENT_JUST_CREATED          | 63    |                                                       |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_GOSSIP_HELLO          | 64    |                                                       |                             |                   |                                 |                      | On Right-Click Creature/Gameobject that have gossip enabled.                 |
| SMART_EVENT_FOLLOW_COMPLETED      | 65    |                                                       |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_UNUSED_66             | 66    |                                                       |                             |                   |                                 |                      | UNUSED                                                                       |
| SMART_EVENT_IS_BEHIND_TARGET      | 67    | CooldownMin                                           | CooldownMax                 |                   |                                 |                      | On Creature is behind target.                                                |
| 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_STATE_CHANGED      | 70    | State (0 - Active, 1 - Ready, 2 - Active alternative) |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_GO_EVENT_INFORM       | 71    | EventId                                               |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_ACTION_DONE           | 72    | EventId                                               |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_ON_SPELLCLICK         | 73    |                                                       |                             |                   |                                 |                      |                                                                              |
| SMART_EVENT_FRIENDLY_HEALTH_PCT   | 74    | minHpPct                                              | maxHpPct                    | repeatMin         | repeatMax                       | Range                |                                                                              |
| SMART_EVENT_DISTANCE_CREATURE     | 75    | database guid                                         | database entry              | distance          | repeat interval (ms)            |                      | On creature guid OR any instance of creature entry is within distance.       |
| SMART_EVENT_DISTANCE_GAMEOBJECT   | 76    | database guid                                         | database entry              | distance          | repeat interval (ms)            |                      | On gameobject guid OR any instance of gameobject entry is within   distance. |
| SMART_EVENT_COUNTER_SET           | 77    | counterID                                             | value                       | cooldownMin       | cooldownMax                     |                      | If the value of specified counterID is equal to a specified value            |
| SMART_EVENT_NEAR_PLAYERS          | 101   | minPlayers                                            | Range (yards)               | FirstCheck (ms)   | RepeatCheck (ms)                |                      | Event will trigger if there are more than minPlayers in range.               |
| SMART_EVENT_NEAR_PLAYERS_NEGATION | 102   | maxPlayers                                            | Range (yards)               | FirstCheck (ms)   | RepeatCheck (ms)                |                      | Event will trigger if there are less than maxPlayers in range.               |

### action\_type

| Name                                            | Value | Param1                                                                                                                                                                                                                                                                                                                                                                                                                                 | Param2                                                                                               | Param3                                                                                                                     | Param4                                         | Param5                                | Param6                                | Comment                                                                                                                                                                                                                                                                                                                                     |
| ----------------------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SMART_ACTION_NONE                               | 0     |                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                      |                                                                                                                            |                                                |                                       |                                       | Do nothing                                                                                                                                                                                                                                                                                                                                  |
| SMART_ACTION_TALK                               | 1     | creature_text.GroupID                                                                                                                                                                                                                                                                                                                                                                                                                  | Duration to wait before SMART_EVENT_TEXT_OVER is triggered.                                          | 0 It will try to trigger talk of the target<br/>1 Set target as   talk target (used for $vars in texts and whisper target) |                                                |                                       |                                       | Param2 in Milliseconds.                                                                                                                                                                                                                                                                                                                     |
| SMART_ACTION_SET_FACTION                        | 2     | FactionID (or 0 for default)                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                      |                                                                                                                            |                                                |                                       |                                       | Sets faction to creature.                                                                                                                                                                                                                                                                                                                   |
| SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL            | 3     | creature_template.entry(param1)                                                                                                                                                                                                                                                                                                                                                                                                        | creature_template.modelidx(param2)                                                                   |                                                                                                                            |                                                |                                       |                                       | Take DisplayID of creature (param1) OR Turn to DisplayID (param2) OR Both   = 0 for Demorph                                                                                                                                                                                                                                                 |
| SMART_ACTION_SOUND                              | 4     | SoundId