Every loot container is tied to a loot list, which the specifies either specific items or groups of items. The odds of getting any of those items
may be scaled by your Gamestage. So for example, here is the small domed trash can from blocks.xml:
<block name="cntDomedTrashCanFull">
...
<property name="LootList" value="16"/>
...
</block>
And here is loot list #16 (loot.xml):
<lootcontainer id="16" count="0,2" size="6,2" loot_quality_template="qualBaseTemplate">
<item group="garbage"/>
</lootcontainer>
So that container "rolls" RNG against the "garbage" loot group and picks from 0 to 2 items. Right away you can see that there is a quality template in effect, "qualBaseTemplate". I'll get into that at the end of this diatribe. For now, let's look at what is in "garbage":
<lootgroup name="garbage">
<item group="junk"/>
</lootgroup>
<shakes tiny fist> THANKS TFP, REAL HELPFUL. Okay let's look at "junk" (insert crude joke here):
(This is just a subset of the group - "junk" is very large [insert other crude joke here]):
<lootgroup name="junk">
<item name="drinkJarEmpty"/>
<item name="drinkCanEmpty"/>
<item name="drugPainkillers"/>
<item name="oldCash" count="1,6" prob="0.3"/>
<item name="resourceOil" count="2,6"/>
<item name="resourceDuctTape" count="1,3"/>
<item group="rottenFood"/>
<item group="booksAllScaled"/>
<item group="groupQuestChallenge" prob="0.11"/>
<item group="groupTreasureMaps" prob="0.092"/>
<item name="resourceSewingKit" count="1,2"/>
</lootgroup>
So a few things to note:
- As noted in the original loot list, from 0 to 2 items are picked from this list; it can pick the same item twice also
- Some items have their own "count" so you can get for example 2-6 oil bottles which count as just one "item"; if it picks oil twice, then maybe you get 12 of them!
- Some items have their own "prob(ability)" value; this does not mean exactly what it says. There is math wankery to figure out the true probability; in general every item in the group without a "prob" value has a 3% chance (or so), and a prob="0.3" (like the oldCash) would be approximately 1% chance.
- There are more groups within this group, e.g. "rottenFood" and "booksAllScaled"; each of these can be further expanded (no I'm not going to do that) and yet more probabilities are embedded in them. Determining probability of Item X gets hairy really quickly
Since we're talking about GS-scaled loot, here's a quick peek into "booksAllScaled" which is a GS-scaled loot group:
<lootgroup name="booksAllScaled">
<item group="perkBooks" prob="133"/>
<item group="schematicsModsAndGeneralCommon" prob="60"/>
<item group="schematicsToolsCommon" prob="7"/>
<item group="schematicsWeaponsArmorCommon" prob="36"/>
<item group="schematicsVehiclesCommon" prob="10"/>
<item group="schematicsElectrical" prob="13"/>
<item group="groupQuestChallenge" prob="10"/>
</lootgroup>
The probabilities here are
not scaled; math wankery gives for example 49.4% chance for "perkBooks" and 2.6% chance for "schematicsToolsCommon". WHERE IS MY GAMESTAGE-SCALED LOOT DAMMIT?!? Well it's hiding in "schematicsToolsCommon" (for example):
<lootgroup name="schematicsToolsCommon">
<item group="schematicsToolsT0"/>
<item group="schematicsToolsT1" loot_prob_template="ProbT1"/>
<item group="schematicsToolsT2" loot_prob_template="ProbT2"/>
</lootgroup>
There you go - the "ProbT1" and "ProbT2" probability templates - which I am
not going to go into - are chock-full of GS ranges to determine when and at what probability you will find a T0, T1, or T2 tool schematic.
Way up there we had "qualBaseTemplate", remember that? Well, funny thing - the "junk" group does not, after fully expanding all sub-groups, produce any items with a quality level. So the quality template is moot in this example. But for completeness and to make sure you are
fully asleep after reading this, here's a tiny snippet of what's in that probability template - the part that applies for Gamestage 0 through 9 (it says "level" but it means Gamestage):
<qualitytemplate level="0,9" default_quality="1">
<loot quality="1" prob="0.764"/>
<loot quality="2" prob="0.765"/>
<loot quality="3" prob="1"/>
</qualitytemplate>
This means that if a loot container produces a quality-having item (a tool, weapon, or armor), then there is (not showing the math) a 30% chance it will be Q1, 30% of Q2 item, and 40% chance for Q3.
The main takeway: all lootable containers, including zombie drop bags, work using the above techniques. Loot lists lead to loot groups which lead to more loot groups, and everything has either a fixed or GS-scaled probability.