From a35d4f08a3f9f086eae94dccbfda2ff0c8eb5ae3 Mon Sep 17 00:00:00 2001 From: FrancescoBorzi Date: Mon, 25 Feb 2019 19:24:20 +0100 Subject: Import DB wiki from TC 335 --- docs/conditions.md | 1630 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1611 insertions(+), 19 deletions(-) (limited to 'docs/conditions.md') diff --git a/docs/conditions.md b/docs/conditions.md index bec7a5b..5d9a962 100644 --- a/docs/conditions.md +++ b/docs/conditions.md @@ -1,19 +1,1611 @@ -[Database Structure](Database-Structure) > [World-Database](World-Database) > [conditions](conditions) - -Column | Type | Description ---- | --- | --- -SourceTypeOrReferenceId | mediumint(8) | -SourceGroup | mediumint(8) unsigned | -SourceEntry | mediumint(8) | -SourceId | int(11) | -ElseGroup | mediumint(8) unsigned | -ConditionTypeOrReference | mediumint(8) | -ConditionTarget | tinyint(3) unsigned | -ConditionValue1 | mediumint(8) unsigned | -ConditionValue2 | mediumint(8) unsigned | -ConditionValue3 | mediumint(8) unsigned | -NegativeCondition | tinyint(3) unsigned | -ErrorType | mediumint(8) unsigned | -ErrorTextId | mediumint(8) unsigned | -ScriptName | char(64) | -Comment | varchar(255) | +# conditions + +`Back-to:World` + +**The \`conditions\` table** + +This table allows you to define conditions for various systems - Gossip, loot etc. + +**Structure** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field

Type

Attributes

Key

Null

Default

Extra

Comment

SourceTypeOrReferenceId

mediumint(8)

signed

PRI

NO

0


+


+

SourceGroup

mediumint(8)

unsigned

PRI

NO

0


+


+

SourceEntry

mediumint(8)

signed

PRI

NO

0


+


+

SourceId

int(11)

signed

PRI

NO

0


+

smart_scripts.source_type || 0 for everything else

ElseGroup

mediumint(8)

unsigned

PRI

NO

0


+


+

ConditionTypeOrReference

mediumint(8)

signed

PRI

NO

0


+


+

ConditionTarget

tinyint(3)

unsigned

PRI

NO

0


+


+

ConditionValue1

int(10)

unsigned

PRI

NO

0


+


+

ConditionValue2

int(10)

unsigned

PRI

NO

0


+


+

ConditionValue3

int(10)

unsigned

PRI

NO

0


+


+

NegativeCondition

tinyint(3)

unsigned


+

NO

0


+

Boolean 0 or 1 (if NegativeCondition

ErrorType

mediumint(8)

unsigned


+

NO

0


+


+

ErrorTextId

mediumint(8)

unsigned


+

NO

0


+


+

ScriptName

char(64)

signed


+

NO

' '


+


+

Comment

varchar(255)


+


+

YES

NULL


+


+

+ +**Description of the fields** + +### SourceTypeOrReferenceId + +if negative, then it is a reference template. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

SourceTypeOrReferenceId

IDSourceGroupSourceEntrySourceIdConditionTargetNotes
CONDITION_SOURCE_TYPE_NONE0See REFERENCE TEMPLATES(REFERENCE TEMPLATES)Always 0(See below)Only used in Reference Templates! See below.
CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE1creature_loot_template.Entry or reference_loot_template.Entryitem 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.Entryitem 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.Entryitem 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.Entryitem 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.Entryitem 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.Entryitem 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.Entryitem 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.Entryitem 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.Entryitem 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.Entryitem 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.Entryitem id (_loot_template.Item or reference_loot_template.Item)Always 0Always 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 fileAlways 0

0 : 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 0

0 = Player
+1 = WorldObject


+
CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION15gossip_menu_option.menu_id (menu entry)gossip_menu_option.idAlways 0

0 = Player
+1 = WorldObject


+
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE16Always 0creature entry (creature_template.entry)Always 0

0 = Player riding vehicle
+1 = Vehicle creature


+

+
+
+
+
+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)
    +
  • 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_EVENT18creature entry (npc_spellclick_spells.npc_entry)Spell (npc_spellclick_spells.spell_id)Always 00 = Clicker
