Skip to content

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.

Structure ​

FieldTypeAttributesKeyNullDefaultExtraComment
entryorguidbigintsignedPRINO0
source_typetinyintunsignedPRINO0
idsmallintunsignedPRINO0
linksmallintunsignedPRINO0
Difficultiesvarchar(100)NO''
event_typetinyintunsignedNO0
event_phase_masksmallintunsignedNO0
event_chancetinyintunsignedNO100
event_flagssmallintunsignedNO0
event_param1intunsignedNO0
event_param2intunsignedNO0
event_param3intunsignedNO0
event_param4intunsignedNO0
event_param5intunsignedNO0
event_param_stringvarchar(255)NO''
action_typetinyintunsignedNO0
action_param1intunsignedNO0
action_param2intunsignedNO0
action_param3intunsignedNO0
action_param4intunsignedNO0
action_param5intunsignedNO0
action_param6intunsignedNO0
action_param7intunsignedNO0
action_param_stringvarchar(255)YES
target_typetinyintunsignedNO0
target_param1intunsignedNO0
target_param2intunsignedNO0
target_param3intunsignedNO0
target_param4intunsignedNO0
target_param_stringvarchar(255)YES
target_xfloatNO0
target_yfloatNO0
target_zfloatNO0
target_ofloatNO0
commentmediumtextNOEvent Comment
 

Description of fields ​

entryorguid ​

source_type ​

Object type (creature, gameobject, quest, etc.).

NameValueSourceScript nameBase Object
SMART_SCRIPT_TYPE_CREATURE0creature_template.entry or creature.guidSmartAI (creature_template.AIName)Creature
SMART_SCRIPT_TYPE_GAMEOBJECT1gameobject_template.entry or gameobject.guidSmartGameObjectAI (gameobject_template.AIName)GameObject
SMART_SCRIPT_TYPE_AREATRIGGER2Areatrigger.db2 (ID)SmartTrigger (areatrigger_scripts.ScriptName)Player
SMART_SCRIPT_TYPE_EVENT3event_script_names.IdSmartEventTrigger (event_script_names.ScriptName)Player, Creature or GameObject
❌ SMART_SCRIPT_TYPE_GOSSIP4
SMART_SCRIPT_TYPE_QUEST5quest_template.IDSmartQuest (quest_template_addon.ScriptName)Player
❌ SMART_SCRIPT_TYPE_SPELL6
❌ SMART_SCRIPT_TYPE_TRANSPORT7
❌ SMART_SCRIPT_TYPE_INSTANCE8
SMART_SCRIPT_TYPE_TIMED_ACTIONLIST9smart_scripts.entryorguidCreature, GameObject or AreaTrigger
SMART_SCRIPT_TYPE_SCENE10scene_template.idSmartScene (scene_template.ScriptName)Player
SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY11areatrigger_template.Id (IsServerSide = 0)SmartAreaTriggerAI (areatrigger.ScriptName)AreaTrigger
SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY_SERVERSIDE12areatrigger_template.Id (IsServerSide = 1)SmartAreaTriggerAI (areatrigger.ScriptName)AreaTrigger

Please note ❌means that the source_type is not (yet) implemented.

id ​

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.

Difficulties ​

Comma-separated list of difficulties where only the event can occur. '' means everywhere.

Examples:

  • '' → Everywhere
  • '0' → Open world
  • '1,2' → Dungeon normal/heroic
  • '0,3' → Open world and Raid 10 Player
  • '3,4,5,6' → Raid 10/25 normal/heroic

event_phase_mask ​

Event can only occur if the source is in this event phase. The default event phase is SMART_EVENT_PHASE_ALWAYS (0).

NameFlagHexComment
SMART_EVENT_PHASE_ALWAYS00x000Means all phases (1 ... 12)
SMART_EVENT_PHASE_110x001Phase 1 only.
SMART_EVENT_PHASE_220x002Phase 2 only.
SMART_EVENT_PHASE_340x004Phase 3 only.
SMART_EVENT_PHASE_480x008Phase 4 only.
SMART_EVENT_PHASE_5160x010Phase 5 only.
SMART_EVENT_PHASE_6320x020Phase 6 only.
SMART_EVENT_PHASE_7640x040Phase 7 only.
SMART_EVENT_PHASE_81280x080Phase 8 only.
SMART_EVENT_PHASE_92560x100Phase 9 only.
SMART_EVENT_PHASE_105120x200Phase 10 only.
SMART_EVENT_PHASE_1110240x400Phase 11 only.
SMART_EVENT_PHASE_1220480x800Phase 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

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 ​

