Note: This mod is no longer needed, in fact using it will probably cause some weird issues. I've taken the mod down because of this.
Greetings,
For fun, I have created a mod that changes the way Imbue Champion/Make Spellcaster work.
Instead of costing 3 essence and giving 3 Essence to the Champion, the spells now cost 5 Essence and give Essence equal to the Champion's Wisdom score minus 3 on the first cast and 5 Essence for any additional casting on the same target.
What this means is that, generally, gaining a Champion and giving them Essence results in a net GAIN in Essence, rather than just spreading it around. At worst, you'd break even, as I don't think there are any Champions with Wisdom of less than 8.
Possible Problems:
-Is it Unbalanced? Eh, maybe. I was thinking of separating the Imbue Champion spell to its own spellbook and making it something you have to research rather than it being part of the Basic set of spells to balance it out a bit more. I could also reduce the amount of Essence it gives initially, but this plays into the next part:
-Wisdom is a hidden stat. You won't know how much Essence you'll gain until you cast the spell. If I reduce the Initial Essence gained, it would be possible to actually LOSE Essence from casting it on the wrong Champion. Given the hoops I already had to jump through to get this working (I'll get to that!), I might be able to make sure they always gain at least 5 essence, but... we'll see.
-While it appears Champions cannot cast Imbue Champion, I'm not so sure about the Sovereign's offspring... if they can, that will be a problem due to how I set up the conditions for the initial Essence boost. I'll have to test this out.
You can download the mod clicking the External Link thing above or by going here: http://www.box.net/shared/8agsox7amv
Now that I've explained what the mod does itself... let me explain a couple of things I ran into/discovered while making this mod:
Custom UnitStats - They work perfectly fine! You can hide them, show them, given the Default values, and use them in calculations without a hitch. I created a UnitStat (look in CoreUnitStats.xml for examples) and used it as a flag to determine if the new Imbue Champion spell had already been cast on a Champion.
Couple of Additional notes about the UnitStat properties:
Hidden - If set to 0, the stat will be visible in the Book Entry for NPCs you don't control, but it still won't show up for your own Champions...
Upgradeable - If set to 1, the stat WILL be visible for your own Champions in their Book Entry, BUT it will also show up in the Level Up screen as a choice... unless they have Essence, in which case it will be shunted off the bottom of the screen (which doesn't appear to have any scroll bars)
Conditional Calculations - Since you can create custom UnitStats and use them in Calculations, you can create quasi-conditional statements anywhere you can use the <Calculate> tag. You just have to set up the Calculations and the possible values of your flags carefully.
GameModifier/Calculations appear to work in the order they are defined - I ended up using three separate GameModifier tags to set up the new system: One to add the initial burst of Essence, one to give the 5 Essence afterwards, and a final one to make sure the flag for Receiving the Essence boost is set. Since I used that flag in the previous two GameModifier sections, there could have been unpredictable results if that last one got triggered first. Granted, this isn't something that wouldn't be expected, but... it's nice to know that you can depend on a given path for how the GameModifiers are triggered.
SetUnitStat does not work properly - At all. Seriously, look at this:
Code: xml
- <GameModifier InternalName="ClumiestPersonInTheWorld">
- <ModType>Unit</ModType>
- <Attribute>SetUnitStat</Attribute>
- <StrVal>UnitStat_Dexeterity</StrVal>
-
- <Value>1.0</Value>
-
- </GameModifier>
You'd think this code would set the target's Dexterity to 1, but instead it will actually DOUBLE the unit's Dexterity and then add 1 to that. Cast it on someone with 10 Dexterity, and they'll get a Dexterity of 21. Weird, eh?
This code will actually set the target's Dexterity to 1:
Code: xml
- <GameModifier InternalName="ClumiestPersonInTheWorld">
- <ModType>Unit</ModType>
- <Attribute>SetUnitStat</Attribute>
- <StrVal>UnitStat_Dexeterity</StrVal>
-
- <Calculate InternalName="CancelOutDoublingAndBaseStat" ValueOwner="TargetUnit">
- <Expression><![CDATA[[UnitStat_Dexterity] * -2.0]]></Expression>
- </Calculate>
-
- <Calculate InternalName="Value">
- <Expression><![CDATA[[CancelOutDoublingAndBaseStat] + 1]]></Expression>
- </Calculate>
- </GameModifier>
Not exactly the most intuitive thing in the world. Granted, this is definitely a bug, but it's one that drove me a little crazy 
Side Note: This actually means the Slow spell (which is where I pulled the SetUnitStat attribute from...) should actually double a unit's Combat Speed and add +1 to it, rather than the intended effect. I haven't actually tested this, so... maybe the SetUnitStat attribute actually works in Tactical Battles? Doubt it, but... you never know...
Anyway, that's about it for what I did with the mod. There are additional comments in the *.xml files themselves, if you are really curious about how I set up the calculations. If you have any questions, comments, or run into any Bugs, let me know!