+1 =  Spellclick target (clickee)

+
CONDITION_SOURCE_TYPE_QUEST_AVAILABLE19Always 0Quest IDAlways 0Always 0Condition must be met for quest to be available to player.
UNUSED20
+

+

+

+

+CONDITION_SOURCE_TYPE_VEHICLE_SPELL

+21
creature entry (creature_template.entry)
+Spell ID from Spell.dbc
Always 00 = Player for whom spell bar is shown1 =  Vehicle creature
+This will show or hide spells in vehicle spell bar.
CONDITION_SOURCE_TYPE_SMART_EVENT22ID (smart_scripts.id) + 1EntryOrGuid (smart_scripts.entryorguid)SourceType (smart_scripts.source_type)0 = Invoker
+1 = Object

+
CONDITION_SOURCE_TYPE_NPC_VENDOR23vendor entry (npc_vendor.entry)item entry (npc_vendor.item)Always 0Always 0
+
CONDITION_SOURCE_TYPE_SPELL_PROC24Always 0Spell ID of aura which triggers the procAlways 00 = Actor
+1 = ActionTarget

+
CONDITION_SOURCE_TYPE_TERRAIN_SWAP (6.x / 7.x only)25Always 0terrainSwap - object in terrainswap [ 6.x / 7.x only ]Always 0(source code / new description here)
+
CONDITION_SOURCE_TYPE_PHASE (6.x / 7.x only)26Phase IDZone or Area ID (or 0 for any area)Always 0(source code / new description here)
+
CONDITION_SOURCE_TYPE_MAX27
+

+

+

+
(Placeholder)
+ +### SourceGroup + +See above. + +### SourceEntry + +See above. + +### ElseGroup + +Allows building grouped conditions - all entries belonging to the same condition (same [SourceType](#conditions-SourceTypeOrReferenceId), [SourceGroup](#conditions-SourceGroup) and [SourceEntry](#conditions-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 +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ConditionTypeOrReference (name)ValueConditionValue1ConditionValue2ConditionValue3
CONDITION_NONE0(Never used)(Never used)(Never used)
CONDITION_AURA1Spell ID from Spell.dbcEffect index (0-2)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_RANK

+
+
+
+
+5


+
+
+
+
+Faction template ID from Faction.dbc

rank:
+  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_TEAM6Team id :Alliance = 469 / Horde = 67Always 0Always 0
CONDITION_SKILL7Required skill. See SkillLine.dbc .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_DRUNKENSTATE10Sober=0; Tipsy=1, Drunk=2, Smashed=3Always 0Always 0
CONDITION_WORLD_STATE11World state indexWorld state valueAlways 0
CONDITION_ACTIVE_EVENT12Event entry (game_event.eventEntry)Always 0Always 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_NONE14Quest ID - see quest_template.idAlways 0Always 0

+CONDITION_CLASS

+15
Class mask from ChrClasses.dbc
+Add flags together for all classes where condition is true.
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_SPAWNMASK19spawnMask from
+Creature.spawnMask / Gameobject.spawnMask
Always 0Always 0
CONDITION_GENDER200 = Male, 1 = Female, 2 = NoneAlways 0Always 0
CONDITION_UNIT_STATE21UnitState (enum from Unit.h)Always 0Always 0
CONDITION_MAPID22

Map 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_TYPE24

Creature type from creature_template.type

+

True if creature_template.type == ConditionValue1

Always 0Always 0
CONDITION_SPELL25Spell ID from Spell.dbcAlways 0Always 0
CONDITION_PHASEMASK26phasemask valueAlways 0Always 0

+CONDITION_LEVEL

+27

