How do you get a list of spells from a hero? You can do it like this:
for spellID = 1, 239 do
flag = KnowHeroSpell(heroname, spellID);
end;
But there's a problem: many numbers in this range are not spells, and if you pass them to the function, it will throw an error and the thread will die. And as I understand it, there's no way to catch the exception because pcall was removed from Lua.
Auto-translated