Conditions SF

From Project Skyfire
Jump to: navigation, search

Back to world database list of tables.


Conditions_SF

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) unsigned PRI NO 0
SourceId mediumint(8) unsigned PRI NO 0
ElseGroup mediumint(8) unsigned PRI NO 0
ConditionTypeOrReference mediumint(8) signed PRI NO 0
ConditionTarget tinyint(3) unsigned NO 0
ConditionValue1 mediumint(8) unsigned PRI NO 0
ConditionValue2 mediumint(8) unsigned PRI NO 0
ConditionValue3 mediumint(8) unsigned PRI NO 0
NegativeCondition tinyint(3) unsigned NO 0
ErrorTextId mediumint(8) unsigned NO 0
ScriptName char(64) signed NO "
Comment varchar(255) NO


Description of the fields

SourceTypeOrReferenceId

if negative, then it is a reference template

   CONDITION_SOURCE_TYPE_NONE                           = 0,
   CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE         = 1,
   CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE       = 2,
   CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE          = 3,
   CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE       = 4,
   CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE             = 5,
   CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE             = 6,
   CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE          = 7,
   CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE    = 8,
   CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE      = 9,
   CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE        = 10,
   CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE         = 11,
   CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE            = 12,
   CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET          = 13,
   CONDITION_SOURCE_TYPE_GOSSIP_MENU                    = 14,
   CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION             = 15,
   CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE      = 16,
   CONDITION_SOURCE_TYPE_SPELL                          = 17,
   CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT              = 18,
   CONDITION_SOURCE_TYPE_QUEST_ACCEPT                   = 19,
   CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK                = 20,
   CONDITION_SOURCE_TYPE_VEHICLE_SPELL                  = 21,
   CONDITION_SOURCE_TYPE_SMART_EVENT                    = 22,
   CONDITION_SOURCE_TYPE_MAX                            = 23


SourceGroup

See below

SourceEntry

See below

ElseGroup

Allows building grouped conditions - all entries belonging to the same condition (same SourceType, SourceGroup and 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).

ConditionTypeOrReference

See below

CONDITION_NONE                    = 0,   
CONDITION_AURA                    = 1,   
CONDITION_ITEM                    = 2,   
CONDITION_ITEM_EQUIPPED           = 3,   
CONDITION_ZONEID                  = 4,   
CONDITION_REPUTATION_RANK         = 5,   
CONDITION_TEAM                    = 6,   
CONDITION_SKILL                   = 7,   
CONDITION_QUESTREWARDED           = 8,   
CONDITION_QUESTTAKEN              = 9,   
CONDITION_DRUNKENSTATE            = 10,
CONDITION_WORLD_STATE             = 11,  
CONDITION_ACTIVE_EVENT            = 12,  
CONDITION_INSTANCE_DATA           = 13,  
CONDITION_QUEST_NONE              = 14,  
CONDITION_CLASS                   = 15,  
CONDITION_RACE                    = 16,  
CONDITION_ACHIEVEMENT             = 17,  
CONDITION_UNUSED_18               = 18,  
CONDITION_UNUSED_19               = 19,  
CONDITION_UNUSED_20               = 20,  
CONDITION_UNUSED_21               = 21,  
CONDITION_MAPID                   = 22,  
CONDITION_AREAID                  = 23,  
CONDITION_UNUSED_24               = 24,  
CONDITION_SPELL                   = 25,  
CONDITION_PHASEMASK               = 26,  
CONDITION_LEVEL                   = 27,
CONDITION_QUEST_COMPLETE          = 28,
CONDITION_NEAR_CREATURE           = 29, 
CONDITION_NEAR_GAMEOBJECT         = 30,
CONDITION_OBJECT_ENTRY            = 31,
CONDITION_TYPE_MASK               = 32,
CONDITION_RELATION_TO             = 33,
CONDITION_REACTION_TO             = 34,
CONDITION_DISTANCE_TO             = 35,
CONDITION_ALIVE                   = 36,
CONDITION_HP_VAL                  = 37,
CONDITION_HP_PCT                  = 38,
CONDITION_MAX                     = 39 


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.

