diff options
Diffstat (limited to 'docs/conditions.md')
| -rw-r--r-- | docs/conditions.md | 1630 |
1 files changed, 1611 insertions, 19 deletions
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** + +<table> +<tbody> +<tr class="odd"> +<td><p><strong>Field</strong></p></td> +<td><p><strong>Type</strong></p></td> +<td><p><strong>Attributes</strong></p></td> +<td><p><strong>Key</strong></p></td> +<td><p><strong>Null</strong></p></td> +<td><p><strong>Default</strong></p></td> +<td><p><strong>Extra</strong></p></td> +<td><p><strong>Comment</strong></p></td> +</tr> +<tr class="even"> +<td><p><a href="#conditions-SourceTypeOrReferenceId">SourceTypeOrReferenceId</a></p></td> +<td><p>mediumint(8)</p></td> +<td><p>signed</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="odd"> +<td><p><a href="#conditions-SourceGroup">SourceGroup</a></p></td> +<td><p>mediumint(8)</p></td> +<td><p>unsigned</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="even"> +<td><p><a href="#conditions-SourceEntry">SourceEntry</a></p></td> +<td><p>mediumint(8)</p></td> +<td><p>signed</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="odd"> +<td><p><a href="#conditions-CONDITION_SOURCE_TYPE_SMART_EVENT=22">SourceId</a></p></td> +<td><p>int(11)</p></td> +<td><p>signed</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><a href="https://trinitycore.atlassian.net/wiki/display/tc/smart_scripts#smart_scripts-source_type">smart_scripts.source_type</a> <strong>||</strong> 0 for everything else</p></td> +</tr> +<tr class="even"> +<td><p><a href="#conditions-ElseGroup">ElseGroup</a></p></td> +<td><p>mediumint(8)</p></td> +<td><p>unsigned</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="odd"> +<td><p><a href="#conditions-ConditionTypeOrReference">ConditionTypeOrReference</a></p></td> +<td><p>mediumint(8)</p></td> +<td><p>signed</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="even"> +<td><p><a href="#conditions-ConditionTarget">ConditionTarget</a></p></td> +<td><p>tinyint(3)</p></td> +<td><p>unsigned</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="odd"> +<td><p><a href="#conditions-ConditionValue1">ConditionValue1</a></p></td> +<td><p>int(10)</p></td> +<td><p>unsigned</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="even"> +<td><p><a href="#conditions-ConditionValue2">ConditionValue2</a></p></td> +<td><p>int(10)</p></td> +<td><p>unsigned</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="odd"> +<td><p><a href="#conditions-ConditionValue3">ConditionValue3</a></p></td> +<td><p>int(10)</p></td> +<td><p>unsigned</p></td> +<td><p>PRI</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="even"> +<td><p><a href="#conditions-NegativeCondition">NegativeCondition</a></p></td> +<td><p>tinyint(3)</p></td> +<td><p>unsigned</p></td> +<td><p><br /> +</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p>Boolean 0 or 1 (if <a href="#conditions-NegativeCondition">NegativeCondition</a></p></td> +</tr> +<tr class="odd"> +<td><p><a href="#conditions-ErrorType">ErrorType</a></p></td> +<td><p>mediumint(8)</p></td> +<td><p>unsigned</p></td> +<td><p><br /> +</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="even"> +<td><p><a href="#conditions-ErrorTextId">ErrorTextId</a></p></td> +<td><p>mediumint(8)</p></td> +<td><p>unsigned</p></td> +<td><p><br /> +</p></td> +<td><p>NO</p></td> +<td><p>0</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="odd"> +<td><p><a href="#conditions-ScriptName">ScriptName</a></p></td> +<td><p>char(64)</p></td> +<td><p>signed</p></td> +<td><p><br /> +</p></td> +<td><p>NO</p></td> +<td><p>' '</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +<tr class="even"> +<td><p><a href="#conditions-Comment">Comment</a></p></td> +<td><p>varchar(255)</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +<td><p>YES</p></td> +<td><p>NULL</p></td> +<td><p><br /> +</p></td> +<td><p><br /> +</p></td> +</tr> +</tbody> +</table> + +**Description of the fields** + +### SourceTypeOrReferenceId + +if negative, then it is a reference template. + +<table> +<thead> +<tr class="header"> +<th><h3 id="conditions-SourceTypeOrReferenceId.1">SourceTypeOrReferenceId</h3></th> +<th>ID</th> +<th>SourceGroup</th> +<th>SourceEntry</th> +<th><a href="https://trinitycore.atlassian.net/wiki/display/tc/conditions#conditions-CONDITION_SOURCE_TYPE_SMART_EVENT=22">SourceId</a></th> +<th>ConditionTarget</th> +<th>Notes</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_NONE</td> +<td>0</td> +<td><strong><a href="#conditions-REFERENCETEMPLATES">See REFERENCE TEMPLATES</a></strong></td> +<td>(REFERENCE TEMPLATES)</td> +<td>Always 0</td> +<td>(See below)</td> +<td><strong>Only used in <a href="#conditions-REFERENCETEMPLATES">Reference Templates! See below.</a></strong></td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE</td> +<td>1</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">creature_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE</td> +<td>2</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">disenchant_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE</td> +<td>3</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">fishing_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE</td> +<td>4</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">gameobject_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE</td> +<td>5</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">item_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE</td> +<td>6</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">mail_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE</td> +<td>7</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">milling_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE</td> +<td>8</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">pickpocketing_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE</td> +<td>9</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">prospecting_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE</td> +<td>10</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE</td> +<td>11</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">skinning_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE</td> +<td>12</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Entry">spell_loot_template.Entry or reference_loot_template.Entry</a></td> +<td>item id (<a href="https://trinitycore.atlassian.net/wiki/display/tc/loot_template#loot_template-Item">_loot_template.Item or reference_loot_template.Item)</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td><br /> +CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET</td> +<td><br /> +13</td> +<td>Mask of effects to be affected by condition:<br /> +1 = EFFECT_0, 2 = EFFECT_1, 4 = EFFECT_2</td> +<td>Spell Id from <a href="http://collab.kpsn.org/display/tc/Spell">Spell DBC file</a></td> +<td>Always 0</td> +<td><p>0 : Potential spell Target<br /> +1 : spell Caster</p></td> +<td>Don't use wowhead to get number of effects, data from wowhead sometimes doesn't match real effect number.</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_GOSSIP_MENU</td> +<td>14</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/gossip_menu#gossip_menu-entry">gossip_menu.entry</a> (gossip menu entry)</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/gossip_menu#gossip_menu-text_id">gossip_menu.text_id</a> (points to npc_text.ID)</td> +<td>Always 0</td> +<td><p>0 = Player<br /> +1 = WorldObject</p></td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION</td> +<td>15</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/gossip_menu_option#gossip_menu_option-menu_id">gossip_menu_option.menu_id</a> (menu entry)</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/gossip_menu_option#gossip_menu_option-id">gossip_menu_option.id</a></td> +<td>Always 0</td> +<td><p>0 = Player<br /> +1 = WorldObject</p></td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE</td> +<td>16</td> +<td>Always 0</td> +<td>creature entry (<a href="https://trinitycore.atlassian.net/wiki/display/tc/creature_template#creature_template-entry">creature_template.entry</a>)</td> +<td>Always 0</td> +<td><p>0 = Player riding vehicle<br /> +1 = Vehicle creature</p></td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td><br /> +<br /> +<br /> +<br /> +<br /> +CONDITION_SOURCE_TYPE_SPELL</td> +<td><br /> +<br /> +<br /> +<br /> +<br /> +17</td> +<td>Always 0</td> +<td><br /> +<br /> +<br /> +<br /> +<br /> +Spell ID from <a href="https://trinitycore.atlassian.net/wiki/display/tc/Spell">Spell.dbc</a></td> +<td>Always 0</td> +<td><br /> +<br /> +<br /> +0 = spell Caster<br /> +1 = Explicit Target of the spell (only for spells which take the object selected by caster into account)</td> +<td><ul> +<li>This source type allows you to define caster/explicit target requirements for spell to be cast.</li> +<li>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.</li> +<li>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).</li> +<li>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.</li> +</ul></td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT</td> +<td>18</td> +<td>creature entry (<a href="https://trinitycore.atlassian.net/wiki/display/tc/npc_spellclick_spells#npc_spellclick_spells-npc_entry">npc_spellclick_spells.npc_entry</a>)</td> +<td>Spell (<a href="https://trinitycore.atlassian.net/wiki/display/tc/npc_spellclick_spells#npc_spellclick_spells-spell_id">npc_spellclick_spells.spell_id</a>)</td> +<td>Always 0</td> +<td>0 = Clicker<br /> +1 = Spellclick target (clickee)</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_QUEST_AVAILABLE</td> +<td>19</td> +<td>Always 0</td> +<td><a href="https://trinitycore.atlassian.net/wiki/display/tc/quest_template#quest_template-id">Quest ID</a></td> +<td>Always 0</td> +<td>Always 0</td> +<td>Condition must be met for quest to be available to player.</td> +</tr> +<tr class="odd"> +<td>UNUSED</td> +<td>20</td> +<td><br /> +</td> +<td></td> +<td><br /> +</td> +<td><br /> +</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td><br /> +CONDITION_SOURCE_TYPE_VEHICLE_SPELL</td> +<td><br /> +21</td> +<td>creature entry (<a href="https://trinitycore.atlassian.net/wiki/display/tc/creature_template#creature_template-entry">creature_template.entry</a>)</td> +<td><br /> +Spell ID from <a href="https://trinitycore.atlassian.net/wiki/display/tc/Spell">Spell.dbc</a></td> +<td>Always 0</td> +<td>0 = Player for whom spell bar is shown1 = Vehicle creature</td> +<td><br /> +This will show or hide spells in vehicle spell bar.</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_SMART_EVENT</td> +<td>22</td> +<td>ID (<a href="https://trinitycore.atlassian.net/wiki/display/tc/smart_scripts#smart_scripts-id">smart_scripts.id</a>) + 1</td> +<td>EntryOrGuid (<a href="https://trinitycore.atlassian.net/wiki/display/tc/smart_scripts#smart_scripts-entryorguid">smart_scripts.entryorguid</a>)</td> +<td>SourceType (<a href="https://trinitycore.atlassian.net/wiki/display/tc/smart_scripts#smart_scripts-source_type">smart_scripts.source_type</a>)</td> +<td>0 = Invoker<br /> +1 = Object</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_NPC_VENDOR</td> +<td>23</td> +<td>vendor entry (<a href="https://trinitycore.atlassian.net/wiki/display/tc/npc_vendor#npc_vendor-entry">npc_vendor.entry</a>)</td> +<td>item entry (<a href="https://trinitycore.atlassian.net/wiki/display/tc/npc_vendor#npc_vendor-item">npc_vendor.item</a>)</td> +<td>Always 0</td> +<td>Always 0</td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_SPELL_PROC</td> +<td>24</td> +<td>Always 0</td> +<td>Spell ID of aura which triggers the proc</td> +<td>Always 0</td> +<td>0 = Actor<br /> +1 = ActionTarget</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_TERRAIN_SWAP (6.x / 7.x only)</td> +<td>25</td> +<td>Always 0</td> +<td><a href="https://github.com/TrinityCore/TrinityCore/blob/6.x/src/server/game/Conditions/ConditionMgr.h#L92">terrainSwap</a> - object in terrainswap [ 6.x / 7.x only ]</td> +<td>Always 0</td> +<td>(source code / new description here)</td> +<td><br /> +</td> +</tr> +<tr class="odd"> +<td>CONDITION_SOURCE_TYPE_PHASE (6.x / 7.x only)</td> +<td>26</td> +<td>Phase ID</td> +<td>Zone or Area ID (or 0 for any area)</td> +<td>Always 0</td> +<td>(source code / new description here)</td> +<td><br /> +</td> +</tr> +<tr class="even"> +<td>CONDITION_SOURCE_TYPE_MAX</td> +<td>27</td> +<td><br /> +</td> +<td><br /> +</td> +<td><br /> +</td> +<td><br /> +</td> +<td>(Placeholder)</td> +</tr> +</tbody> +</table> + +### 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 + + +<table> +<thead> +<tr class="header"> +<th>ConditionTypeOrReference (name)</th> +<th>Value</th> +<th>ConditionValue1</th> +<th>ConditionValue2</th> +<th>ConditionValue3</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td>CONDITION_NONE</td> +<td>0</td> +<td>(Never used)</td> +<td>(Never used)</td> +<td>(Never used)</td> +</tr> +<tr class="even"> +<td>CONDITION_AURA</td> +<td>1</td> +<td>Spell ID from <a href="https://trinitycore.atlassian.net/wiki/display/tc/Spell">Spell.dbc</a></td> +<td>Effect index (0-2)</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_ITEM</td> +<td>2</td> +<td>item entry (<a href="https://trinitycore.atlassian.net/wiki/display/tc/item_template#item_template-entry">item_template.entry</a>)</td> +<td>item count</td> +<td>0 = not in bank, 1 = in bank</td> +</tr> +<tr class="even"> +<td>CONDITION_ITEM_EQUIPPED</td> +<td>3</td> +<td>item entry (<a href="https://trinitycore.atlassian.net/wiki/display/tc/item_template#item_template-entry">item_template.entry</a>)</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_ZONEID</td> +<td>4</td> +<td>Zone ID where this condition will be true.</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td><br /> +<br /> +<br /> +<br /> +<br /> +CONDITION_REPUTATION_RANK</td> +<td><br /> +<br /> +<br /> +<br /> +<br /> +5</td> +<td><p><br /> +<br /> +<br /> +<br /> +<br /> +Faction template ID from <a href="https://trinitycore.atlassian.net/wiki/display/tc/Faction">Faction.dbc</a></p></td> +<td><pre><code>rank: + 1 = Hated + 2 = Hostile + 4 = Unfriendly + 8 = Neutral + 16 = Friendly + 32 = Honored + 64 = Revered +128 = Exalted</code></pre> +<p>Add the target ranks together for the condition to be true for all those ranks.</p></td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_TEAM</td> +<td>6</td> +<td>Team id :Alliance = 469 / Horde = 67</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_SKILL</td> +<td>7</td> +<td>Required skill. See <a href="https://trinitycore.atlassian.net/wiki/display/tc/SkillLine">SkillLine.dbc</a> .</td> +<td>Skill rank value (e.g. from 1 to 450 for the 3.3.5 branch)</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_QUESTREWARDED</td> +<td>8</td> +<td>Quest ID - see <a href="https://trinitycore.atlassian.net/wiki/display/tc/quest_template#quest_template-id">quest_template.id</a></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_QUESTTAKEN</td> +<td>9</td> +<td>Quest ID - see <a href="https://trinitycore.atlassian.net/wiki/display/tc/quest_template#quest_template-id">quest_template.id</a></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_DRUNKENSTATE</td> +<td>10</td> +<td>Sober=0; Tipsy=1, Drunk=2, Smashed=3</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_WORLD_STATE</td> +<td>11</td> +<td>World state index</td> +<td>World state value</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_ACTIVE_EVENT</td> +<td>12</td> +<td>Event entry (<a href="https://trinitycore.atlassian.net/wiki/display/tc/game_event#game_event-eventEntry">game_event.eventEntry</a>)</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td><br /> +CONDITION_INSTANCE_INFO</td> +<td><br /> +13</td> +<td><strong><br /> +entry</strong> (see corresponding source script files for info)</td> +<td><strong><br /> +data</strong> (see corresponding script source files for more info)</td> +<td><p>0=INSTANCE_INFO_DATA</p> +<p>1=INSTANCE_INFO_GUID_DATA</p> +<p>2=INSTANCE_INFO_BOSS_STATE</p> +<p>3=INSTANCE_INFO_DATA64</p></td> +</tr> +<tr class="odd"> +<td>CONDITION_QUEST_NONE</td> +<td>14</td> +<td>Quest ID - see <a href="https://trinitycore.atlassian.net/wiki/display/tc/quest_template#quest_template-id">quest_template.id</a></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td><br /> +CONDITION_CLASS</td> +<td><br /> +15</td> +<td>Class mask from <a href="https://trinitycore.atlassian.net/wiki/display/tc/ChrClasses">ChrClasses.dbc</a><br /> +Add flags together for all classes where condition is true.</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_RACE</td> +<td>16</td> +<td>Player must be this race. See <a href="https://trinitycore.atlassian.net/wiki/display/tc/ChrRaces">ChrRaces.dbc</a> .<br /> +Add flags together for all races where condition is true.</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_ACHIEVEMENT</td> +<td>17</td> +<td>Achievement ID from <a href="https://trinitycore.atlassian.net/wiki/display/tc/Achievement">Achievement.dbc</a></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_TITLE</td> +<td>18</td> +<td>Title ID from <a href="https://trinitycore.atlassian.net/wiki/display/tc/CharTitles">CharTitles.dbc</a></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_SPAWNMASK</td> +<td>19</td> +<td>spawnMask from<br /> +<a href="https://trinitycore.atlassian.net/wiki/display/tc/creature#creature-spawnMask">Creature.spawnMask</a> / <a href="https://trinitycore.atlassian.net/wiki/display/tc/gameobject#gameobject-spawnMask">Gameobject.spawnMask</a></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_GENDER</td> +<td>20</td> +<td>0 = Male, 1 = Female, 2 = None</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_UNIT_STATE</td> +<td>21</td> +<td>UnitState (<a href="https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Unit/Unit.h#L498">enum from Unit.h</a>)</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_MAPID</td> +<td>22</td> +<td><p>Map entry from Map.dbc</p> +<p>(0=Eastern Kingdoms, 1=Kalimdor, - and so on.)</p></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_AREAID</td> +<td>23</td> +<td>Area ID from AreaTable.dbc</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_CREATURE_TYPE</td> +<td>24</td> +<td><p>Creature type from <a href="https://trinitycore.atlassian.net/wiki/display/tc/creature_template#creature_template-type">creature_template.type</a></p> +<p>True if creature_template.type == ConditionValue1</p></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_SPELL</td> +<td>25</td> +<td>Spell ID from <a href="https://trinitycore.atlassian.net/wiki/display/tc/Spell">Spell.dbc</a></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_PHASEMASK</td> +<td>26</td> +<td>phasemask value</td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td><br /> +CONDITION_LEVEL</td> +<td><br /> +27</td> +<td><br /> +Player level (1-80 in 3.3.5 || 1-110 in 7.x)</td> +<td>Optional: 0 = Level must be equal, 1 = Level must be higher, 2 = Level must be lower,<br /> +3 = Level must be higher or equal, 4 = Level must be lower or equal.</td> +<td>Always 0</td> +</tr> +<tr class="odd"> +<td>CONDITION_QUEST_COMPLETE</td> +<td>28</td> +<td>Quest ID - see <a href="https://trinitycore.atlassian.net/wiki/display/tc/quest_template#quest_template-id">quest_template.id</a></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td>CONDITION_NEAR_CREATURE</td> +<td>29</td> +<td>Creature entry from <a href="https://trinitycore.atlassian.net/wiki/display/tc/creature_template#creature_template-entry">creature_template.entry</a></td> +<td>Distance in yards</td> +<td>Alive=0 / Dead=1</td> +</tr> +<tr class="odd"> +<td>CONDITION_NEAR_GAMEOBJECT</td> +<td>30</td> +<td>Gameobject entry from <a href="https://trinitycore.atlassian.net/wiki/display/tc/gameobject_template#gameobject_template-entry">gameobject_template.entry</a></td> +<td>Distance in yards</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td><br /> +<br /> +CONDITION_OBJECT_ENTRY_GUID</td> +<td><br /> +<br /> +31</td> +<td><p>TypeID. Available object types:<br /> +3 : TYPEID_UNIT<br /> +4 : TYPEID_PLAYER<br /> +5 : TYPEID_GAMEOBJECT<br /> +7 : TYPEID_CORPSE (player corpse, after spirit release)</p></td> +<td><p><br /> +0 = Any object of given TypeID<br /> +if TypeID = TYPEID_UNIT => Creature entry from <a href="https://trinitycore.atlassian.net/wiki/display/tc/creature_template#creature_template-entry">creature_template.entry<br /> +if TypeID = TYPEID_GAMEOBJECT => Gameobject entry from </a><a href="https://trinitycore.atlassian.net/wiki/display/tc/gameobject_template#gameobject_template-entry">gameobject_template.entry</a></p></td> +<td><p><br /> +0 = Any object of given type</p> +<p>1 - 500k : creature / gameobject GUID</p></td> +</tr> +<tr class="odd"> +<td><br /> +<br /> +CONDITION_TYPE_MASK</td> +<td><br /> +<br /> +32</td> +<td><p>TypeMask - a bitmask of following object types:<br /> +0x0008 - TYPEMASK_UNIT (8)<br /> +0x0010 - TYPEMASK_PLAYER (16)<br /> +0x0020 - TYPEMASK_GAMEOBJECT (32)<br /> +0x0080 - TYPEMASK_CORPSE (player corpse after spirit release) (128)</p></td> +<td>Always 0</td> +<td>Always 0</td> +</tr> +<tr class="even"> +<td><br /> +<br /> +<br /> +CONDITION_RELATION_TO< |
