All scripts
Материал из YTDB DataBase
|
Назад к списку таблиц world database.
Таблица `*_scripts`
Этот формат таблицы используется для 5 различных таблиц, чтобы управлять возможными скриптами, активизированными различными действиями:
- gameobject_scripts: Содержит информация для активации скриптов предназначенных для игровых объектов (ИО) типа GAMEOBJECT_TYPE_BUTTON (1).
- spell_scripts: Содержит информацию для активации скриптов предназначенных для заклинаний с эффектом SPELL_EFFECT_SCRIPT_EFFECT (77).
- quest_start_scripts: Содержит информацию для активации скриптов после того, как игрок взял указанный квест.
- quest_end_scripts: Содержит информацию для активации скриптов после того, как игрок сдал указанный квест.
- event_scripts: Содержит скрипты активирующиеся всякий раз, когда происходит указанный случай, будь это объект или эффект заклинания SPELL_EFFECT_SEND_EVENT (61).
ПРИМЕЧЕНИЕ: У скриптов в этой таблицы может быть больше чем одна запись, поскольку скрипт может сделать больше чем только одно действие. Также каждому действию, которое может сделать скрипт, можно указать отдельную задержку к нему. В этом случае, ядро активизирует соответствующее действие после правильной задержки.
Структура
Field | Type | Null | Key | Default | Extra |
id | int(11) unsigned | NO | 0 | ||
delay | int(11) unsigned | NO | 0 | ||
command | int(11) unsigned | NO | 0 | ||
datalong | int(11) unsigned | NO | 0 | ||
datalong2 | int(11) unsigned | NO | 0 | ||
dataint | int(11) | NO | 0 | ||
x | float | NO | 0 | ||
y | float | NO | 0 | ||
z | float | NO | 0 | ||
o | float | NO | 0 |
Описание полей
id
For gameobject_scripts, it is the guid of the button/lever. See gameobject.guid.
For spell_scripts, it is the spell ID. See Spell.dbc
For quest_*_scripts, it is the ID that is used in StartScript or CompleteScript in the quest template definition.
For event_scripts, 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.
delay
Delay in seconds before this current step of the script activates. 0 = instant.
command
The type of action performed by the script after delay seconds have passed. The value of this field affects what other fields also need to be set.
The following commands can be used:
Command | Name | Description |
---|---|---|
0 | TALK | Creature say/whisper/yell/textemote. |
1 | EMOTE | Play emote on creature. |
2 | FIELD_SET | Change the value at an index for the player. |
3 | MOVE_TO | Relocate creature to a destination |
4 | FLAG_SET | Turns on bits on a flag field at an index for the player. |
5 | FLAG_REMOVE | Turns off bits on a flag field at an index for the player. |
6 | TELEPORT_TO | Teleports the player to a location. |
7 | QUEST_EXPLORED | Satisfies the explore requirement for a quest. |
8 | KILL_CREDIT | Satisfies the kill credit requirement for a quest. |
9 | RESPAWN_GAMEOBJECT | Spawns a despawned gameobject. |
10 | TEMP_SUMMON_CREATURE | Temporarily summon a creature. |
11 | OPEN_DOOR | Opens a door gameobject (type == 0). |
12 | CLOSE_DOOR | Closes a door gameobject (type == 0). |
13 | ACTIVATE_OBJECT | Activates an object. |
14 | REMOVE_AURA | Removes an aura due to a spell. |
15 | CAST_SPELL | Casts a spell. |
16 | PLAY_SOUND | Play sound. |
OtherFields
Depending on what command was used, the meaning and use for the following fields varies.
- SCRIPT_COMMAND_TALK = 0
- datalong: 0=say, 1=whisper, 2=yell, 3=text emote
- dataint: The text ID that the creature will say. See db_script_string. ID must be between 2000000000 and 2000010000.
- SCRIPT_COMMAND_EMOTE = 1
- datalong: The emote ID to play.
- 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.
- x: X position to move to.
- y: Y position to move to.
- z: Z position to move to.
- o: Orientation to face.
- SCRIPT_COMMAND_FLAG_SET = 4
- datalong: Field index to be set.
- datalong2: Flag bit(s) to set.
- 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 Maps.dbc
- x: Teleport target x coordinate.
- y: Teleport target y coordinate.
- z: Teleport target z coordinate.
- o: Teleport target orientation.
- 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
- SCRIPT_COMMAND_KILL_CREDIT = 8
- datalong: Kill credit entry for quest (entry in quest_template.ReqCreatureOrGOId)
- datalong2: 0=personal credit, 1=group credit
- SCRIPT_COMMAND_RESPAWN_GAMEOBJECT = 9
- datalong: Guid of the gameobject to respawn. See gameobject.guid.
- datalong2: Despawn time in seconds. If the value is < 5 seconds: 5 is used instead.
- SCRIPT_COMMAND_TEMP_SUMMON_CREATURE = 10
- datalong: Entry of the summoned creature from creature_template.entry.
- datalong2: Despawn time in ms.
- 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.
- datalong2: Delay before closing again the door. If the value is < 5 seconds: 5 is used instead.
- SCRIPT_COMMAND_CLOSE_DOOR = 12
- datalong: Guid of the activated door. It's a gameobject.guid.
- datalong2: Delay before opening again the door. If the value is < 5 seconds: 5 is used instead.
- SCRIPT_COMMAND_ACTIVATE_OBJECT = 13
- The source must be a unit and the target a game object.
- SCRIPT_COMMAND_REMOVE_AURA = 14
- datalong: Spell ID.
- datalong2: If value > 0, then cast on the source; otherwise cast on the target.
- SCRIPT_COMMAND_CAST_SPELL = 15
- datalong: Spell ID.
- datalong2: If value > 0, then cast on the source; otherwise cast on the target.
- SCRIPT_COMMAND_PLAY_SOUND = 16
- datalong: sound_id.
- datalong2: bitmask: 0/1=anyone/target, 0/2=with distance dependent, so 1|2 = 3 is target with distance dependent.