It looks like there's a lot of math here. From what I can decipher -
there's a base probability template which is used by default. This varies based on gamestage. And then there's weighting, so prob has different meanings in different contexts in the same file.
From what I can gather, a container will have an item count range, and a list of items or groups that may drop from that container. I am not sure if the game rolls for each slot or rolls once and then rolls for how many. for example
lootcontainer id="143" count="1,2" size="8,9" sound_open="UseActions/open_cooler" sound_close="UseActions/close_chest" loot_quality_template="qualBaseTemplate">
<item name="drinkJarRiverWater" count="1,2"/>
</lootcontainer>
The count should be the range of potential items in the containers, but if there's a probability of .1 as the base for the gamestage I do not know if it rolls 1d10 twice or if it rolls 1d10 once and then 1d2 to determine how many items. By default I believe it uses the base probability group defined at the top of the loot.xml file unless a different template is defined.
If the base probability roll does pass, then the item to award gets picked from a list. In the above example, there's one item, so it has a 100% chance of dropping 1-2 water jars if it drops 1 item. Looking at a more complex example:
<lootcontainer id="141" count="1,3" size="7,2" sound_open="UseActions/open_garbage" sound_close="silencefiller" loot_quality_template="qualBaseTemplate">
<item name="resourceCloth" count="2,7" prob=".08"/>
<item group="groupApparelShirtLong" prob=".55"/>
<item group="groupApparelTankTopTShirt" prob="0.55"/>
</lootcontainer>
So, above we have a potential for 1-3 items to drop from the container, based on the base gamestage probability. If the items had no prob value, there would be a 33% chance for each item to drop. But the items are weighted and the math gets crazy. To determine the probability of the long shirt, we add each probability (where no prob is given, it is assumed to be 1), and then find the percentage of the total.
So, we get .08+.55+.55, or 1.18. Since the shirt is .55, we get .55/1.18, or a 47ish percent chance of getting a long shirt if one item drops.
If we look at the loot group:
<lootgroup name="groupApparelShirtLong">
<item name="apparelLongShirt" mods="dye" mod_chance="0"/>
<item name="apparelArmyShirt"/>
<item name="apparelHoodySweatshirt" mods="dye" mod_chance="0"/>
<item name="apparelSweatshirt" mods="dye" mod_chance="0"/>
<item name="apparelFlannelShirt" mods="dye" mod_chance="0"/>
</lootgroup>
There is a 20% chance of getting an army shirt if we get a long shirt (1/5). So, what are the chances of getting an army shirt from that container?
<lootprobtemplate name="baseProbTemplate">
<loot level="1,100" prob="0.25"/>
<loot level="101,200" prob="0.5"/>
<loot level="201,300" prob="0.75"/>
<loot level="301,999999" prob="1"/>
</lootprobtemplate>
Let's assume our gamestage is 150. There is a .5 chance of getting an item (it's actually 1-3 items but let's make the example easier). If an item drops, there is a 47% chance of getting an item from the long shirt group, and there is a 20% chance of getting an army shirt in that group. So, .5*.47*.2 gives us about a 4.7% chance of getting an army shirt from that container.
To the original question: if I wanted zombie X to drop item Y 5% of the time under all circumstances, I'd have to do the following:
Append a new probability group with a constant 5% drop chance:
<append xpath="/loot/lootcontainers/lootprobtemplates">
<lootprobtemplate name="myProbTemplate">
<loot level="1,999999" prob="0.05"/>
</lootprobtemplate>
</append>
<append xpath="/loot/lootcontainers/">
<lootcontainer id="900" count="1" size="6,2" sound_open="UseActions/open_backpack" sound_close="UseActions/close_backpack" open_time="1.5" loot_quality_template="qualBaseTemplate" loot_prob_template="myProbTemplate"> <!-- I'm pretty sure this will work here. note that the container IDs are fixed, so be careful not to overwrite one -->
<item name="myItem"/>
</lootcontainer>
That gives you a 5% drop chance any time that template is called, regardless of game stage. And creates a container that calls that probability template and drops one of the item myItem. If you wanted to have a zombie drop the item 5% of the time, you could either change the prob in the template to 1 and then modify entityclasses.xml to make the desired zombie drop a pack 5% of the time (<property name="LootDropProb" value=".05"/>, modify the LootDropEntityClass property to a new entity class name, then add that entity class in with a LootListOnDeath value of 900 (calling back to the lootcontainer ID).
-
There's probably a simpler way, and of course you can muck with the probabilities (zombie has 100% chance to drop a backpack with a 5% chance of having loot, etc.). And I'm not 100% on any of this, so ymmv. I welcome corrections.