This is actually an old post for WoM, but I'll quote it completely here:
"My question stems from experience with Heroes of Might and Magic 3. On the highest difficulty level the AI players got immense bonuses and some scenarios were nearly impossible to defeat because of their resource advantage. However, once the player got access to certain spells, the game became a cakewalk. The AI clearly didn't take them into account.
One such spell was dimension door. With it, the player could teleport an army a short distance. One near impossible scenario had a city that had to be conquered. The city was occupied by a huge army. I positioned my own small forces behind a mountain. The AI calculated that there was no way I could reach the city in a single turn and moved it's army out. Next turn a cast Dimension door to teleport my army next to the city and conquered it.
In a screenshot, I've seen a "Teleport into friendly territory" spell and in another thread Frogboy mentioned an AI function "How many armies threaten this area" or something like that. It was like a flashback to a time of total AI failure.
That is why I ask, how will the AI cope with player magic? Will it even try to guess the extent of player's spell effects? Will it "remember" which spells a player has cast and therefore has access to? Will it just have automatic knowledge of all the spells a player can cast? Or ultimately, will it be as ignorant as the HoMM AI?"