NOTE: This page is auto-generated from the MAGNET DBDocs module,
Any changes made directly to this page will be lost when it is regenerated.
Description of the 'disenchant_loot_template' table for MaNGOSZero
This table format is used to generate different loot items. Loot templates define only items in the loot. See comments about money drop in corpse, pickpocketing and luggage loot in creature_template and item_template.
This table uses the 'MyISAM' DB Engine
The Field definitions follow:
|Field Name||Field Type||Nullable||Key||Default Value||Attributes||Notes|
|entry||mediumint(8) unsigned||NO||PRI||'0'||The ID of the loot definition (loot template).|
|item||mediumint(8) unsigned||NO||PRI||'0'||Template ID of the item which can be included into the loot.|
|ChanceOrQuestChance||float||NO||'100'||Command parameter, see command description.|
|groupid||tinyint(3) unsigned||NO||'0'||A group is a set of loot definitions.|
|mincountOrRef||mediumint(9)||NO||'1'||The total number of copies of an item or may reference another loot template|
|maxcount||tinyint(3) unsigned||NO||'1'||For non-reference entries - the maximum number of copies of the item.|
|condition_id||mediumint(8) unsigned||NO||'0'||Value that represents a loot condition that must be filled.|
Description of the fields
entry mediumint(8) unsigned
The ID of the loot definition (loot template). The rows with the same ID defines a single loot. (Recommended id selection: item_level*100 + item_quality)
It is often the same ID as the loot source (item, creature, etc) but when the link is made not on entry field of the Related table then ID can be different. For example, when several loot sources should provide the same loot, single loot definition can be used. In this case the loot sources have the same value in the link field.
It is possible also to set up artificial loot templates which are not used directly at all as they have ID which are not referenced from the related source. Such "support templates" can be referenced from "normal" loot templates.
When a common or artificial loot template is used a problem arises: what ID to use for that template? Depending on the loot table, different rules can be agreed on to simplify maintenance for the table. Moreover, such rules would be very handy but it seems at the moment there are very few rules explicitly defined.
Agreements on entry field values are described there.
item mediumint(8) unsigned
Template ID of the item which can be included into the loot. NOTE: For reference entries this field has no meaning and not used by the core in any way. Yet because of the PRIMARY KEY on the entry + item combination, this field will nonetheless need to be a unique number for each reference entry so that no indexing conflicts arise.
This field determines if an item should drop by chance, or by the character looting having a quest. The meaning is determined by the fields signedness and the value of the mincountOrRef field's value.
The following table shows possible combinations and their meanings.
|> 0||> 0||A simple percentage based drop chance.|
|< 0||> 0||A quest based drop chance.|
|> 0||< 0||A drop chance which has a chance to be used.|
Setting ChanceOrQuestChance to 0 is only allowed for entries which are part of a loot group (aka. have a groupid set). Also note that non-zero values are subject to multiplication based on the drop rate configured in the world server configuration if they are not part of a loot group.
groupid tinyint(3) unsigned
A group is a set of loot definitions processed in such a way that at any given looting event the loot generated can receive only 1 (or none) item from the items declared in the loot definitions of the group. Groups are formed by loot definitions having the same values of entry and groupid fields. A group may consists of explicitly-chanced (having non-zero ChanceOrQuestChance) and equal-chanced (ChanceOrQuestChance = 0) entries. Every equal-chanced entry of a group is considered having such a chance that: ¦all equal-chanced entries have the same chance ¦group chance (sum of chances of all entries) is 100% Of course group may consist of ¦only explicitly-chanced entries or ¦only equal-chanced entries or ¦entries of both type. The easies way to understand what are groups is to understand how core processes grouped entries: At loading time: ¦groups are formed - all grouped entries with the same values of groupid and entry fields are gathered into two sets - one for explicitly-chanced entries and one for equal-chanced. Note that order of entries in the sets can not be defined by DB - you should assume that the entries are in an unknown order. But indeed every time core processes a group the entries are in some order, constant during processing. During loot generation: ¦core rolls for explicitly-chanced entries (if any): ¦a random number R is rolled in range 0 to 100 (floating point value). ¦chance to drop is checked for every (explicitly-chanced) entry in the group: ¦if R is less than absolute value of ChanceOrQuestChance of the entry then the entry 'wins': the item is included in the loot. Group processing stops, the rest of group entries are just skipped. ¦otherwise the entry 'looses': the item misses its chance to get into the loot. R is decreased by the absolute value of ChanceOrQuestChance and next explicitly-chanced entry is checked. ¦if none of explicitly-chanced entries got its chance then equal-chanced part (if any) is processed: ¦a random entry is selected from the set of equal-chanced entries and corresponding item is included in the loot. ¦If nothing selected yet (this never happens if the group has some equal-chanced entries) - no item from the group is included into the loot. Let us use term group chance as the sum of ChanceOrQuestChance (absolute) values for the group. Please note that even one equal-chanced entry makes group chance to be 100% (provided that sum of explicit chances does not exceed 100%). If you understand the process you can understand the results: ¦Not more than one item from a group may drop at any given time. ¦If group chance is at least 100 then one item will be dropped for sure. ¦If group chance does not exceed 100 then every item defined in group entries has exactly that chance to drop as set in ChanceOrQuestChance. ¦If group chance is greater than 100 then some entries will lost a part of their chance (or even not be checked at all - that will be the case for all equal-chanced entries) whatever value takes the roll R. So for some items chance to drop will be less than their ChanceOrQuestChance. That is very bad and that is why having group chance > 100 is strictly prohibited. ¦Processing of equal-chanced part takes much less time then of explicitly-chanced one. So usage of equal-chanced groups is recommended when possible. So now basic applications of the groups are clear: ¦Groups with group chance of 100% generate exactly one item every time. This is needed quite often, for example such behavior is needed to define a loot template for tier item drop from a boss. ¦Groups with group chance < 100 generate one or zero items every time keeping chances of every item unchanged. Such behavior is useful to limit maximum number of items in the loot. ¦A single group may be define d for a set of items common for several loot sources. This could be very useful for decreasing DB size without any loss of data. See References for more details. There is no way to have a reference as a part of a group. Note: A group may contain definitions of non-quest drop, quest drop or both, but mixing non-quest and quest drop in a single group is not recommended. Note: The core has a limitation - only 16 non-quest items (money and items added into the loot for quests are not counted for this "16") may come into the loot. And this is not a caprice of core devs - the client has some constraints. As most of loots have much more than 16 possible items (sometimes several hundreds) so without groups there is a (little) chance that more than 16 items will be rolled for a given loot but player will be able to see (and take) only first 16 of them. With groups you can ensure that more than 16 items will never drop. If DB pretends to be a quality software it must have loot template definitions which ensure that not more than 16 plain entries and groups are defined for any loot template. This is just a note - such declaration is not issued by UDB developers yet. Note: The core has no limitation for number of groups (except 255 by DB field size), but according to the previous note there is no need to use values greater than 16.
Depending on the value of the field it may either define the minimum number of copies for the item to be dropped, or it may reference another loot template.
maxcount tinyint(3) unsigned
For non-reference entries - the maximum number of copies of the item that can drop in a single loot. For references value of maxcount field is used as a repetition factor for references - the reference will be processed not just once but exactly maxcount times. This is designed to serve a single purpose: to make definition of tier token drops a bit simplier (tokens of a tier are defined as a 100%-chance group of an artificial template and bosses' loot templates include 100%-chanced reference to that group with repetition factor of 2 or 3 depending on the case). Using non-1 repetition factor for other things (references to a group with group chance less than 100% or chanced references with chance less than 100%) must be agreed with UDB devs first (and described here). Note: core rolls chance for any loot definition entry just one time - so if a references looses its chance it is skipped for the current loot completely whatever is maxcount value.
condition_id mediumint(8) unsigned
Value that represents a loot condition that must be filled in order for the item to drop. This field combined with condition_value1-2 fields can provide conditions on when an item can be dropped. Value Condition Comments 0 CONDITION_NONE Regular drop 1 CONDITION_AURA Player looting 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_ZONEID Player must be in a certain zone 5 CONDITION_REPUTATION_RANK 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 Player looting must have no aura active mentioned in condition_value1 12 CONDITION_ACTIVE_EVENT The loot with that condition can be looted only while the Event (condition_value1) is active NOTE: For reference entries this field has no meaning, not used by the core in any way and should have the default value of 0.
auto-generated by the getMaNGOS.eu MAGNET dbdocs module
Edited by Antz