AzerothCore
Pages :

Tablas de scripts

<-Volver a: World

Tablas: ***_scripts

Este formato de tabla se usa para 3 tablas diferentes para controlar los posibles scripts activados por distintas acciones:

spell_scripts: contiene los scripts que pueden activarse mediante hechizos con el efecto SPELL_EFFECT_SCRIPT_EFFECT (77) o SPELL_EFFECT_DUMMY(3).

event_scripts: contiene los scripts que se activan cada vez que se activa un evento, ya sea por un objeto o como el spell effect SPELL_EFFECT_SEND_EVENT (61).

waypoint_scripts: contiene los scripts usados en la tabla waypoint_data. Ver también Waypoints-Information para información general sobre los waypoints.

NOTA: una entrada de esta tabla puede tener más de una fila, ya que un script puede hacer más de una acción. Además, cada acción que realice el script puede tener un delay independiente asociado. En ese caso, el core activará la acción apropiada tras el delay correcto.

Estructura

Field Type Attributes Key Null Default Extra Comment
id INT UNSIGNED NO 0
effIndex INT UNSIGNED NO 0 only used in spell_scripts
delay INT UNSIGNED NO 0
command INT UNSIGNED NO 0
datalong INT UNSIGNED NO 0
datalong2 INT UNSIGNED NO 0
dataint INT NO 0
x FLOAT NO 0
y FLOAT NO 0
z FLOAT NO 0
o FLOAT NO 0
guid INT PRI NO 0 only used in waypoint_scripts; acts as primary key and is set automatically using the GM command 'wp event add'

Descripción de los campos

id

Para spell_scripts, es el ID del hechizo. Ver Spell.dbc

Para event_scripts, es el ID del evento. Actualmente no existe una lista completa de eventos. En cualquier caso, los IDs de evento se toman directamente de los datos WDB del gameobject o de los datos del spell effect. Si tanto un gameobject como un hechizo activan el mismo evento, los IDs coincidirán.

Para waypoint_scripts, es el ID de la action.

effIndex

El índice del efecto del hechizo al que se va a aplicar este script.

delay

Delay en segundos antes de que se active este paso actual del script. 0 = instantáneo.

command

