Skip to content

conditions

Structure ​

FieldTypeAttributesKeyNullDefaultExtraComment
SourceTypeOrReferenceIdintsignedPRINO0
SourceGroupintunsignedPRINO0
SourceEntryintsignedPRINO0
SourceIdintsignedPRINO0
ElseGroupintunsignedPRINO0
ConditionTypeOrReferenceintsignedPRINO0
ConditionTargettinyintunsignedPRINO0
ConditionValue1intunsignedPRINO0
ConditionValue2intunsignedPRINO0
ConditionValue3intunsignedPRINO0
ConditionStringValue1varchar(64)PRINO''
NegativeConditiontinyintunsignedNO0
ErrorTypeintunsignedNO0
ErrorTextIdintunsignedNO0
ScriptNamevarchar(64)NO''
Commentvarchar(255)YESNULL

 

Description of fields ​

SourceTypeOrReferenceId ​

  • if a negative value, id of a reference (referenced directly in the ConditionTypeOrReference of another condition).
  • If a positive value, source type of the condition to be applied:
    SourceTypeOrReferenceIdIDSourceGroupSourceEntrySourceIdConditionTargetNotes
    CONDITION_SOURCE_TYPE_NONE0(Never used)(Never used)(Never used)(Never used)
    CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE1creature_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE2disenchant_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE3fishing_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE4gameobject_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE5item_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE6mail_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE7milling_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE8pickpocketing_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE9prospecting_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE10reference_loot_template.Entryitem id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE11skinning_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE12spell_loot_template.Entry or
    reference_loot_template.Entry
    item id (_loot_template.Item or
    reference_loot_template.Item)
    Always 0Always 0
    CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET13Mask of effects to be affected by condition:
    1 = EFFECT_0, 2 = EFFECT_1, 4 = EFFECT_2 ... (231 = EFFECT_31)
    SpellIDAlways 00 : Potential spell target
    1 = Spell caster
    Don't use wowhead to get number of effects, data from wowhead sometimes doesn't match real effect number.
    CONDITION_SOURCE_TYPE_GOSSIP_MENU14gossip_menu.entry (gossip menu entry)gossip_menu.text_id (points to npc_text.ID)Always 00 = Player
    1 = WorldObject
    CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION15gossip_menu_option.menu_id (menu entry)gossip_menu_option.idAlways 00 = Player
    1 = WorldObject
    CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE16Always 0creature entry (creature_template.entry)Always 00 = Player riding vehicle
    1 = Vehicle creature
    CONDITION_SOURCE_TYPE_SPELL17Always 0SpellIDAlways 00 = Spell aster
    1 = Explicit target of the spell
    (only for spells which take the object
    selected by caster into account)
    • This source type allows you to define caster/explicit target requirements for spell to be cast.
    • Explicit target of the spell is the target which is selected by player during cast, not all spells take that target into account.
      non-explicit targets of the spell (the ones which are selected by spell like area or nearby targets for example)
      are not affected by this condition source type, if you want to affect those use CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET instead.
    • If you are looking for old CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET, use this condition source type instead
      (ConditionTarget = 1 allows you to set requirements for a given spell, so to use this condition type you need spellid of the spell cast on item use).
    • Remember that conditions with the same ElseGroup value will be used to make logical AND check,
      so to allow different targets for the same spell effect you have to set ElseGroup respectively.
    CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT18npc_spellclick_spells.npc_entrynpc_spellclick_spells.spell_idAlways 00 = Clicker
    1 = Spellclick target (clickee)
    CONDITION_SOURCE_TYPE_QUEST_AVAILABLE19Always 0quest_template.IDAlways 0Always 0Condition must be met for quest to be available to player.
    UNUSED20
    CONDITION_SOURCE_TYPE_VEHICLE_SPELL21creature_template_spell.CreatureIDcreature_template_spell.SpellAlways 00 = Player for whom spell bar is shown
    1 = Vehicle creature
    This will show or hide spells in vehicle spell bar.
    CONDITION_SOURCE_TYPE_SMART_EVENT22smart_scripts.id + 1smart_scripts.entryorguidsmart_scripts.source_type0 = Invoker
    1 = Object
    CONDITION_SOURCE_TYPE_NPC_VENDOR23npc_vendor.entrynpc_vendor.itemAlways 00 = Player
    1 = WorldObject
    CONDITION_SOURCE_TYPE_SPELL_PROC24Always 0SpellID of aura which triggers the procAlways 00 = Actor
    1 = ActionTarget
    CONDITION_SOURCE_TYPE_TERRAIN_SWAP25Always 0terrain_swap_defaults.TerrainSwapMapAlways 0Always 0
    CONDITION_SOURCE_TYPE_PHASE26phase_area.PhaseIdphase_area.AreaId (0 for any area)Always 0Always 0
    CONDITION_SOURCE_TYPE_GRAVEYARD27graveyard_zone.GhostZonegraveyard_zone.IDAlways 0Always 0
    CONDITION_SOURCE_TYPE_AREATRIGGER28areatrigger_template.Idareatrigger_template.IsCustomAlways 0Always 0
    CONDITION_SOURCE_TYPE_CONVERSATION_LINE29Always 0conversation_line_template.IdAlways 0Always 0
    CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED30Always 0AreatriggerIDAlways 0Always 0
    CONDITION_SOURCE_TYPE_TRAINER_SPELL31trainer_spell.TrainerIdtrainer_spell.SpellIdAlways 0Always 0
    CONDITION_SOURCE_TYPE_OBJECT_ID_VISIBILITY32ObjectType:
    5 = Unit
    8 = GameObject
    CreatureID / GameObjectIDAlways 00 = Player
    1 = WorldObject
    CONDITION_SOURCE_TYPE_SPAWN_GROUP33Always 0spawn_group_template.groupIdAlways 0Always 0
    CONDITION_SOURCE_TYPE_PLAYER_CONDITION34Always 0PlayerConditionIDAlways 0Always 0
    CONDITION_SOURCE_TYPE_SKILL_LINE_ABILITY35Always 0ID from SkillLineAbility.db2Always 0Always 0
    CONDITION_SOURCE_TYPE_PLAYER_CHOICE_RESPONSE36playerchoice_response.ChoiceIdplayerchoice_response.ResponseIdAlways 0Always 0

 

