Well, in some fantasy worlds, a'mad king' might be a ruler who has been driven insane by power, magic, or some tragic event in his life. In the'mad king got story', this king could be the central character whose madness sets off a chain of events that form the story. For example, his madness could lead to wars, betrayals, or the downfall of his kingdom, all of which are elements that could make up the story.
Sansa Stark is frequently in these fanfictions. As someone who was a victim of Joffrey's cruelty, if he is in a time loop, Sansa might find herself in a different situation each time. Maybe in one loop Joffrey starts to treat her better, which would completely change her perspective and her own actions within the story. Also, Cersei Lannister could be involved. As Joffrey's mother, she would be very concerned about any changes in her son during the time loop and might try to interfere to keep things as she wants them.
The Night King was a powerful and terrifying figure in 'Game of Thrones'. He was the leader of the White Walkers. He was created by the Children of the Forest as a weapon against the First Men, but things got out of control. He had the ability to raise the dead, which made his army grow continuously. His goal seemed to be to bring an eternal winter to the world of Westeros.
I'm not entirely sure which specific 'got mad king story' you mean. There are numerous tales in history about kings going mad. For instance, in some fictional stories, a mad king might be one who rules tyrannically due to his mental instability. He could make irrational decisions like starting unjust wars or imposing cruel laws on his people.
In some fanfiction, it might be Varys. He was known for his intelligence network and his ability to work from the shadows. He could have seen Joffrey as a threat to the stability of the Seven Kingdoms. So, he arranged for the young king's death, perhaps thinking that a more malleable ruler could take his place and be more easily influenced to make better decisions for the realm.
In fanfic, the relationship between Joffrey and Sansa is often a complex and twisted one. Joffrey was cruel in the original story, but in some fanfics, writers might explore a different side of him in relation to Sansa. It could be an exploration of what might have been if Joffrey had not been so evil, perhaps delving into a more romantic or at least a more nuanced connection between them.
In a fanfiction, the lemon could play a magical role. Imagine Joffrey is cursed, and the only way to break the curse is through a lemon - related task. This could lead to a whole new side of Joffrey being explored as he has to rely on something as simple as a lemon to save himself.
In fanfiction, a smart Joffrey often has strategic thinking. He's able to plan ahead and manipulate situations to his advantage, much like a chess player. For example, he might outwit his enemies in court politics.
One key element could be the cause of the king's madness. It might be due to a genetic disorder, like in the case of some historical kings. Another element is the reaction of the court and the people. They might be in shock, or some might try to take advantage of the king's madness for their own gain.