Auto-translated
What about linking a battle script to a hero? The thing is, I would like to be able to hire such a hero, say, in a tavern, but in this case, he appears on the map without the linked script and loses his functions.
Is there a function that, if such a hero appears on the map, automatically links the battle script to him? Or is there another way?
SetHeroCombatScript(heroname, script)
I already described it in the neighboring topic:
it is done by adding a few lines of script to the 'combat-common.lua' file - this file is launched by the game when any battle starts.