ErrorTextId

Entry from skyfire_string table. Will be displayed only for the below condition source type:

   CONDITION_SOURCE_TYPE_SPELL                          = 17

ScriptName

The ScriptName the condition uses, if any. Default is NULL

Comment

Explanation of this condition or reference


The content of the SourceGroup and SourceEntry fields depends on the 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)
    • 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)
    • SourceEntry: gossip menu text id (gossip_menu.text_id)
    • ConditionTarget:
      • 0 - Player for which gossip text is shown
      • 1 - WorldObject providing gossip


  • CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15


  • CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16
    • SourceGroup: always 0
    • SourceEntry: creature entry (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 of the vehicle if the player leaves that area.


  • CONDITION_SOURCE_TYPE_SPELL = 17
    • SourceGroup: always 0
    • SourceEntry: spell (Spell Id from Spell.dbc)
    • 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_QUEST_ACCEPT = 19
    • SourceGroup: ?
    • SourceEntry: Quest id)
    • ConditionTarget: always 0


  • CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20
    • SourceGroup: ?
    • SourceEntry: Quest id)
    • ConditionTarget: always 0


  • CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21
    • SourceGroup: creature entry (creature_template.entry)
    • SourceEntry: spell (Spell Id from Spell.dbc)
    • ConditionTarget:
      • 0 - Player for which spell bar is shown
      • 1 - Vehicle creature

Note: it will show or hide spells in vehicle spell bar.



The content of the ConditionValueX fields depends on the ConditionTypeOrReference

  • CONDITION_NONE = 0

Never used


  • CONDITION_AURA = 1
    • ConditionValue1: spell (Spell Id from Spell.dbc)
    • ConditionValue2: effect index (0-2)
    • ConditionValue3: always 0


  • CONDITION_ITEM = 2
    • ConditionValue1: item entry (item_template.entry)
    • ConditionValue2: item count
    • ConditionValue3: in bank? (true=1)


  • CONDITION_ITEM_EQUIPPED = 3
    • ConditionValue1: item entry (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)
    • 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
    • ConditionValue2: skill value
    • ConditionValue3: always 0


  • CONDITION_QUESTREWARDED = 8
    • ConditionValue1: (quest_template.id)
    • ConditionValue2: always 0
    • ConditionValue3: always 0


  • CONDITION_QUESTTAKEN = 9
    • ConditionValue1: (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


  • CONDITION_INSTANCE_DATA = 13
    • ConditionValue1: entry //see corresponding script source files for more info
    • ConditionValue2: data //see corresponding script source files for more info
    • ConditionValue3: always 0


  • CONDITION_QUEST_NONE = 14
    • ConditionValue1: (quest_template.id)
    • ConditionValue2: always 0
    • ConditionValue3: always 0


  • CONDITION_CLASS = 15
    • ConditionValue1: class ID. Add flags together for all classes condition should be true for. See ChrClasses.dbc
    • 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
    • ConditionValue2: always 0
    • ConditionValue3: always 0


  • CONDITION_ACHIEVEMENT = 17
    • ConditionValue1: achievement ID from Achievement.dbc
    • 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_SPELL = 25
    • ConditionValue1: spell (Spell Id from Spell.dbc)
    • 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
    • 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
    • ConditionValue2: Distance (yd)
    • ConditionValue3: always 0


  • CONDITION_NEAR_GAMEOBJECT = 30
    • ConditionValue1: Gameobject entry
    • ConditionValue2: Distance (yd)
    • ConditionValue3: always 0


  • CONDITION_OBJECT_ENTRY= 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
    • ConditionValue3: always 0


  • 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)
    • 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 looksdead 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


  • REFERENCE TEMPLATES
    • SourceTypeOrReferenceId : used as negative, for reference ID
    • SourceGroup  : always 0
    • SourceEntry  : always 0
    • ElseGroup  : OR modifier
    • ConditionTypeOrReference: ConditionTypeOrReference
    • ConditionValue1  : see above
    • ConditionValue2  : see above
    • ConditionValue3  : see above
    • ErrorTextId  : see above
    • Comment  : see above


Return to world database structure