Versiones comparadas

Clave

  • Se ha añadido esta línea.
  • Se ha eliminado esta línea.
  • El formato se ha cambiado.

Back-to:World

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.

...

entry

Creature's unique id.

difficulty_entry_1-3

...

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 to the first 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 to the second 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 smart or C++ script will be required.

modelid1-4

A random graphical model that the client applies on this creature. This is a creature_model_info.modelid

name

Base name of the creature.

subname

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

IconName

Used to tell the player what kind of NPC this creature is.

List of known icon names:

Directions - Used for Guards and Teleporter NPC's.

Gunner - Indicator of a Turret NPC/Player Controlled.

vehichleCursor - Indicator that this is a PCV (Player Controlled Vehicle)

Driver - Shows a Steering Wheel icon when mouse over.

Attack - Shows a Sword icon indicating you can attack this target.

Buy - Shows a Brown Bag icon usually if the NPC only sells things.

Speak - Shows a Chat Bubble icon if this NPC has Quest/Gossip options.

Pickup - Shows a Hand Grasping icon of if this NPC can be picked up for quest/items.

Interact - Shows Cog icon commonly used for quest/transport.

Trainer - Shows a Book icon, identifying this NPC as a "Trainer".

Taxi - Shows a Boot w/Wings icon identifying this NPC as a "Taxi".

Repair - Shows a Anvil icon identifying this npc as a Repair NPC.

LootAll - Shows a Multiple Brown Bag icon (Same as holding Shift before looting a creature).

Quest - Unused or Unknown. (See EntryID 32870 The Real Ronakada).

PVP - Unused or Unknown.(See EntryID 29387 Arena Master: Dalaran Arena).

...

Also: Names are case sensitive. If in doubt use an example above.

gossip_menu_id

The gossip ID of this creature. This field is obtained from sniff (update fields). If you can not sniff this value, and need to make one up, it must be > 50000. This field is the link to gossip_menu.entry.

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.

exp

The expansion table the creatures health value is taken from. Values are from 0 to 2. See creature_classlevelstats.

faction

The faction of the creature. See FactionTemplate. 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.

...

So if you want an NPC that is a quest giver, a vendor, and can repair you just add the specific flags together: `npcflag`=`npcflag`|1|2|128|4096 
The same with hexadecimal numbers: 0x1 + 0x2 + 0x80 + 0x1000 = 0x1083

speed_walk

Controls how fast the creature can walk. For vehicles: increases fly speed.

speed_run

Controls how fast the creature can run. For vehicles: increases ground movement speed.

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:

...

Creature.spawntimesecs

...

Worldserver.conf (Corpse.Decay)

...

spawntimesecs + Corpse.Decay

...

Note 1: An NPC's rank is mostly visual (which also requires your Cache to be cleared to see changes). Changing this value will not change its health, damage, or loot. However, it will change the respawn time of the creature.

Note 2: Respawn times can be modified in two other places: Creature.spawntimesecs (only for that single GUID of the creature) and in the worldserver.conf file under the "Corpse.Decay" settings (for ALL creatures of the same rank). The default `spawntimesecs` for all spawned creatures is 300 seconds (5 minutes). For example, using the ".npc add" command to spawn a "Normal" NPC will give it a default respawn time of 6 minutes (spawntimesecs + Corpse.Decay time). Also, the creature must decay first before it can respawn. For this reason, the Corpse Decay Time of the creature is also it's minimum respawn time, since setting the creature's Creature.spawntimesecs = 0 will remove the Default Respawn Time. In the example above, setting our Normal NPC's spawntimesecs = 0 will mean the creature's respawn time decreases from 6 minutes to 60 seconds.

Note 3: If you want the creature to show a skull or "??" in the portrait (often with Bosses), set the type_flags to 4.

mindmg

Minimum damage the creature deals in melee. This field is no longer combined with the attackpower field to calculate the damage.

maxdmg

Maximum damage the creature deals in melee. This field is no longer combined with the attackpower field to calculate the damage.

dmgschool

Creature's melee damage school.

IDName
0SPELL_SCHOOL_NORMAL
1SPELL_SCHOOL_HOLY
2SPELL_SCHOOL_FIRE
3SPELL_SCHOOL_NATURE
4SPELL_SCHOOL_FROST
5SPELL_SCHOOL_SHADOW
6SPELL_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.

dmg_multiplier

Multiplier for mindmg and maxdmg

Example: mindmg=200 maxdmg = 500 dmg_multiplier = 10

Outcome: mob will hit for 2000-5000

baseattacktime

This is the base time that determines how long a creature must wait between melee attacks. This time is in milliseconds.