NameFlagHexComment
SMART_EVENT_FLAG_NOT_REPEATABLE10x01Event can not repeat
⚠️ SMART_EVENT_FLAG_DIFFICULTY_0_DEPRECATED     20x02UNUSED, DO NOT REUSE
⚠️ SMART_EVENT_FLAG_DIFFICULTY_1_DEPRECATED40x04UNUSED, DO NOT REUSE
⚠️ SMART_EVENT_FLAG_DIFFICULTY_2_DEPRECATED80x08UNUSED, DO NOT REUSE
⚠️ SMART_EVENT_FLAG_DIFFICULTY_3_DEPRECATED160x10UNUSED, DO NOT REUSE
ℹ️ SMART_EVENT_FLAG_ACTIONLIST_WAITS320x20Timed action list will wait for action from this event to finish before moving on to next action
SMART_EVENT_FLAG_RESERVED_6640x40
SMART_EVENT_FLAG_DEBUG_ONLY1280x80Event only occurs in debug build
SMART_EVENT_FLAG_DONT_RESET2560x100Event will not reset in SmartScript::OnReset()
SMART_EVENT_FLAG_WHILE_CHARMED5120x200Event occurs even if AI owner is charmed

SMART_EVENT_FLAG_ACTIONLIST_WAITS supports these actions:

  • SMART_ACTION_TALK
  • SMART_ACTION_SIMPLE_TALK
  • SMART_ACTION_CAST
  • SMART_ACTION_SELF_CAST
  • SMART_ACTION_INVOKER_CAST
  • SMART_ACTION_MOVE_OFFSET
  • SMART_ACTION_WP_START
  • SMART_ACTION_MOVE_TO_POS
  • SMART_ACTION_CROSS_CAST
  • SMART_ACTION_ACTIVATE_TAXI
  • SMART_ACTION_JUMP_TO_POS
  • SMART_ACTION_START_CLOSEST_WAYPOINT
  • SMART_ACTION_FALL

Please note ⚠️means that the event_flags is deprecated and should not be used.

event_type ​

NameValueParam1Param2Param3Param4Param5ParamStringComment
SMART_EVENT_UPDATE_IC0InitialMinInitialMaxRepeatMinRepeatMaxIn combat
SMART_EVENT_UPDATE_OOC1InitialMinInitialMaxRepeatMinRepeatMaxOut of combat
SMART_EVENT_HEALTH_PCT2MinHpPctMaxHpPctRepeatMinRepeatMaxHealth percentage
SMART_EVENT_MANA_PCT3MinManaPctMaxManaPctRepeatMinRepeatMaxMana percentage
SMART_EVENT_AGGRO4On creature aggro
SMART_EVENT_KILL5CooldownMinCooldownMaxPlayer only (0/1)creature_template.entry
(If Param3 is 0)
On creature kill
SMART_EVENT_DEATH6On creature death
SMART_EVENT_EVADE7On creature evade attack
SMART_EVENT_SPELLHIT8SpellIDSchoolCooldownMinCooldownMaxOn spell hit
SMART_EVENT_RANGE9MinDistMaxDistRepeatMinRepeatMaxOn target in range
SMART_EVENT_OOC_LOS10HostilityMode:
  • 0 → Hostile
  • 1 → NotHostile
  • 2 → Any
MaxRangeCooldownMinCooldownMaxPlayer only (0/1)On target in range (Out of combat)
SMART_EVENT_RESPAWN11Type:
  • 0 → None
  • 1 → Map
  • 2 → Area
MapIdZoneIdOn spawn/respawn/summon
⚠️ SMART_EVENT_TARGET_HEALTH_PCT12UNUSED, DO NOT REUSE
SMART_EVENT_VICTIM_CASTING13RepeatMinRepeatMaxSpellID (0 any)On target casting spell
⚠️ SMART_EVENT_FRIENDLY_HEALTH14UNUSED, DO NOT REUSE
SMART_EVENT_FRIENDLY_IS_CC15RadiusRepeatMinRepeatMaxOn friendly in cc
SMART_EVENT_FRIENDLY_MISSING_BUFF16SpellIDRadiusRepeatMinRepeatMaxOn friendly lost buff
SMART_EVENT_SUMMONED_UNIT17creature_template.entry (0 any)CooldownMinCooldownMaxOn summoned unit
⚠️ SMART_EVENT_TARGET_MANA_PCT18UNUSED, DO NOT REUSE
SMART_EVENT_ACCEPTED_QUEST19QuestID (0 any)RepeatMinRepeatMaxOn target accepted quest
SMART_EVENT_REWARD_QUEST20QuestID (0 any)RepeatMinRepeatMaxOn target rewarded quest
SMART_EVENT_REACHED_HOME21On creature reached home
SMART_EVENT_RECEIVE_EMOTE22EmoteID (Emotes.db2)CooldownMinCooldownMaxOn emote received
SMART_EVENT_HAS_AURA23SpellIDStacksRepeatMinRepeatMaxOn creature has aura
SMART_EVENT_TARGET_BUFFED24SpellIDStacksRepeatMinRepeatMaxOn target buffed with spell
SMART_EVENT_RESET25After combat or on spawn/respawn
SMART_EVENT_IC_LOS26HostilityMode:
  • 0 → Hostile
  • 1 → NotHostile
  • 2 → Any
