So, basically, this thread is going to be about moving ALL the fightmodes' enemy targeting into IsEnemy, instead of only the 'aggressive' AIs, while others currently use a nest in AcquireFocusMob, which can cause issues when one is dealing with a non-AcquireFocusMob source using IsEnemy with a non-aggressive FightMode.

Also, adding an IsHostile method to BaseCreature below IsEnemy. These two methods could then be used for any AI or spell targeting for the purposes of AOE attacks, instead of the somewhat kludgey way it is done now. It will pretty much just be a duplicate of the one in BaseAI.

Finally, separating the AI methods of wild creatures and pets. Controlled creatures should be using ONLY DoOrder methods, and wild creatures should be the only ones using DoAction methods. However, pets are currently referencing the DoAction methods, and it causes some AI oddities.

I believe I've finally gotten how I shall do the expansion of IsEnemy done, just needing to make sure it's done with current code. Plus a note that the AI should always use a creature's FightMode for acqType in AcquireFocusMob, because IsEnemy always uses FightMode.
 
Here's the pull and branch for moving the non-aggressive stuff into IsEnemy. Adds fixes and homogenization for the fightmodes, including proper summon aggro, non-agro fightmodes attacking opposition/tribal enemies, and non-agro fightmodes using XML attachments if available. Also added a note to not use acquire types different from creature's fightmode for enemies, as it causes weird effects. None are used this way in default code.
 
Back