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 'fishing_loot_template' table for MaNGOSThree
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 'InnoDB' 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)||NO||PRI||'0'||Template ID of the item which can be included into the loot.|
|ChanceOrQuestChance||float||NO||'100'||Meaning of that field is a bit different depending on its sign.|
|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||smallint(5) 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. (entry 0 used for junk loot at fishing fail (if allowed by config option)).
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.
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.
Meaning of that field is a bit different depending on its sign and the sign of mincountOrRef: Plain entry ChanceOrQuestChance > 0, mincountOrRef > 0 Absolute value of ChanceOrQuestChance (actuallu just the value as it's positive in this case) signifies the percent chance that the item has to drop. Any floating point number is allowed but indeed any value larger that 100 will make the same result as 100. Quest drop ChanceOrQuestChance 0 Just as for plain entries absolute value of ChanceOrQuestChance signifies the percent chance that the item has to drop. But in addition negative ChanceOrQuestChance informs the core that the item should be shown only to characters having appropriate quest. This means that even if item is dropped, in order to see it in the loot the player must have at least one quest that has the item ID in its ReqItemIdN fields or in its ReqSourceIdN fields. The player must also have less copies of the item than ReqItemCountN or ReqSourceCountN. Chanced references mincountOrRef
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
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 smallint(5) 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