Records of the Three Kingdoms
Zhong Hui, courtesy name Shiji, was from Changshe in Yingchuan, a son of Zhong Yao. Sima Zhao valued his learning. In 263, as general who guards the west, he led more than a hundred thousand men against Shu. He was the main force. Jiang Wei held Jian’ge, and for a time Zhong Hui could not break in. The surrender of Chengdu was made by Deng Ai’s side column.
After the conquest Zhong Hui resented that Deng Ai alone had the achievement and secretly accused him. Once Deng Ai was taken away, Zhong Hui entered Chengdu and planned with Jiang Wei to have the Wei officers rebel against Sima Zhao and to hold Shu himself. The officers and men would not. In the rising Zhong Hui was killed, and Jiang Wei with him.
Romance of the Three Kingdoms
The novel has him contend with Deng Ai for the credit, and has him and Jiang Wei use each other. Jiang Wei feigns surrender. Zhong Hui thinks he has the hearts of Shu. On the day of the mutiny both are killed.
The ambition is in the histories. What the novel adds is the long talk with Jiang Wei and one disordered night in Chengdu.
Reference: Wikipedia · Zhong Hui