The language of ToME4.
Some of the documentation for T-Engine 4 can be found here: http://te4.org/docs/t-engine4/1.2.3/index.html
Here are some helpful links to learn Lua:
- "The Crash Course to Lua", courtesy of The.Lua.Tutorial
- The lua-users wiki
- Lua 5.1 Reference Manual (available in print and online)
- Programming in Lua (links to both print and online versions; the online version is outdated but still useful)
- http://lua.gts-stolberg.de/en/index.php (possibly outdated but this is an amazing resource, especially for beginners, I wish I would have known about it two years ago)
- Learn Lua in 15 Minutes
When learning Lua, it helps to have a Lua environment to play around in. repl.it provides an online environment where you can type Lua commands and see their results.
Once you know the basics of Lua you can start looking at the code of ToME4 and try to understand it, making small edits and observing if they do what you expect them to do to further increase your understanding.
Some comments on the talent code can also be found on this page.