The `conditions` table
...
Field | Type | Attributes | Key | Null | Default | Extra | Comment |
mediumint(8) | signed | PRI | NO | 0 | |||
mediumint(8) | unsigned | PRI | NO | 0 | |||
mediumint(8) | signed | PRI | NO | 0 | |||
int(11) | signed | PRI | NO | 0 | smart_scripts.source_type || 0 for everything else | ||
mediumint(8) | unsigned | PRI | NO | 0 | |||
mediumint(8) | signed | PRI | NO | 0 | |||
tinyint(3) | unsigned | PRI | NO | 0 | |||
int(10) | unsigned | PRI | NO | 0 | |||
int(10) | unsigned | PRI | NO | 0 | |||
int(10) | unsigned | PRI | NO | 0 | |||
tinyint(3) | unsigned | NO | 0 | Boolean 0 or 1 (if NegativeCondition | |||
mediumint(8) | unsigned | NO | 0 | ||||
mediumint(8) | unsigned | NO | 0 | ||||
char(64) | signed | NO | ' ' | ||||
varchar(255) | YES | NULL |
Description of the fields
...
if negative, then it is a reference template.
...
SourceTypeOrReferenceId | ID | SourceGroup | SourceEntry | SourceId | ConditionTarget | Notes |
---|---|---|---|---|---|---|
CONDITION_SOURCE_TYPE_NONE | 0 | See REFERENCE TEMPLATES | ( |
...
74219362) | Always 0 | (See below) | Only used in Reference Templates! See below. | |||
CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE | 1 | creature_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE | 2 | disenchant_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE | 3 | fishing_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE | 4 | gameobject_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE | 5 | item_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE | 6 | mail_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE | 7 | milling_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE | 8 | pickpocketing_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE | 9 | prospecting_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE | 10 | reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE | 11 | skinning_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE | 12 | spell_loot_template.Entry or reference_loot_template.Entry | item id (_loot_template.Item or reference_loot_template.Item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET | 13 | Mask of effects to be affected by condition: 1 = EFFECT_0, 2 = EFFECT_1, 4 = EFFECT_2 | Spell Id from Spell DBC file | Always 0 | 0 : Potential spell Target | Don't use wowhead to get number of effects, data from wowhead sometimes doesn't match real effect number. |
CONDITION_SOURCE_TYPE_GOSSIP_MENU | 14 | gossip_menu.entry (gossip menu entry) | gossip_menu.text_id (points to npc_text.ID) | Always 0 | 0 = Player | |
CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION | 15 | gossip_menu_option.menu_id (menu entry) | gossip_menu_option.id | Always 0 | 0 = Player | |
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE | 16 | Always 0 | creature entry (creature_template.entry) | Always 0 | 0 = Player riding vehicle | |
CONDITION_SOURCE_TYPE_SPELL | 17 | Always 0 | Spell ID from Spell.dbc | Always 0 | 0 = spell Caster 1 = Explicit Target of the spell (only for spells which take the object selected by caster into account) |
|
CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT | 18 | creature entry (npc_spellclick_spells.npc_entry) | Spell (npc_spellclick_spells.spell_id) | Always 0 | 0 = Clicker 1 = Spellclick target (clickee) | |
CONDITION_SOURCE_TYPE_QUEST_AVAILABLE | 19 | Always 0 | Quest ID | Always 0 | Always 0 | Condition must be met for quest to be available to player. |
UNUSED | 20 | |||||
CONDITION_SOURCE_TYPE_VEHICLE_SPELL | 21 | creature entry (creature_template.entry) | Spell ID from Spell.dbc | Always 0 | 0 = Player for whom spell bar is shown 1 = Vehicle creature | This will show or hide spells in vehicle spell bar. |
CONDITION_SOURCE_TYPE_SMART_EVENT | 22 | ID (smart_scripts.id) + 1 | EntryOrGuid (smart_scripts.entryorguid) | SourceType (smart_scripts.source_type) | 0 = Invoker 1 = Object | |
CONDITION_SOURCE_TYPE_NPC_VENDOR | 23 | vendor entry (npc_vendor.entry) | item entry (npc_vendor.item) | Always 0 | Always 0 | |
CONDITION_SOURCE_TYPE_SPELL_PROC | 24 | Always 0 | Spell ID of aura which triggers the proc | Always 0 | 0 = Actor 1 = ActionTarget | |
CONDITION_SOURCE_TYPE_TERRAIN_SWAP (6.x / 7.x only) | 25 | Always 0 | terrainSwap - object in terrainswap [ 6.x / 7.x only ] | Always 0 | (source code / new description here) | |
CONDITION_SOURCE_TYPE_PHASE (6.x / 7.x only) | 26 | Phase ID | Zone or Area ID (or 0 for any area) | Always 0 | (source code / new description here) | |
CONDITION_SOURCE_TYPE_MAX | 27 | (Placeholder) |
SourceGroup
See belowabove.
SourceEntry
See belowabove.
ElseGroup
Allows building grouped conditions - all entries belonging to the same condition (same SourceType, SourceGroup and SourceEntry) that share the same number in ElseGroup, define one group. The entire condition is met when any of its groups is met (logical OR). The group is met when all of its entries are met (logical AND).
...
Panel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
ConditionTarget
Allows selecting an object for which conditions will be checked. Available objects are dependant on SourceTypeOrReferenceId, for details see respective source type reference.
...
Id from /src/server/game/Miscellaneous/SharedDefines.h:839. Will be displayed only for the below condition source type:
Panel |
---|
CONDITION_SOURCE_TYPE_SPELL = 17 |
...
Id from /src/server/game/Miscellaneous/SharedDefines.h:1033. Will be displayed only for the below condition source type:
Panel |
---|
CONDITION_SOURCE_TYPE_SPELL = 17 |
...
Explanation of condition types
The content of the SourceGroup 74219362 and SourceEntry 74219362 fields depends on the SourceTypeOrReferenceId 74219362
*CONDITION_SOURCE_TYPE_NONE = 0
...
- SourceGroup: gossip menu entry (gossip_menu.entry)
- SourceEntry: gossip menu text id (gossip_menu.text_id)
- ConditionTarget:
- 0 - Player for which gossip text is shown
- 1 - WorldObject providing gossip
...
- SourceGroup: gossip menu entry (gossip_menu_option.menu_id)
- SourceEntry: gossip menu option id (gossip_menu_option.id)
- ConditionTarget:
- 0 - Player for which gossip text is shown
- 1 - WorldObject providing gossip
...
- SourceGroup: creature entry (npc_spellclick_spells.npc_entry)
- SourceEntry: spell (npc_spellclick_spells.spell_id)
- ConditionTarget:
- 0 - Clicker
- 1 - Spellclick target (clickee)
*CONDITION_SOURCE_TYPE_QUEST_ACCEPT AVAILABLE = 19
- SourceGroup: ?
- SourceEntry: Quest id)
- ConditionTarget: always 0
...
*CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20
...
UNUSED = 20
*CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21
...
- ConditionValue1: spell (Spell Id from Spell.dbc)
- ConditionValue2: effect index (0-2)
- ConditionValue3: always 0
*CONDITION_ITEM = 2
- ConditionValue1: item entry (item_template.entry)
- ConditionValue2: item count
- ConditionValue3: in bank? (true=1)
*CONDITION_ITEM_EQUIPPED = 3
- ConditionValue1: item entry (item_template.entry)
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_ZONEID = 4
- ConditionValue1: zone ID where this condition will be true
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_REPUTATION_RANK = 5
- ConditionValue1: faction template ID (from Faction.dbc)
- ConditionValue2: rank (Hated - 1, Hostile - 2, Unfriendly - 4, Neutral - 8, Friendly - 16, Honored - 32, Revered - 64, Exalted - 128) Flags can be added together for all ranks the condition should be true in.
- ConditionValue3: always 0
*CONDITION_TEAM = 6
- ConditionValue1: team id (469 - Alliance, 67 - Horde)
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_SKILL = 7
- ConditionValue1: skill required, see SkillLine.dbc
- ConditionValue2: skill value
- ConditionValue3: always 0
*CONDITION_QUESTREWARDED = 8
- ConditionValue1: (quest_template.id)
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_QUESTTAKEN = 9
- ConditionValue1: (quest_template.id)
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_DRUNKENSTATE = 10
...
*CONDITION_WORLD_STATE = 11
- ConditionValue1: world state index
- ConditionValue2: world state value
- ConditionValue3: always 0
*CONDITION_ACTIVE_EVENT= 12
- ConditionValue1: event entry (game_event.eventEntry)
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_INSTANCE_INFO = 13
- ConditionValue1: entry //see corresponding script source files for more info
- ConditionValue2: data //see corresponding script source files for more info
- ConditionValue3: type:
- 0 - INSTANCE_INFO_DATA
- 1 - INSTANCE_INFO_GUID_DATA
- 2 - INSTANCE_INFO_BOSS_STATE
- 3 - INSTANCE_INFO_DATA64
*CONDITION_QUEST_NONE = 14
- ConditionValue1: (quest_template.id)
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_CLASS = 15
- ConditionValue1: class mask. Add flags together for all classes condition should be true for. See ChrClasses.dbc
- ConditionValue2: always 0
- ConditionValue3: always 0
...
- ConditionValue1: 0 = Male, 1 = Female, 2 = None
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_UNIT_STATE = 21
- ConditionValue1: UnitState (enum)
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_MAPID = 22
- ConditionValue1: Map entry
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_AREAID = 23
- ConditionValue1: Area ID
- ConditionValue2: always 0
- ConditionValue3: always 0
...
- ConditionValue1: Creature type (creature_template.type). Condition is true if creature_template.type == ConditionValue1
- ConditionValue2: always 0
- ConditionValue3: always 0
...
*CONDITION_PHASEMASK = 26
- ConditionValue1: phasemask value
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_LEVEL = 27
- ConditionValue1: Player level
- ConditionValue2: Optional
- 0 = Level must be equal
- 1 = Level must be higher
- 2 = Level must be lesser
- 3 = Level must be equal or higher
- 4 = Level must be equal or lower
- ConditionValue3: always 0
*CONDITION_QUEST_COMPLETE = 28
- ConditionValue1: Quest id
- ConditionValue2: Always 0
- ConditionValue3: always 0
Only if player has all quest objectives complete, but not yet rewarded.
...
*CONDITION_NEAR_GAMEOBJECT = 30
- ConditionValue1: Gameobject entry
- ConditionValue2: Distance (yd)
- ConditionValue3: always 0
*CONDITION_OBJECT_ENTRY_GUID= 31
- ConditionValue1: TypeID - available object types:
- 3 - TYPEID_UNIT
- 4 - TYPEID_PLAYER
- 5 - TYPEID_GAMEOBJECT
- 7 - TYPEID_CORPSE (player corpse, after released spirit)
- ConditionValue2: Entry
- 0 for any object of given type
- Gameobject entry for TypeID = TYPEID_GAMEOBJECT
- Creature entry for TypeID = TYPEID_UNIT
- ConditionValue3 0 for any object of given type, any other value to match that guid
- ConditionValue1: TypeID - available object types:
*CONDITION_TYPE_MASK= 32
- ConditionValue1: TypeMask - a bitmask of following object types:
- 0x0008 - TYPEMASK_UNIT
- 0x0010 - TYPEMASK_PLAYER
- 0x0020 - TYPEMASK_GAMEOBJECT
- 0x0080 - TYPEMASK_CORPSE (player corpse, after released spirit)
- ConditionValue2: always 0
- ConditionValue3: always 0
- ConditionValue1: TypeMask - a bitmask of following object types:
*CONDITION_RELATION_TO= 33
- ConditionValue1: target to which relation is checked - one of ConditionTargets available in current SourceType.
- ConditionValue2: RelationType - defines relation of current ConditionTarget to target specified in ConditionValue1.
- 0 - RELATION_SELF
- 1 - RELATION_IN_PARTY
- 2 - RELATION_IN_RAID_OR_PARTY
- 3 - RELATION_OWNED_BY (ConditionTarget is owned by ConditionValue1)
- 4 - RELATION_PASSENGER_OF (ConditionTarget is passenger of ConditionValue1)
- 5 - RELATION_CREATED_BY (ConditionTarget is summoned by ConditionValue1)
- ConditionValue3: always 0
*CONDITION_REACTION_TO= 34
- ConditionValue1: target to which reaction is checked - one of ConditionTargets available in current SourceType.
- ConditionValue2: rankMask- defines reactions of current ConditionTarget to target specified in ConditionValue1 which are allowed. This is a bitmask, flags for reactions are:
- 1 - Hated
- 2 - Hostile
- 4 - Unfriendly
- 8 - Neutral
- 16 - Friendly
- 32 - Honored
- 64 - Revered
- 128 - Exalted
- ConditionValue3: always 0
*CONDITION_DISTANCE_TO= 35
- ConditionValue1: target to which distance is checked - one of ConditionTargets available in current SourceType.
- ConditionValue2: distance - defines distance between current ConditionTarget and target specified in ConditionValue1.
- ConditionValue3: ComparisionType:
- 0 = distance must be equal to ConditionValue2
- 1 = distance must be higher than ConditionValue2
- 2 = distance must be lesser than ConditionValue2
- 3 = distance must be equal or higher than ConditionValue2
- 4 = distance must be equal or lower than ConditionValue2
*CONDITION_ALIVE= 36
- ConditionValue1: always 0
- ConditionValue2: always 0
- ConditionValue3: always 0
- NegativeCondition:
- 0 (If target needs to be ALIVE)
- 1 (If target needs to be DEAD)
NOTE: A creature corpse and a creature that_looks_dead are two different things. One is actually dead and the other is just using an emote to appear dead.
*CONDITION_HP_VAL = 37
- ConditionValue1: HP
- ConditionValue2: ComparisionType:
- 0 = HP must be equal
- 1 = HP must be higher
- 2 = HP must be lesser
- 3 = HP must be equal or higher
- 4 = HP must be equal or lower
- ConditionValue3: always 0
*CONDITION_HP_PCT = 38
- ConditionValue1: Percentage of max HP
- ConditionValue2: ComparisionType:
- 0 = Percentage of max HP must be equal
- 1 = Percentage of max HP must be higher
- 2 = Percentage of max HP must be lesser
- 3 = Percentage of max HP must be equal or higher
- 4 = Percentage of max HP must be equal or lower
- ConditionValue3: always 0
*CONDITION_REALM_ACHIEVEMENT = 39
- ConditionValue1: achievement ID from Achievement.dbc
- ConditionValue2: always 0
- ConditionValue3: always 0
*CONDITION_IN_WATER = 40
- ConditionValue1: always 0
- ConditionValue2: always 0
- ConditionValue3: always 0
- NegativeCondition:
- 0 (If target needs to be on land)
- 1 (If target needs to be in water)
*CONDITION_STAND_STATE = 42
...
- SourceTypeOrReferenceId : used as negative, for reference ID
- SourceGroup : always 0
- SourceEntry : always 0
- ElseGroup : OR modifier
- ConditionTypeOrReference: ConditionTypeOrReference
- ConditionValue1 : see above
- ConditionValue2 : see above
- ConditionValue3 : see above
- ErrorType : see above
- ErrorTextId : see above
- Comment : see above
...