I've been exploring Letum Frigus, Bradeline's Well, and Maenalus every turn in a constant cycle for maybe 200 turns now. Results have varied, but one thing that seems to stand out is that Rods of Wind were apparently mass-produced back in the Age of Magic. I've got something like a dozen of those, maybe half a dozen Timor Masks, a couple Rings of Kanna, and a single Jade Torc. Now, it's been far too long since I've done any modding or tweaking of my own, so I've forgotten where to look for the event code, but I'm wondering if there's something unusual going on or some kind of weighting for equipment finds where things that show up earlier in the list have a higher chance to be found.
The code for granting lair results like equipment is found in CustomFunction.py under def exploreLairBigGood(self, pCaster):, beginning around line 600.
The result chosen is determined around like 677. The equipment gifts are among those that work through the Goody system, requiring a result defined in CIV4GoodyInfo.xml. (You could technically make anything found in that file be revealed by exploring a goody hut.)
Where an item is placed on the list should not matter, as the whole list is composed before a (pseudo-)random number is generated based on the length of the list to select an item from the list.
I included checks that should prevent Kanna's Ring, the Rod of Winds, or the Spear of Majosi equipment from being added to the list to begin with if the item's unitclass has already been maxed out.
I however forgot to assign those unitclasses any <iMaxGlobalInstances>, which meant they could never be maxed out.
While correcting this just now, I realized that I added a "Shield of Balance" equipment to the game a long time ago but never made there be any way for it to actually appear in the game. I suppose I'll add it to the goody list now.
Assuage (Spirit III) doesn't remove Committed to the Asylum. It probably should.
I believe that it already does, but just is not well documented.
Because the DLL/xml schema only allow up to 3 promotions to be removed through a spell's xml defines, I had to resort to python.
In Python, the spell removes Crazed, Enraged, Burning Blood, Committed, and Rebellious. Only the first 3 of those are removed in python and so automatically listed in the 'pedia and mouse-overs.
I should probably update TXT_KEY_SPELL_ASSUAGE_HELP to clarify that the spell removes the other two too. It would look a little odd though for it to list 3 promotions to remove at the top and two at the bottom, as the range would automatically be placed after the automatically listed promotions before the custom stuff.
I could remove the XML effect as python can really handle all of it, but I believe that the AI players have a much better understanding of when to use spells if more of their effects are in XML.
Adventurers resetting via "Now for something completely different" allows infinite promotions for free, through Adept line free promotions combined with the upgrade discounts from both Adventurer and an attached Great Commander.
I like letting Adventurers get a huge number of free promotions, including the free promotions based on mana and those earned though experience even if unavailible to other unitcombat types. I have tried to remove the exploit of free promotion picks from upgrading, but that is really hard to do.
The process of upgrading a unit technically initializes a new unit (which gets its free promotions, free promotion picks, etc) before passing any information from the old unit, and then kills the old unit. There is not a special python handle that lets me run code after a unit has been upgraded and check for things like the Adventurer promotion. I can only check the new unit before the old data has been passed on.
Edit: Now that I think of it, it might be possible to add a few lines to the top of the Something Different effect which remove the free promotion picks when the unit does not have more xp than is required for a conventional level up. If I remember correctly, and I'm not sure I do, such a PythonPerTurn effect would be run automatically once the promotion is added to the new unit during its upgrade conversion.
Edit2: Well, that does not seem to work.
Adventurers resetting also removes Life III promotion, possibly because it thinks they're dying?
I have to remove immortality (including the Immortal or Life III promotions) in order to prevent adventurers from being duplicated in the process of being converted to a different unit type. I could add the promotions back later. That would make the code a little more complicated and the units even more overpowered. It may be an ok trade off if I get the free promotion picks removed though, as they would have to be removed even in cases where a normally upgrading unit would benefit from them.