diff --git a/doc/ScriptCommands.md b/doc/ScriptCommands.md index 0490ea7f..021ec577 100644 --- a/doc/ScriptCommands.md +++ b/doc/ScriptCommands.md @@ -129,57 +129,51 @@ where `A -> B` means that the command is executed from A with B as target. Commands and their parameters ----------------------------- -ID | Name | Parameters --- | -------------------------------------- | ------------------------------------- -0 | SCRIPT_COMMAND_TALK | resultingSource = WorldObject, resultingTarget = Unit/none, `dataint` = text entry from db_script_string -table. `dataint2`-`dataint4` optionally, for random selection of text -1 | SCRIPT_COMMAND_EMOTE | resultingSource = Unit, resultingTarget = Unit/none, `datalong` = emote_id, dataint1-dataint4 = optionally for random selection of emote -2 | SCRIPT_COMMAND_FIELD_SET | source = any, `datalong` = field_id, `datalong2` = field value -3 | SCRIPT_COMMAND_MOVE_TO | resultingSource = Creature. If position is very near to current position, or x=y=z=0, then only orientation is changed. `datalong2` = travel_speed*100 (use 0 for creature default movement). `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: teleport unit to position `x`/`y`/`z`/`o` -4 | SCRIPT_COMMAND_FLAG_SET | source = any. `datalong` = field_id, `datalong2` = bit mask -5 | SCRIPT_COMMAND_FLAG_REMOVE | source = any. `datalong` = field_id, `datalong2` = bit mask -6 | SCRIPT_COMMAND_TELEPORT_TO | source or target with Player. `datalong` = map_id, x/y/z -7 | SCRIPT_COMMAND_QUEST_EXPLORED | one from source or target must be Player, another GO/Creature. `datalong` = quest_id, `datalong2` = distance or 0 -8 | SCRIPT_COMMAND_KILL_CREDIT | source or target with Player. `datalong` = creature entry, or 0; If 0 the entry of the creature source or target is used, `datalong2` = bool (0=personal credit, 1=group credit) -9 | SCRIPT_COMMAND_RESPAWN_GAMEOBJECT | source = any, target = any. `datalong`=db_guid (can be skipped for buddy), `datalong2` = despawn_delay -10 | SCRIPT_COMMAND_TEMP_SUMMON_CREATURE | source = any, target = any. `datalong` = creature entry, `datalong2` = despawn_delay, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: summon as active object -11 | SCRIPT_COMMAND_OPEN_DOOR | source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay -12 | SCRIPT_COMMAND_CLOSE_DOOR | source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay -13 | SCRIPT_COMMAND_ACTIVATE_OBJECT | source = unit, target=GO. -14 | SCRIPT_COMMAND_REMOVE_AURA | resultingSource = Unit. `datalong` = spell_id -15 | SCRIPT_COMMAND_CAST_SPELL | resultingSource = Unit, cast spell at resultingTarget = Unit. `datalong` = spell id, `dataint1`-`dataint4` optional. If some of these are set to a spell id, a random spell out of datalong, datint1, ..,dataintX is cast., `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: cast triggered -16 | SCRIPT_COMMAND_PLAY_SOUND | source = any object, target=any/player. `datalong` = sound_id, `datalong2` (bit mask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide; so 1|2 = 3 is target with distance dependent) -17 | SCRIPT_COMMAND_CREATE_ITEM | source or target must be player. `datalong` = item entry, `datalong2` = amount -18 | SCRIPT_COMMAND_DESPAWN_SELF | resultingSource = Creature. `datalong` = despawn delay -19 | SCRIPT_COMMAND_PLAY_MOVIE | target can only be a player. `datalong` = movie id -20 | SCRIPT_COMMAND_MOVEMENT | resultingSource = Creature. `datalong` = MovementType (0:idle, 1:random or 2:waypoint), `datalong2` = wanderDistance (for random movement), `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: RandomMovement around current position -21 | SCRIPT_COMMAND_SET_ACTIVEOBJECT | resultingSource = Creature. `datalong` = bool 0=off, 1=on -22 | SCRIPT_COMMAND_SET_FACTION | resultingSource = Creature. `datalong` = factionId OR 0 to restore original faction from creature_template, `datalong2` = enum TemporaryFactionFlags -23 | SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL | resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to demorph, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit -24 | SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL | resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to dismount, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit -25 | SCRIPT_COMMAND_SET_RUN | resultingSource = Creature. `datalong` = bool 0=off, 1=on -26 | SCRIPT_COMMAND_ATTACK_START | resultingSource = Creature, resultingTarget = Unit. -27 | SCRIPT_COMMAND_GO_LOCK_STATE | resultingSource = GO. `datalong` = flag_go_lock = 0x01, flag_go_unlock = 0x02, flag_go_nonInteract = 0x04, flag_go_interact = 0x08 -28 | SCRIPT_COMMAND_STAND_STATE | resultingSource = Creature. `datalong` = stand state (enum UnitStandStateType) -29 | SCRIPT_COMMAND_MODIFY_NPC_FLAGS | resultingSource = Creature. `datalong` = NPCFlags, `datalong2` = 0x00=toggle, 0x01=add, 0x02=remove -30 | SCRIPT_COMMAND_SEND_TAXI_PATH | resultingTarget or Source must be Player. `datalong` = taxi path id -31 | SCRIPT_COMMAND_TERMINATE_SCRIPT | `datalong` = search for npc entry if provided, `datalong2` = search distance, `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: if npc not alive found, terminate script, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`: if npc alive found, terminate script, `dataint` = change of waittime (MILLISECONDS) of a current waypoint movement type (negative values will decrease time) -32 | SCRIPT_COMMAND_PAUSE_WAYPOINTS | resultingSource must be Creature. `datalong` = 0/1 unpause/pause waypoint movement -33 | SCRIPT_COMMAND_RESERVED_1 | reserved for 3.x and later. Do not use! -34 | SCRIPT_COMMAND_TERMINATE_COND | `datalong` = condition_id, `datalong2` = fail-quest (if provided this quest will be failed for a player), `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: terminate when condition is true, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`: terminate when condition is false -35 | SCRIPT_COMMAND_SEND_AI_EVENT_AROUND | resultingSource = Creature, resultingTarget = Unit, datalong = AIEventType - limited only to EventAI supported events, datalong2 = radius -36 | SCRIPT_COMMAND_TURN_TO | resultingSource = Creature, resultingTarget = Unit/none. -37 | SCRIPT_COMMAND_MOVE_DYNAMIC | Move resultingSource to a random point around resultingTarget or to resultingTarget - | * resultingSource = Creature, resultingTarget Worldobject. - | * datalong = 0: Move resultingSource towards resultingTarget - | * datalong != 0: Move resultingSource to a random point between datalong2..datalong around resultingTarget. - | orientation != 0: Obtain a random point around resultingTarget in direction of orientation - | * data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL Obtain a point in direction of resTarget->GetOrientation + orientation - | for resTarget == resSource and orientation == 0 this will mean resSource moving forward -38 | SCRIPT_COMMAND_SEND_MAIL | Send a mail from resSource to resTarget - | * resultingSource = Creature OR NULL, resTarget must be Player - | * datalong = mailTemplateId - | * datalong2: AlternativeSenderEntry. Use as sender-Entry of the sent mail - | * dataint1: Delay (>= 0) in Seconds +
ID | +Name | +Parameters | +
---|---|---|
0 | SCRIPT_COMMAND_TALK | resultingSource = WorldObject, resultingTarget = Unit/none, `dataint` = text entry from db_script_string -table. `dataint2`-`dataint4` optionally, for random selection of text |
1 | SCRIPT_COMMAND_EMOTE | resultingSource = Unit, resultingTarget = Unit/none, `datalong` = emote_id, dataint1-dataint4 = optionally for random selection of emote |
2 | SCRIPT_COMMAND_FIELD_SET | source = any, `datalong` = field_id, `datalong2` = field value |
3 | SCRIPT_COMMAND_MOVE_TO | resultingSource = Creature. If position is very near to current position, or x=y=z=0, then only orientation is changed. `datalong2` = travel_speed*100 (use 0 for creature default movement). `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: teleport unit to position `x`/`y`/`z`/`o` |
4 | SCRIPT_COMMAND_FLAG_SET | source = any. `datalong` = field_id, `datalong2` = bit mask |
5 | SCRIPT_COMMAND_FLAG_REMOVE | source = any. `datalong` = field_id, `datalong2` = bit mask |
6 | SCRIPT_COMMAND_TELEPORT_TO | source or target with Player. `datalong` = map_id, x/y/z |
7 | SCRIPT_COMMAND_QUEST_EXPLORED | one from source or target must be Player, another GO/Creature. `datalong` = quest_id, `datalong2` = distance or 0 |
8 | SCRIPT_COMMAND_KILL_CREDIT | source or target with Player. `datalong` = creature entry, or 0; If 0 the entry of the creature source or target is used, `datalong2` = bool (0=personal credit, 1=group credit) |
9 | SCRIPT_COMMAND_RESPAWN_GAMEOBJECT | source = any, target = any. `datalong`=db_guid (can be skipped for buddy), `datalong2` = despawn_delay |
10 | SCRIPT_COMMAND_TEMP_SUMMON_CREATURE | source = any, target = any. `datalong` = creature entry, `datalong2` = despawn_delay, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: summon as active object |
11 | SCRIPT_COMMAND_OPEN_DOOR | source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay |
12 | SCRIPT_COMMAND_CLOSE_DOOR | source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay |
13 | SCRIPT_COMMAND_ACTIVATE_OBJECT | source = unit, target=GO. |
14 | SCRIPT_COMMAND_REMOVE_AURA | resultingSource = Unit. `datalong` = spell_id |
15 | SCRIPT_COMMAND_CAST_SPELL | resultingSource = Unit, cast spell at resultingTarget = Unit. `datalong` = spell id, `dataint1`-`dataint4` optional. If some of these are set to a spell id, a random spell out of datalong, datint1, ..,dataintX is cast., `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: cast triggered |
16 | SCRIPT_COMMAND_PLAY_SOUND | source = any object, target=any/player. `datalong` = sound_id, `datalong2` (bit mask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide; so 1 + 2 = 3 is target with distance dependent) |
17 | SCRIPT_COMMAND_CREATE_ITEM | source or target must be player. `datalong` = item entry, `datalong2` = amount |
18 | SCRIPT_COMMAND_DESPAWN_SELF | resultingSource = Creature. `datalong` = despawn delay |
19 | SCRIPT_COMMAND_PLAY_MOVIE | target can only be a player. `datalong` = movie id |
20 | SCRIPT_COMMAND_MOVEMENT | resultingSource = Creature. `datalong` = MovementType (0:idle, 1:random or 2:waypoint), `datalong2` = wanderDistance (for random movement), `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: RandomMovement around current position |
21 | SCRIPT_COMMAND_SET_ACTIVEOBJECT | resultingSource = Creature. `datalong` = bool 0=off, 1=on |
22 | SCRIPT_COMMAND_SET_FACTION | resultingSource = Creature. `datalong` = factionId OR 0 to restore original faction from creature_template, `datalong2` = enum TemporaryFactionFlags |
23 | SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL | resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to demorph, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit |
24 | SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL | resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to dismount, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit |
25 | SCRIPT_COMMAND_SET_RUN | resultingSource = Creature. `datalong` = bool 0=off, 1=on |
26 | SCRIPT_COMMAND_ATTACK_START | resultingSource = Creature, resultingTarget = Unit. |
27 | SCRIPT_COMMAND_GO_LOCK_STATE | resultingSource = GO. `datalong` = flag_go_lock = 0x01, flag_go_unlock = 0x02, flag_go_nonInteract = 0x04, flag_go_interact = 0x08 |
28 | SCRIPT_COMMAND_STAND_STATE | resultingSource = Creature. `datalong` = stand state (enum UnitStandStateType) |
29 | SCRIPT_COMMAND_MODIFY_NPC_FLAGS | resultingSource = Creature. `datalong` = NPCFlags, `datalong2` = 0x00=toggle, 0x01=add, 0x02=remove |
30 | SCRIPT_COMMAND_SEND_TAXI_PATH | resultingTarget or Source must be Player. `datalong` = taxi path id |
31 | SCRIPT_COMMAND_TERMINATE_SCRIPT | `datalong` = search for npc entry if provided, `datalong2` = search distance, `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: if npc not alive found, terminate script, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`:if npc alive found, terminate script, `dataint` = change of waittime (MILLISECONDS) of a current waypoint movement type (negative values will decrease time) |
32 | SCRIPT_COMMAND_PAUSE_WAYPOINTS | resultingSource must be Creature. `datalong` = 0/1 unpause/pause waypoint movement |
33 | SCRIPT_COMMAND_RESERVED_1 | reserved for 3.x and later. Do not use! |
34 | SCRIPT_COMMAND_TERMINATE_COND | `datalong` = condition_id, `datalong2` = fail-quest (if provided this quest will be failed for a player), `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: terminate when condition is true, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`:terminate when condition is false |
35 | SCRIPT_COMMAND_SEND_AI_EVENT_AROUND | resultingSource = Creature, resultingTarget = Unit, datalong = AIEventType - limited only to EventAI supported events, datalong2 = radius |
36 | SCRIPT_COMMAND_TURN_TO | resultingSource = Creature, resultingTarget = Unit/none. |
37 | SCRIPT_COMMAND_MOVE_DYNAMIC | Move resultingSource to a random point around resultingTarget or to resultingTarget. `resultingSource` = Creature, resultingTarget Worldobject. `datalong` = 0:Move resultingSource towards resultingTarget, `datalong` != 0: Move resultingSource to a random point between datalong2..datalong around resultingTarget. `orientation` != 0: Obtain a random point around resultingTarget in direction of orientation, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL Obtain a point in direction of resTarget->GetOrientation + orientation for resTarget == resSource and orientation == 0 this will mean resSource moving forward. |
38 | SCRIPT_COMMAND_SEND_MAIL | Send a mail from resSource to resTarget. `resultingSource` = Creature OR NULL, resTarget must be Player, `datalong` = mailTemplateId, `datalong2`: AlternativeSenderEntry. Use as sender-Entry of the sent mail, `dataint1`: Delay (>= 0) in Seconds |