Creature template

From OregonCore Wiki
Jump to: navigation, search



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.

Schema Last Modified: Rev 1283 - Schema Verified: Rev 1307


Structure

Field Type Null Key Default Extra

entry

mediumint(8) unsigned NO PRI 0

heroic_entry

mediumint(8) unsigned NO 0

KillCredit1

int(11) unsigned NO 0

KillCredit2

int(11) unsigned NO 0

modelid_A

mediumint(8) unsigned NO 0

modelid_A2

mediumint(8) unsigned NO 0

modelid_H

mediumint(8) unsigned NO 0

modelid_H2

mediumint(8) unsigned NO 0

name

char(100) NO 0

subname

char(100) YES None

IconName

char(100) YES

gossip_menu_id

mediumint(8) unsigned YES 1

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

float YES 1

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

baseattacktime

int(10) unsigned YES 0

rangeattacktime

int(10) unsigned YES 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

class

tinyint(3) unsigned YES 0

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

smallint(5) 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

RacialLeader

tinyint(3) unsigned NO 0

RegenHealth

tinyint(3) unsigned NO 1

equipment_id

mediumint(8) unsigned 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

entry

Creature's unique id.

heroic_entry

If not zero, this field refers to an entry of creature_template. If a creature spawned in a heroic instance has the template, it will get the template pointed to by this field instead.

KillCredit1

If this is a kill credit template -- one that is a dummy template that is used when more than one creature can count as a kill in a quest, then this is a link the the fist [index.php@title=Creature_template.html#entry entry] of the creature that could be killed to give quest credit.

KillCredit2

If this is a kill credit template -- one that is a dummy template that is used when more than one creature can count as a kill in a quest, then this is a link the the second [index.php@title=Creature_template.html#entry entry] of the creature that could be killed to give quest credit. If more than two creatures can be killed and count toward a single objective, an EAI or C script will be required.

modelid_A

Graphical model that the client applies on this creature when it is on the Alliance side. This is a [index.php@title=Creature_model_info.html#entry creature_model_info.entry]

modelid_A2 is just a second field to store 2 possibilities

modelid_H

Graphical model that the client applies on this creature when it is on the Horde side. This is a [index.php@title=Creature_model_info.html#entry creature_model_info.entry]

modelid_H2 is just a second field to store 2 possibilities

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

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 [index.php@title=FactionTemplate.dbc.html 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 [index.php@title=FactionTemplate.dbc.html 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.
4 Not used
8 Not Used
16 Trainer Allows the creature to have a trainer list to teach spells
32 Class Trainer Specifies the creature as class trainer
64 Profession Trainer Specifies the creature as profession trainer
128 Vendor Any creature selling items needs to have this flag.
256 Vendor Not used by OregonCore. Sells ammo. (not sure)
512 Vendor Not used by OregonCore. Sells food/drink. (not sure)
1024 Vendor Not used by OregonCore. Sells poisons. (not sure)
2048 Vendor Not used by OregonCore. Sells reagents. (not sure)
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. More at MaNGOS forum and at Npc_spellclick_spells table

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.

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.

maxdmg

Maximum damage the creature deals in melee.

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 indicates how much dmg is possible to take off from mob, by using -ap or ap effects.

baseattacktime

Creature's melee attack time in milliseconds.

rangeattacktime

Creature's ranged attack time in milliseconds.

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_UNKNOWN7
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_UNKNOWN9
128 UNIT_FLAG_NOT_ATTACKABLE_1 (??) ((UNIT_FLAG_PVP_ATTACKABLE UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE)
256 UNIT_FLAG_UNKNOWN2 (2.0.8) (2.4.3, Seems to make the unit unattackable)
512 UNIT_FLAG_UNKNOWN11
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_UNKNOWN4 (2.0.8)
32768 UNIT_FLAG_UNK_15
65536 UNIT_FLAG_UNKNOWN14
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 0x4 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_UNKNOWN5 (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_UNKNOWN17
536870912 UNIT_FLAG_UNKNOWN6 (used in Feing Death spell)
1073741824 UNIT_FLAG_SHEATHE

dynamicflags

Flags that control visual appearance of the creature.

A few known flags and their use are:

Flag Name Comments
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)

family

The family this creature belongs to. Only used if [index.php@title=Creature_template.html#type 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

If you want to select only the exotic pets, there is the list: 32, 33, 35, 36, 37, 39, 40 [exotic ones are highlighted in the table]

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

[index.php@title=Creature_template.html#class class]

Trains class spells
1 TRAINER_TYPE_MOUNTS

[index.php@title=Creature_template.html#race race]

Trains riding skill
2 TRAINER_TYPE_TRADESKILLS

[index.php@title=Creature_template.html#trainer_spell trainer_spell]

Trains professions
3 TRAINER_TYPE_PETS

[index.php@title=Creature_template.html#class class]

Trains pet skills

trainer_spell

If the NPC is a trainer that teaches professions ([index.php@title=Creature_template.html#trainer_type trainer_type] == 2), then the player must already know the spell ID specified here to be able to talk to this NPC.

class

If the NPC is a class trainer or a pet trainer ([index.php@title=Creature_template.html#trainer_type 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 [index.php@title=Characters.html#class characters.class]

race

If the NPC is a mount trainer ([index.php@title=Creature_template.html#trainer_type trainer_type] == 1), then the player's race must be the same as the value specified here to talk to this trainer. See [index.php@title=Characters.html#race characters.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 [index.php@title=Loot_Template_tables.html 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 [index.php@title=Loot_Template_tables.html#entry creature_loot_template.entry]

pickpocketloot

The ID of the pickpocketing loot template that this creature should use to generate pickpocketing loots. See [index.php@title=Loot_Template_tables.html#entry pickpocketing_loot_template.entry]

skinloot

The ID of the skinning loot template that this creature should use to generate skinning loots. See [index.php@title=Loot_Template_tables.html#entry skinning_loot_template.entry]

resistance1

Holy resistance.

resistance2

Fire resistance.

resistance3

Nature resistance.

resistance4

Frost resistance.

resistance5

Shadow resistance.

resistance6

Arcane resistance.

spell1-4

Spells that are available to the creature.

At this time, these fields are used by core only to populate pet spells if [index.php@title=Creature_template.html#PetSpellDataId PetSpellDataId ] is 0

PetSpellDataId

ID linked to CreatureSpellData.dbc 1st column. This dbc contains pet spells (habilities).

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

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 [index.php@title=Creature_equip_template.html#entry creature_equip_template.entry]

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_NO_TAUNT Makes creature immune to taunt.
512 CREATURE_FLAG_EXTRA_GHOST Makes creature visible only for dead players.

ScriptName

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