Skip to content
Schmoozerd edited this page Apr 14, 2013 · 2 revisions

Back to world database list of tables.

The `creature_template` table

This table contains the description of creatures. Each spawned creature is an instance of a template present in this table, this means every creature MUST be defined in this table.

Structure

Field Type Null Key Default Extra
entry mediumint(8) unsigned NO PRI 0
difficulty_entry_1 mediumint(8) unsigned NO 0
difficulty_entry_2 mediumint(8) unsigned NO 0
difficulty_entry_3 mediumint(8) unsigned NO 0
KillCredit1 INTEGER unsigned NO 0
KillCredit2 INTEGER unsigned NO 0
modelid_1 mediumint(8) unsigned NO 0
modelid_2 mediumint(8) unsigned NO 0
modelid_3 mediumint(8) unsigned NO 0
modelid_4 mediumint(8) unsigned NO 0
name char(100) NO 0
subname char(100) YES Null
IconName char(100) YES Null
gossip_menu_id MENIUMINT YES 0
minlevel tinyint(3) unsigned YES 1
maxlevel tinyint(3) unsigned YES 1
minhealth int(10) unsigned YES 0
maxhealth int(10) unsigned YES 0
minmana int(10) unsigned YES 0
maxmana int(10) unsigned YES 0
armor mediumint(8) unsigned NO 0
faction_A smallint(5) unsigned NO 0
faction_H smallint(5) unsigned NO 0
npcflag int(10) unsigned NO 0
speed_walk float YES 1
speed_run float YES 1.14286
scale float NO 0
rank tinyint(3) unsigned YES 0
mindmg float YES 0
maxdmg float YES 0
dmgschool tinyint(4) NO 0
attackpower int(10) unsigned NO 0
dmg_multiplie float NO 0
baseattacktime int(10) unsigned YES 0
rangeattacktime int(10) unsigned YES 0
unit_class int unsigned NO 0
unit_flags int(10) unsigned NO 0
dynamicflags int(10) unsigned NO 0
family tinyint(4) YES 0
trainer_type tinyint(4) YES 0
trainer_spell mediumint(8) unsigned YES 0
trainer_class tinyint(3) unsigned YES 0
trainer_race tinyint(3) unsigned YES 0
minrangedmg float NO 0
maxrangedmg float NO 0
rangedattackpower smallint(5) unsigned NO 0
type tinyint(3) unsigned NO 0
type_flags int(10) unsigned YES 0
lootid mediumint(8) unsigned NO 0
pickpocketloot mediumint(8) unsigned NO 0
skinloot mediumint(8) unsigned NO 0
resistance1 int(10) unsigned NO 0
resistance2 smallint(5) NO 0
resistance3 smallint(5) NO 0
resistance4 smallint(5) NO 0
resistance5 smallint(5) NO 0
resistance6 smallint(5) NO 0
spell1 mediumint(8) unsigned NO 0
spell2 mediumint(8) unsigned NO 0
spell3 mediumint(8) unsigned NO 0
spell4 mediumint(8) unsigned NO 0
PetSpellDataId mediumint(8) unsigned NO 0
mingold mediumint(8) unsigned NO 0
maxgold mediumint(8) unsigned NO 0
AIName char(64) NO
MovementType tinyint(3) unsigned NO 0
InhabitType tinyint(3) unsigned NO 3
unk16 float NO 1.0
unk17 float NO 1.0
RacialLeader tinyint(3) unsigned NO 0
questItem1 INTEGER NO 0
questItem2 INTEGER NO 0
questItem3 INTEGER NO 0
questItem4 INTEGER NO 0
questItem5 INTEGER NO 0
questItem6 INTEGER NO 0
movementId INTEGER NO 0
RegenHealth tinyint(3) unsigned NO 1
equipment_id mediumint(8) unsigned NO 0
trainer_id mediumint(8) NO 0
vendor_id mediumint(8) NO 0
mechanic_immune_mask int(10) unsigned NO 0
flags_extra int(10) unsigned NO 0
ScriptName char(64) NO

Description of the fields

difficulty_entry

If not zero, this field refers to an entry of creature_template. Which suppose to be used in certain difficulty see below:

DUNGEON_DIFFICULTY_NORMAL 0
DUNGEON_DIFFICULTY_HEROIC 1
RAID_DIFFICULTY_10MAN_NORMAL 0
RAID_DIFFICULTY_25MAN_NORMAL 1
RAID_DIFFICULTY_10MAN_HEROIC 2
RAID_DIFFICULTY_25MAN_HEROIC 3

modelid

Graphical model that the client applies on this creature. This is a creature_model_info.entry

name

Base name of the creature.

subname

The subname of the creature that appears in <> below the creature’s name.

IconName

Script icon used by guards with directions menu.

gossip_menu_id

Reference to a gossip_menu_id.

minlevel

The minimum level of the creature if the creature has a level range.

maxlevel

The maximum level of the creature if the creature has a level range. When added to world, a level in chosen in the specified level range.

minhealth

The minimum health of the creature if the creature has variable health.

maxhealth

The maximum health of the creature if the creature has a variable health. When added to world, the health value is chosen in proportion to the level chosen.

minmana

The miminum mana of the creature if the creature has variable mana.

maxmana

The maximum mana of the creature if the creature has variable mana. When added to world, the mana value is chosen in proportion to the level chosen.

armor

The armor value of the creature. It controls how much damage reduction the creature gets from physical attacks.

faction_A

The faction if the creature is on the alliance side. See FactionTemplate.dbc.. Just because more than one faction has the same name, the inter-faction relationships can be different.

Note: This field also controls the creature family assistance mechanic. Only creatures with the same faction will assist each other.

faction_H

The faction if the creature is on the horde side. See FactionTemplate.dbc.. Just because more than one faction has the same name, the inter-faction relationships can be different.

Note: This field also controls the creature family assistance mechanic. Only creatures with the same faction will assist each other.

npcflag

A bitmask that represents what NPC flags the creature has. Each bit controls a different flag and to combine flags, you can add each flag that you want, in effect activating the respective bits.

Bit Flag Comment
1 Gossip If creature has more gossip options, add this flag to bring up a menu.
2 Quest Giver Any creature giving or taking quests needs to have this flag.
16 Trainer Allows the creature to have a trainer list to teach spells
128 Vendor Any creature selling items needs to have this flag.
4096 Repairer Creatures with this flag can repair items.
8192 Flight Master Any creature serving as fly master has this.
16384 Spirit Healer Makes the creature invisible to alive characters and has the resurrect function.
32768 Spirit Guide
65536 Innkeeper Creatures with this flag can set hearthstone locations.
131072 Banker Creatures with this flag can show the bank
262144 Petitioner
524288 Tabard Designer Allows the designing of guild tabards.
1048576 Battlemaster Creatures with this flag port players to battlegrounds.
2097152 Auctioneer Allows creature to display auction list.
4194304 Stable Master Has the option to stable pets for hunters.
16777216 Instantloot NPC could be loot immediately without killing, just after clicking on it. (Npc_spellclick_spells)
268435456 Guard Creatures with this flag act as guards in cities.

So if you want an NPC that is a quest giver, a vendor, and can repair you just add the specific flags together: 1 + 2 + 128 + 4096 = 4227.

speed

Controls how fast the creature can move in a certain mode.

scale

If non-zero, this field defines the size of how the model of the creature appears ingame. If zero, it will use default model size taken from the DBC.

rank

The rank of the creature:

Rank Name Comments
0 Normal
1 Elite Higher damage, more health, better loot.
2 Rare Elite A rare mob but with elite damage and health.
3 World Boss Highest rank, best loot, longest respawn time.
4 Rare Somewhat better loot, longer respawn time.

mindmg

Minimum damage the creature deals in melee. This field is combined with the attackpower field to calculate the damage. Look at attackpower to see the formula.

maxdmg

Maximum damage the creature deals in melee. This field is combined with the attackpower field to calculate the damage. Look at attackpower to see the formula.

dmgschool

Creature’s melee damage school.

ID Name
0 SPELL_SCHOOL_NORMAL
1 SPELL_SCHOOL_HOLY
2 SPELL_SCHOOL_FIRE
3 SPELL_SCHOOL_NATURE
4 SPELL_SCHOOL_FROST
5 SPELL_SCHOOL_SHADOW
6 SPELL_SCHOOL_ARCANE

attackpower

The attack power for the creature’s melee attacks. This field along with mindmg and maxdmg dictate how much the creature will hit for. The formula in applying correct damages is as follows:

UPDATE `creature_template` SET 
    `mindmg` = <#1>, 
    `maxdmg` = <#2>, 
    `attackpower` = ROUND((`mindmg` + `maxdmg`) / 4 * 7), 
    `mindmg` = ROUND(`mindmg` - `attackpower` / 7), 
    `maxdmg` = ROUND(`maxdmg` - `attackpower` / 7) 
  WHERE `entry` = ...

In the query above, substitute ‘<#1>’ with the minimum damage you want the creature to deal and ‘<#2>’ with the maximum damage you want the creature to deal.

NOTE: You might also want to double check the values calculated after the query is run because if the difference between mindmg and maxdmg is too high, mindmg will end up being a negative value.

baseattacktime

Creature’s melee attack time in milliseconds.

rangeattacktime

unit_class

The class of substance. Only 4 classes available to creatures.

ID Name
CLASS_WARRIOR 1
CLASS_PALADIN 2
CLASS_ROGUE 4
CLASS_MAGE 8

unit_flags

Allows the manual application of unit flags to creatures. Again this is a bitmask field and to apply more than one flag, just add the different numbers. Some possible flags are:

Flag Name Comments
1 UNIT_FLAG_UNK_0
2 UNIT_FLAG_NON_ATTACKABLE
4 UNIT_FLAG_DISABLE_MOVE
8 UNIT_FLAG_PVP_ATTACKABLE (allow apply pvp rules to attackable state in addition to faction dependent state)
16 UNIT_FLAG_RENAME
32 UNIT_FLAG_RESTING
64 UNIT_FLAG_UNK_6
128 UNIT_FLAG_NOT_ATTACKABLE_1 (??) ((UNIT_FLAG_PVP_ATTACKABLE + UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE)
256 UNIT_FLAG_OOC_NOT_ATTACKABLE (2.0.8 – Can not be attacked when not in combat. Removed if unit for some reason enter combat.) (2.4.3, Seems to make the unit unattackable)
512 UNIT_FLAG_PASSIVE (makes unable to attack everything. Almost identical to "civilian". Will not engage in combat unless "called upon" or engaged by another unit.)
1024 UNIT_FLAG_LOOTING (loot animation)
2048 UNIT_FLAG_PET_IN_COMBAT (in combat?, 2.0.8)
4096 UNIT_FLAG_PVP Allows item spells to be casted upon (?)
8192 UNIT_FLAG_SILENCED Can’t cast spells
16384 UNIT_FLAG_UNK_14 (2.0.8)
32768 UNIT_FLAG_UNK_15
65536 UNIT_FLAG_UNK_16
131072 UNIT_FLAG_PACIFIED
262144 UNIT_FLAG_DISABLE_ROTATE (stunned, 2.1.1)
524288 UNIT_FLAG_IN_COMBAT
1048576 UNIT_FLAG_TAXI_FLIGHT (disable casting at client side spell not allowed by taxi flight (mounted?), probably used with 0×4 flag)
2097152 UNIT_FLAG_DISARMED (disable melee spells casting…, "Required melee weapon" added to melee spells tooltip.)
4194304 UNIT_FLAG_CONFUSED
8388608 UNIT_FLAG_FLEEING
16777216 UNIT_FLAG_PLAYER_CONTROLLED (used in spell Eyes of the Beast for pet…)
33554432 UNIT_FLAG_NOT_SELECTABLE Can’t be selected by mouse
67108864 UNIT_FLAG_SKINNABLE
134217728 UNIT_FLAG_MOUNT (the client seems to handle it perfectly)
268435456 UNIT_FLAG_UNK_28
536870912 UNIT_FLAG_UNK_29 (used in Feing Death spell)
1073741824 UNIT_FLAG_SHEATHE
2147483648 UNIT_FLAG_UNK_31 (set skinnable icon and also changes color of portrait)

dynamicflags

Flags that control visual appearance of the creature.

A few known flags and their use are:

Flag Name Comments
0 UNIT_DYNFLAG_NONE
1 UNIT_DYNFLAG_LOOTABLE
2 UNIT_DYNFLAG_TRACK_UNIT
4 UNIT_DYNFLAG_OTHER_TAGGER Makes creatures name appear grey (good for simulating dead creatures)
8 UNIT_DYNFLAG_ROOTED
16 UNIT_DYNFLAG_SPECIALINFO Shows creatures basic stats (Health, damage, resistances, tamable).
32 UNIT_DYNFLAG_DEAD Makes the creature appear dead (this DOES NOT make the creatures name grey)
64 UNIT_DYNFLAG_TAPPED_BY_ALL_THREAT_LIST

family

The family this creature belongs to. Only used if type is 1 (Beast).

ID Family ID Family ID Family
1 Wolf 15 Doomguard 29 Nether Ray
2 Cat 16 Scorpid 30 Serpent
3 Spider 17 Turtle 31 Moth
4 Bear 18 Imp 32 Chimaera
5 Boar 19 Bat 33 Devilsaur
6 Crocolisk 20 Hyena 34 Ghoul
7 Carrion Bird 21 Bird of Prey 35 Silithid
8 Crab 22 Wind Serpent 36 Worm
9 Gorilla 23 Remote Control 37 Rhino
10 Raptor 24 Felguard 38 Wasp
11 Tallstrider 25 Dragonhawk 39 Core Hound
12 Felhunter 26 Ravager 40 Spirit Beast
13 Voidwalker 27 Warp Stalker
14 Succubus 28 Sporebat

trainer_type

If the NPC is a trainer (has the trainer flag), then this field controls what kind of trainer it is. Both this field and the related field must be filled in for a trainer to work correctly.

ID Type Related Field Comments
0 TRAINER_TYPE_CLASS class]] Trains class spells
1 TRAINER_TYPE_MOUNTS race]] Trains riding skill
2 TRAINER_TYPE_TRADESKILLS trainer_spell]] Trains professions
3 TRAINER_TYPE_PETS class]] Trains pet skills

