Saṅgāmāvacara Jātaka (No.182)
The Bodhisatta was once a skilled elephant-trainer. The king, in whose service he was, attacked Bārāṇasī, riding the state elephant; but the elephant was so scared by the missiles and noise that he would not approach the place. Thereupon his trainer encouraged him, telling him that he should feel at home on the battlefield, and the elephant, impressed by his words, broke down all obstacles and achieved victory for his master.
The story was told in reference to the Buddha’s step-brother Nanda (q.v.), who, at first, kept the precepts of the Order, because the Buddha had promised to get for him the dove footed nymphs (kakuṭapādiniyo) of Sakka’s heaven; but later, moved by Sāriputta’s words, he put forth effort and attained Arahantship. Nanda was the elephant and Ānanda the king. J.ii.92‑5.