thorin removed all of his armor before he went to join the battle because he had a death wish

he asked the Company, “will you follow me one last time?” because he did not intend to survive the battle and if he did survive he knew he would never be king under the mountain because the dragon sickness would have driven him mad

when bilbo appears on raven hill, reason returns to thorin and he wants them all to live to fight another day - bilbo’s presence reversed his death wish

he smiles warmly at bilbo when he says, “go back to your armchair and your books; plant your trees, watch them grow” and he is literally dying happy thinking of bilbo doing these things