NOTE: This page is auto-generated from the MAGNET DBDocs module, Any changes made directly to this page will be lost when it is regenerated. |
Description of the 'db_scripts' table for MaNGOSThree
This table holds scripts activated under certain criteria.
The type controls what criteria are in effect
Table Notes
This table uses the 'MyISAM' DB Engine
The Field definitions follow:
Field Name | Field Type | Nullable | Key | Default Value | Attributes | Notes |
---|---|---|---|---|---|---|
script_guid | mediumint(8) unsigned | NO | PRI | NULL | 'auto_increment' | The Unique Identifier for this script |
script_type | smallint(2) unsigned | NO | '0' | The type of script | ||
id | mediumint(8) unsigned | NO | '0' | Gossip script ID. | ||
delay | int(10) unsigned | NO | '0' | Delay (sec). | ||
command | mediumint(8) unsigned | NO | '0' | Script command. | ||
datalong | mediumint(8) unsigned | NO | '0' | Command parameter, see command description. | ||
datalong2 | int(10) unsigned | NO | '0' | Command parameter, see command description. | ||
buddy_entry | int(10) unsigned | NO | '0' | Creature ID (creature_template.entry) for changing source/target. | ||
search_radius | int(10) unsigned | NO | '0' | Radius for the buddy search. | ||
data_flags | tinyint(3) unsigned | NO | '0' | Command flags. | ||
dataint | int(11) | NO | '0' | Command parameter, see command description. | ||
dataint2 | int(11) | NO | '0' | Command parameter, see command description. | ||
dataint3 | int(11) | NO | '0' | Command parameter, see command description. | ||
dataint4 | int(11) | NO | '0' | Command parameter, see command description. | ||
x | float | NO | '0' | Position X. | ||
y | float | NO | '0' | Position Y. | ||
z | float | NO | '0' | Position Z. | ||
o | float | NO | '0' | Orientation angle (0 to 2*Pi). | ||
comments | varchar(255) | NO | {Blank String} | Textual comment. |
Description of the fields
script_guid mediumint(8) unsigned
The Unique Identifier for this script
script_type smallint(2) unsigned
The type of script:
Type | Type Name | Notes |
---|---|---|
0 | Quest Start | This type are scripts mentioned in the quest_template table. Here source = questgiver, target = Player. |
1 | Quest End | This type are scripts mentioned in the quest_template table. Here source = questrewarder, target = Player. |
2 | Gossip |
This type are scripts mentioned in the gossip_menu and gossip_menu_option tables. In the latter case, the parameters depend on object type (GameObject or Unit) of the object having such gossip: for GO, source = Player and target = GameObject; for Unit, source = Unit and target = Player. In the former case, source = Player and target = Unit. This all is rather funny, isn't this? The scripts "on talking to gameobject" are implemented instead with type 7 (Go Template Use). |
3 | Creature Movement | This type are scripts activated when a creature moving by waypoints reaches a WP. (Source: creature) |
4 | Creature Death | This type are scripts activated when a creature dies. (Source: creature; at the script execution time, it is considered alive, so can cast instant spells.) |
5 | Spell |
This type are scripts triggered by spells with EFFECT_DUMMY (3) or EFFECT_SCRIPT_EFFECT (77). Here source = caster, target = unitTarget. Note that if the spell contains more than 1 effect of such type, this script will be set up for the single effect only, namely for one with the least effect number. |
6 | Go Use |
This type are scripts activated when a character uses either door or button. This script, bound to the GameObject GUID, does not override the script bound to the GameObject entry, if any. If both scripts are defined, they are executed sequentially, the script of this type activates after type 7 (Go Template Use). |
7 | Go Template Use | This type are scripts activated when a character uses a gameobject (like door, chest, button so on). |
8 | Event | This type are scripts activated when an event is sent either via spell (SPELL_EFFECT_SEND_EVENT=61) or by a gameobject. |
id mediumint(8) unsigned
Gossip script ID [See gossip_menu.script_id, gossip_menu_option.action_script_id].
The script may contain several commands with identical id. Execution of these commands is not synchronized but the sequence is uniquely defined by 'delay' parameter.
delay int(10) unsigned
Delay in seconds. Note that for any delay>0, the creature is dead and cannot perform any action by itself (including cast).
Note:
Delay is accumulated over all events with identical id values.
command mediumint(8) unsigned
Script command. Note for this script type, several commands have no sense. These are animation command (will be overridden by death animation), movement, mount, despawn.
Command name | Value | Source and target | Other fields |
---|---|---|---|
SCRIPT_COMMAND_TALK | 0 | Source = WorldObject, Target = Unit/none | dataint = text entry from db_script_string table. dataint2-4 optional for random selected texts |
SCRIPT_COMMAND_EMOTE | 1 | Source = Unit, Target = Unit/none | datalong1 = emote_id, dataint1-4 optional for random selected emotes |
SCRIPT_COMMAND_FIELD_SET | 2 | source = any | datalong = field_id, datalong2 = value |
SCRIPT_COMMAND_MOVE_TO | 3 | Source = Creature | datalong2 = travel_speed*100, x/y/z; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL: teleport unit to position |
SCRIPT_COMMAND_FLAG_SET | 4 | source = any | datalong = field_id, datalong2 = bitmask |
SCRIPT_COMMAND_FLAG_REMOVE | 5 | source = any | datalong = field_id, datalong2 = bitmask |
SCRIPT_COMMAND_TELEPORT_TO | 6 | source or target is Player | datalong2 = map_id, x/y/z |
SCRIPT_COMMAND_QUEST_EXPLORED | 7 | one from source or target must be Player, another GO/Creature | datalong=quest_id, datalong2=distance or 0 |
SCRIPT_COMMAND_KILL_CREDIT | 8 | source or target is Player | datalong = creature entry (or 0 for target-entry), datalong2 = bool (0=personal credit, 1=group credit) |
SCRIPT_COMMAND_RESPAWN_GAMEOBJECT | 9 | source = any | datalong=db_guid, datalong2=despawn_delay |
SCRIPT_COMMAND_TEMP_SUMMON_CREATURE | 10 | source = any | datalong=creature entry, datalong2=despawn_delay; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL = summon active |
SCRIPT_COMMAND_OPEN_DOOR | 11 | datalong=db_guid (or not provided), datalong2=reset_delay | |
SCRIPT_COMMAND_CLOSE_DOOR | 12 | datalong=db_guid (or not provided), datalong2=reset_delay | |
SCRIPT_COMMAND_ACTIVATE_OBJECT | 13 | source = unit, target=GO | |
SCRIPT_COMMAND_REMOVE_AURA | 14 | Source = Unit | datalong = spell_id |
SCRIPT_COMMAND_CAST_SPELL | 15 | Source = Unit, cast spell on Target = Unit | datalong=spellid; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL = cast triggered |
SCRIPT_COMMAND_PLAY_SOUND | 16 | Source = WorldObject, target=any/player | datalong (sound_id), datalong2 (bitmask: 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) |
SCRIPT_COMMAND_CREATE_ITEM | 17 | source or target must be player | datalong = item entry, datalong2 = amount |
SCRIPT_COMMAND_DESPAWN_SELF | 18 | Source = Creature | datalong = despawn delay |
SCRIPT_COMMAND_PLAY_MOVIE | 19 | target can only be a player | datalog = movie id |
SCRIPT_COMMAND_MOVEMENT | 20 | Source = Creature | datalong = MovementType (0:idle, 1:random or 2:waypoint), datalong2 = wander-distance; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL = Random-movement around current position |
SCRIPT_COMMAND_SET_ACTIVEOBJECT | 21 | Source = Creature | datalong=bool 0=off, 1=on |
SCRIPT_COMMAND_SET_FACTION | 22 | Source = Creature | datalong=factionId, datalong2=faction_flags |
SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL | 23 | Source = Creature | datalong=creature entry/modelid; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL = use datalong value as modelid explicit |
SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL | 24 | Source = Creature | datalong=creature entry/modelid; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL = use datalong value as modelid explicit |
SCRIPT_COMMAND_SET_RUN | 25 | Source = Creature | datalong= bool 0=off, 1=on |
SCRIPT_COMMAND_ATTACK_START | 26 | Source = Creature, Target = Unit | |
SCRIPT_COMMAND_GO_LOCK_STATE | 27 | Source = GameObject | datalong= 1=lock, 2=unlock, 4=set not-interactable, 8=set interactable |
SCRIPT_COMMAND_STAND_STATE | 28 | Source = Creature | datalong = stand state (enum UnitStandStateType) |
SCRIPT_COMMAND_MODIFY_NPC_FLAGS | 29 | Source = Creature | datalong=NPCFlags; datalong2:0x00=toggle, 0x01=add, 0x02=remove |
SCRIPT_COMMAND_SEND_TAXI_PATH | 30 | source or target must be player | datalong = taxi path id |
SCRIPT_COMMAND_TERMINATE_SCRIPT | 31 | datalong = search for npc entry if provided, datalong2= search distance; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL: terminate steps of this script if npc found, ELSE: terminate steps of this script if npc not found; dataint=diff to change a waittime of current Waypoint Movement | |
SCRIPT_COMMAND_PAUSE_WAYPOINTS | 32 | Source = Creature | datalong = 0: unpause waypoint 1: pause waypoint |
SCRIPT_COMMAND_JOIN_LFG | 33 | datalong = zoneId | |
SCRIPT_COMMAND_TERMINATE_COND | 34 | datalong = condition_id, datalong2 = if != 0 then quest_id of quest that will be failed for player's group if the script is terminated; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL terminate when condition is false ELSE terminate when condition is true | |
SCRIPT_COMMAND_SEND_AI_EVENT_AROUND | 35 | Source = Creature, Target = Unit | datalong = AIEventType, datalong2 = radius |
SCRIPT_COMMAND_TURN_TO | 36 | Source = Unit, Target = Unit/none | |
SCRIPT_COMMAND_MOVE_DYNAMIC | 37 | Source = Creature, Target Worldobject. | datalong = 0: Move Source towards Target; datalong != 0: Move Source to a random point between datalong2..datalong around Target.;orientation != 0: Obtain a random point around Target in direction of orientation; data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL Obtain a random point around Target in direction of Target->GetOrientation + orientation; for Target == Source and orientation == 0 this will mean Source moving forward. |
SCRIPT_COMMAND_SEND_MAIL | 38 | Source WorldObject, can be NULL, Target Player | datalong: Send mailTemplateId from Source (if provided) to player Target; datalong2: AlternativeSenderEntry. Use as sender-Entry; dataint1: Delay (>= 0) in Seconds |
SCRIPT_COMMAND_SET_FLY | 39 | Source = Creature | datalong = 0 (off) or 1 (on) |
SCRIPT_COMMAND_DESPAWN_GO | 40 | Target = GameObject | |
SCRIPT_COMMAND_RESPAWN | 41 | Source = Creature. | Requires SCRIPT_FLAG_BUDDY_IS_DESPAWNED to find dead or despawned targets |
SCRIPT_COMMAND_SET_EQUIPMENT_SLOTS | 42 | Source = Creature | datalong = reset default 0(false) or 1(true); dataint = main hand slot, dataint2 = offhand slot, dataint3 = ranged slot |
SCRIPT_COMMAND_RESET_GO | 43 | Target = GameObject | |
SCRIPT_COMMAND_UPDATE_TEMPLATE | 44 | Source = Creature | datalong = new creature entry, datalong2 = 0(Alliance) or 1(Horde) |
datalong mediumint(8) unsigned
Command parameter, see command description.
datalong2 int(10) unsigned
Command parameter, see command description.
buddy_entry int(10) unsigned
Creature ID (creature_template.entry) for changing source/target.
search_radius int(10) unsigned
Radius, in which the buddy will be searched. For changing source/target mechanic.
Note:
If data_flags has SCRIPT_FLAG_BUDDY_BY_GUID set, this references an entry in the 'gameobject' table or 'creature' table table.
data_flags tinyint(3) unsigned
Command flags [See enum scriptinfodataflags in scriptmgr.h].
Default cast direction: source/buddy -> target, flags can change this.
Flag | Value (hex) | Meaning |
---|---|---|
SCRIPT_FLAG_BUDDY_AS_TARGET | 0x01 | source -> buddy |
SCRIPT_FLAG_REVERSE_DIRECTION | 0x02 | target* -> source* (* result after previous flag is evaluated) |
SCRIPT_FLAG_SOURCE_TARGETS_SELF | 0x04 | source* -> source* (* result after previous flag is evaluated) |
SCRIPT_FLAG_COMMAND_ADDITIONAL | 0x08 | command-specific |
SCRIPT_FLAG_BUDDY_BY_GUID | 0x10 | take the buddy by guid instead of entry |
SCRIPT_FLAG_BUDDY_IS_PET | 0x20 | buddy is a pet |
dataint int(11)
Command parameter, see command description.
dataint2 int(11)
Command parameter, see command description.
dataint3 int(11)
Command parameter, see command description.
dataint4 int(11)
Command parameter, see command description.
x float
X of position - for commands requiring position.
y float
Y of position - for commands requiring position.
z float
Z of position - for commands requiring position.
o float
Orientation angle (0 to 2*Pi): 0 north, Pi south - for commands requiring position.
comments varchar(255)
Textual comment, ignored by the core.
auto-generated by the getMaNGOS.eu MAGNET dbdocs module
Edited by Antz
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now