Diferencia entre revisiones de «Smart scripts»

De TimelessWoW
Ir a la navegación Ir a la búsqueda
Línea 127: Línea 127:
! style="background:PaleGreen;" | Nombre
! style="background:PaleGreen;" | Nombre
! style="background:PaleGreen;" | Valor
! style="background:PaleGreen;" | Valor
! style="background:PaleGreen;" | Param1
! style="background:PaleGreen;" | Parametro 1
! style="background:PaleGreen;" | Param2
! style="background:PaleGreen;" | Parametro 2
! style="background:PaleGreen;" | Param3
! style="background:PaleGreen;" | Parametro 3
! style="background:PaleGreen;" | Param4
! style="background:PaleGreen;" | Parametro 4
! style="background:PaleGreen;" | Param5
! style="background:PaleGreen;" | Parametro 5
! style="background:PaleGreen;" | Comentario
! style="background:PaleGreen;" | Comentario
|-
|-
Línea 143: Línea 143:
|-
|-
| SMART_EVENT_AGGRO|| 4|| ||||||||||NONE
| SMART_EVENT_AGGRO|| 4|| ||||||||||NONE
|-
| SMART_EVENT_KILL|| 5|| CooldownMin0|| CooldownMax1|| playerOnly (0/1)|| Enttry (Si el parámetro 3 es 0)|| || Sobre la muerte de criaturas
|-
| SMART_EVENT_DEATH|| 6|| ||||||||||NONE
|-
| SMART_EVENT_EVADE|| 7|| ||||||||||NONE
|-
| SMART_EVENT_SPELLHIT|| 8|| SpellID|| School|| CooldownMin|| CooldownMax|| || Al golpear com un hechizo a creatura/objeto
|-
| SMART_EVENT_RANGE|| 9|| MinDist|| MaxDist|| RepeatMin|| RepeatMax|| || Al objeto dentro del rango
|-
| SMART_EVENT_OOC_LOS|| 10|| Ignorar hostilidad - target (0/1)|| Max Distancia al target|| CooldownMin|| CooldownMax|| || Distancia cuando está fuera de combate
|-
|-
|}
|}

Revisión del 01:12 10 oct 2025

La tabla `smart_scripts`

Con este sistema podremos programar eventos bastante complejos sin la necesidad de recurrir a scripts.

Dado las grandes posibilidades que presenta sustituye completamente a los eventos programados por Event AI,
así que este último sistema ha quedado obsoleto y ya no se usa.


Estructura

Field Type Attributes KEY NULL Default Extra Comment
entryorguid int(11) signed PRI NO None
source_type tinyint(3) unsigned PRI NO 0
id smallint(5) unsigned PRI NO 0
link smallint(5) unsigned PRI NO 0
event_type tinyint(3) unsigned NO 0
event_phase_mask tinyint(3) unsigned NO 0
event_chance tinyint(3) unsigned NO 100
event_flags tinyint(3) unsigned NO 0
event_param1 int(10) unsigned NO 0
event_param2 int(10) unsigned NO 0
event_param3 int(10) unsigned NO 0
event_param4 int(10) unsigned NO 0
action_type tinyint(3) unsigned NO 0
action_param1 int(10) unsigned NO 0
action_param2 int(10) unsigned NO 0
action_param3 int(10) unsigned NO 0
action_param4 int(10) unsigned NO 0
action_param5 int(10) unsigned NO 0
action_param6 int(10) unsigned NO 0
target_type tinyint(3) unsigned NO 0
target_param1 int(10) unsigned NO 0
target_param2 int(10) unsigned NO 0
target_param3 int(10) unsigned NO 0
target_x float signed NO 0
target_y float signed NO 0
target_z float signed NO 0
target_o float signed NO 0
comment text signed NO Event Comment

Descripción de los campos

Nótese que significa que esa característica/opción no está (aún) implementada.

entryorguid

  • EntryOrGuid > 0: entry de la criatura/ gameobject / etc.
  • EntryOrGuid < 0: guid de la criatura/ gameobject / etc.
  • Depende del valor tomado en source_type.

