In Shakespeare's Richard III, eleven ghosts appear in both Richard and Richmond's dreams the night before the battle. Each one of the ghosts had been murdered by Richard: Prince Edward, King Henry VI, Clarence, Rivers, Gray, Vaughan, the two princes who Richard murdered, Hastings, Lady Anne, and Buckingham. They appear first in Richard's dream to tell him to "despair and die," and then move to Richmond's dream to encourage him and promise him he will rule England.
The ghosts appear in order to force Richard to examine his own choices, and foreshadow his downfall and Richmond's success. Richard's introspection causes him to realize that he is a murderer and examine what he truly fears and loves; he concludes that he is afraid and cannot love himself. When Richard and Richmond meet and duel the next day, the ghosts' predictions are proven correct as Richard is killed and Richmond is granted the crown. Richmond becomes King Henry VII and ends the war by granting Richard's men amnesty.