One of my favorite horror films. Very underappreciated movie. Excellent performances from George C Scott and Brad Dourif. You are correct this was based on author William Peter Blatty's sequel to The Exorcist called Legion. Blatty also directed it. Great movie.