Where did the "arrow in the knee" joke start?
For that kind of Meme, you can find every information you need on knowyourmeme.com:
In The Elder Scrolls V: Skyrim, the town guard non-player characters (NPCs) have several stock lines they will repeat when the player walks near them, including a bewildered statement about “curved swords”, a patronizing statement about “sweetroll” theft, and the melancholy confession “I used to be an adventurer like you, then I took an arrow in the knee.” The restating of such a specific story over and over again by so many different guards caused it to be noticed by players, who then proceeded to post about it in gaming forums and image boards. Along with the game itself, the video below helps give the idea that almost every guard in Skyrim became a guard due to the life altering results of receiving an arrow to the knee.
Source: http://knowyourmeme.com/memes/i-took-an-arrow-in-the-knee
So you were right: that's a NPC quote (and it doesn't come from older versions).
The joke itself is from Skyrim, not a previous game. According to Know Your Meme:
In The Elder Scrolls V: Skyrim, the town guard non-player characters (NPCs) have several stock lines they will repeat when the player walks near them, including a bewildered statement about “curved swords”, a patronizing statement about “sweetroll” theft, and the melancholy confession “I used to be an adventurer like you, then I took an arrow in the knee.”
The joke itself was spread on Reddit:
On November 18th, 2011, a thread reached the frontpage of the r/skyrim subreddit, titled “‘I was an adventurer too, until I took an arrow to the knee.’
One reason I read about is that in former Elder Scrolls games, one of the armor pieces were greaves, which protected the knee. In Skryim, there are no greaves.