rangeattacktime

This is the base time that determines how long a creature must wait between ranged attacks. This time is in milliseconds.

unit_class

This is the creature's class, and it dictates levels of health and mana. Also note that health and mana will change according to exphealth_mod, and mana_mod. Not setting this value will report a minor warning in the DB_Errors.log.

...

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:

...

unit_flags2

Allows additional 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:

...

allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL

...

Flags that control visual appearance of the creature.

A few known flags and their use are:

...

family

The family this creature belongs to.

...

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.

...

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 characters.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 characters.race

minrangedmg

Minimum ranged damage the creature inflicts.

maxrangedmg

Maximum range damage the creature inflicts.

rangedattackpower

This field also refers to the damage multiplier.

Example: If the creature is using a ranged weapon and its rangedattackpower = 500 and the dmg_multiplier is 10 the max that it can hit for with ranged attacks would be 5000

type

The type of the creature.

...

type_flags

This field can control whether a mob is minable or herbable or lootable by engineer. If it is either of those three, then the loot given when it is skinned/mined will be stored in the skinning_loot_template table. It also controls, whether this mob can be tamed by a hunter. Other fields have no special meaning on the serverside. The entire field will be send to the client in SMSG_CREATURE_QUERY_RESPONSE

...

Projectiles can collide with this creature - interacts with TARGET_DEST_TRAJ

...

Can only interact with its creator.

...

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 can be used for Mind Control of this creature. 
For vehicle creatures: 1st spell on action bar

spell2

Spell ID that can be used for Mind Control of this creature. 
For vehicle creatures: 2nd spell on action bar

spell3

Spell ID that can be used for Mind Control of this creature. 
For vehicle creatures: 3rd spell on action bar

spell4

Spell ID that can be used for Mind Control of this creature. 
For vehicle creatures: 4th spell on action bar

spell5

Spell ID that can be used for Mind Control of this creature. 
For vehicle creatures: 5th spell on action bar

spell6

Spell ID that can be used for Mind Control of this creature. 
For vehicle creatures: 6th spell on action bar

spell7

Spell ID that can be used for Mind Control of this creature. 
For vehicle creatures: 7th spell on action bar

spell8

Spell ID that can be used for Mind Control of this creature. 
For vehicle creatures: 8th spell on action bar

PetSpellDataId

ID, found in CreatureSpellData.dbc, that displays what spells the pet has in the client.

VehicleId

Entryid of Vehicle if creature is/has a vehicle entry. This field determines how the player appears on the vehicle, how the vehicle moves, and whether or not the vehicle action bar is shown. For example, a VehicleID of 292 will make the player invisible, prevent the vehicle from strafing left/right (but will allow fowards/backwards), and will show the vehicle action bar spells (which are defined in spell1-8). An npc_spellclick_spells entry must be made for this creature entry in order for this to work.

mingold

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

maxgold

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

AIName

This field is overridden by ScriptName field if both are set.

...

MovementType

The creature's default movement type.

...

InhabitType

Controls where the creature can move and attack.

...

(This is a bitmask'ed value. You can add values together: 1+4=5 would make the creature walk on ground and fly.)

...

HoverHeight

Distance above the ground that the creature will hover if it has MOVEMENTFLAG_DISABLE_GRAVITY enabled. Value taken from sniffs.

Health_mod

Used to modify the base Level/Class health of a creature. This field comes from WDB.

Mana_mod

Used to modify the base Level/Class mana of a creature. This field comes from WDB.

Armor_mod

Used to modify the base Level/Class armor of a creature.

RacialLeader

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

QuestItem1-6

Tells the client (mouse-hovering this creature -> tooltip) that this creature will drop the item specified in this field.

movementID

We have no idea what this field does. It is passed directly to the client.

RegenHealth

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

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.

...

To combine immunities just add values. Immune to everything corresponds to the value 2147483647 (0x3FFF FFFF).

flags_extra

These flags control certain creature specific attributes. Flags can be added together to apply more than one.

Example: 32+64=96

...

NPCs can help with killing this creature and player will still be credited if he tags the creature

...

Creature is a dungeon boss. This flag is generically set by core during runtime. Setting this in database will give you startup error.

...

ScriptName

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

VerifiedBuild

This field is used by the TrinityDB Team to determine whether a template has been verified from WDB files.

If value is 0 then it has not been parsed yet.

If value is above 0 then it has been parsed with WDB files from that specific client build.

If value is -1 then it is just a place holder until proper data are found on WDBs.

...

Please select the version you are looking for:

TrinityCore 3.3.5a: creature_template (3.3.5a)

TrinityCore master: creature_template (master)