SourceGroup ​

See table above.
 

SourceEntry ​

See table above.
 

SourceId ​

See table above.
 

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).

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 ​

  • if a negative value, id of a reference (references directly the SourceTypeOrReferenceId of another condition).
  • If a positive value, condition type to be applied:
    ConditionTypeOrReference (name)ValueConditionValue1ConditionValue2ConditionValue3Usage
    CONDITION_NONE0(Never used)(Never used)(Never used)
    CONDITION_AURA1Spell ID from Spell.dbcEffect index (0-31)Always 0
    CONDITION_ITEM2item entry (item_template.entry)item count0 = not in bank
    1 = in bank
    CONDITION_ITEM_EQUIPPED3item entry (item_template.entry)Always 0Always 0
    CONDITION_ZONEID4Zone ID where this condition will be true.Always 0Always 0
    CONDITION_REPUTATION_RANK5Faction template ID from Faction.dbcrank:
      1 = Hated
    2 = Hostile
    4 = Unfriendly
    8 = Neutral
    16 = Friendly
    32 = Honored
    64 = Revered
    128 = Exalted

    Add the target ranks together for the condition to be true for all those ranks.
    Always 0
    CONDITION_TEAM6TeamID:
    Alliance = 469
    Horde = 67
    Always 0Always 0
    CONDITION_SKILL7Required skill.
    See SkillLine.db2 .
    Skill rank value (e.g. from 1 to 450 for the 3.3.5 branch)Always 0
    CONDITION_QUESTREWARDED8Quest ID - see quest_template.idAlways 0Always 0
    CONDITION_QUESTTAKEN9Quest ID - see quest_template.idAlways 0Always 0
    CONDITION_DRUNKENSTATE10
    Sober = 0
    Tipsy = 1
    Drunk = 2
    Smashed = 3
    Always 0Always 0
    CONDITION_WORLD_STATE11World state indexWorld state valueAlways 0
    CONDITION_ACTIVE_EVENT12Event entry
    (game_event.eventEntry)
    Always 0Always 0
    CONDITION_INSTANCE_INFO13entry (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_NONE14Quest ID - see quest_template.idAlways 0Always 0
    CONDITION_CLASS15Class mask from ChrClasses.dbc
    Add flags together for all classes where condition is true.
      1 = Warrior
    2 = Paladin
    4 = Hunter
    8 = Rogue
    16 = Priest
    32 = Death Knight
    64 = Shaman
    128 = Mage
    256 = Warlock
    512 = Monk
    1024 = Druid
    2048 = Demon Hunter
    4096 = Evoker
    Always 0Always 0
    CONDITION_RACE16Player must be this race.
    See ChrRaces.dbc .
    Add flags together for all races where condition is true.
    Always 0Always 0
    CONDITION_ACHIEVEMENT17Achievement ID from Achievement.dbcAlways 0Always 0
    CONDITION_TITLE18Title ID from CharTitles.dbcAlways 0Always 0
    ⚠️ CONDITION_SPAWNMASK_DEPRECATED19UNUSED, DO NOT REUSE
    CONDITION_GENDER200 = Male
    1 = Female
    2 = None
    Always 0Always 0
    CONDITION_UNIT_STATE21UnitState (enum from Unit.h)Always 0Always 0
    CONDITION_MAPID22Map entry from Map.dbc

    (0=Eastern Kingdoms, 1=Kalimdor, - and so on.)
    Always 0Always 0
    CONDITION_AREAID23Area ID from AreaTable.dbcAlways 0Always 0
    CONDITION_CREATURE_TYPE24Creature type from creature_template.type

    True if creature_template.type == ConditionValue1
    Always 0Always 0
    CONDITION_SPELL25Spell ID from Spell.dbcAlways 0Always 0
    CONDITION_PHASEID26PhaseIDAlways 0Always 0
    CONDITION_LEVEL27Player level (1-80 in 3.3.5 || 1-60 in 9.x)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_COMPLETE28Quest ID - see quest_template.idAlways 0Always 0
    CONDITION_NEAR_CREATURE29Creature entry from creature_template.entryDistance in yardsAlive=0
    Dead=1
    CONDITION_NEAR_GAMEOBJECT30Gameobject entry from gameobject_template.entryDistance in yardsAlways 0
    CONDITION_OBJECT_ENTRY_GUID_LEGACY31TypeID. Available object types:
    3 : TYPEID_UNIT
    4 : TYPEID_PLAYER
    5 : TYPEID_GAMEOBJECT
    7 : TYPEID_CORPSE (player corpse, after spirit release)
    0 = Any object of given TypeID
    if TypeID = TYPEID_UNIT => Creature entry from creature_template.entry
    if TypeID = TYPEID_GAMEOBJECT => Gameobject entry from gameobject_template.entry
    0 = Any object of given type

    1 - 500k : creature / gameobject GUID
    CONDITION_TYPE_MASK_LEGACY32TypeMask - a bitmask of following object types:
    0x0008 - TYPEMASK_UNIT (8)
    0x0010 - TYPEMASK_PLAYER (16)
    0x0020 - TYPEMASK_GAMEOBJECT (32)
    0x0080 - TYPEMASK_CORPSE (player corpse after spirit release) (128)
    Always 0Always 0
    CONDITION_RELATION_TO33Target to which relation is checked.
    - one of the ConditionTargets available in current SourceType
    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)
    Always 0
    CONDITION_REACTION_TO34Target to which reaction is checked.
    - one of the ConditionTargets available in current SourceType
    rankMask: This bitmask defines the reaction(s) of the current ConditionTarget
    to the target specified in ConditionValue1 (which are allowed).
    Flags for the reactions are:
      1 = Hated
    2 = Hostile
    4 = Unfriendly
    8 = Neutral
    16 = Friendly
    32 = Honored
    64 = Revered
    128 = Exalted
    Always 0
    CONDITION_DISTANCE_TO35Target to which distance is checked
    - one of ConditionTargets available in current SourceType
    Distance.
    Defines distance between current ConditionTarget and target specified in ConditionValue1
    ComparisionType:
    0 = distance must be equal to ConditionValue2
    1 = distance must be higher than ConditionValue2
    2 = distance must be lower than ConditionValue2
    3 = distance must be equal to or higher than ConditionValue2
    4 = distance must be equal to or lower than ConditionValue2
    CONDITION_ALIVE36Always 0 - Use NegativeCondition and the following settings:
    NegativeCondition = 0 if target needs to be ALIVE.
    NegativeCondition = 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.
    Always 0Always 0
    CONDITION_HP_VAL37HP valueComparisionType:
    • 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
    Always 0
    CONDITION_HP_PCT38Percentage of max HPComparisionType:
    • 0 = Percentage of max HP must be equal
    • 1 = Percentage of max HP must be higher
    • 2 = Percentage of max HP must be lower
    • 3 = Percentage of max HP must be equal or higher
    • 4 = Percentage of max HP must be equal or lower
    Always 0
    CONDITION_REALM_ACHIEVEMENT39Achievement ID
    from Achievement.dbc
    Always 0Always 0
    CONDITION_IN_WATER40Always 0 - Use NegativeCondition and the following settings:
    NegativeCondition = 0 If target needs to be on land
    NegativeCondition = 1 If target needs to be in water
    Always 0Always 0
    CONDITION_TERRAIN_SWAP41terrainSwap - true if object is in terrainswap [ master only ]Always 0Always 0
    CONDITION_STAND_STATE42stateType (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 1
    0 = Standing 1 = Sitting
    Always 0
    CONDITION_DAILY_QUEST_DONE43Quest ID - see quest_template.idAlways 0Always 0
    CONDITION_CHARMED44Always 0Always 0Always 0
    CONDITION_PET_TYPE45maskAlways 0Always 0
    CONDITION_TAXI46Always 0Always 0Always 0
    CONDITION_QUESTSTATE47Quest ID - see quest_template.idstate_mask: true if player is in any of the provided quest states for the quest
    1 = not taken
    2 = completed
    8 = in progress
    32 = failed
    64 = rewarded
    Always 0
    CONDITION_QUEST_OBJECTIVE_PROGRESS48Quest Objective IDAlways 0Progress Value
    CONDITION_DIFFICULTY_ID49Difficulty (0 None, 1 Normal, etc)Always 0Always 0true if target's map has difficulty id
    CONDITION_GAMEMASTER50canBeGMAlways 0Always 0true if player is gamemaster
    (or can be gamemaster)
    CONDITION_OBJECT_ENTRY_GUID51TypeIDentryguidtrue if object is type TypeID
    and the entry is 0
    or matches entry of the object
    or matches guid of the object
    CONDITION_TYPE_MASK52TypeMaskAlways 0Always 0true if object is type object's
    TypeMask matches provided TypeMask
    CONDITION_BATTLE_PET_COUNT53SpeciesIdcountComparisonTypetrue if player has count of battle pet species
    CONDITION_SCENARIO_STEP54ScenarioStepId (Only >= 5.0.3)Always 0Always 0true if object is at scenario
    with current step equal to ScenarioStepID
    CONDITION_SCENE_IN_PROGRESS55SceneScriptPackageIdAlways 0Always 0true if player is playing a scene
    with ScriptPackageId equal to given value
    CONDITION_PLAYER_CONDITION56PlayerConditionIdAlways 0Always 0true if player satisfies PlayerCondition
    CONDITION_PRIVATE_OBJECT57Always 0Always 0Always 0true if entity is private object
    CONDITION_STRING_ID58Always 0Always 0Always 0true if entity uses string id (ConditionStringValue1)
    CONDITION_LABEL59LabelAlways 0Always 0true if creature/gameobject has specified Label in CreatureLabel.db2/GameObjectLabel.db2

Please note ⚠️means that the ConditionType is deprecated and should not be used.

ConditionTarget ​

Allows selecting an object for which conditions will be checked. Available objects are dependant on SourceTypeOrReferenceId, for details see respective source type reference.
 

ConditionValue1 ​

See ConditionTypeOrReference.
 

ConditionValue2 ​

See ConditionTypeOrReference.
 

ConditionValue3 ​

See ConditionTypeOrReference.
 

ConditionStringValue1 ​

- no description -
 

NegativeCondition ​

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.
 

ErrorType ​

Id from /src/server/game/Miscellaneous/SharedDefines.h#L1442. Will be displayed only for the below condition source type:

CONDITION_SOURCE_TYPE_SPELL = 17
 

ErrorTextId ​

Id from /src/server/game/Miscellaneous/SharedDefines.h#L1766. Will be displayed only for the below condition source type:

CONDITION_SOURCE_TYPE_SPELL = 17

(ErrorType must be SPELL_FAILED_CUSTOM_ERROR (211) otherwise 0)
 

ScriptName ​

The ScriptName this condition uses, if any.
 

Comment ​

Explanation of this condition or reference