trainer_spell

If the NPC is a trainer that teaches professions (trainer_type == 2), then the player must already know the spell ID specified here to be able to talk to this NPC.

trainer_class

If the NPC is a class trainer or a pet trainer (trainer_type == 0 or 3), then the player’s class must be the same as the value specified here to talk to this trainer. For pet trainers, this value must be 3 (hunter). See character.class

trainer_race

If the NPC is a mount trainer (trainer_type == 1), then the player’s race must be the same as the value specified here to talk to this trainer. See character.race

minrangedmg

Minimum ranged damage the creature inflicts.

maxrangedmg

Maximum range damage the creature inflicts.

rangedattackpower

type

The type of the creature.

ID Type
0 None
1 Beast
2 Dragonkin
3 Demon
4 Elemental
5 Giant
6 Undead
7 Humanoid
8 Critter
9 Mechanical
10 Not specified
11 Totem
12 Non-combat Pet
13 Gas Cloud

type_flags

This field can control whether a mob is minable or herbable. If it is either of those two, then the loot given when it is skinned/mined will be stored in the skinning_loot_template table. Aside from those two flags, field has no special meaning on the serverside. It will be send to the client in SMSG_CREATURE_QUERY_RESPONSE

Some values provided from the community:

Flag Name Comments
1 Makes the mob tameable (must also be a beast and have family set)
2 UNIT_FLAG_NOT_ATTACKABLE
8 UNIT_FLAG_ATTACKABLE
128 UNIT_FLAG_NOT_ATTACKABLE_1
136 UNIT_FLAG_NON_PVP_PLAYER
256 Makes mob herbable
512 Makes mob minable
1024 UNIT_FLAG_ANIMATION_FROZEN
4096 UNIT_FLAG_WAR_PLAYER

lootid

The ID of the loot template ID that this creature should use to generate loots. See creature_loot_template.entry

pickpocketloot

The ID of the pickpocketing loot template that this creature should use to generate pickpocketing loots. See pickpocketing_loot_template.entry

skinloot

The ID of the skinning loot template that this creature should use to generate skinning loots. See skinning_loot_template.entry

resistance1

Holy resistance.

resistance2

Fire resistance.

resistance3

Nature resistance.

resistance4

Frost resistance.

resistance5

Shadow resistance.

resistance6

Arcane resistance.

spell1

Spell ID that is available to the creature. At this time, this field isn’t used by the core.

spell2

Spell ID that is available to the creature. At this time, this field isn’t used by the core.

spell3

Spell ID that is available to the creature. At this time, this field isn’t used by the core.

spell4

Spell ID that is available to the creature. At this time, this field isn’t used by the core.

PetSpellDataId

ID that displays what spells the pet has in the client.

mingold

Minimum money that the creature drops when killed, in copper.

