Tables: *_gameobject_loot_template
General
Well, according to vocabulary the meaning of the word "loot" is good for corpse loot and may be for some gameobjects like chests but quite unfit for fishing "loot". Nevermind. We will use term "loot" here as "a set of items generated on an event for a player" and "loot definition" as "a set of rules for loot generation". And forget about vocabulary for a while.
...
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.
Structure
Field | Type | Null | Key | Default | Extra |
mediumint unsigned | NO | PRI | 0 | ||
mediumint unsigned | NO | PRI | 0 | ||
Reference | mediumint unsigned | NO | 0 | ||
float | NO | 100 | |||
QuestRequired | bool | NO | 0 | ||
smallint | NO | 1 | |||
tinyint | NO | 0 | |||
mediumint | NO | 1 | |||
tinyint unsigned | NO | 1 | |||
Comment | varchar |
Relations
The 11 tables have different relations with other DB tables.
Loot table | Field | Relation | Related table | Field | Comment |
---|---|---|---|---|---|
fishing_loot_template | no relation | 74219462 is linked with ID of the fishing zone or area | |||
creature_loot_template | many <- many | lootid | |||
gameobject_loot_template | many <- many | Only gameobject type 3 (GAMEOBJECT_TYPE_CHEST) or 25 (GAMEOBJECT_TYPE_FISHINGHOLE) use data1 as loot ID, for other types data1 is used in other ways | |||
item_loot_template | many <- one | ||||
disenchant_loot_template | many <- many | ||||
prospecting_loot_template | many <- one | ||||
milling_loot_template | many <- one | ||||
pickpocketing_loot_template | many <- many | ||||
skinning_loot_template | many <- many | Can also store minable/herbable items gathered from creatures | |||
quest_mail_loot_template | |||||
reference_loot_template | many <- many |
| In case of negative mincountOrRef | ||
spell_loot_template | 74219462 | many <- many | Spell (DBC) | SpellId |
Description of the fields
Entry
The ID of the loot definition (loot template). The rows with the same ID defines a single loot.
...
Agreements on Entry field values are described there.
Item
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.
Reference
Template reference asks core to process another loot template and to include all items dropped for that template into current loot. Simple idea.
...
then the core will crash due to stack overflow at first attempt of loot 21215 processing. That is why self references and loop references are strictly forbidden.
ChanceOrQuestChance
Item drop chance (plain entry or quest entry). Not sure how this functions for loot reference items.
Plain entry
Chance > 0
Absolute value of Chance 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
Chance > 0
Absolute value of Chance 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.
Just as for plain entries absolute value of Chance signifies the percent chance that the item has to drop. But in addition negative Chance
Chanced references
For Reference entries Chance signifies the percent chance that the reference has to be used. So it is very similar to plain entries meaning, just note that entire reference is skipped if the chance is missed.
Negative and zero values of Chance make no sense for that case and should not be used.
Common remarks
Zero value of Chance is allowed for grouped entries only.
(Non-zero) values of Chance in loot definition are multiplied by RATE_DROP_ITEMS (mangos config setting) during loot generation for references and non-reference entries, but not for grouped entries.
QuestRequired
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 RequiredItemId fields or in its RequiredSourceItemId fields. The player must also have less copies of the item than RequiredItemCount or RequiredSourceItemCount.
LootMode
A special parameter used for separating conditional loot, such as Hard Mode loot. A lootmode of 0 will effectively disable a loot entry (its roll will always fail). This column is a bitmask, so you shouldn't duplicate loot across lootmodes. The active lootmode(s) can be changed at any time by the core. This column should only be used if required, in most cases it should be left as 1. Valid lootmodes include: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 16384, 32768.
GroupId
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) 74219462 from the items declared in the loot definitions of the group. Groups are formed by loot definitions having the same values of 74219462 and GroupId fields.
...
For reference entries: If GroupId > 0 only the referenced items with said GroupId will drop.
MinCountOrRef
The minimum number of copies of the item that can drop in a single loot
- Zero value makes no sense and should not be used.
MaxCount
For non-reference entries - the maximum number of copies of the item that can drop in a single loot.
...
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.
Agreements
These agreements are different for different loot tables. Mainly agreements defines rules for loot template IDs (74219462) and groups
Fishing haul
For fishing_loot_template, ID is the zone or area ID from AreaTable.dbc (Note: Area IDs are not included in the link)
...
When a fish is catched for a quest it becoms the second fish on the hook. Many people rolled on floor laughing but this is blizzlike and fortunately easy to implement. Just add necessary quest drop definition(s).
Corpse loot
For creature_loot_template basic approach is to use creature_template.lootid equal to creature_template.entry. But this results in great overhead in the loot table as
- many creatures use the same loot definition (well, stats on sites are similar due to the nature of random roll)
- even more creatures use same parts of loot definition
That is why it is recommended to use grouping, group references and template references.
Disenchant outcome
Agreements for disenchant loot templates numbering is item.ItemLevel*100 + item.quality where Item is disenchanting target.
...
There is no use for references here as the reference is done with the relation field. No quest drop at all.
Gameobject harvest
TBD
Luggage contents
TBD
Pocket pick-ups
Agreements for pickpocketing loot templates numbering is not known.
TBD
Prospecting outcome
Agreements for prospecting loot templates numbering is not known.
TBD
Skinning pulls
Agreements for skinning loot templates numbering is not known. It's a real pity as many creatures should use the same templates. In most cases mobs with the same family and level have very similar skinning statistics.
...
When a skin is pulled for a quest it becoms the second skin from the mob. Yes, funny. This is blizzlike and fortunately easy to implement. Just add necessary quest drop definition(s).
Reference Template Numbering
Agreements for Reference Templates are as followed:
Range | Used for |
00000-00999 | Skinning Reference Templates |
01000-09999 | KEEP FREE: TDB-DEV-References |
10000-10999 | Item Reference Templates |
11000-11799 | Fishing Reference Templates |
11800-11999 | Milling Reference Templates |
12000-12899 | Raid: Gameobject Reference Templates |
12900-12999 | Mining Reference Templates |
13000-13999 | Prospecting Reference Templates |
14000-29000 | World Reference Templates |
34000-34999 | Raid: Creature Reference Templates |
35000-35999 | Dungeon Reference Templates |
Examples
Gameobject dropping a single non-quest item
Bloque de código | ||
---|---|---|
| ||
-- Add a single non-quest item to an object DELETE `gameobject_loot_template` WHERE `Entry`=1419; INSERT INTO `gameobject_loot_template` (`Entry`,`Item`,`Chance`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`) VALUES (1419,2453,100,0,0,1,3); -- 100% chance to drop a 1 to 3 Bruiseweed |
Creature having in the pocket single quest item
Bloque de código |
---|
-- creature_template: entry=6846, name='Defias Dockmaster', pickpocketloot=6846 -- Note: link with pickpocketing_loot_template is on `pickpocketloot` field (which is equal to `entry` field in this case) DELETE `pickpocketing_loot_template` WHERE `Entry`=6846; INSERT INTO `pickpocketing_loot_template` (`Entry`,`Item`,`Chance`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`) VALUES (6846,7675,100,0,0,1,1); |
...