El tipo de acción que realiza el script tras haber pasado delay segundos. El valor de este campo determina qué otros campos también deben establecerse. Se pueden usar los siguientes comandos:

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 Gives kill credit to the player.
9 RESPAWN_GAMEOBJECT Spawns a despawned gameobject.
10 TEMP_SUMMON_CREATURE Temporarily summons a creature.
11 OPEN_DOOR Opens a door gameobject (type h1. 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 Plays a sound.
17 CREATE_ITEM Creates specified amount of items for the player.
18 DESPAWN_SELF Forces creature to despawn.
20 LOAD_PATH Load path to unit, then unit starts waypoint movement.
21 CALLSCRIPT_TO_UNIT Calls script from one of *_scripts table with given unit as source.
22 KILL Changes state of the creature to dead and optionally removes its corpse.
30 ORIENTATION Changes unit's orientation (Used in Waypoint Scripts)
31 EQUIP Sets creature equipment.
32 MODEL Sets creature model.
33 CLOSE_GOSSIP Closes gossip window. This command is only used for Gossip Scripts.
34 PLAYMOVIE Plays movie.
35 MOVEMENT Change movement type.

OtherFields

Dependiendo del comando usado, el significado y uso de los siguientes campos varía.

*SCRIPT_COMMAND_TALK = 0

  • source: Creature.
  • target: any/Player (for whisper).
  • datalong: 0=say, 1=yell, 2=text emote, 3=boss emote, 4=whisper 5=boss whisper
  • dataint: referencia a broadcast_text.id

*SCRIPT_COMMAND_EMOTE = 1

  • source or target: Creature.
  • datalong: The emote ID to play.
  • datalong2: If this value is > 0 the npc will play emote state rather than oneshot.

*SCRIPT_COMMAND_FIELD_SET = 2

  • source or target: Creature.
  • datalong: Index of the field.
  • datalong2: Value to place at the index.

*SCRIPT_COMMAND_MOVE_TO = 3

  • source: Creature.
  • datalong2: Length (in time) of the motion.
  • x: X position to move to.
  • y: Y position to move to.
  • z: Z position to move to.

*SCRIPT_COMMAND_FLAG_SET = 4

  • source or target: Creature.
  • datalong: Field index to be set.
  • datalong2: Flag bit(s) to set.

*SCRIPT_COMMAND_FLAG_REMOVE = 5

  • source or target: Creature.
  • datalong: Field index to be unset.
  • datalong2: Flag bit(s) to unset.

*SCRIPT_COMMAND_TELEPORT_TO = 6

  • source or target: Player (datalong2 0) or Creature (datalong2 1).
  • 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.

*SCRIPT_COMMAND_QUEST_EXPLORED = 7

  • source or target: Player.
  • target or source: WorldObject.
  • datalong: Quest entry which external status should be satisfied. See quest_template.id.
  • datalong2: Distance away from the NPC/object that the player can be and have the script still take effect (min value 5).

*SCRIPT_COMMAND_KILL_CREDIT = 8

  • target or source: Player.
  • datalong: Creatue entry of kill credit. See creature_template.entry.
  • datalong2: If value > 0 gives kill credit to the whole group player belongs to, otherwise, gives personal kill credit.

*SCRIPT_COMMAND_RESPAWN_GAMEOBJECT = 9

  • source: WorldObject (summoner).
  • 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

  • source: WorldObject (summoner).
  • datalong: Entry of the summoned creature. See 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

  • source: WorldObject.
  • datalong: Guid of the activated door. See gameobject.guid.
  • datalong2: Delay before closing again the door. If the value is < 15 seconds: 15 is used instead.

*SCRIPT_COMMAND_CLOSE_DOOR = 12

  • source: WorldObject.
  • datalong: Guid of the activated door. See gameobject.guid.
  • datalong2: Delay before opening again the door. If the value is < 15 seconds: 15 is used instead.

*SCRIPT_COMMAND_ACTIVATE_OBJECT = 13

  • source: Unit.
  • target: GameObject.

*SCRIPT_COMMAND_REMOVE_AURA = 14

  • source (datalong2 != 0) or target (datalong2 h1. 0): Unit.
  • datalong: Spell ID. See Spell.dbc
  • datalong2: If value > 0, then remove from the source; otherwise remove from the target.

*SCRIPT_COMMAND_CAST_SPELL = 15

  • source: Unit.
  • target: Unit.
  • datalong: Spell ID. See Spell.dbc
  • datalong2:
    • 0 - Source->Target
    • 1 - Source->Source (Self cast, use for dummy spells)
    • 2 - Target->Target
    • 3 - Target->Source
    • 4 - Source->Closest entry of dataint.
  • dataint: Creature entry to target if datalong2 value is 4, or triggered attribute for CastSpell method in other cases.
  • x: Search range for creature entry (dataint) if datalong2 value is 4.

*SCRIPT_COMMAND_PLAY_SOUND = 16

  • source: WorldObject.
  • target: none (datalong2 & 1 0) or Player (datalong2 & 1 != 0).
  • datalong: Sound ID.
  • datalong2:
    • 0 - play direct sound to everyone.
    • 1 - play direct sound to target (must be Player).
    • 2 - play sound with distance dependency to anyone.
    • 3 - play sound with distance dependency to target (must be Player).
    • 4 - play sound within radius to anyone.
  • dataint: radius if datalong2 value is 4

*SCRIPT_COMMAND_CREATE_ITEM = 17

  • target or source: Player.
  • datalong: Item entry to create. See item_template.entry.
  • datalong2: Amount of items to create.

*SCRIPT_COMMAND_DESPAWN_SELF = 18

  • target: Creature.
  • datalong: Despawn delay.

*SCRIPT_COMMAND_LOAD_PATH = 20

  • source: Unit.
  • datalong: Path ID. See waypoint_data.id.
  • datalong2: If value > 0, means waypoint movement is repeatable.

*SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT = 21

  • source: if present, used as a search center.
  • datalong: entry of searched creature, if source exists, guid of the creature otherwise. **datalong2: ID of the script from *_scripts table.
  • dataint:
    • 3 - use spell_scripts table;
    • 5 - use event_scripts table;
    • 6 - use waypoint_scripts table.

*SCRIPT_COMMAND_KILL = 22

  • source: Creature.
  • dataint: if value == 1 remove corpse.

*SCRIPT_COMMAND_ORIENTATION = 30

  • source: Unit.
  • target: Unit (datalong != 0).
  • datalong: If value != 0, then turn to face the target; otherwise turn to value in o.
  • o: Set orientation to value in field `o`.

*SCRIPT_COMMAND_EQUIP = 31

*SCRIPT_COMMAND_MODEL = 32

  • source: Creature.
  • datalong: model ID.

*SCRIPT_COMMAND_CLOSE_GOSSIP = 33

  • source: Player.

*SCRIPT_COMMAND_PLAYMOVIE = 34

  • source: Player.
  • datalong: movie ID.

*SCRIPT_COMMAND_MOVEMENT = 35

  • source: Creature.
  • datalong: MovementType.
  • datalong2: MovementDistance (e.g. wander_distance for MovementType 1).
  • dataint: pathid (for MovementType 2, see waypoint_data.id).

guid

Existe solo para 'waypoint_scripts' y actúa allí como clave primaria; se establece automáticamente usando el comando GM 'wp event add'.