Background. Local infiltration analgesia (LIA) provides postoperative analgesia for total knee arthroplasty (TKA). The purpose of this study was to evaluate the analgesic effect of a cocktail of ropivacaine, morphine, and Diprospan for TKA. Methods. A total of 100 patients from September 2018 to February 2019 were randomized into 2 groups. Group A (control group, 50 patients) received LIA of ropivacaine alone (80 ml, 0.25% ropivacaine). Group B (LIA group, 50 patients) received an LIA cocktail of ropivacaine, morphine, and Diprospan (80 ml, 0.25% ropivacaine, 0.125 mg/ml morphine, and 62.5 μg/ml compound betamethasone). The primary outcomes were the levels of inflammatory markers C-reactive protein (CRP) and interleukin-6 (IL-6), pain visual analog scale (VAS) scores, opioid consumption, range of motion (ROM), functional tests, and sleeping quality. The secondary outcomes were adverse events, satisfaction rates, HSS scores, and SF-12 scores. The longest follow-up was 2 years. Results. The two groups showed no differences in terms of characteristics (P > 0.05). Group B had lower resting VAS pain scores (1.54 ± 0.60, 95% CI = 1.37 to 1.70 vs. 2.00 ± 0.63, 95% CI = 2.05 to 2.34) and active VAS pain scores (2.64 ± 0.62, 95% CI = 2.46 to 2.81 vs. 3.16 ± 0.75, 95% CI = 2.95 to 3.36) within 48 h postoperatively than Group A (P<0.001), while none of the pain differences exceeded the minimal clinically important difference (MCID). Group B had significantly lower CRP levels (59.49 ± 13.01, 95% CI = 55.88 to 63.09 vs. 65.95 ± 14.41, 95% CI = 61.95 to 69.94) and IL-6 levels (44.11 ± 13.67, 95% CI = 40.32 to 47.89 vs. 60.72 ± 15.49, 95% CI = 56.42 to 65.01), lower opioid consumption (7.60 ± 11.10, 95% CI = 4.52 to 10.67 vs. 13.80 ± 14.68, 95% CI = 9.73 to 17.86), better ROM (110.20 ± 10.46, 95% CI = 107.30 to 113.09 vs. 105.30 ± 10.02, 95% CI = 102.52 to 108.07), better sleep quality (3.40 ± 1.03, 95% CI = 3.11 to 3.68 vs. 4.20 ± 1.06, 95% CI = 3.90 to 4.49), and higher satisfaction rates than Group A within 48 h postoperatively (P < 0.05). Adverse events, HSS scores, and SF-12 scores were not significantly different within 2 years postoperatively. Conclusions. A cocktail of ropivacaine, morphine, and Diprospan prolongs the analgesic effect up to 48 h postoperatively. Although the small statistical benefit may not result in MCID, the LIA cocktail still reduces opioid consumption, results in better sleeping quality and faster rehabilitation, and does not increase adverse events. Therefore, cocktails of ropivacaine, morphine, and Diprospan have good application value for pain control in TKA. This trial is registered with ChiCTR1800018372.