creature_ai_scripts

This table is for simple creature scripts e.g. trashmobs in several instances.

Structure

Field Type Default Comment
min_build int 12340  
max_build int 12340  
entry int    
difficulty tinyint 0  
phase tinyint 0  
event tinyint 0  
action tinyint 0  
maxCount tinyint 0  
chance float 1  
spell int 0  
spell_type int 0  
triggered tinyint 0 1 = true, 0 = false
target int 0  
cooldownMin int 0  
cooldownMax int 0  
minHealth float 0  
maxHealth float 100  
textId int 0  
misc1 int 0  
comments text NULL  

min-max_build

The build range for this script to be loaded.

entry

The creature entry ID from creature_properties table.

difficulty

0 = Normal / 10 Man Normal,
1 = Heroic / 25 Man Normal,
2 = 10 Man Heroic,
3 = 25 Man Heroic,
4 = All difficulties, ignore difficulty check.

phase

This is NOT the worldphase, it is the script phase. Controle in which script phase this record is enabled.

event

0 = onLoad,
1 = onEnterCombat,
2 = onLeaveCombat,
3 = onDied,
4 = onTargetDied,
5 = onAIUpdate,
6 = onCallForHelp,
7 = onRandomWaypoint,
8 = onDamageTaken,
9 = onFlee

action

0 = actionNone,
1 = actionSpell,
2 = actionSendMessage,
3 = actionPhaseChange   Change phase +1

maxCount

Maximum count how often this script gets executed.

chance

The percent the monster will say some text on entering event.

0 = never
100 = always.

spell

The spellId to cast.

spell_type

The spell type

0 = NUll,
1 = Root,
2 = Heal,
3 = Stun,
4 = Fear,
5 = Silence,
6 = Curse,
7 = AOE,
8 = Damage,
9 = Summon,
10 = Buff,
11 = Debuff

triggered

Defines if the spell is triggered (1) or not (0).

target

The target for this spell:

0 = TARGET_SELF,
1 = TARGET_VARIOUS,
2 = TARGET_ATTACKING,
3 = TARGET_DESTINATION,
4 = TARGET_SOURCE,
5 = TARGET_RANDOM_FRIEND,
6 = TARGET_RANDOM_SINGLE,
7 = TARGET_RANDOM_DESTINATION,
8 = TARGET_CLOSEST,
9 = TARGET_FURTHEST

cooldownmin-max

action = 1 (spell)

min/max cooldown in ms

action = 3 (change phase)

min/max time for changing script phase

min-maxhealth

action = 1 (spell)

min and max = used for hp range when a spell can get casted.

events

Call For Help Health

Flee Health

On AiUpdate Action on xx Health

ChangePhase at % hp

textId

action = 1 (spell)

Send message on casting spell.

action = 2 (chat message)

Send message on event.

misc1

action = 3 (change phase)

change script phase to X.

event = 9 (flee)

Duration in ms how long creature is fleeing.

comments

Used for db devs.