Conversation so far:
Who is the story based on?
Wenceslas' death, four biographies of him were in circulation.
These hagiographies had a powerful influence on the High Middle Ages conceptualization of the rex iustus, or "righteous king.
When was the legend created?
CANNOTANSWER.
What did the righteous king do?
a monarch whose power stems mainly from his great piety, as well as from his princely vigor.

Question: where did this king live?
Self-contained rewrite: where did King Wenceslas live?