+Player level (1-80 in 3.3.5 || 1-110 in 7.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

+
+31

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

+
+32

TypeMask - 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_TO

+
+
+33


+
+
+Target 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_TO

+
+
+
+
+34


+
+
+
+
+Target 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_TO

+
+
+
+35


+
+
+Target 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_ALIVE

+
+
+36
Always 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_VAL

+
+
+37

+
+
+HP value
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
  • +
Always 0

+
+
+CONDITION_HP_PCT

+
+
+38
Percentage 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.dbcAlways 0Always 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 waterAlways 0Always 0
CONDITION_TERRAIN_SWAP41

terrainSwap - true if object is in terrainswap [ 6.x only ]

Always 0Always 0


+CONDITION_STAND_STATE


+42
stateType (exact or any): 0 = Exact state used in ConditionValue2 1 = Any type of state in ConditionValue2Exact stand state, or generic state (stand / sit), depending on value 10 = Standing 1 = SittingAlways 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_maskAlways 0
CONDITION_QUEST_OBJECTIVE_COMPLETE (6.x / 7.x only)48Quest Objective ID - see quest_objectivesAlways 0Always 0

CONDITION_MAX

49
+

+

+
+ +### 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 below + +### ConditionValue2 + +See below + +### ConditionValue3 + +See below + +### 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:839](https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Miscellaneous/SharedDefines.h#L839). Will be displayed only for the below condition [source type](#conditions-SourceTypeOrReferenceId): + +CONDITION\_SOURCE\_TYPE\_SPELL = 17 + +### ErrorTextId + +Id from [/src/server/game/Miscellaneous/SharedDefines.h:1033](https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Miscellaneous/SharedDefines.h#L1033). Will be displayed only for the below condition [source type](#conditions-SourceTypeOrReferenceId): + +CONDITION\_SOURCE\_TYPE\_SPELL = 17 + +(ErrorType must be SPELL\_FAILED\_CUSTOM\_ERROR (209) otherwise 0) + +### ScriptName + +The ScriptName this condition uses, if any. + +### Comment + +Explanation of this condition or reference + +### Explanation of condition types + +The content of the [SourceGroup](#conditions-SourceGroup) and [SourceEntry](#conditions-SourceEntry) fields depends on the [SourceTypeOrReferenceId](#conditions-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) + +- - ConditionTarget: always 0 + +*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** + +- - SourceGroup: mask of effects to be affected by condition (1 - EFFECT\_0, 2 - EFFECT\_1, 4 - EFFECT\_2 - don't use wowhead to get number of effects, data from wowhead sometimes doesn't match real effect number) + - SourceEntry: spell (Spell Id from  [Spell DBC file](http://collab.kpsn.org/display/tc/Spell).) + - ConditionTarget: + - 0 - Potential target of the spell + - 1 - Caster of the spell + +Notes: + +- this condition source type allows to define a filter for possible spell effect targets, so only targets matching condition will be selected as implicit targets of the spell. Only target types: *AREA*, *NEARBY* and *CONE* are allowed to be filtered. This source type affects only targets selected by spell, it doesn't affect spell target selected by player on cast, to affect that target use CONDITION\_SOURCE\_TYPE\_SPELL. +- to restrict targets to player's only use CONDITION\_TYPEMASK with TYPEMASK\_PLAYER + TYPEMASK\_CORPSE to allow targeting dead players. +- remember that conditions with the same value ElseGroup will be used to make logical AND check, so to allow different targets for the same spell effect you have to set ElseGroup respectively. +- if you're looking for old CONDITION\_SOURCE\_TYPE\_SPELL\_SCRIPT\_TARGET - use this condition source type instead + +\***CONDITION\_SOURCE\_TYPE\_GOSSIP\_MENU = 14** + +- - SourceGroup: gossip menu entry ([gossip\_menu.entry](gossip_menu335_2130187.html#gossip_menu335-entry)) + - SourceEntry: gossip menu text id ([gossip\_menu.text\_id](gossip_menu335_2130187.html#gossip_menu335-text_id)) + - ConditionTarget: + - 0 - Player for which gossip text is shown + - 1 - WorldObject providing gossip + +\***CONDITION\_SOURCE\_TYPE\_GOSSIP\_MENU\_OPTION = 15** + +- - SourceGroup: gossip menu entry ([gossip\_menu\_option.menu\_id](gossip_menu_option335_2130188.html#gossip_menu_option335-menu_id)) + - SourceEntry: gossip menu option id ([gossip\_menu\_option.id](gossip_menu_option335_2130188.html#gossip_menu_option335-id)) + - ConditionTarget: + - 0 - Player for which gossip text is shown + - 1 - WorldObject providing gossip + +\***CONDITION\_SOURCE\_TYPE\_CREATURE\_TEMPLATE\_VEHICLE = 16** + +- - SourceGroup: always 0 + - SourceEntry: creature entry ([creature\_template.entry](creature_template_2130008.html#creature_template-entry)) + - ConditionTarget: + - 0 - Player riding a vehicle + - 1 - Vehicle creature + +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** + +- - SourceGroup: always 0 + - SourceEntry: spell (Spell Id from [Spell.dbc](Spell)) + - ConditionTarget: + - 0 - Caster of the spell + - 1 - Explicit target of the spell (only for spells which take object selected by caster into account) + +Notes: + +- 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're 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 value ElseGroup 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\_EVENT = 18** + +- - SourceGroup: creature entry ([npc\_spellclick\_spells.npc\_entry](npc_spellclick_spells_2130251.html#npc_spellclick_spells-npc_entry)) + - SourceEntry: spell ([npc\_spellclick\_spells.spell\_id](npc_spellclick_spells_2130251.html#npc_spellclick_spells-spell_id)) + - ConditionTarget: + - 0 - Clicker + - 1 - Spellclick target (clickee) + +\***CONDITION\_SOURCE\_TYPE\_QUEST\_ACCEPT = 19** + +- - SourceGroup: ? + - SourceEntry: Quest [id](quest_template_2130261.html#quest_template-id)) + - ConditionTarget: always 0 + +\***CONDITION\_SOURCE\_TYPE\_QUEST\_SHOW\_MARK = 20** + +- - SourceGroup: ? + - SourceEntry: Quest [id](quest_template_2130261.html#quest_template-id)) + - ConditionTarget: always 0 + +\***CONDITION\_SOURCE\_TYPE\_VEHICLE\_SPELL = 21** + +- - SourceGroup: creature entry ([creature\_template.entry](creature_template_2130008.html#creature_template-entry)) + - SourceEntry: spell (Spell Id from [Spell.dbc](Spell)) + - ConditionTarget: + - 0 - Player for which spell bar is shown + - 1 - Vehicle creature + +Note: it will show or hide spells in vehicle spell bar. + +\***CONDITION\_SOURCE\_TYPE\_SMART\_EVENT = 22** + +- - SourceGroup: Id ([smart\_scripts.id](smart_scripts_2130108.html#smart_scripts-id)) + 1 + - SourceEntry: EntryOrGuid ([smart\_scripts.entryorguid](smart_scripts_2130108.html#smart_scripts-entryorguid)) + - SourceId: SourceType ([smart\_scripts.source\_type](smart_scripts_2130108.html#smart_scripts-source_type)) + - ConditionTarget: + - 0 - Invoker + - 1 - Object + +\***CONDITION\_SOURCE\_TYPE\_NPC\_VENDOR = 23** + +- - SourceGroup: vendor entry ([npc\_vendor.entry](npc_vendor_2130245.html#npc_vendor-entry)) + - SourceEntry: item entry ([npc\_vendor.item](npc_vendor_2130245.html#npc_vendor-item)) + - SourceId: always 0 + +\***CONDITION\_SOURCE\_TYPE\_SPELL\_PROC = 24** + +- - SourceGroup: always 0 + - SourceEntry: spell id of aura which triggers the proc + - ConditionTarget: + - 0 - Actor + - 1 - ActionTarget + +### Explanation of ConditionValueX fields + +\***CONDITION\_NONE = 0** + +**Never used** + +\***CONDITION\_AURA = 1** + +- - ConditionValue1: spell (Spell Id from [Spell.dbc](Spell)) + - ConditionValue2: effect index (0-2) + - ConditionValue3: always 0 + +\***CONDITION\_ITEM = 2** + +- - ConditionValue1: item entry ([item\_template.entry](item_template_2130222.html#item_template-entry)) + - ConditionValue2: item count + - ConditionValue3: in bank? (true=1) + +\***CONDITION\_ITEM\_EQUIPPED = 3** + +- - ConditionValue1: item entry ([item\_template.entry](item_template_2130222.html#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](Faction)) + - 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](SkillLine) + - ConditionValue2: skill value + - ConditionValue3: always 0 + +\***CONDITION\_QUESTREWARDED = 8** + +- - ConditionValue1: ([quest\_template.id](quest_template_2130261.html#quest_template-id)) + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_QUESTTAKEN = 9** + +- - ConditionValue1: ([quest\_template.id](quest_template_2130261.html#quest_template-id)) + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_DRUNKENSTATE = 10** + +- - ConditionValue1: drunken state: 0 - sober; 1 - tipsy, 2 - drunk, 3 - smashed + - ConditionValue2: always 0 + - ConditionValue3: always 0 + - (Formerly AD\_COMMISSION\_AURA) + +\***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](game_event_2130151.html#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](quest_template_2130261.html#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](ChrClasses) + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_RACE = 16** + +- - ConditionValue1: race the player must be. Add flags together for all races condition should be true for. See [ChrRaces.dbc](ChrRaces) + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_ACHIEVEMENT = 17** + +- - ConditionValue1: achievement ID from [Achievement.dbc](Achievement) + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_TITLE = 18** + +- - ConditionValue1: title ID from [CharTitles.dbc](CharTitles) + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_SPAWNMASK = 19** + +- - ConditionValue1: spawnMask (see [Gameobject.spawnMask](gameobject_2130146.html#gameobject-spawnMask)/[Creature.spawnMask](creature_2130009.html#creature-spawnMask)) + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_GENDER = 20** + +- - ConditionValue1: 0 = Male, 1 = Female, 2 = None + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_UNIT\_STATE = 21** + +- - ConditionValue1: UnitState ([enum](https://github.com/TrinityCore/TrinityCore/blob/master/src/server/game/Entities/Unit/Unit.h#L466))  + - 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 + +\***CONDITION\_CREATURE\_TYPE = 24** + +- - ConditionValue1: Creature type ([creature\_template.type](https://trinitycore.atlassian.net/wiki/display/tc/creature_template#creature_template-type)). Condition is true if creature\_template.type == ConditionValue1 + - ConditionValue2: always 0 + - ConditionValue3: always 0 + +\***CONDITION\_SPELL = 25** + +- - ConditionValue1: spell (Spell Id from [Spell.dbc](Spell)) + - 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](quest_template_2130261.html#quest_template-id) + - ConditionValue2: Always 0 + - ConditionValue3: always 0 + +*Only if player has all quest objectives complete, but not yet rewarded.* + +\***CONDITION\_NEAR\_CREATURE = 29** + +- - ConditionValue1: Creature [entry](creature_template_2130008.html#creature_template-entry) + - ConditionValue2: Distance (yd) + - ConditionValue3: 0 = Alive , 1 = Dead + +\***CONDITION\_NEAR\_GAMEOBJECT = 30** + +- - ConditionValue1: Gameobject [entry](gameobject_template_2130143.html#gameobject_template-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](gameobject_template_2130143.html#gameobject_template-entry) for TypeID = TYPEID\_GAMEOBJECT + - [Creature entry](creature_template_2130008.html#creature_template-entry) for TypeID = TYPEID\_UNIT + - ConditionValue3 0 for any object of given type, any other value to match that guid + +\***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 + +\***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](Achievement) + - 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**** + +- - ConditionValue1: stateType (exact or any) + - 0 = Exact state used in ConditionValue2 + - 1 = Any type of state in ConditionValue2 + - ConditionValue2: Exact stand state, or generic state (stand / sit), or  depending on value 1 + - 0 = Standing + - 1 = Sitting + - ConditionValue3: always 0 + +### \***REFERENCE TEMPLATES** + +- - SourceTypeOrReferenceId : used as negative, for reference ID + - SourceGroup  : always 0 + - SourceEntry  : always 0 + - ElseGroup  : OR modifier + - ConditionTypeOrReference: [ConditionTypeOrReference](#conditions-ConditionTypeOrReference) + - ConditionValue1  : see above + - ConditionValue2  : see above + - ConditionValue3  : see above + - ErrorType  : see above + - ErrorTextId  : see above + - Comment  : see above + + + +- 0 (If target needs to be on land) + -- cgit