mysqlazerothcore

The reference_loot_template understanding


I have an issue with understanding of reference_loot_template table. Can someone explain what shoudl I refer to?

For example SQL query SELECT * FROM acore_world.creature_loot_template where Entry = 14427; returns us rows, 3 lasts rows looks like this:

Entry   Item    Reference   Chance  QuestRequired   LootMode    GroupId MinCount    MaxCount    Comment
14427   24058   24058       5       0               1           1       1           1           Gibblesnik - (ReferenceTable)
14427   24066   24066       0.5     0               1           1       1           1           Gibblesnik - (ReferenceTable)
14427   24068   24068       1       0               1           1       1           1           Gibblesnik - (ReferenceTable)

What does it mean?

P.S. I've read doc few times but can't get it. Can you explain me with example?

I did run SELECT * FROM acore_world.creature_loot_template where Reference = 24058; and spotted that there are a lot of different creatures has **_loot_templete for such reference.


Solution

  • Reference Template reference asks core to process another loot template and to include all items dropped for that template into current loot. Simple idea.

    Value of MaxCount field is used as a repetition factor for references - the reference will be processed not just once but exactly MaxCount times. So if the referenced template can produce 3 to 10 items (depending on luck) and value of MaxCount is '5' then after processing of that reference 15 to 50 items will be added to the loot. An awful example, isn't it? Actually no good example for whole template reference repetition is known, but it is quite useful for group references sometimes.

    Be careful. Self references (loot template includes reference to itself) and loop references (loot template A includes reference to entire template B, loot template B includes reference to entire template A) are completely different from internal references. If you make a self-reference like

    https://www.azerothcore.org/wiki/loot_template