It's impossible to have a great movie without a great script. And often, great actors are able to take what's written and turn it into something even better. A lot of directors actually encourage their actors to ad-lib, since it can give a scene a better sense of authenticity.