The `conditions` table
This table allows you to define conditions for various systems - Gossip, loot etc.
Table Structure
Field |
Type |
Attributes |
Key |
Null |
Default |
Extra |
Comment |
MEDIUMINT |
SIGNED |
PRI |
NO |
0 |
|
|
|
MEDIUMINT |
UNSIGNED |
PRI |
NO |
0 |
|
|
|
MEDIUMINT |
SIGNED |
PRI |
NO |
0 |
|
|
|
INT |
SIGNED |
PRI |
NO |
0 |
|
smart_scripts.source_type || 0 for everything else |
|
MEDIUMINT |
UNSIGNED |
PRI |
NO |
0 |
|
|
|
MEDIUMINT |
SIGNED |
PRI |
NO |
0 |
|
|
|
TINYINT |
UNSIGNED |
PRI |
NO |
0 |
|
|
|
INT |
UNSIGNED |
PRI |
NO |
0 |
|
|
|
INT |
UNSIGNED |
PRI |
NO |
0 |
|
|
|
INT |
UNSIGNED |
PRI |
NO |
0 |
|
|
|
TINYINT |
UNSIGNED |
|
NO |
0 |
|
Boolean 0 or 1 (if NegativeCondition |
|
MEDIUMINT |
UNSIGNED |
|
NO |
0 |
|
|
|
MEDIUMINT |
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 | (REFERENCE TEMPLATES) | 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 | 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.MenuID | gossip_menu.TextID (points to npc_text.ID) | Always 0 | 0 = Player |
|
CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION | 15 | gossip_menu_option.MenuID | gossip_menu_option.OptionID | 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. |
CONDITION_SOURCE_TYPE_UNUSED_20 | 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 shown1 = 聽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_MAX | 27 | (Placeholder) |
See above.
See above.
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).
Example:
Two conditions with the same SourceType, SourceGroup and SourceEntry but with a different Condition, the first one has ElseGroup = 1 and the second has ElseGroup = 2, this creates a Logical OR.
Two conditions with the same聽SourceType, SourceGroup and SourceEntry but with a different Condition, both has ElseGroup = 1, this creates a Logical AND.
聽
ConditionTypeOrReference (name) | Value | ConditionValue1 | ConditionValue2 | ConditionValue3 |
---|---|---|---|---|
CONDITION_NONE | 0 | (Never used) | (Never used) | (Never used) |
CONDITION_AURA | 1 | Spell ID from聽Spell.dbc | Effect index (0-2) | Always 0 |
CONDITION_ITEM | 2 | item entry (item_template.entry) | item count | 0 = not in bank, 1 = in bank |
CONDITION_ITEM_EQUIPPED | 3 | item entry (item_template.entry) | Always 0 | Always 0 |
CONDITION_ZONEID | 4 | Zone ID where this condition will be true. | Always 0 | Always 0 |
CONDITION_REPUTATION_RANK | 5 |
|
Add the target ranks together for the condition to be true for all those ranks. |
Always 0 |
CONDITION_TEAM | 6 | Team id :Alliance = 469 / Horde = 67 | Always 0 | Always 0 |
CONDITION_SKILL | 7 | Required skill. See聽SkillLine.dbc . | Skill rank value (e.g. from 1 to 450 for the 3.3.5 branch) | Always 0 |
CONDITION_QUESTREWARDED | 8 | Quest ID - see quest_template.id | Always 0 | Always 0 |
CONDITION_QUESTTAKEN | 9 | Quest ID - see quest_template.id | Always 0 | Always 0 |
CONDITION_DRUNKENSTATE | 10 | Sober=0; Tipsy=1, Drunk=2, Smashed=3 | Always 0 | Always 0 |
CONDITION_WORLD_STATE | 11 | World state index | World state value | Always 0 |
CONDITION_ACTIVE_EVENT | 12 | Event entry (game_event.eventEntry) | Always 0 | Always 0 |
CONDITION_INSTANCE_INFO | 13 | entry (see corresponding source script files for info) |
data (see corresponding script source files for more info) |
0=INSTANCE_INFO_DATA 1=INSTANCE_INFO_GUID_DATA 2=INSTANCE_INFO_BOSS_STATE 3=INSTANCE_INFO_DATA64 |
CONDITION_QUEST_NONE | 14 | Quest ID - see quest_template.id | Always 0 | Always 0 |
CONDITION_CLASS | 15 | Class mask from ChrClasses.dbc Add flags together for all classes where condition is true. |
Always 0 | Always 0 |
CONDITION_RACE | 16 | Race mask from聽ChrRaces.dbc . Add flags together for all races where condition is true. |
Always 0 | Always 0 |
CONDITION_ACHIEVEMENT | 17 | Achievement ID from聽Achievement.dbc | Always 0 | Always 0 |
CONDITION_TITLE | 18 | Title ID from聽CharTitles.dbc | Always 0 | Always 0 |
CONDITION_SPAWNMASK | 19 | spawnMask from Creature.spawnMask / Gameobject.spawnMask |
Always 0 | Always 0 |
CONDITION_GENDER | 20 | 0 = Male, 1 = Female, 2 = None | Always 0 | Always 0 |
CONDITION_UNIT_STATE | 21 | UnitState (enum from Unit.h) | Always 0 | Always 0 |
CONDITION_MAPID | 22 | Map entry from Map.dbc (0=Eastern Kingdoms, 1=Kalimdor, - and so on.) |
Always 0 | Always 0 |
CONDITION_AREAID | 23 | Area ID from AreaTable.dbc | Always 0 | Always 0 |
CONDITION_CREATURE_TYPE | 24 | Creature type from creature_template.type True if creature_template.type ==聽ConditionValue1 |
Always 0 | Always 0 |
CONDITION_SPELL | 25 | Spell ID from聽Spell.dbc | Always 0 | Always 0 |
CONDITION_PHASEMASK | 26 | phasemask value | Always 0 | Always 0 |
CONDITION_LEVEL | 27 | Player level (1-80 in 3.3.5) | Optional: 0 = Level must be equal, 1 = Level must be higher, 2 = Level must be lower, 3 = Level must be higher or equal, 4 = Level must be lower or equal. |
Always 0 |
CONDITION_QUEST_COMPLETE | 28 | Quest ID - see quest_template.id | Always 0 | Always 0 |
CONDITION_NEAR_CREATURE | 29 | Creature entry from creature_template.entry | Distance聽in yards | Alive=0 / Dead=1 |
CONDITION_NEAR_GAMEOBJECT | 30 | Gameobject entry from聽gameobject_template.entry | Distance聽in yards | GoState 0 = ignore, 1 = Ready, 2 = Not Ready |
CONDITION_OBJECT_ENTRY_GUID | 31 | TypeID. Available object types: |
|
1 - 500k : creature / gameobject GUID |
CONDITION_TYPE_MASK | 32 | TypeMask - a bitmask of following object types: |
Always 0 | Always 0 |
CONDITION_RELATION_TO | 33 | Target to which relation is checked. |
RelationType - defines relation of current ConditionTarget to target specified in ConditionValue1. |
Always 0 |
CONDITION_REACTION_TO | 34 | Target to which reaction is checked. |
|
Always 0 |
CONDITION_DISTANCE_TO | 35 | Target to which distance is checked |
Distance. Defines distance between current ConditionTarget and target specified in ConditionValue1 |
ComparisionType: |
CONDITION_ALIVE | 36 | Always 0 - Use NegativeCondition and the following settings:
NegativeCondition = 0 if target needs to be ALIVE. |
Always 0 | Always 0 |
CONDITION_HP_VAL | 37 | HP value | ComparisionType:
|
Always 0 |
CONDITION_HP_PCT | 38 | Percentage of max聽HP | ComparisionType:
|
Always 0 |
CONDITION_REALM_ACHIEVEMENT | 39 | Achievement ID from聽Achievement.dbc | Always 0 | Always 0 |
CONDITION_IN_WATER | 40 | Always 0 - Use NegativeCondition and the following settings:NegativeCondition = 0 If target needs to be on landNegativeCondition = 1 If target needs to be聽in water | Always 0 | Always 0 |
CONDITION_STAND_STATE | 42 | stateType (exact or any): 0 = Exact state used in ConditionValue2 1 = Any type of state in ConditionValue2 | Exact stand state, or generic state聽(stand / sit), depending on value 10 = Standing 1 = Sitting | Always 0 |
CONDITION_DAILY_QUEST_DONE | 43 | Quest ID - see quest_template.id | Always 0 | Always 0 |
CONDITION_CHARMED | 44 | Always 0 | Always 0 | Always 0 |
CONDITION_PET_TYPE | 45 | mask | Always 0 | Always 0 |
CONDITION_TAXI | 46 | Always 0 | Always 0 | Always 0 |
CONDITION_QUESTSTATE | 47 | Quest ID - see quest_template.id | state_mask:
|
Always 0 |
CONDITION_QUEST_OBJECTIVE_PROGRESS | 48 | Quest ID - see quest_template.id | Quest Objective ID - see quest_template.RequiredNpcOrGo | Quest Objective Count |
CONDITION_DIFFICULTY_ID | 49 | Difficulty | Always 0 | Always 0 |
CONDITION_QUEST_SATISFY_EXCLUSIVE | 101 | quest_id | Always 0 | Always 0 |
CONDITION_HAS_AURA_TYPE | 102 | aura_type | Always 0 | Always 0 |
CONDITION_WORLD_SCRIPT | 103 | conditionId | state | Always 0 |
Allows selecting an object for which conditions will be checked. Available objects are dependant on SourceTypeOrReferenceId, for details see respective source type reference.
See below
See below
See below
If set to 1, the condition will be "inverted"
Example: CONDITION_AURA with NegativeCondition will be true when the player does NOT have the aura.
Id from /src/server/game/Miscellaneous/SharedDefines.h#L830. Will be displayed only for the below condition source type:
CONDITION_SOURCE_TYPE_SPELL = 17
Id from /src/server/game/Miscellaneous/SharedDefines.h#L1024. Will be displayed only for the below condition source type:
CONDITION_SOURCE_TYPE_SPELL = 17
(ErrorType must be SPELL_FAILED_CUSTOM_ERROR (209) otherwise 0)
The ScriptName this condition uses, if any.
Explanation of this condition or reference
The content of the SourceGroup and SourceEntry fields depends on the SourceTypeOrReferenceId
*CONDITION_SOURCE_TYPE_NONE = 0
Only used in Reference Templates! See below.
*CONDITION_SOURCE_TYPE_ * _LOOT_TEMPLATE = 1 - 12 *SourceGroup: loot entry (_loot_template.Entry or Reference_loot_template.Entry) *SourceEntry: item id (_loot_template.Item or Reference_loot_template.Item)
example: if you use type 1 (creature_loot_template) then use the entry and item fields from that table
*CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET = 13
Notes:
*CONDITION_SOURCE_TYPE_GOSSIP_MENU = 14
*CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15
*CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16
Note: creature entry must be a vehicle. Example: If this is used with CONDITION_AREA, the player will be dismounted from the vehicle if the mounted player leaves that area.
*CONDITION_SOURCE_TYPE_SPELL = 17
Notes:
*CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT = 18
*CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19
*CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20
*CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21
Note: it will show or hide spells in vehicle spell bar.
*CONDITION_SOURCE_TYPE_SMART_EVENT = 22
*CONDITION_SOURCE_TYPE_NPC_VENDOR = 23
*CONDITION_SOURCE_TYPE_SPELL_PROC = 24
*CONDITION_NONE = 0
Never used
*CONDITION_AURA = 1
*CONDITION_ITEM = 2
*CONDITION_ITEM_EQUIPPED = 3
*CONDITION_ZONEID = 4
*CONDITION_REPUTATION_RANK = 5
*CONDITION_TEAM = 6
*CONDITION_SKILL = 7
*CONDITION_QUESTREWARDED = 8
*CONDITION_QUESTTAKEN = 9
*CONDITION_DRUNKENSTATE = 10
*CONDITION_WORLD_STATE = 11
*CONDITION_ACTIVE_EVENT= 12
*CONDITION_INSTANCE_INFO = 13
*CONDITION_QUEST_NONE = 14
*CONDITION_CLASS = 15
*CONDITION_RACE = 16
*CONDITION_ACHIEVEMENT = 17
*CONDITION_TITLE = 18
*CONDITION_SPAWNMASK = 19
*CONDITION_GENDER = 20
*CONDITION_UNIT_STATE = 21
*CONDITION_MAPID = 22
*CONDITION_AREAID = 23
*CONDITION_CREATURE_TYPE = 24
*CONDITION_SPELL = 25
*CONDITION_PHASEMASK = 26
*CONDITION_LEVEL = 27
*CONDITION_QUEST_COMPLETE = 28
Only if player has all quest objectives complete, but not yet rewarded.
*CONDITION_NEAR_CREATURE = 29
*CONDITION_NEAR_GAMEOBJECT = 30
*CONDITION_OBJECT_ENTRY_GUID= 31
*CONDITION_TYPE_MASK= 32
*CONDITION_RELATION_TO= 33
*CONDITION_REACTION_TO= 34
*CONDITION_DISTANCE_TO= 35
*CONDITION_ALIVE= 36
*CONDITION_HP_VAL = 37
*CONDITION_HP_PCT = 38
*CONDITION_REALM_ACHIEVEMENT = 39
*CONDITION_IN_WATER = 40
*CONDITION_STAND_STATE = 42
*CONDITION_WORLD_SCRIPT = 103