I suggest preparing your spells to avoid the encounters.
If they're predictable, that just makes it easy!