source_type

  • Fuente del evento: criatura, gameobect, spell.

Consultar la tabla.

Nombre Valor
SMART_SCRIPT_TYPE_CREATURE 0
SMART_SCRIPT_TYPE_GAMEOBJECT 1
SMART_SCRIPT_TYPE_AREATRIGGER 2
SMART_SCRIPT_TYPE_EVENT 3
SMART_SCRIPT_TYPE_GOSSIP 4
SMART_SCRIPT_TYPE_QUEST 5
SMART_SCRIPT_TYPE_SPELL 6
SMART_SCRIPT_TYPE_TRANSPORT 7
SMART_SCRIPT_TYPE_INSTANCE 8
SMART_SCRIPT_TYPE_TIMED_ACTIONLIST 9
SMART_SCRIPT_TYPE_SCENE 10
SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY 11
SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY_SERVERSIDE 12

id

  • Incremento de id ligad a cada 'entryorguid' y 'source_type' (0, 1, 2, ...).

link

  • Método simple para enlazar eventos.
  • Ejemplo: Tenemos un evento (con un entryorguid y un source_type definidos) con id = 0 y link = 1; el evento (que tiene el mismo entryorguid y source_type) con id = 1 sólo podrá ocurrir si el evento con id = 0 ha sido desencadenado.
  • Cuando se usa este método, hay que seleccionar el event_type 61 (SMART_EVENT_LINK).

Volver a smart_scripts.

event_type

Nombre Valor Parametro 1 Parametro 2 Parametro 3 Parametro 4 Parametro 5 Comentario
SMART_EVENT_UPDATE_IC 0 Inicio/Mínimo Inicio/Máximo Repite/Mínimo Repite/Máximo En combate
SMART_EVENT_UPDATE_OOC 1 Inicio/Mínimo Inicio/Máximo Repite/Mínimo Repite/Máximo Fuera de combate
SMART_EVENT_HEALT_PCT 2 HPMin% HPMax% RepeatMin RepeatMax Porcentage de salud
SMART_EVENT_MANA_PCT 3 ManaMin% ManaMax% RepeatMin RepeatMax Porcentage de maná
SMART_EVENT_AGGRO 4 NONE
SMART_EVENT_KILL 5 CooldownMin0 CooldownMax1 playerOnly (0/1) Enttry (Si el parámetro 3 es 0) Sobre la muerte de criaturas
SMART_EVENT_DEATH 6 NONE
SMART_EVENT_EVADE 7 NONE
SMART_EVENT_SPELLHIT 8 SpellID School CooldownMin CooldownMax Al golpear com un hechizo a creatura/objeto
SMART_EVENT_RANGE 9 MinDist MaxDist RepeatMin RepeatMax Al objeto dentro del rango
SMART_EVENT_OOC_LOS 10 Ignorar hostilidad - target (0/1) Max Distancia al target CooldownMin CooldownMax Distancia cuando está fuera de combate
  • El evento sólo podrá ocurrir si la criatura/gameobject está en esta fase.
  • El 0 engloba todas las fases (?).

event_phase_mask


event_chance

  • Probabilidad de que el evento tenga lugar, en porcentaje (0-100%).

event_flags

  • Establece si el evento no debería repetirse o sólo debería ocurrir en una determinada dificultad de instancia/mazmorra (si corresponde).
  • Los valores se pueden sumar.

action_type

  • Acción que se usará si el evento es desencadenado.

target_type

  • Define el target del evento y/o la acción.

comment

  • Al comentar en Smart AI se usa una plantilla como la siguiente:

"Nombre de la criatura - Evento - Acción "Minion of Gurok - On spawn - Set Random Movement"

Notas:

  • Actualiza siempre la tabla creature_template o gameobject_template(dependiendo de a quien afecta el evento) con:

UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=XXXXX;

UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=XXXXX;

  • Si la criatura o gameobject está dentro de una mazmorra, establece event_flags de acuerdo a la dificultad de la estancia (heroica, banda 10j., etc.).