conditions - cmangos/issues GitHub Wiki
Back to world database list of tables.
With this table and the new conditions it is possible to create tree like and very complicated combined conditions (like HasAura && (HasItem || HasQuest))
Used in:
Field | Type | Attributes | Key | Null | Default |
condition_entry | mediumint(8) | unsigned | PRI | YES | NULL |
type | tinyint(3) | signed | NO | 0 | |
value1 | mediumint(8) | unsigned | NO | 0 | |
value2 | mediumint(8) | unsigned | NO | 0 | |
value3 | mediumint(8) | unsigned | NO | 0 | |
value4 | mediumint(8) | unsigned | NO | 0 | |
flags | tinyint(3) | unsigned | NO | 0 |
Identifier
To avoid conflicts between Expansions, please use:
Vanilla: | 0 – 9999 |
TBC: | 10000 – 19999 |
WotLK: | 20000 + |
Type of the condition
data field one for the condition
data field two for the condition
data field three for the condition
data field four for the condition
Flags modifying the condition for an evaluation type such as inverting result or swapping target and source.
Decimal | Hex | Type | Description |
0 | 0×00 | DEFAULT | no effect |
1 | 0×01 | CONDITION_FLAG_REVERSE_RESULT | Reverse the evaluation of the condition like requiering an item/aura instead of missing it (not supported by all conditions) |
2 | 0×02 | CONDITION_FLAG_SWAP_TARGETS | Swap the source and the target when evaluating the condition (not supported by all conditions) |
This is a description of the values in type
Value of type | Condition | Comments |
---|---|---|
-3 | CONDITION_NOT | NOT combination of another condition_entry * |
-2 | CONDITION_OR | OR combination of 2 to 4 other condition_entry * |
-1 | CONDITION_AND | AND combination of 2 to 4 other condition_entry * |
0 | CONDITION_NONE | No condition, returns always true |
1 | CONDITION_AURA | Target must have or be missing an aura |
2 | CONDITION_ITEM | Player must have or be missing a number of items in his/her inventory |
3 | CONDITION_ITEM_EQUIPPED | Player must have an item equipped |
4 | CONDITION_AREAID | Player must be in a certain area/zone |
5 | CONDITION_REPUTATION_RANK_MIN | Player must have a certain reputation rank with a certain faction |
6 | CONDITION_TEAM | Player must be part of the specified team (Alliance or Horde) |
7 | CONDITION_SKILL | Player must have a certain skill value |
8 | CONDITION_QUESTREWARDED | Player must have completed a quest first |
9 | CONDITION_QUESTTAKEN | Players must have the quest in the quest log and not completed yet |
10 | CONDITION_AD_COMMISSION_AURA | |
11 | CONDITION_PVP_RANK | Player must have Honor Rank (minrank, maxrank) |
12 | CONDITION_ACTIVE_GAME_EVENT | Event must be active/inactive. |
13 | CONDITION_AREA_FLAG | |
14 | CONDITION_RACE_CLASS | Has special race or class. |
15 | CONDITION_LEVEL | Has special level. |
16 | UNUSED | Deprecated was CONDITION_NOITEM replaced by CONDITION_ITEM + FLAG_REVERSE_RESULT. |
17 | CONDITION_SPELL | Knows some spell. |
18 | CONDITION_INSTANCE_SCRIPT | SD2-Based condition |
19 | CONDITION_QUESTAVAILABLE | Some quest is available. |
20 | CONDITION_ACHIEVEMENT | Has or has no special achievement. |
21 | CONDITION_ACHIEVEMENT_REALM | Realm-wideversion of 20. |
22 | CONDITION_QUEST_NONE | Has not taken a quest yet. |
23 | CONDITION_ITEM_WITH_BANK | Checks presence or absence of required amount of items in inventory or bank. |
24 | UNUSED | Deprecated was CONDITION_NOITEM_WITH_BANK replaced by CONDITION_ITEM_WITH_BANK + FLAG_REVERSE_RESULT. |
25 | UNUSED | Deprecated was CONDITION_NOT_ACTIVE_GAME_EVENT replaced by CONDITION_ACTIVE_GAME_EVENT + FLAG_REVERSE_RESULT. |
26 | CONDITION_ACTIVE_HOLIDAY | |
27 | UNUSED | Deprecated was CONDITION_NOT_ACTIVE_HOLIDAY replaced by CONDITION_ACTIVE_HOLIDAY + FLAG_REVERSE_RESULT. |
28 | CONDITION_LEARNABLE_ABILITY | Checks if the player has high enough skill level and may check if a special item is in the inventory. |
29 | CONDITION_SKILL_BELOW | |
30 | CONDITION_REPUTATION_RANK_MAX | |
31 | CONDITION_COMPLETED_ENCOUNTER | Checks if some encounter is completed |
32 | UNUSED | Deprecated was CONDITION_SOURCE_AURA replaced by CONDITION_AURA + FLAG_SWAP_TARGETS |
33 | CONDITION_LAST_WAYPOINT | Checks the waypoint-state of the source of the condition |
34 | CONDITION_XP_USER | Checks if a player has turned XP earning on/off |
35 | CONDITION_GENDER | Checks the gender of a player |
36 | CONDITION_DEAD_OR_AWAY | |
37 | CONDITION_CREATURE_IN_RANGE | |
38 | CONDITION_PVP_SCRIPT | |
39 | CONDITION_SPAWN_COUNT | Returns if specified count of creature entry exists on map |
40 | CONDITION_WORLD_SCRIPT | Check the state of a given World State |
41 | UNUSED | Deprecated was CONDITION_GENDER_NPC replaced by CONDITION_GENDER + FLAG_SWAP_TARGETS |
42 | CONDITION_WORLDSTATE | Checks the value of a worldstate variable in map |
(*) Meta-Condition types CONDITION_AND (-1) and CONDITION_OR (-2) which are used as: value1 (as condition_entry) AND / OR value2 (as condition_entry) AND / OR value3 (as condition_entry) AND / OR value4 (as condition_entry). With these meta-conditions it is possible to create tree like and very complicated combined conditions (like HasAura && (HasItem || HasQuest))
The meaning of the values in value1 / value2 / value3 / value4 depend of the type of the condition
- CONDITION_NOT (-3)
- value1: condition_entry
- Must have higher condition_entry than value1
Returns NOT condition (of value1)
- CONDITION_OR (-2)
- value1: condition_entry
- value2: condition_entry
- value3: condition_entry (optional)
- value4: condition_entry (optional)
- Must have higher condition_entry than value1, value2, value3 and value4
Returns condition (of value1) OR condition (of value2) OR condition (of value3) OR condition (of value4)
- CONDITION_AND (-1)
- value1: condition_entry
- value2: condition_entry
- value3: condition_entry (optional)
- value4: condition_entry (optional)
- Must have higher condition_entry than value1, value2, value3 and value4
Returns condition (of value1) AND condition (of value2) AND condition (of value3) AND condition (of value4)
- CONDITION_NONE (0)
No condition – is always met
- CONDITION_AURA (1)
- value1: The spell ID from where the aura came from.
- value2: The effect index of the spell that applied the aura (0, 1, or 2)
- value3: unused
- value4: unused
- flags: FLAG_REVERSE_RESULT or FLAG_SWAP_TARGETS
Returns if the target has an aura. If &FLAG_REVERSE_RESULT: returns if the target has no aura. If &FLAG_SWAP_TARGETS: returns if the source has an aura (or not if &FLAG_REVERSE_RESULT), evaluating the source instead of the target (usually source is a NPC and target is a player)
- CONDITION_ITEM (2)
- value1: Item ID
- value2: Count
- value3: unused
- value4: unused
- flags: FLAG_REVERSE_RESULT
Returns if a player has Count items in his inventory. If &FLAG_REVERSE_RESULT: returns if a player has not Count items in Inventory
- CONDITION_ITEM_EQUIPPED (3)
- value1: Item ID
Returns if a player has an item equipped
- value1: Item ID
- CONDITION_AREAID (4)
- value1: Area ID
- value2: 0, 1 (0: in (sub)area, 1: not in (sub)area)
Returns if (or if not depending on value2) a player is in an area/zone
- CONDITION_REPUTATION_RANK_MIN (5)
- value1: Faction ID
- value2: Minimum rank
Returns if a player has at least (>=) minimum rank at the given faction
ID | Rank |
---|---|
0 | Hated |
1 | Hostile |
2 | Unfriendly |
3 | Neutral |
4 | Friendly |
5 | Honored |
6 | Revered |
7 | Exalted |
- CONDITION_TEAM (6)
- value1: Player team (469 – Alliance, 67 – Horde)
Returns if a player has the team of value1
- value1: Player team (469 – Alliance, 67 – Horde)
- CONDITION_SKILL (7)
- value1: Skill ID (SkillLine.dbc)
- value2: Skill value needed
Returns if a player has Skill ID of value
- CONDITION_QUESTREWARDED (8)
- value1: Quest ID
Returns if a player already got a quest rewarded
- value1: Quest ID
- CONDITION_QUESTTAKEN (9)
- value1: Quest ID
- value2:
0 | Returns true if quest is taken, no matter if completed or not |
1 | Returns true if quest is taken but not completed |
2 | Returns true if quest is taken and completed |
- CONDITION_AD_COMMISSION_AURA (10)
Returns if a Player has any Argent Dawn Commission Aura Active (17670,23930,24198,29112,29113)
- CONDITION_ACTIVE_GAME_EVENT (12)
- value1: event
- value2: unused
- value3: unused
- value4: unused
- flags: FLAG_REVERSE_RESULT
Returns if a event is active. If &FLAG_REVERSE_RESULT: returns if a game event is not active.
- CONDITION_AREA_FLAG (13)
- value1: area_flag
- value2: not_have_flag
Returns if area_flag is present in current area (if area_flag set != 0) AND if not_have_flag is not present in current area (if not_have_flag != 0)
- CONDITION_RACE_CLASS (14)
- value1: race_mask
- value2: class_mask
Returns if a player is of race (if race_mask set != 0) AND if a player is of class (if class_mask != 0)
Mask | Race |
---|---|
1 | Human |
2 | Orc |
4 | Dwarf |
8 | Night Elf |
16 | Undead |
32 | Tauren |
64 | Gnome |
128 | Troll |
512 | Blood Elf |
1024 | Draenei |
Mask | Class |
---|---|
1 | Warrior |
2 | Paladin |
4 | Hunter |
8 | Rogue |
16 | Priest |
32 | Death Knight |
64 | Shaman |
128 | Mage |
256 | Warlock |
1024 | Druid |
- CONDITION_LEVEL (15)
- value1: level
- value2: 0: equal to, 1: equal or higher than, 2: equal or less than
Returns if a player is of/ has a higher/ has a lower level
- CONDITION_SPELL (17)
- value1: spellid
- value2: 0: has spell, 1: has no spell
Returns if a player has (not) learned a spell
- CONDITION_INSTANCE_SCRIPT (18)
- value1: instance_condition_id (see InstanceData.h enum InstanceConditionIDs)
Returns the result of the current instance’s instance-script function CheckConditionCriteriaMeet (which must be implemented for such an instance)
To ’’communicate’’ with the instance script, there are a few instance_condition_id predefined, which can be used:
for hard-mode loot (0 normal; 1,2… hard,harder… mode)- INSTANCE_CONDITION_ID_NORMAL_MODE = 0,
- INSTANCE_CONDITION_ID_HARD_MODE = 1,
- INSTANCE_CONDITION_ID_HARD_MODE_2 = 2,
- INSTANCE_CONDITION_ID_HARD_MODE_3 = 3,
- INSTANCE_CONDITION_ID_HARD_MODE_4 = 4,
to check for which team the instance is doing scripts - INSTANCE_CONDITION_ID_TEAM_HORDE = 67,
- INSTANCE_CONDITION_ID_TEAM_ALLIANCE = 469,
- value1: instance_condition_id (see InstanceData.h enum InstanceConditionIDs)
- CONDITION_QUESTAVAILABLE (19)
- value1: questid
Returns if a player could start a quest (ie. if all requirements for accepting like pre-quests are met)
- value1: questid
- CONDITION_ACHIEVEMENT (20)
- value1: achievementid
- value2: 0: has achievement, 1: has no achievement
Returns if a player has (not) earned an achievement
- CONDITION_ACHIEVEMENT_REALM (21)
- value1: achievementid
- value2: 0: has achievement, 1: has no achievement
Returns if an achivement was (not) already earned by any player on the realm
- CONDITION_QUEST_NONE (22)
- value1: questid
Returns if a player has a quest neither taken nor ever rewarded
- value1: questid
- CONDITION_ITEM_WITH_BANK (23)
- value1: item_id
- value2: count
- value3: unused
- value4: unused
- flags: FLAG_REVERSE_RESULT
Returns if a player has at least count of items (including inventory stored in the bank). if &FLAG_REVERSE_RESULT: returns if a player has less than count of items (including inventory stored in the bank).
- CONDITION_ACTIVE_HOLIDAY (26)
- value1: holiday_id
- value2: unused
- value3: unused
- value4: unused
- flags: FLAG_REVERSE_RESULT
Returns if a holidy is active. If &FLAG_REVERSE_RESULT: returns if a holiday is not active
- CONDITION_LEARNABLE_ABILITY (28)
- value1: spell_id
- value2: 0 or item_id
Returns player can learn ability (using min skill value from SkillLineAbility).
Item_id can be defined in addition, to check if player has one (1) item in inventory or bank.
When player has spell or has item (when defined), condition return false.
- CONDITION_SKILL_BELOW (29)
- value1: skill_id
- value2: skill_value
Returns if player has skill skill_id and skill less than (and not equal) skill_value (for skill_value > 1)
If skill_value == 1, then true if player has not skill skill_id
- CONDITION_REPUTATION_RANK_MAX (30)
value1: faction_id
value2: max_rank
Returns if a player has at most (<=) max_rank with a faction
ID | Rank |
---|---|
0 | Hated |
1 | Hostile |
2 | Unfriendly |
3 | Neutral |
4 | Friendly |
5 | Honored |
6 | Revered |
7 | Exalted |
- CONDITION_COMPLETED_ENCOUNTER (31)
- value1: encounter_id (DungeonEncounter(dbc).id)
- value2: encounter_id2 (DungeonEncounter(dbc).id)
Returns if encounter_id is complete (if encounter_id2 provided it will return if encounter_id is completed OR if encounter_id2 is completed)
- CONDITION_LAST_WAYPOINT (33)
- value1: waypointId
- value2: 0 = exact, 1: wp <= waypointId, 2: wp > waypointId
Returns if the source of the condition is on/ has reached/ has passed a waypoint
- CONDITION_XP_USER (34)
- value1: 0, 1 (0: XP off, 1: XP on)
Returns if a player has his XP earning turned off/on
- value1: 0, 1 (0: XP off, 1: XP on)
- CONDITION_GENDER (35)
- value1: 0=male, 1=female, 2=none (see enum Gender)
- value2: unused
- value3: unused
- value4: unused
- flags: FLAG_SWAP_TARGETS
Returns if a player is male or female (none cannot happen). If &FLAG_SWAP_TARGETS: returns true if source NPC model has gender equal to value1. Model gender is defined in creature_model_info.gender.
- CONDITION_DEAD_OR_AWAY (36)
- value1: 0=player dead, 1=player is dead (with group dead), 2=player in instance are dead, 3=creature is dead
- value2: optional_range
Returns if a player / a player’s group / all players in an instance / or a creature is dead or left the map.
If the optional_range is provided the condition will also fail if the player[s] are out of range
- CONDITION_CREATURE_IN_RANGE (37)
- value1: creatureEntry
- value2: range
Returns if the creature of the given entry is found in the given range
- CONDITION_PVP_SCRIPT (38)
- value1: area_id of the outdoor PvP script
- value2: opvp_condition_id (defined in the actual script)
Returns the result of the outdoor PvP script function IsConditionFulfilled (which must be implemented for the required scripts)
- CONDITION_SPAWN_COUNT (39)
- value1: creature_template.entry
- value2: Minimum amount of specified creature to exist on map for condition to return true
Condition returns true if there are more than or equal amounts of creature on map.
Note: The creature specified in value1 must have ExtraFlags CREATURE_EXTRA_FLAG_COUNT_SPAWNS!
- CONDITION_WORLD_SCRIPT (40)
- value1: transport WorldState from WorldState.h enum Conditions
- value2: event state value from WorldState.cpp enum
Condition returns true if WorldState for given transport is equals to the expected event state
- CONDITION_WORLDSTATE (42)
- value1: worldstate variable Id – must have worldstate_name table entry defined – also see src/Game/World/WorldStateDefines.h for official variables
- value2: sign for operation from enum WorldStateConditionSign in src/Game/Globals/Conditions.h
- value3: other operand
Condition returns true if WorldState variable operation for given map is true
Example: 10000; =; 0 – true when 10000 is zero