MaxRangeCooldownMinCooldownMaxPlayer only (0/1)On target in range (In combat)
SMART_EVENT_PASSENGER_BOARDED27CooldownMinCooldownMaxOn passenger boarded
SMART_EVENT_PASSENGER_REMOVED28CooldownMinCooldownMaxOn passenger removed
SMART_EVENT_CHARMED29Event:
  • 0 → On apply
  • 1 → On remove
On creature charmed
⚠️ SMART_EVENT_CHARMED_TARGET30UNUSED, DO NOT REUSE
SMART_EVENT_SPELLHIT_TARGET31SpellIDSchoolRepeatMinRepeatMaxOn target spell hit
SMART_EVENT_DAMAGED32MinDmgMaxDmgRepeatMinRepeatMaxOn damaged
SMART_EVENT_DAMAGED_TARGET33MinDmgMaxDmgRepeatMinRepeatMaxOn target damaged
SMART_EVENT_MOVEMENTINFORM34MovementType:PointID (0xFFFFFFFF any)On movement inform
SMART_EVENT_SUMMON_DESPAWNED35creature_template.entryCooldownMinCooldownMaxOn summoned unit despawned
SMART_EVENT_CORPSE_REMOVED36On creature corpse removed
SMART_EVENT_AI_INIT37On AI init
SMART_EVENT_DATA_SET38FieldValueCooldownMinCooldownMaxOn data set
(See SMART_ACTION_SET_DATA)
⚠️ SMART_EVENT_WAYPOINT_START39UNUSED, DO NOT REUSE
SMART_EVENT_WAYPOINT_REACHED40waypoint_path_node.NodeId (0xFFFFFFFF any)waypoint_path_node.PathId (0 any)On creature waypoint ID reached
❌ SMART_EVENT_TRANSPORT_ADDPLAYER41Not yet implemented
❌ SMART_EVENT_TRANSPORT_ADDCREATURE42Entry (0 any)Not yet implemented
❌ SMART_EVENT_TRANSPORT_REMOVE_PLAYER     43Not yet implemented
❌ SMART_EVENT_TRANSPORT_RELOCATE44PointIDNot yet implemented
❌ SMART_EVENT_INSTANCE_PLAYER_ENTER45Team (0 any)CooldownMinCooldownMaxNot yet implemented
SMART_EVENT_AREATRIGGER_ENTER46On areatrigger enter
SMART_EVENT_QUEST_ACCEPTED47On target quest accepted
SMART_EVENT_QUEST_OBJ_COMPLETION48quest_objectives.IDOn target quest objective completed
SMART_EVENT_QUEST_COMPLETION49On target quest completed
SMART_EVENT_QUEST_REWARDED50On target quest rewarded
SMART_EVENT_QUEST_FAIL51On target quest failed
SMART_EVENT_TEXT_OVER52creature_text.GroupIDcreature_text.CreatureID (0 any)On text over event triggered after SMART_ACTION_TALK
SMART_EVENT_RECEIVE_HEAL53MinHealMaxHealCooldownMinCooldownMaxOn creature received healing
SMART_EVENT_JUST_SUMMONED54On summon
SMART_EVENT_WAYPOINT_PAUSED55waypoint_path_node.NodeId (0xFFFFFFFF any)waypoint_path_node.PathId (0 any)On creature waypoint ID paused
SMART_EVENT_WAYPOINT_RESUMED56waypoint_path_node.NodeId (0xFFFFFFFF any)waypoint_path_node.PathId (0 any)On creature waypoint ID resumed
SMART_EVENT_WAYPOINT_STOPPED57waypoint_path_node.NodeId (0xFFFFFFFF any)waypoint_path_node.PathId (0 any)On creature waypoint ID stopped
SMART_EVENT_WAYPOINT_ENDED58waypoint_path_node.NodeId (0xFFFFFFFF any)waypoint_path_node.PathId (0 any)On creature waypoint ID ended
SMART_EVENT_TIMED_EVENT_TRIGGERED59IdOn timed event triggered
(See SMART_ACTION_TRIGGER_TIMED_EVENT)
SMART_EVENT_UPDATE60InitialMinInitialMaxRepeatMinRepeatMaxOn event update
SMART_EVENT_LINK61Used to link together multiple events (smart_scripts.link)
SMART_EVENT_GOSSIP_SELECT62gossip_menu_option.MenuIDgossip_menu_option.OptionIDOn gossip option selected
SMART_EVENT_JUST_CREATED63On spawn/respawn/summon
SMART_EVENT_GOSSIP_HELLO64NoReportUse (for GOs):
  • 0 → On gossip hello and on report use
    (Action could be executed twice)
  • 1 → On gossip hello
  • 2 → On report use
