Im doing another community patch update and considering to implement a quite major change in spellcasting selection and cast order
except many bugs Ive found out (these fixes will be included in next CP release):
- category 1 is substituted for 11 by GetCreatureTalent* functions and vice versa - seems hardcoded
- CountEnemies count dead PCs/henchmans
- DetermineclassToUse returns invalid class in some cases
- GetLastGenericSpellCast returns always -1 after a while (at least if creature is hasted)
Im planning to change the spell selection to GetCreatureTalentRandom instead of Best. But im not sure whether Im going on the right path. First I describe my results with one test subject:
Ive tried sorcerer lvl 20 with following spells:
- meteor swarm
- mantle
- power word kill
- horrid wilting
- sunburst
- premonition
- great thunderclap
- shadow shield
- chain lightning
- true seeing
- great dispelling
- firebrand
- mestills sheat
- isaac's lesser
- ice storm
- ii
- fireball
in 1.69, he is casting true seeing over and over or one particulare best offensive spell over and over until he lost whole spell level, then he choose different spell, plus he will loose the whole 9th level if his target has more than 100hp due to the way how AI works, well pointless to speak about, without my fixes sorcerers are almost unusable
after the fixes from CP and new fixes above, if he decide to cast offensive spell, first he choose meteor swarm as that is the best "discriminant harmful aoe" spell as it has CR 17. Next round, the first he find is again meteors but since he casted it previous round the AI moves to the next step and choose great thunderclap as best "indiscriminant aoe spell". Next round again meteor, again thunderclap unless Im struck by the spell and paralyzed/kded/deafened in that case it will use random discriminant spell (chain, horrid, meteor). After losing 9th level, he choose sunburst as first spell, after losing 7th level he choose Ice storm as best indiscriminant. After losing 8th lvl, he uses chain lighting as best discriminant and after losing 4th level he choose fireball as best indiscriminant.
Problem is that this is quite uneffective. His best spell is horrid wilting and he will use it only rarely (btw in 1.69 with this setup this spell is ignored completely). Imo spells are not comparable only by innate level. Also I dont know why the GetCreatureTalentBest function does return always sunburst when there is horrid with same category and innate level. Hardly best
'>
So I tried to use GetCreatureTalentRandom function instead. (btw builder can force this behavior already using variable "X2_SPELL_RANDOM" int 1)
Now he randomly uses those 4 discriminant spells he got: meteor, horrid, sunburst, chain - until he loose them all or the AI choose same spell twice in a row - in that case it moves to the indiscriminant where it randomly chooses thunderclap/ice storm/fireball.
This seems to me much better than default "best" method of choosing spells. It isnt perfect for sure as the ice storm is often better than discriminant spells, but its more random and efficient I think. Problem is that it changes the spell selection of all spellcaster in module, and it wont be in all cases improvement, as Wizards casting well already. It won't be worse but still...
Thougths? Suggestions?