The story is centered around an uneducated street urchin Wei Xiaobao, who was born and raised in a brothel by his mother. Through a series of misadventures, he managed to make his way from the southern playground of Yangzhou to Beijing, the seat of Manchu imperial power, and bumbling accidentally into a fateful encounter with the young Kangxi Emperor. By hook or by crook, but also through a genuine concern and fierce loyalty towards Kangxi, Wei Xiaobao found himself in the greatest of confidences and a complicated friendship of one of the most eminent monarchs of Chinese history.
The plot follows Wei on a rags to riches journey as he becomes embroiled in political and court intrigues, overcoming enemies for Kangxi and accomplishing amazing achievements. Along the way, Wei meets with and successfully woos seven beautiful women, climbs his way up the social ladder from brothel boy to great lord and nobleman, acquiring titles such as Imperial Emissary and Plenipotentiary, Ambassador, general and admiral - courtesy of Kangxi - as well as finding himself in positions completely at odds with the above: Green Wood Lodge Master of the Heaven and Earth Society, and White Dragon Marshal of the Mystic Dragon Cult.
In the end, however, Wei Xiaobao could not reconcile his two separate lives - as an anti-Qing rebel and Kangxi's devoted courtier. He chose to offer up his own life- in return for Kangxi's munificence towards him and also as an honourable way out of the Heaven and Earth Society. Pained and aggrieved beyond words, Kangxi orders the execution of his one and only true friend. Afterwards, plagued by loss and guilt, Kangxi took a long walk along the Great Wall, asking heaven for guidance - only to be happily surprised by the appearance of Wei Xiaobao, who didn't die after all. After saving his mate's life once again, Wei bades goodbye to Kangxi, reaffirming their friendship which will, from that point onwards, remain only in the minds and memories of the two men.