In my experience, conversations with NPCs in games are always scripted. Natural-language parsing and sentence formation are difficult and mostly unsolved problems at this point, so we fake it.
To the extent that there's anything that could be called "AI" you can do one of two things, both of which still count as scripting in my book:
1) Flags. If the player has taken a certain action in the game, or earlier in the conversation, or whatever, then set a flag on the NPC that makes them treat the player differently. Think of every RPG you've ever seen where the palace guard tells you the princess has been kidnapped, until you bring her back, at which point he says something else.
2) Numeric ranges. The player has one or more numeric attributes. These might be global attributes (Karma in Fallout 3, Light/Dark side points in Knights of the Old Republic, etc.), or specific to that NPC or that NPC's faction (like your friendship/romance levels with other characters in The Sims). If your value is higher or lower than a certain threshold, the NPC treats you differently.