Skip to content
Saltgurka edited this page Apr 18, 2020 · 44 revisions

Back to world database list of tables.

The `dbscripts_on_*` tables

The manual reference for these tables is located in the doc/script_commands.txt file.

The information below may be outdated, use with caution!

This table format is used for different tables to control possible scripts activated by different actions:

  • `dbscripts_on_go_[template]_use: Holds possible scripts activated by gameobjects.
    Source: object user (unit); Target: gameobject.
    • dbscripts_on_go_template_use can be used for any type of gameobject.
    • dbscripts_on_go_use can be used only for GAMEOBJECT_TYPE_DOOR (0) and GAMEOBJECT_TYPE_BUTTON (1)
  • `dbscripts_on_spell: Holds scripts that can be activated by spells with the following spell effects:
    • SPELL_EFFECT_DUMMY (3)
    • SPELL_EFFECT_TRIGGER_SPELL (64) – only for missing triggered spells
    • SPELL_EFFECT_SCRIPT_EFFECT (77)
      Source: caster; Target: target.
  • `dbscripts_on_relay: Holds scripts that can be activated by AI or other dbscripts. The usage of IDs is as following:
    • Classic – 1-9999
    • TBC – 10000-19999
    • WotLK – 20000+
      Source and Target are defined by the mechanism that launched it.
  • `dbscripts_on_quest_start: Holds scripts activated when a player accepts a quest.
    Source: quest giver (creature); Target: player; Script execution unique by source.
  • `dbscripts_on_quest_end: Holds scripts activated when a player finishes a quest.
    Source: quest taker (creature); Target: player; Script execution unique by source.
  • `dbscripts_on_creature_movement: Holds scripts activated while a npc is moving.
    Source: moving creature; Target moving creature.
  • `dbscripts_on_creature_death: Holds scripts activated when a creature dies.
    Source: killed creature; Target: responsible killer (unit or player).
  • `dbscripts_on_event: Holds scripts activated whenever an event is activated by spell, gameobject or taxi waypoints. The following spell effects and gameobjects can activate an event:
    • SPELL_EFFECT_SEND_EVENT (61)
    • GAMEOBJECT_TYPE_CHEST (3)
    • GAMEOBJECT_TYPE_GOOBER (10)
    • GAMEOBJECT_TYPE_TRANSPORT (11) [not supported yet]
    • GAMEOBJECT_TYPE_CAMERA (13)
    • GAMEOBJECT_TYPE_MO_TRANSPORT (15) [partially supported]
    • GAMEOBJECT_TYPE_FLAGDROP (26) [not supported yet]
    • GAMEOBJECT_TYPE_CAPTURE_POINT (29)
    • GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING (33)
      Source, Target and Script execution can be different based on the event activation source.
  • `dbscripts_on_gossip: Holds scripts activated on gossip_menu_option or gossip_menu.
    • For gossip_menu – Source: player; Target: gossip holder (creature or gameobject); Script execution unique by target.
    • For gossip_menu_option when gossip holder is creature – Source: gossip holder (creature); Target: player; Script execution unique by source.
    • For gossip_menu_option when gossip holder is gameobject – Source: player; Target: gossip holder (gameobject); Script execution unique by target.

NOTE: An entry in this table may have more than one row as a script may do more than just one action. Also each action the script may make can have a separate delay attached to it. In that case, the core will activate the appropriate action after the correct delay.

Structure

Field Type Null Key Default Extra
id int(8) unsigned NO 0
delay int(10) unsigned NO 0
command mediumint(8) unsigned NO 0
datalong mediumint(8) unsigned NO 0
datalong2 int(10) unsigned NO 0
datalong3 int(11) unsigned NO 0
buddy_entry int(10) unsigned NO 0
search_radius int(10) unsigned NO 0
data_flags tinyint(3) unsigned NO 0
dataint int(11) NO 0
dataint2 int(11) NO 0
dataint3 int(11) NO 0
dataint4 int(11) NO 0
x float NO 0
y float NO 0
z float NO 0
o float NO 0
comments VARCHAR NO NULL

Description of the fields

id

For dbscripts_on_creature_death, it is the entry of the creature. See creature_template.entry.
For dbscripts_on_creature_movement, it is the script id of the waypoint. The PROPER formatting for the ID field is as follows: Creature_entry + 2-Digit Script ID (Starting at 01). Example: c.2386 has few movement_scripts, so 2386+01 = 238601 … 23602 ..etc
For dbscripts_on_event, it is the event ID. There doesn’t exist currently a full list of events. In any case, the event IDs are taken directly from gameobject WDB data or spell effect data. If both a gameobject and a spell activate the same event, the IDs will match.
For dbscripts_on_go_template_use, it is the entry of the button/lever. See gameobject_template.entry.
For dbscripts_on_go_use, it is the guid of the button/lever. See gameobject.guid.
For dbscripts_on_gossip, it is the action script id of the gossip option.
For dbscripts_on_promo_code_use, it is the ?
For dbscripts_on_quest_end, it is the ID that is used in CompleteScript in the quest template definition.
For dbscripts_on_quest_start, it is the ID that is used in StartScript in the quest template definition.
For dbscripts_on_relay, it is unique ID (0-9999 for Classic, 10k-19999 for TBC, 20K+ for WoTLK)
For dbscripts_on_spell, it is the Spell ID. See spell_template.Id

delay

Delay in milliseconds before this current step of the script activates. 0 = instant.

NOTE: Delay is Cumulative From Script to Script with same ID.
Example: Script 1 Has 5 seconds (5000ms) delay and then if you want script 2 to trigger 3 seconds (3000ms) later you would use delay value 8000 (5000+3000) for script 2 in the sequence.

command

The type of action performed by the script after delay milliseconds have passed. The value of this field affects what other fields also need to be set.

The following commands can be used (enum ScriptCommand):

Command Name Description
0 SCRIPT_COMMAND_TALK Creature say/whisper/yell/textemote.
1 SCRIPT_COMMAND_EMOTE Plays emote on a player/creature.
2 SCRIPT_COMMAND_FIELD_SET Change the value at an index for the player.
3 SCRIPT_COMMAND_MOVE_TO Relocate creature to a destination
4 SCRIPT_COMMAND_FLAG_SET Turns on bits on a flag field at an index for the player.
5 SCRIPT_COMMAND_FLAG_REMOVE Turns off bits on a flag field at an index for the player.
6 SCRIPT_COMMAND_TELEPORT_TO Teleports the player to a location.
7 SCRIPT_COMMAND_QUEST_EXPLORED Satisfies the explore requirement for a quest.
8 SCRIPT_COMMAND_KILL_CREDIT Satisfies the kill credit requirement for a quest.
9 SCRIPT_COMMAND_RESPAWN_GAMEOBJECT Spawns a despawned gameobject.
10 SCRIPT_COMMAND_TEMP_SPAWN_CREATURE Temporarily summon a creature.
11 SCRIPT_COMMAND_OPEN_DOOR Opens a door gameobject (type == 0).
12 SCRIPT_COMMAND_CLOSE_DOOR Closes a door gameobject (type == 0).
13 SCRIPT_COMMAND_ACTIVATE_OBJECT Activate (use) a gameobject.
14 SCRIPT_COMMAND_REMOVE_AURA Removes an aura due to a spell.
15 SCRIPT_COMMAND_CAST_SPELL Casts a spell.
16 SCRIPT_COMMAND_PLAY_SOUND Plays a sound.
17 SCRIPT_COMMAND_CREATE_ITEM Creates an item.
18 SCRIPT_COMMAND_DESPAWN_SELF Despawns a creature with some delay.
19 SCRIPT_COMMAND_PLAY_MOVIE Plays a movie to the target player.
20 SCRIPT_COMMAND_MOVEMENT Change the movement type of a creature (idle, random, waypoint).
21 SCRIPT_COMMAND_SET_ACTIVEOBJECT Set a creature as active object.
22 SCRIPT_COMMAND_SET_FACTION Changes the faction of a creature.
23 SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL Morphs a creature go a given model.
24 SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL Mounts or dismounts a creature to mount entry or model.
25 SCRIPT_COMMAND_SET_RUN Makes a creature start or stop running.
26 SCRIPT_COMMAND_ATTACK_START Makes a creature attack things within a radius.
27 SCRIPT_COMMAND_GO_LOCK_STATE Change the GO lock or interact flags.
28 SCRIPT_COMMAND_STAND_STATE Change the stand state of a creature.
29 SCRIPT_COMMAND_MODIFY_NPC_FLAGS Change NPC flags of a creature.
30 SCRIPT_COMMAND_SEND_TAXI_PATH Sends a player on a give taxi path.
31 SCRIPT_COMMAND_TERMINATE_SCRIPT Stop script execution if a given creature entry meets conditions.
32 SCRIPT_COMMAND_PAUSE_WAYPOINTS Pause or unpause waypoint movement.
33 SCRIPT_COMMAND_RESERVED_1 Enable or disable experience gain for a player.
34 SCRIPT_COMMAND_TERMINATE_COND Stop script execution when a give condition is met.
35 SCRIPT_COMMAND_SEND_AI_EVENT Send a give AI event for EventAI around the source with a given radius.
36 SCRIPT_COMMAND_SET_FACING Turn resulting source to resulting target.
37 SCRIPT_COMMAND_MOVE_DYNAMIC Move resulting source to a random point around resulting target or to resulting target.
38 SCRIPT_COMMAND_SEND_MAIL Send mail from resulting source to resulting target.
39 SCRIPT_COMMAND_SET_FLY Makes a creature start or stop flying.
40 SCRIPT_COMMAND_DESPAWN_GO Despawns a gameobject.
41 SCRIPT_COMMAND_RESPAWN Respawns a creature.
42 SCRIPT_COMMAND_SET_EQUIPMENT_SLOTS Change equipment slots of the resulting source.
43 SCRIPT_COMMAND_RESET_GO Reset a gameobject.
44 SCRIPT_COMMAND_UPDATE_TEMPLATE Update creature entry.
45 SCRIPT_COMMAND_START_RELAY_SCRIPT Launch relay script or relay template.
46 SCRIPT_COMMAND_CAST_CUSTOM_SPELL resSource = Unit, cast spell at resTarget = Unit
47 SCRIPT_COMMAND_INTERRUPT_SPELL resSource = Unit, interrupt spell in specific slot
48 SCRIPT_UNK_1 reserved
49 SCRIPT_UNK_2 reserved

buddy_entry

Commands except the ones requiring a player (like KILL_CREDIT) have support for the buddy concept.

This means that if an entry for buddy_entry is provided, aside from source and target as listed above also a “buddy” is available.

Which one on the three (originalSource, originalTarget, buddy) will be used in the command, depends on the data_flags (enum ScriptInfoDataFlags) Note that some commands (like EMOTE) use only the resulting source for an action.

Possible combinations of the data_flags |SCRIPT_FLAG_BUDDY_AS_TARGET 0×01|SCRIPT_FLAG_REVERSE_DIRECTION 0×02|SCRIPT_FLAG_SOURCE_TARGETS_SELF 0×04| are:

Where “A → B” means that the command is executed from A with B as target.

Hex A → B
0×00 originalSource / buddyIfProvided → originalTarget
0×01 originalSource → buddy
0×02 originalTarget → originalSource / buddyIfProvided
0×03 buddy → originalSource
0×04 originalSource / buddyIfProvided → originalSource / buddyIfProvided
0×05 originalSource → originalSource
0×06 originalTarget → originalTarget
0×07 buddy → buddy

search_radius

Range in which the buddy defined in buddy_entry will be searched by creature_template.entry.

& data_flags Description
& SCRIPT_FLAG_BUDDY_BY_GUID creature.guid instead of creature_template.entry
& SCRIPT_FLAG_BUDDY_BY_POOL pool_creature.pool_entry instead of creature_template.entry

data_flags

Defined in “enum ScriptInfoDataFlags”

Decimal Hex Type Description
0 0×00 DEFAULT s/b → t
1 0×01 SCRIPT_FLAG_BUDDY_AS_TARGET s → b
2 0×02 SCRIPT_FLAG_REVERSE_DIRECTION t* → s* (* result after previous flag is evaluated)
4 0×04 SCRIPT_FLAG_SOURCE_TARGETS_SELF s* → s* (* result after previous flag is evaluated)
8 0×08 SCRIPT_FLAG_COMMAND_ADDITIONAL Only for some commands possible.
16 0×10 SCRIPT_FLAG_BUDDY_BY_GUID Interpret search_radius as buddy_entry GUID.
32 0×20 SCRIPT_FLAG_BUDDY_IS_PET Do not search for an npc, but for a pet.
64 0×40 SCRIPT_FLAG_BUDDY_IS_DESPAWNED Search for a creature that is despawned or dead.
128 0×80 SCRIPT_FLAG_BUDDY_BY_POOL buddy should be part of a pool

OtherFields

Depending on what command was used, the meaning and use for the following fields varies.

  • SCRIPT_COMMAND_TALK = 0
    • All information of the text (type, language, associated sound, emote) is stored in the dbscript_string. table
    • datalong: dbscript_random_templates.id – will randomize between all dbscript_strings in given template.
    • dataint – 4: The text ID that the creature will say. See dbscript_string.. ID must be between 2000000000 and 2000010000. In case more then only dataint field is filled the texts will be used randomly.
  • SCRIPT_COMMAND_EMOTE = 1
    • datalong: The emote ID to play.
    • dataint1-dataint4 optionally, for random selection of emote
    • Resulting source must be a unit.
  • SCRIPT_COMMAND_FIELD_SET = 2
    • datalong: Index of the field.
    • datalong2: Value to place at the index.
  • SCRIPT_COMMAND_MOVE_TO = 3
    • datalong2: Length of the motion. This calculates as travel_speed*100. Use 0 for creature default movement.
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8) will teleport the creature to the given location.
    • x: X position to move to.
    • y: Y position to move to.
    • z: Z position to move to.
    • o: Orientation to face.
    • Resulting source must be a creature.
      Side note: If position is very near to current position, or x=y=z=0, then only orientation is changed.
  • SCRIPT_COMMAND_FLAG_SET = 4
    • datalong: Field index to be set.
    • datalong2: Flag bit(s) to set.
Type classic tbc wotlk Description
UNIT_FIELD_HEALTH 22 22 24 Health
UNIT_FIELD_POWER1 23 23 25 Mana
UNIT_FIELD_LEVEL 34 34 54 Level
UNIT_FIELD_FLAGS 46 46 59 UnitFlags
UNIT_FIELD_BOUNDINGRADIUS 129 150 65 bounding_radius
UNIT_FIELD_COMBATREACH 130 151 66 combat_reach
UNIT_FIELD_BYTES_1 138 159 74 bytes1
UNIT_DYNAMIC_FLAGS 143 164 79 DynamicFlags
UNIT_NPC_FLAGS 147 168 82 NpcFlags

More Examples Can Be Found At: UpdateFields.h In Core

  • SCRIPT_COMMAND_FLAG_REMOVE = 5
    • datalong: Field index to be unset.
    • datalong2: Flag bit(s) to unset.
  • SCRIPT_COMMAND_TELEPORT_TO = 6
    • datalong: Target Map ID. See Map.dbc.
    • x: Teleport target x coordinate.
    • y: Teleport target y coordinate.
    • z: Teleport target z coordinate.
    • o: Teleport target orientation.
    • The source or target must be a player.
  • SCRIPT_COMMAND_QUEST_EXPLORED = 7
    • datalong: Quest ID whose external status should be satisfied.
    • datalong2: Distance away from the NPC/object that the player can be and have the script still take effect.
    • The source or target must be a player.
  • SCRIPT_COMMAND_KILL_CREDIT = 8
    • datalong: Kill credit entry for quest (entry in quest_template.ReqCreatureOrGOId). If set to 0 then the creature source or target will be used.
    • datalong2: Can be 0 = personal credit or 1 = group credit.
    • The source or target must be a player.
  • SCRIPT_COMMAND_RESPAWN_GAMEOBJECT = 9
    • datalong: Guid of the gameobject to respawn. See gameobject.guid. Can be skipped for buddy.
    • datalong2: Despawn time in seconds. If the value is < 5 seconds then 5 seconds is used instead.
  • SCRIPT_COMMAND_TEMP_SPAWN_CREATURE = 10
    • datalong: Entry of the summoned creature from creature_template.entry.
    • datalong2: Despawn time (MILLIESECONDS). If set to 0 then the creature will be despawned only when killed.
    • datalong3: The pathId you want the creature to immediately start moving on (if MovementType=2)
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8) will summon the creature as active object.
    • dataint: SetRun (bool). 0 = off (default), 1 = on
    • dataint2 = factionId – if 0 is set, faction is from DB entry
    • dataint3 = modelId – if 0 is set, model is from DB entry
    • x: Summon target x coordinate.
    • y: Summon target y coordinate.
    • z: Summon target z coordinate.
    • o: Summon target orientation.
  • SCRIPT_COMMAND_OPEN_DOOR = 11
    • datalong: Guid of the activated door. It’s a gameobject.guid. Can be skipped for buddy.
    • datalong2: Delay before closing again the door. If the value is < 15 seconds then 15 seconds is used instead.
  • SCRIPT_COMMAND_CLOSE_DOOR = 12
    • datalong: Guid of the activated door. It’s a gameobject.guid. Can be skipped for buddy.
    • datalong2: Delay before opening again the door. If the value is < 15 seconds then 15 is used instead.
  • SCRIPT_COMMAND_ACTIVATE_OBJECT = 13
    • The source must be a unit and the target a gameobject.
  • SCRIPT_COMMAND_REMOVE_AURA = 14
    • datalong: Spell ID.
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8) will remove aura from the source only for the target unit.
      warning – if used with a channeled spell will not interrupt channel
  • SCRIPT_COMMAND_CAST_SPELL = 15
    • datalong: Spell ID.
    • datalong2: TriggerCastFlags
    • buddy_entry: entry of the target
    • search_radius: radius to search for buddy_entry or guid of the specific guid if data_flags is set
    • dataint1-dataint4 optional. If some of these are set to a spell id, a random spell out of datalong, datint1, ..,dataintX is cast.

TriggerCastFlags

Bit Name Description
0 TRIGGERED_NONE Not Triggered
1 TRIGGERED_OLD_TRIGGERED Legacy bool support TODO: Restrict usage as much as possible.
2 TRIGGERED_IGNORE_HIT_CALCULATION Will ignore calculating hit in SpellHitResult
4 TRIGGERED_IGNORE_UNSELECTABLE_FLAG Ignores UNIT_FLAG_NOT_SELECTABLE in CheckTarget
8 TRIGGERED_INSTANT_CAST Will ignore any cast time set in spell entry
16 TRIGGERED_AUTOREPEAT Will signal spell system that this is internal autorepeat call
32 TRIGGERED_IGNORE_UNATTACKABLE_FLAG Ignores UNIT_FLAG_NOT_ATTACKABLE in CheckTarget
64 TRIGGERED_DO_NOT_PROC Spells from scripts should not proc – DBScripts for example
128 TRIGGERED_PET_CAST Spell that should report error through pet opcode
256 TRIGGERED_NORMAL_COMBAT_CAST AI needs to be notified about change of target TODO: change into TRIGGERED_NONE
  • SCRIPT_COMMAND_PLAY_SOUND = 16
    • datalong: Sound ID.
    • datalong2: bitmask: 0/1=anyone/target, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide; 1|2 = 3 is target with distance dependent.
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8): play music instead of sound
    • Source may be any object. Target may be any player.
  • SCRIPT_COMMAND_CREATE_ITEM = 17
    • datalong: Item entry.
    • datalong2: Amount.
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8): remove the item from player by the given amount
    • Source or target must be a player.
  • SCRIPT_COMMAND_DESPAWN_SELF = 18
    • datalong: Despawn delay (MILLISECONDS).
    • Resulting source must be a creature.
    • Despawns the target.
  • SCRIPT_COMMAND_PLAY_MOVIE = 19
    • datalong: Plays a movie_id to the target player.
    • Target must be a player.
  • SCRIPT_COMMAND_MOVEMENT = 20
    • datalong: Change the MovementType of a creature. Possible values: 0 = Idle, 1 = Random Movement, 2 = Waypoint Movement.
    • datalong2: Wander distance (for random movement), creature_movement_template.pathId (for waypoint movement).
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8) will set random movement around the current position.
    • Resulting source must be a creature.
  • SCRIPT_COMMAND_SET_ACTIVEOBJECT = 21
    • datalong: Can be defined as 1 = On or 0 = Off. Set a creature as active object, depending on the datalong value.
    • Resulting source must be creature.
  • SCRIPT_COMMAND_SET_FACTION = 22
    • datalong: Faction Id. If set to 0 will restore original faction from creature_template.
    • Resulting source must be a creature.
    • datalong2: Temporary faction flags
Bit Hex Description
0 0×00 TEMPFACTION_NONE When no flag is used in temporary faction change, faction will be persistent. It will then require manual change back to default/another faction when changed once.
1 0×01 TEMPFACTION_RESTORE_RESPAWN Default faction will be restored at respawn.
2 0×02 TEMPFACTION_RESTORE_COMBAT_STOP at CombatStop() (happens at creature death, at evade or custom script among others).
4 0×04 TEMPFACTION_RESTORE_REACH_HOME at reaching home in home movement (evade), if not already done at CombatStop().
8 0×08 TEMPFACTION_TOGGLE_NON_ATTACKABLE Remove UNIT_FLAG_NON_ATTACKABLE(0×02) when faction is changed (reapply when temp-faction is removed).
16 0×10 TEMPFACTION_TOGGLE_IMMUNE_TO_PLAYER Remove UNIT_FLAG_IMMUNE_TO_PLAYER(0×100) when faction is changed (reapply when temp-faction is removed.)
32 0×20 TEMPFACTION_TOGGLE_IMMUNE_TO_NPC Remove UNIT_FLAG_IMMUNE_TO_NPC(0×200) when faction is changed (reapply when temp-faction is removed)
64 0×40 TEMPFACTION_TOGGLE_PACIFIED Remove UNIT_FLAG_PACIFIED(0×20000) when faction is changed (reapply when temp-faction is removed)
128 0×80 TEMPFACTION_TOGGLE_NOT_SELECTABLE Remove UNIT_FLAG_NOT_SELECTABLE(0×2000000) when faction is changed (reapply when temp-faction is removed)
  • SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL = 23
    • datalong: Creature entry or model_id (depending on data_flags). If set to 0 then the creature will demorph.
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8) to use datalong value as model_id explicit.
    • Resulting source must be a creature.
  • SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL = 24
    • datalong: Creature entry or model_id (depending on data_flags). If set to 0 then the creature will dismount.
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8) to use datalong value as model_id explicit.
    • Resulting source must be creature.
  • SCRIPT_COMMAND_SET_RUN = 25
    • datalong: Set run to 1 = On or 0 = Off
    • Resulting source must be a creature.
  • SCRIPT_COMMAND_ATTACK_START = 26
    • Resulting source must be a creature and resulting target must be a unit.
  • SCRIPT_COMMAND_GO_LOCK_STATE = 27
    • Resulting source must be gameobject.
    • datalong:
Bit Hex Name
1 0×01 flag_go_lock
2 0×02 flag_go_unlock
4 0×04 flag_go_nonInteract
8 0×08 flag_go_interact
  • SCRIPT_COMMAND_STAND_STATE = 28
    • Resulting source must be a creature.
    • datalong: stand state (enum UnitStandStateType)
Bit Name Comment
0 UNIT_STAND_STATE_STAND normal behavior
1 UNIT_STAND_STATE_SIT sitting on ground
2 UNIT_STAND_STATE_SIT_CHAIR sitting on normal chair
3 UNIT_STAND_STATE_SLEEP sleeping
4 UNIT_STAND_STATE_SIT_LOW_CHAIR sitting on low chair
5 UNIT_STAND_STATE_SIT_MEDIUM_CHAIR sitting on medium chair
6 UNIT_STAND_STATE_SIT_HIGH_CHAIR sitting on high chair
7 UNIT_STAND_STATE_DEAD play dead
8 UNIT_STAND_STATE_KNEEL kneel
9 UNIT_STAND_STATE_CUSTOM Depends on model animation. Submerge, freeze, hide, hibernate, rest
  • SCRIPT_COMMAND_MODIFY_NPC_FLAGS = 29
    • Resulting source must be a creature.
    • datalong: NPC Flags
    • datalong2:
Hex Action
0×00 Toggle
0×01 Add
0×02 Remove
  • SCRIPT_COMMAND_SEND_TAXI_PATH = 30
    • datalong: Taxi path id.
    • Source or target must be a player.
  • SCRIPT_COMMAND_TERMINATE_SCRIPT = 31
    • datalong: Creature entry if provided. (Or pool ID if SCRIPT_FLAG_BUDDY_BY_POOL)
    • datalong2: Search distance.
    • dataint: Change of waittime (MILLISECONDS) of a current waypoint movement type. Negative values will decrease time.
    • data_flags
& data_flags Description
& SCRIPT_FLAG_COMMAND_ADDITIONAL 8 0×08 If creature is found and alive, terminate script.
! SCRIPT_FLAG_COMMAND_ADDITIONAL If creature is not found or not alive, terminate script.
  • SCRIPT_COMMAND_PAUSE_WAYPOINTS = 32
    • datalong: 1 = Pause or 0 = Unpause waypoint movement.
    • Resulting source or target must be a creature.
  • SCRIPT_COMMAND_XP_USER = 33
    • datalong: Set experience gain to 1 = On or 0 = Off
    • Source or target must be a player.
      Side note: Only available on wotlk version.
& data_flags Description
& SCRIPT_FLAG_COMMAND_ADDITIONAL 8 0×08 Terminate when condition is false.
! SCRIPT_FLAG_COMMAND_ADDITIONAL Terminate when condition is true.
  • SCRIPT_COMMAND_SEND_AI_EVENT = 35
    • datalong: AI event id. Only EventAI events are accepted. Supported types see CreatureAI.h enum AIEventType.
    • datalong2: Radius. If radius isn’t provided and the target is a creature, then send AIEvent to target.
    • Source and target must be a creature.
  • SCRIPT_COMMAND_SET_FACING = 36
    • Resulting source must be a creature; Resulting target must be a Worldobject.
    • datalong != 0 Reset orientation
  • SCRIPT_COMMAND_MOVE_DYNAMIC = 37
    • Resulting source must be a creature; Resulting target must be a Worldobject.
    • datalong = 0: Move resulting source towards resulting target
    • datalong != 0: Move resulting source to a random point between datalong2..datalong around resulting target.
    • datalong3 = Exact contact point distance, to be used when you want to stop moving as soon as you’re within this distance of the target
    • orientation != 0: Obtain a random point around resulting target in direction of orientation
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8) Obtain a point in direction of resulting target→GetOrientation + orientation
    • for resulting target == resulting source and orientation == 0 this will mean resulting source moving forward
  • SCRIPT_COMMAND_SEND_MAIL = 38
    • Resulting source should be a Creature OR NULL. Resulting target must be Player
    • datalong = mailTemplateId
    • datalong2: AlternativeSenderEntry. Use as sender-Entry of the sent mail
    • dataint1: Delay (>= 0) in Seconds
  • SCRIPT_COMMAND_SET_FLY = 39
    • Resulting source must be a creature.
    • datalong = bool 0=off, 1=on
    • data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL (8) set/unset byte flag UNIT_BYTE1_FLAG_FLY_ANIM
  • SCRIPT_COMMAND_DESPAWN_GO = 40
    • Resulting target must be a Gameobject. Please note that not all gameobject types support this command.
  • SCRIPT_COMMAND_RESPAWN = 41
    • resultingSource = Creature. Requires SCRIPT_FLAG_BUDDY_IS_DESPAWNED to find dead or despawned targets
  • SCRIPT_COMMAND_SET_EQUIPMENT_SLOTS = 42
    • Resulting source must be a creature.
    • datalong = resetDefault: bool 0=false, 1=true
    • dataint = main hand slot; dataint2 = off hand slot; dataint3 = ranged slot
  • SCRIPT_COMMAND_RESET_GO = 43
    • Resulting target must be a Gameobject. Only works for Gameobject which are doors or buttons (GO type 0 and 1)
  • SCRIPT_COMMAND_UPDATE_TEMPLATE = 44
    • Resulting source must be a Creature.
    • datalong = new creature entry. Must be different than the current one
    • datalong2 = faction for which the entry is updated. 0 = Alliance, 1 = Horde. No other values are allowed
  • SCRIPT_COMMAND_START_RELAY_SCRIPT= 45
    • Resulting source must be a Unit. Target is not mandatory.
    • datalong = dbscripts_on_relay Id which should be launched
    • datalong2 = dbscript_random_template relay Id which should be launched. Takes precedence over relay Id.
  • SCRIPT_COMMAND_CAST_CUSTOM_SPELL= 46
    • Resulting source must be a Unit. Target is Unit.
    • datalong = spellid
    • datalong2 = castFlags, enum TriggerCastFlags
    • dataint1-3 define the &bp value for the spell. At least one field is required.
  • SCRIPT_COMMAND_INTERRUPT_SPELL= 47
Clone this wiki locally