On gossip hello
SMART_EVENT_FOLLOW_COMPLETED65On follow completed
⚠️ SMART_EVENT_EVENT_PHASE_CHANGE66UNUSED, DO NOT REUSE
⚠️ SMART_EVENT_IS_BEHIND_TARGET67UNUSED, DO NOT REUSE
SMART_EVENT_GAME_EVENT_START68game_event.eventEntryOn game_event started
SMART_EVENT_GAME_EVENT_END69game_event.eventEntryOn game_event ended
SMART_EVENT_GO_LOOT_STATE_CHANGED70State:
  • 0 → Not Ready
  • 1 → Ready
  • 2 → Activacted
  • 3 → Just deactivated
On go state changed
SMART_EVENT_GO_EVENT_INFORM71EventIdOn go event inform
SMART_EVENT_ACTION_DONE72ActionIdOn action done
(See SMART_ACTION_DO_ACTION)
SMART_EVENT_ON_SPELLCLICK73On spellclick
SMART_EVENT_FRIENDLY_HEALTH_PCT74MinHpPctMaxHpPctRepeatMinRepeatMaxRadiusOn friendly health percentage
SMART_EVENT_DISTANCE_CREATURE75creature.guidcreature_template.entryDistanceRepeat interval (ms)On creature guid/entry is within distance
SMART_EVENT_DISTANCE_GAMEOBJECT76gameobject.guidgameobject_template.entryDistanceRepeat interval (ms)On gameobject guid/entry is within distance
SMART_EVENT_COUNTER_SET77CounterIDValueCooldownMinCooldownMaxOn CounterID value equal to a specified value
(See SMART_ACTION_SET_COUNTER)
SMART_EVENT_SCENE_START78On scene start
SMART_EVENT_SCENE_TRIGGER79TriggerNameOn scene trigger
SMART_EVENT_SCENE_CANCEL80On scene cancel
SMART_EVENT_SCENE_COMPLETE81On scene complete
SMART_EVENT_SUMMONED_UNIT_DIES82On summoned unit dies
SMART_EVENT_ON_SPELL_CAST83SpellIDCooldownMinCooldownMaxOn spell cast
SMART_EVENT_ON_SPELL_FAILED84SpellIDCooldownMinCooldownMaxOn spell failed
SMART_EVENT_ON_SPELL_START85SpellIDCooldownMinCooldownMaxOn spell start
SMART_EVENT_ON_DESPAWN86On despawn
SMART_EVENT_SEND_EVENT_TRIGGER87On GameEvent triggered
SMART_EVENT_AREATRIGGER_EXIT88On areatrigger exit
SMART_EVENT_ON_AURA_APPLIED89SpellIDCooldownMinCooldownMaxOn Aura apply
SMART_EVENT_ON_AURA_REMOVED90SpellIDCooldownMinCooldownMaxOn Aura remove

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.

action_type ​

NameValueParam1Param2Param3Param4Param5Param6ParamStringComment
SMART_ACTION_NONE0Do nothing
SMART_ACTION_TALK1creature_text.GroupID
SMART_ACTION_SET_FACTION2faction.db2.ID (0 for default)Sets faction to creature.
SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL3creature_template.entryCreature_template.modelID
SMART_ACTION_SOUND4SoundIdonlySelf (0/1)Distant Sound (0/1)
SMART_ACTION_PLAY_EMOTE5emote.db2.IDPlay Emote
SMART_ACTION_FAIL_QUEST6quest_template.IDFail Quest of Target
SMART_ACTION_OFFER_QUEST7quest_template.IDAdd Quest to Target
SMART_ACTION_SET_REACT_STATE8State:
  • 0 → Passiv
  • 1 → Defensive
  • 2 → Aggresive
  • 3 → Assist
SMART_ACTION_ACTIVATE_GOBJECT9Activate Object
SMART_ACTION_RANDOM_EMOTE10EmoteId1EmoteId2EmoteId3EmoteId4EmoteId5EmoteId6Play Random Emote
SMART_ACTION_CAST11SpellIdcastFlagtriggeredFlagsCast Spell ID at Target
SMART_ACTION_SUMMON_CREATURE12creature_template.entrySummon Typeduration in msattackInvokerSmartActionSummonCreatureFlags:
  • 1 → PersonalSpawn
  • 2 → PreferUnit
