Title: Lonely Mountain
Content:  as recompense for the destruction. Thorin, mad with greed, refused all claims and sent word to his second cousin Dáin II Ironfoot, chief of the Dwarves of the Iron Hills, who brought reinforcements to the aid of Thorin and Company. However before any battle began, an army of Orcs and Wargs descended on Erebor. Dwarves, Elves, and Men joined ranks against them, which led to the Battle of Five Armies. During this battle, Thorin's nephews Fíli and Kíli were killed, and Thorin himself was mortally injured; he died shortly afterwards. The title of King under the Mountain passed to Dáin.
Title: Thorin Oakenshield
Content:  men, and elves was averted only by an invasion of goblins and wargs, whereupon the Dwarves joined forces with the wood-elves, the men of Lake-town, and the great eagles in the Battle of Five Armies. During the battle, Thorin was mortally wounded, but he made his peace with Bilbo before he died. When Thorin died, he was buried with the Arkenstone, and Orcrist was returned and laid upon his tomb. The blade would glow blue should Orcs approach, and they could thus not take the Mountain by surprise. Thorin was succeeded as leader of Durin's Folk by his cousin Dáin.
Title: Thorin Oakenshield
Content:  Thorin Oakenshield is a fictional character in J. R. R. Tolkien's 1937 novel The Hobbit. Thorin is the leader of the Company of Dwarves who aim to reclaim the Lonely Mountain from Smaug the dragon. He is the son of Thráin II, grandson of Thrór, and becomes King of Durin's Folk during their exile from Erebor. Thorin's background is further elaborated in Appendix A of Tolkien's 1955 novel The Return of the King, and in Unfinished Tales. Commentators have noted that Thorin is Old Norse both in name and character, being surly, illiberal, independent, proud, aristocratic, and like all Dwarves greedy for gold. Tolkien was a Roman Catholic; from a Christian perspective, Thorin exemplifies the deadly sin of avarice, but is able to free himself from it at the time of his death. This deathbed conversion has been compared to the moral transformation of Ebenezer Scrooge in Charles Dickens's A Christmas Carol. Thorin appears in Peter Jackson's The Hobbit film series, in the Rankin/Bass animated version, and in the 1982 game of the same name.
Title: Lonely Mountain
Content:  Erebor became the home of the Folk of Durin, a clan of Dwarves known as the Longbeards, after they were driven from their ancestral home of Khazad-dûm. In the latter days of the Third Age, this Kingdom under the Mountain held one of the largest dwarvish treasure hoards in Middle-earth. Dale, a town of Men built between the two southern spurs of Erebor, grew in harmony with the dwarves. The Kingdom under the Mountain was founded by Thráin I the Old, who discovered the Arkenstone there. His son, Thorin I, left the mountain with much of the Folk of Durin to live in the Ered Mithrin (Grey Mountains) on account of the great riches to be found in that range. After dragons plundered their hoards, the Longbeards, led now by Thrór, a descendant of Thorin, returned to Erebor to take up the title King under the Mountain. Under Thrór's reign, Erebor became a great stronghold where the dwarves became numerous and prosperous, well known for the making of matchless weapons and armour.
Title: Thorin Oakenshield
Content:  and organised the company's escape, floating in barrels out of the wood-elves' fastness. Thorin was the first to emerge from the barrels at Lake-town, marching up to the leaders of the town, declaring himself as King Under the Mountain. With provisions from Lake-town, Thorin led the company to Erebor. Seeing that Smaug was not there, the Dwarves reclaimed some of the treasure; Thorin gave Bilbo "a small coat of mail" made of mithril as the first instalment of his payment. The Dwarves then learnt from the ancient raven Roäc that Smaug had been killed: Bard the Bowman had managed to 
Title: Éomer
Content:   Éomer is the son of Théodwyn and Éomund. After their parents' death Éomer and his sister Éowyn were adopted by their uncle Théoden, king of the Rohirrim. He is the leader of the forces of Rohan who attack and kill the Uruk-hai who had kidnapped the hobbits Merry Brandybuck and Pippin Took. Against orders, impressed by Aragorn, he helps Aragorn, Gimli and Legolas by lending them horses and guiding them to where the attack had taken place. On his return to Edoras, Éomer reports this meeting to Théoden, and is imprisoned on the orders of Gríma Wormtongue, Théoden's sinister advisor. Aragorn, Gimli and Legolas arrive in Edoras with 
Title: Éomer
Content:  of Rohan with his dying breath. Seeing Éowyn seemingly dead on the battlefield, Éomer throws himself and the remaining Rohirrim at the enemy. Aragorn arrives unexpectedly from Pelargir, and joins forces with Éomer, fulfilling his prediction that they would meet in the midst of their enemies. They rout the Orcs and win the battle. Éomer accompanies Aragorn to the Gates of Mordor for the final stand against Sauron, the Battle of the Morannon. This distracts Sauron long enough for the One Ring to be destroyed in Mount Doom, causing his immediate downfall. Théoden is taken back to Edoras to be buried, and Éomer becomes King of the Mark.
Title: Lonely Mountain
Content:  an emissary from Sauron, the lord of Mordor, twice came to Erebor and spoke to Dáin Ironfoot, who was still King under the Mountain. The messenger asked for assistance in finding Bilbo Baggins and retrieving a stolen ring, and in return offered Moria and three of the seven Dwarf rings to Dáin, but he said neither Yea or Nay. Sauron's northern army, which included many Easterlings, then attacked; Dale was overrun, and many Dwarves and Men took refuge in Erebor, which was promptly surrounded. Dáin was killed before the gates of Erebor defending the body of his fallen ally King Brand of Dale. Dáin's son Thorin III Stonehelm and King Bard II withstood the siege and routed Sauron's forces.
Title: History of Arda
Content:  Orcs. There were minor skirmishes with Umbar. In the north, Arnor was long gone, but the Hobbits of the Shire prospered, getting their first Took Thain, and colonizing Buckland. The Dwarves of Durin's folk under Thorin I abandoned Erebor, and left for the Grey Mountains, where most of their kin now gathered. Meanwhile, Sauron created a strong alliance between the tribes of Easterlings, so that when he returned he had many Men in his service. The main events of The Hobbit occur in T.A. 2941. By the time of The Lord of the Rings, Sauron had recovered, and was seeking the One Ring. The events 
Title: Faramir
Content:  Minas Ithil, that Sauron had taken) of evil remnants. Faramir also fulfilled the traditional role of Steward, acting as the King’s chief counsellor and ruling Gondor in his absence. With Éowyn, he settled in Emyn Arnen, where the two had a son named Elboron. After Faramir’s death at the age of 120, his son succeeded him in all of his titles. Barahir, Faramir's grandson, wrote The Tale of Aragorn and Arwen, which was inserted (in an abbreviated form) in the Thain's Book by the writer Findegil, and appears in The Lord of the Rings as part of Appendix A.

Question: who became king of erebor after thorin dies?
Answer: Dáin.
his cousin Dáin.