PC [BUG] Found out why lead rods drop so much, may be a code typo

Angela Ranna

Greenhorn
I was digging around in the code to develop my mod and wanted to check whether there was anything else that could drop weapons besides the crate loot table mentioned on the wiki's Modding:Weapon_Data (Utility.getUncommonItemForThisMineLevel) to explain how some things like Wicked Kris are dropped even though they don't seem to be enabled in weapons.json. I found that a different function is used for special monster drops, but the logic of that function seems to have a problem.

In MineShaft.cs::getSpecialItemForThisMineLevel, there's a big if/else switch that determines what drops when a special enemy drop event happens (like killing a slime with a star on its head). This if/else switch goes like this:
if (level < 20)
if (level < 40)
if (level < 60)
if (level < 160)
if (level < 100)
...(other cases)

That second to last one, level < 160, is short circuiting all the cases below it. So from mines level 60 to skull cavern level 39 this is the only case that is hit. This case chooses between 3 weapons, 2 boots, and 2 rings to drop, but all 3 weapons are lead rods. This probably was meant to be level < 80? Also, it might be a good thing to add a couple more weapons to that drop list for variety's sake and so the boots and rings on that drop table aren't as scarce, or make it a random of 5 values instead of a random of 7 and remove 2 cases of lead rod.
 
Top