Summon Unit
SMART_ACTION_THREAT_SINGLE_PCT13Threat% incThreat% decChange Threat Percentage for Single Target
SMART_ACTION_THREAT_ALL_PCT14Threat% incThreat% decChange Threat Percentage for All Enemies
⚠️ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS15UNUSED, DO NOT REUSE
SMART_ACTION_SET_INGAME_PHASE_ID16PhaseID.db2
SMART_ACTION_SET_EMOTE_STATE17emote.db2.IDPlay Emote Continuously
⚠️ SMART_ACTION_SET_UNIT_FLAG18Can set Multi-able flags at once
⚠️ SMART_ACTION_REMOVE_UNIT_FLAG19Can Remove Multi-able flags at once
SMART_ACTION_AUTO_ATTACK20Stop or Continue Automatic Attack.
SMART_ACTION_ALLOW_COMBAT_MOVEMENT21Allow or Disable Combat Movement
SMART_ACTION_SET_EVENT_PHASE22smart_scripts.event_phase_mask
SMART_ACTION_INC_EVENT_PHASE23incrementDecrementSet param1 OR param2 (not both). Value 0 has no effect.
SMART_ACTION_EVADE24Evade Incoming Attack
SMART_ACTION_FLEE_FOR_ASSIST25If you want the fleeing NPC to say '%s attempts to run away in fear' on flee, use 1 on param1. 0 for no message.
⚠️ SMART_ACTION_CALL_GROUPEVENTHAPPENS26UNUSED, DO NOT REUSE
SMART_ACTION_COMBAT_STOP27
SMART_ACTION_REMOVEAURASFROMSPELL28SpellId0/1 onlyOwnedAuras0 removes all auras
SMART_ACTION_FOLLOW29Distance (0 = default value)Angle (0 = default value)End creature_template.entrycreditcreditTypeFollow Target
SMART_ACTION_RANDOM_PHASE30smart_scripts.event_phase_mask1smart_scripts.event_phase_mask2smart_scripts.event_phase_mask3smart_scripts.event_phase_mask4smart_scripts.event_phase_mask5smart_scripts.event_phase_mask6
SMART_ACTION_RANDOM_PHASE_RANGE31smart_scripts.event_phase_mask minimumsmart_scripts.event_phase_mask maximum
SMART_ACTION_RESET_GOBJECT32Reset Gameobject
SMART_ACTION_CALL_KILLEDMONSTER33creature_template.entry
SMART_ACTION_SET_INST_DATA34FieldDataType:
  • 0 → SetData
  • 1 → SetBossState
SMART_ACTION_SET_INST_DATA6435Field
SMART_ACTION_UPDATE_TEMPLATE36creature_template.entryUpdate Level
SMART_ACTION_DIE37
SMART_ACTION_SET_IN_COMBAT_WITH_ZONE38
SMART_ACTION_CALL_FOR_HELP39Radius in yards0/1 (say call for help text)
SMART_ACTION_SET_SHEATH40Sheath:
  • 0 → unarmed
  • 1 → melee
  • 2 → ranged
