Conditions - vanrhy/linguister 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:

The `conditions` table

Structure

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

Description of the fields

condition_entry

Identifier

type

Type of the condition

value1

data field one for the condition

value2

data field one for the condition

Possible condition types

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 other condition_entry *
-1 CONDITION_AND AND combination of 2 other condition_entry *
0 CONDITION_NONE No condition, returns always true
1 CONDITION_AURA Player must have an aura active
2 CONDITION_ITEM Player must have 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_NO_AURA Miss some aura.
12 CONDITION_ACTIVE_EVENT Event is active.
13 CONDITION_AREA_FLAG
14 CONDITION_RACE_CLASS Has special race or class.
15 CONDITION_LEVEL Has special level.
16 CONDITION_NOITEM Has not enough items yet.
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 of required amount of items in inventory or bank.
24 CONDITION_NOITEM_WITH_BANK Checks absence of required amount of items in inventory or bank.
25 CONDITION_NOT_ACTIVE_GAME_EVENT
26 CONDITION_ACTIVE_HOLIDAY
27 CONDITION_NOT_ACTIVE_HOLIDAY
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 CONDITION_SOURCE_AURA Checks if the source of the condition (like looted npc) has an aura
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

(*) Meta-Condition types CONDITION_AND (-1) and CONDITION_OR (-2) which are used as: value1 (as condition_entry) AND / OR value2 (as condition_entry). With these meta-conditions it is possible to create tree like and very complicated combined conditions (like HasAura && (HasItem || HasQuest))

Detailed description of available condition types

The meaning of the values in value1 / value2 depend of the type of the condition

  • CONDITION_NOT (-3)
    • value1: condition_entry
    • Must have higher condition_entry than value1
      Returns NOT condidition (of value1)
  • CONDITION_OR (-2)
    • value1: condition_entry
    • value2: condition_entry
    • Must have higher condition_entry than value1 OR value2
      Returns condidition (of value1) OR condidition (of value2)
  • CONDITION_AND (-1)
    • value1: condition_entry
    • value2: condition_entry
    • Must have higher condition_entry than value1 OR value2
      Returns condidition (of value1) AND condidition (of value2)
  • 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)
      Returns if a player has an aura
  • CONDITION_ITEM (2)
    • value1: Item ID
    • value2: Count
      Returns if a player has Count items in his inventory
  • CONDITION_ITEM_EQUIPPED (3)
    • value1: Item ID
      Returns if a player has an item equipped
  • 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
      Retuns if a player has at least (>=) minum rank at the given faction
  • CONDITION_TEAM (6)
    • value1: Player team (469 – Alliance, 67 – Horde)
      Returns if a player has the team of value1
  • 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
  • CONDITION_QUESTTAKEN (9)
    • value1: Quest ID
      Returns if a player has a quest taken
  • CONDITION_AD_COMMISSION_AURA (10)
    Returns if a player has one from AD commission aura active
  • CONDITION_NO_AURA (11)
    • value1: spellid
    • value2: EffectIndex
      Returns if a player has not an aura
  • CONDITION_ACTIVE_EVENT (12)
    • value1: event
      Returns if a event is 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)
  • 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_NOITEM (16)
    • value1: itemid
    • value2: count
      Returns if a player has not count items
  • 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,
  • CONDITION_QUESTAVAILABLE (19)
    • value1: questid
      Returns if a player could start a quest (ie. if all requirements for accepting like pre-quests are met)
  • 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
  • CONDITION_ITEM_WITH_BANK (23)
    • value1: item_id
    • value2: count
      Returns if a player has at least count of items (including inventory stored in the bank)
  • CONDITION_NOITEM_WITH_BANK (24)
    • value1: item_id
    • value2: count
      Returns if a player has less than count of items (including inventory stored in the bank)
  • CONDITION_NOT_ACTIVE_GAME_EVENT (25)
    • value1: event_id
      Returns if a game event is not active
  • CONDITION_ACTIVE_HOLIDAY (26)
    • value1: holiday_id
      Returns if a holidy is active
  • CONDITION_NOT_ACTIVE_HOLIDAY (27)
    • value1: holiday_id
      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
  • 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_SOURCE_AURA (32)
    • value1: spell_id
    • value2: effindex
      Returns true if the source of the condition check has aura of spell_id, effIndex
  • 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
  • CONDITION_GENDER (35)
    • value1: 0=male, 1=female, 2=none (see enum Gender)
      Returns if a player is male or female (none cannot happen)
  • 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
⚠️ **GitHub.com Fallback** ⚠️