Complex sentence: Shalya was commander-in-chief on the last day of the war and near the end of the battle he was killed by Yudhishtira in spear-combat.
Split into simpler sentences: Shalya was commander-in-chief on the last day of the war. Near the end of the battle, he was killed by Yudhishtira in spear-combat.