SMART_ACTION_FORCE_DESPAWN41Despawn timer in msRespawn timer in sec
SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL42flat hp valuepercent hp value
SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL43creature_template.entrycreature.template.ModelID
SMART_ACTION_SET_INGAME_PHASE_MASK44creature.phaseId
SMART_ACTION_SET_DATA45FieldData
SMART_ACTION_ATTACK_STOP46
SMART_ACTION_SET_VISIBILITY470/1
SMART_ACTION_SET_ACTIVE480/1
SMART_ACTION_ATTACK_START49
SMART_ACTION_SUMMON_GO50gameobject_template.entry
SMART_ACTION_KILL_UNIT51
SMART_ACTION_ACTIVATE_TAXI52TaxiID
SMART_ACTION_WP_START530 = walk / 1 = runwaypoints.entrycanRepeatquest_template.iddespawntimereactState
SMART_ACTION_WP_PAUSE54time (in ms)
SMART_ACTION_WP_STOP55despawnTimequest_template.idfail (0/1)
SMART_ACTION_ADD_ITEM56ItemSparse.db2.IDcount
SMART_ACTION_REMOVE_ITEM57ItemSparse.db2.IDcount
SMART_ACTION_INSTALL_AI_TEMPLATE58TemplateID
SMART_ACTION_SET_RUN590 = off / 1 = on
SMART_ACTION_SET_DISABLE_GRAVITY600 = gravity on / 1 = gravity off
⚠️ SMART_ACTION_SET_SWIM61
SMART_ACTION_TELEPORT62map.db2.ID
SMART_ACTION_SET_COUNTER63CounterIDvaluereset (0/1)
SMART_ACTION_STORE_TARGET_LIST64varID
SMART_ACTION_WP_RESUME65
SMART_ACTION_SET_ORIENTATION66
SMART_ACTION_CREATE_TIMED_EVENT67idInitialMinInitialMaxRepeatMinRepeatMaxchance
SMART_ACTION_PLAYMOVIE68entry
SMART_ACTION_MOVE_TO_POS69PointIdisTransport(0/1)disablePathfinding(0/1)ContactDistance
SMART_ACTION_ENABLE_TEMP_GOBJ70Respawn timer in sec
SMART_ACTION_EQUIP71creature_equip_template.creatureIdslotmaskSlot1Slot2Slot3
SMART_ACTION_CLOSE_GOSSIP72
SMART_ACTION_TRIGGER_TIMED_EVENT73id(>1)
SMART_ACTION_REMOVE_TIMED_EVENT74id(>1)
⚠️ SMART_ACTION_ADD_AURA75
⚠️ SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT76
⚠️ SMART_ACTION_RESET_SCRIPT_BASE_OBJECT77
SMART_ACTION_CALL_SCRIPT_RESET78
SMART_ACTION_SET_RANGED_MOVEMENT79attackDistanceattackAngle
SMART_ACTION_CALL_TIMED_ACTIONLIST80EntryOrGuid * 100timer update type(0 OOC, 1 IC, 2 ALWAYS)0/1 can override in going action list
SMART_ACTION_SET_NPC_FLAG81creature_template.npcflag
SMART_ACTION_ADD_NPC_FLAG82creature_template.npcflag
SMART_ACTION_REMOVE_NPC_FLAG83creature_template.npcflag
SMART_ACTION_SIMPLE_TALK84creature_text.GroupID
SMART_ACTION_SELF_CAST85SpellIDcastFlagstriggeredFlags
SMART_ACTION_CROSS_CAST86SpellIDcastFlagsCasterTargetTypeCasterTargetCasterTarget param1CasterTarget param2
SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST87EntryOrGuid 1EntryOrGuid 2EntryOrGuid 3EntryOrGuid 4EntryOrGuid 5EntryOrGuid 6
SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST88EntryOrGuid 1EntryOrGuid 2
SMART_ACTION_RANDOM_MOVE89Radius
SMART_ACTION_SET_UNIT_FIELD_BYTES_190ValueType
SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_191ValueType
SMART_ACTION_INTERRUPT_SPELL92With delay (0/1)SpellIdinstant (0/1)
⚠️ SMART_ACTION_SEND_GO_CUSTOM_ANIM93
⚠️ SMART_ACTION_SET_DYNAMIC_FLAG94
⚠️ SMART_ACTION_ADD_DYNAMIC_FLAG95
⚠️ SMART_ACTION_REMOVE_DYNAMIC_FLAG96
SMART_ACTION_JUMP_TO_POS97Speed XYSpeed Z
SMART_ACTION_SEND_GOSSIP_MENU98gossip_menu.entrygossip_menu.text_id
SMART_ACTION_GO_SET_LOOT_STATE99LootState:
  • 0 → Not Ready
  • 1 → Ready
  • 2 → Activated
  • 3 → Just Deactivated
SMART_ACTION_SEND_TARGET_TO_TARGET100Id
SMART_ACTION_SET_HOME_POS101
SMART_ACTION_SET_HEALTH_REGEN1020/1
SMART_ACTION_SET_ROOT1030/1
⚠️ SMART_ACTION_SET_GO_FLAG104gameobject_template_addon.flags
⚠️ SMART_ACTION_ADD_GO_FLAG105gameobject_template_addon.flags
⚠️ SMART_ACTION_REMOVE_GO_FLAG106gameobject_template_addon.flags
SMART_ACTION_SUMMON_CREATURE_GROUP107creature_summon_groups.groupIdAttack Invoker (0/1)
SMART_ACTION_SET_POWER108Power TypeNew Power
SMART_ACTION_ADD_POWER109Power TypePower to add
SMART_ACTION_REMOVE_POWER110Power TypePower to remove
SMART_ACTION_GAME_EVENT_STOP111game_event.eventEntry
SMART_ACTION_GAME_EVENT_START112game_event.eventEntry
SMART_ACTION_START_CLOSEST_WAYPOINT113wp1wp2wp3wp4wp5wp6
SMART_ACTION_MOVE_OFFSET114
SMART_ACTION_RANDOM_SOUND115soundId1soundId2soundId3soundId4onlySelf(0/1)Distant Sound (0/1)
SMART_ACTION_SET_CORPSE_DELAY116timer
SMART_ACTION_DISABLE_EVADE117disable evade (1) / re-enable (0)
SMART_ACTION_GO_SET_GO_STATE118State
⚠️ SMART_ACTION_SET_CAN_FLY119(0/1)
⚠️ SMART_ACTION_REMOVE_AURAS_BY_TYPE120type
⚠️ SMART_ACTION_SET_SIGHT_DIST121SightDistance
⚠️ SMART_ACTION_FLEE122FleeTime
SMART_ACTION_ADD_THREAT123+threat-threat
SMART_ACTION_LOAD_EQUIPMENT124Id
SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT125id min rangeid max range
⚠️ SMART_ACTION_REMOVE_ALL_GAMEOBJECTS126
SMART_ACTION_PAUSE_MOVEMENT127MovementSlotPauseTime (ms)Forced
SMART_ACTION_PLAY_ANIMKIT128AnimKit.db2.IDtype:
  • 0 → PlayOneShotAnimKitId
  • 1 → SetAIAnimKitId
  • 2 → SetMeleeAnimKitId
  • 3 → SetMovementAnimKitId
