conditions

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

ID

SourceGroup

SourceEntry

ConditionTarget

Notes

SourceTypeOrReferenceId

ID

SourceGroup

SourceEntry

ConditionTarget

Notes

CONDITION_SOURCE_TYPE_NONE

0

Always 0

(See below)

Only used in Reference Templates! See below.

CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE

1

creature_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE

2

disenchant_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE

3

fishing_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE

4

gameobject_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE

5

item_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE

6

mail_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE

7

milling_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE

8

pickpocketing_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE

9

prospecting_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE

10

reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE

11

skinning_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 0

 

CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE

12

spell_loot_template.Entry or reference_loot_template.Entry

item id (_loot_template.Item or reference_loot_template.Item)

Always 0

Always 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 file

Always 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_MENU

14

gossip_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_OPTION

15

gossip_menu_option.menu_id (menu entry)

gossip_menu_option.id

Always 0

0 = Player
1 = WorldObject

 

CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE

16

Always 0

creature 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_EVENT

18

creature entry (npc_spellclick_spells.npc_entry)

Spell (npc_spellclick_spells.spell_id)

Always 0

0 = Clicker
1 =  Spellclick target (clickee)

 

CONDITION_SOURCE_TYPE_QUEST_AVAILABLE

19

Always 0

Quest ID

Always 0

Always 0

Condition must be met for quest to be available to player.

UNUSED

20

 

 

 

 

 


CONDITION_SOURCE_TYPE_VEHICLE_SPELL


21

creature entry (creature_template.entry)


Spell ID from Spell.dbc


Always 0

0 = Player for whom spell bar is shown
1 =  Vehicle creature


This will show or hide spells in vehicle spell bar.

CONDITION_SOURCE_TYPE_SMART_EVENT

22

ID (smart_scripts.id) + 1

EntryOrGuid (smart_scripts.entryorguid)

SourceType (smart_scripts.source_type)

0 = Invoker
1 = Object