Skip to content

Tables: *_scripts ​

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

  • event_scripts: Holds scripts activated whenever an event is activated, be it by an object or as the spell effect SPELL_EFFECT_SEND_EVENT (61).
  • waypoint_scripts: Holds scripts used in the waypoint_data table.

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 ​

FieldTypeAttributesKeyNullDefaultExtraComment
idmediumintunsignedNO0
delayintunsignedNO0
commandmediumintunsignedNO0
datalongmediumintunsignedNO0
datalong2intunsignedNO0
dataintintsignedNO0
xfloatNO0
yfloatNO0
zfloatNO0
ofloatNO0
guid ^[1]^intsignedPRINO0Acts as primary key and is set automatically using the GM command 'wp event add'
Commentvarchar(255)NO''
^1^ present in waypoint_scripts table only.
 

Description of fields ​

id ​

  • spell_scripts: Spell ID
  • waypoint_scripts: waypoint_data.action
  • event_scripts: an 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 has passed. The value of this field affects what other fields also need to be set. The following commands can be used:

ValueNameComment
0TALKCreature say/whisper/yell/textemote.
1EMOTEPlay emote on creature.
2FIELD_SETChange the value at an index for the player.
3MOVE_TORelocate creature to a destination.
4FLAG_SETTurns on bits on a flag field at an index for the player.
5FLAG_REMOVETurns off bits on a flag field at an index for the player.
6TELEPORT_TOTeleports the player to a location.
7QUEST_EXPLOREDSatisfies the explore requirement for a quest.
8KILL_CREDITGives kill credit to the player.
9RESPAWN_GAMEOBJECTSpawns a despawned gameobject.
10TEMP_SUMMON_CREATURETemporarily summons a creature.
11OPEN_DOOROpens a door gameobject (type 0).
12CLOSE_DOORCloses a door gameobject (type 0).
13ACTIVATE_OBJECTActivates an object.
14REMOVE_AURARemoves an aura due to a spell.
15CAST_SPELLCasts a spell.
16PLAY_SOUNDPlays a sound.
17CREATE_ITEMCreates specified amount of items for the player.
18DESPAWN_SELFForces unit to despawn.
20LOAD_PATHLoad path to unit, then unit starts waypoint movement.
21CALLSCRIPT_TO_UNITCalls script from one of *_scripts table with given unit as source.
22KILLChanges state of the creature to dead and optionally removes its corpse.
30ORIENTATIONChanges unit's orientation (Used in Waypoint Scripts)
31EQUIPSets creature equipment.
32MODELSets creature model.
33CLOSE_GOSSIPCloses gossip window. This command is only used for Gossip Scripts.
34PLAYMOVIEPlays movie.
35MOVEMENTUpdates creature movement.
36PLAY_ANIMKIT(NOT ON 3.3.5A, DON'T REUSE)

 

Other Fields ​

commanddatalongdatalong2dataintWorld Position
0ChatTypetalk source: 0 - creature; 1 - playerbroadcast_text id-
1Emote IDplay emote as: 0 - oneshot; 1 - state0-
2field indexvalue to be set0-
30time for movement (in seconds?)0destination
4field indexbitmask to be set0-
5field indexbitmask to be unset0-
6destination Map IDtarget: 0 - player; 1 - creature0destination
7quest ID to satisfymin distance to target to satisfy (min.: 5m)0-
8creature entry to creditgranted to: 0 - player; 1 - player+party0-
9object guid to spawndespawn delay in seconds (min.: 5s)0-
10creature entry to spawndespawn delay in seconds0destination
11object guid to openreset delay in milliseconds (min.: 15000ms)0-
12object guid to closereset delay in milliseconds (min.: 15000ms)0-
13000-
14Spell ID to removeremove from: 0 - target; 1 - source0-
15Spell ID to cast0: Source -> Target
1: Source -> Source (self cast)
2: Target -> Target
3: Target -> Source (cast back)
4: creature entry from dataint
cast type: 0 - normal; 1 - triggered



creature entry
-
16SoundEntry ID to play0x1: play to everyone instead of player
0x2: play with distance dependency instead of without
0-
17item entry to createamount0-
18despawn delay (in seconds?)00-
20waypoint path id to loadrepeatable: 0 - no; 1 - yes0-
21creature entry or guid to load script onscript id3: use spell_scripts table
5: use event_scripts table
6: use waypoint_scripts table
-
22000: leave corpse; 1: remove corpse-
30face: 0 - o value; 1 - target000, 0, 0, o (0 – 2π)
31ID from creature_equip_template00-
32CreatureDisplayInfo ID00-
33000-
34Movie ID to play00-
35MOTION_TYPE: 1 - RANDOM; 2 - WAYPOINTdistance in m for RANDOM_MOTION_TYPEpath id for WAYPOINT_MOTION_TYPE-

 

guid ​

Acts as primary key for waypoint_scripts. It is set automatically using the GM command .wp event add.

Note: only present in waypoint_scripts

 

Comment ​

This field is for any comment you want to make. It is arbitrary text.