SMART_ACTION_SCENE_PLAY129scene_template.id
SMART_ACTION_SCENE_CANCEL130scene_template.id
SMART_ACTION_SPAWN_SPAWNGROUP131spawn_group.groupIdminDelaymaxDelayspawnflags
SMART_ACTION_DESPAWN_SPAWNGROUP132spawn_group.groupIdminDelaymaxDelayspawnflags
SMART_ACTION_RESPAWN_BY_SPAWNID133spawnType (0 npc/ 1 gob)SpawnId
SMART_ACTION_INVOKER_CAST134spellIDcastFlagtriggeredFlags
SMART_ACTION_PLAY_CINEMATIC135entrycinematic
SMART_ACTION_SET_MOVEMENT_SPEED136MovementTypespeedIntegerspeedFraction
SMART_ACTION_PLAY_SPELL_VISUAL_KIT137spellVisualKitId.db2.ID
SMART_ACTION_OVERRIDE_LIGHT138zoneIdareaLightIdlightId (overrideLightId)fadeInTime (transition Milliseconds)
SMART_ACTION_OVERRIDE_WEATHER139zoneIdweatherIdweatherGrade (intensity)
⚠️ SMART_ACTION_SET_AI_ANIM_KIT140
SMART_ACTION_SET_HOVER1410 = Off / 1 = On
SMART_ACTION_SET_HEALTH_PCT142percent
SMART_ACTION_CREATE_CONVERSATION143conversation_template.id
SMART_ACTION_SET_IMMUNE_PC1440 = Off / 1 = On
SMART_ACTION_SET_IMMUNE_NPC1450 = Off / 1 = On
SMART_ACTION_SET_UNINTERACTIBLE1460 = Off / 1 = On
SMART_ACTION_ACTIVATE_GAMEOBJECT147GameObjectActions
SMART_ACTION_ADD_TO_STORED_TARGET_LIST148varID
SMART_ACTION_BECOME_PERSONAL_CLONE_FOR_PLAYER149SummonTypeduration in ms
SMART_ACTION_TRIGGER_GAME_EVENT150eventId
SMART_ACTION_DO_ACTION151actionId
SMART_ACTION_COMPLETE_QUEST152quest_template.IDComplete quest with:
QUEST_FLAGS_COMPLETION_EVENT, QUEST_FLAGS_COMPLETION_AREA_TRIGGER or QUEST_FLAGS_TRACKING_EVENT
SMART_ACTION_CREDIT_QUEST_OBJECTIVE_TALK_TO153Only valid for SMART_SCRIPT_TYPE_CREATURE
SMART_ACTION_DESTROY_CONVERSATION154conversation_template.idisPrivate 0/1range
SMART_ACTION_ENTER_VEHICLE155seat.Id
SMART_ACTION_BOARD_PASSENGER156seat.Id
SMART_ACTION_EXIT_VEHICLE157
❌ SMART_ACTION_RESUME_MOVEMENT158UNUSED NEEDS CHERRYPICK
SMART_ACTION_FALL159pointId

Please note ⚠️means that the action_type is deprecated and should not be used.

target_type ​