maxgold

Maximum money that the creature drops when killed, in copper.

AIName

Overrides AI used for the creature.

Name Description
NullAI Empty AI, creature does nothing.
AggressorAI Creature attacks as soon as something is in aggro range.
ReactorAI Creature attacks only if aggroed by attack, spell etc.
GuardAI
PetAI Creature is a pet.
TotemAI Creature casts spell from field spell1, otherwise like NullAI.
EventAI Creature uses event based AI.

MovementType

The creature’s default movement type.

ID Type
0 Idle; stay in one place
1 Random movement inside the spawndist radius
2 Waypoint movement

InhabitType

Controls where the creature can move and attack.

ID Type
1 Ground only
2 Water only
3 Both ground and water
4 Flying

unk16

Float values with unknown meaning. Values are from WDB Files.

unk17

Float values with unknown meaning. Values are from WDB Files.

questItem

The entry of the item that creature drops and is required within an active quest.

RacialLeader

A flag indicating wheather the creature is a racial leader. Killing racial leaders grants 100 honor.

RegenHealth

Boolean 1 or 0 controlling if the creature should regenerate its health or not.

equipment_id

The default ID of the equipment that this creature should display. See creature_equip_template.entry

trainer_id

The id refers to the npc_trainer_template..

vendor_id

The id refers to the npc_vendor_template..

mechanic_immune_mask

This makes the creature immune to specific spell natures. See Spell.dbc at row effect_X_mechanic_id.

Uses references from SpellMechanic.dbc.

Bit Type Bit Type
1 MECHANIC_CHARM 32768 MECHANIC_BANDAGE
2 MECHANIC_CONFUSED 65536 MECHANIC_POLYMORPH
4 MECHANIC_DISARM 131072 MECHANIC_BANISH
8 MECHANIC_DISTRACT 262144 MECHANIC_SHIELD
16 MECHANIC_FEAR 524288 MECHANIC_SHACKLE
32 MECHANIC_FUMBLE 1048576 MECHANIC_MOUNT
64 MECHANIC_ROOT 2097152 MECHANIC_PERSUADE
128 MECHANIC_PACIFY 4194304 MECHANIC_TURN
256 MECHANIC_SILENCE 8388608 MECHANIC_HORROR
512 MECHANIC_SLEEP 16777216 MECHANIC_INVULNERABILITY
1024 MECHANIC_SNARE 33554432 MECHANIC_INTERRUPT
2048 MECHANIC_STUN 67108864 MECHANIC_DAZE
4096 MECHANIC_FREEZE 134217728 MECHANIC_DISCOVERY
8192 MECHANIC_KNOCKOUT 268435456 MECHANIC_IMMUNE_SHIELD
16384 MECHANIC_BLEED 536870912 MECHANIC_SAPPED

To combine immunities just add values. Immune to everything corresponds to the value 1073741823.

flags_extra

These flags control certain creature specific attributes.

Bit Name Description
1 CREATURE_FLAG_EXTRA_INSTANCE_BIND Bounds killer’s party to the instance they are in
2 CREATURE_FLAG_EXTRA_CIVILIAN Makes creature ignore aggro
4 CREATURE_FLAG_EXTRA_NO_PARRY Prohibits creature from parrying
8 CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN Creatures parries do not speed up its next attack
16 CREATURE_FLAG_EXTRA_NO_BLOCK Prohibits creature from blocking
32 CREATURE_FLAG_EXTRA_NO_CRUSH Prohibits creature from dealing crushing blows
64 CREATURE_FLAG_EXTRA_NO_XP_AT_KILL Makes creature reward no XP at kill
128 CREATURE_FLAG_EXTRA_INVISIBLE Makes creature invisible for player. Use this for triggers etc.
256 CREATURE_FLAG_EXTRA_NOT_TAUNTABLE creature is immune to taunt auras and effect attack me
512 CREATURE_FLAG_EXTRA_AGGRO_ZONE creature sets itself in combat with zone on aggro
1024 CREATURE_FLAG_EXTRA_GUARD creature is a guard, for Zone under attack announce if guard death
2048 CREATURE_FLAG_EXTRA_NO_TALKTO_CREDIT creature doesn’t give quest-credits when talked to (temporarily flag).

ScriptName

The name of the script that this creature uses, if any. This ties a script from a scripting engine to this creature.

Clone this wiki locally