NameValueParam1Param2Param3Param4ParamStringXYZOComment
SMART_TARGET_NONE0None
SMART_TARGET_SELF1Self cast
SMART_TARGET_VICTIM2Our current target. (ie: highest aggro)
SMART_TARGET_SECOND_AGGRO3Max distPlayer only (0/1)PowerType + 1 (0: any)Second highest aggro
SMART_TARGET_HOSTILE_LAST_AGGRO4Max distPlayer only (0/1)PowerType + 1 (0: any)Dead last on aggro
SMART_TARGET_HOSTILE_RANDOM5Max distPlayer only (0/1)PowerType + 1 (0: any)Just any random target on our threat list
SMART_TARGET_HOSTILE_RANDOM_NOT_TOP6Max distPlayer only (0/1)PowerType + 1 (0: any)Any random target except top threat
SMART_TARGET_ACTION_INVOKER7Unit who caused this event to occur
SMART_TARGET_POSITION8xyzoUse xyzo from target params
SMART_TARGET_CREATURE_RANGE9creature_template.entry (0: any)Min distMax distNumber of targets (0: all targets)StringIdCreatures with specified entry within specified range
SMART_TARGET_CREATURE_GUID10creature.guidcreature.idCreature with specified GUID (and id)
SMART_TARGET_CREATURE_DISTANCE11creature_template.entry (0: any)Max distNumber of targets (0: all targets)StringIdCreatures with specified entry within distance
SMART_TARGET_STORED12IdUses pre-stored target (list)
SMART_TARGET_GAMEOBJECT_RANGE13gameobject_template.entry (0: any)Min distMax distNumber of targets (0: all targets)StringIdGameobjects with specified entry within specified range
SMART_TARGET_GAMEOBJECT_GUID14gameobject.guidgameobject.idGameobject with specified GUID (and id)
SMART_TARGET_GAMEOBJECT_DISTANCE15gameobject_template.entry (0: any)Max distNumber of targets (0: all targets)StringIdGameobjects with specified entry within distance
SMART_TARGET_INVOKER_PARTY16Invoker's party members
SMART_TARGET_PLAYER_RANGE17Min distMax distAll players within specified range
SMART_TARGET_PLAYER_DISTANCE18Max distAll players within specified distance
SMART_TARGET_CLOSEST_CREATURE19creature_template.entry (0: any)Max dist (0-100 yards)Is dead (0/1)StringIdClosest creature with specified entry within specified distance
SMART_TARGET_CLOSEST_GAMEOBJECT20gameobject_template.entry (0: any)Max dist (0-100 yards)StringIdClosest gameobject with specified entry within specified distance
SMART_TARGET_CLOSEST_PLAYER21Max distClosest player within specified distance
SMART_TARGET_ACTION_INVOKER_VEHICLE22Unit's vehicle who caused this event to occur
SMART_TARGET_OWNER_OR_SUMMONER23Use charmer or owner (0/1)Unit's owner or summoner
SMART_TARGET_THREAT_LIST24Max distAll units on creature's threat list
SMART_TARGET_CLOSEST_ENEMY25Max distPlayer only (0/1)Any attackable target (creature or player) within specified distance
SMART_TARGET_CLOSEST_FRIENDLY26Max distPlayer only (0/1)Any friendly unit (creature, player or pet) within specified distance
SMART_TARGET_LOOT_RECIPIENTS27All tagging players
SMART_TARGET_FARTHEST28Max distPlayer only (0/1)Is in Los (0/1)Farthest unit on the threat list
SMART_TARGET_VEHICLE_PASSENGER29SeatMask (0: all seats)Vehicle targets unit in given seat
SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT30gameobject_template.entry (0: any)Max dist (0-100 yards)Closest unspawned gameobject with specified entry within specified distance.
(To be used only with SMART_ACTION_ENABLE_TEMP_GOBJ (70) and gameobjects with negative respawn time in the DB)

comment ​

Commenting on SAI uses a template which is the following: "Creature name - Event - Action"

Example: "Minion of Gurok - On spawn - Set Random Movement"

Enums ​

TabSet ​

PowerType ​

NameValue
POWER_HEALTH-2
POWER_MANA0
POWER_RAGE1
POWER_FOCUS2
POWER_ENERGY3
POWER_COMBO_POINTS4
POWER_RUNES5
POWER_RUNIC_POWER6
POWER_SOUL_SHARDS7
POWER_LUNAR_POWER8
POWER_HOLY_POWER9
POWER_ALTERNATE_POWER10
POWER_MAELSTROM11
POWER_CHI12
POWER_INSANITY13
POWER_BURNING_EMBERS14
POWER_DEMONIC_FURY15
POWER_ARCANE_CHARGES16
POWER_FURY17
POWER_PAIN18
POWER_ESSENCE19
POWER_RUNE_BLOOD20
POWER_RUNE_FROST21
POWER_RUNE_UNHOLY22
POWER_ALTERNATE_QUEST23
POWER_ALTERNATE_ENCOUNTER24
POWER_ALTERNATE_MOUNT25

EndTabset ​