1-3) Most likely, it’s impossible.
One of the possible, albeit crude, methods, as I think, is to give the hero the corresponding artifact at the beginning of the battle and take it away at the end, but this probably won’t work if the hero already has an item in that artifact slot...
4) You can use the following construct:, which will wait until someone’s turn comes.repeat sleep() until combatReadyPerson()
5) Creatures can cast spells that they don’t know, including creatures that can’t cast spells at all. However, they must have enough mana for this spell.
6) Most likely, no. But the ballista still has infinite shots: after reaching 0, it will continue to fire, and the shots will become negative.
7) You can emulate try using startThread and catch using errorHook. In the lualib library, I implemented the pcall function, which does approximately this.
Added 5 minutes ago
Another question:
I wanted to implement a “rollback” of the hero after casting using combat scripts, making it 20% less (i.e., to position 0.2 on the initiative order instead of 0). It will work normally in the usual case, but what if the hero has Wizard skills? In this case, simply setting the initiative order position will no longer work correctly, and I need to calculate all the hero’s and his opponent’s skills?
Пробуждение зла
Нашествие из Преисподней
Смена эпох
Скачать все кампании одним архивом: Яндекс.Диск Google.Диск
You can download the set of 3 Campaigns (English version) here
Одиночные сценарии Heroes V 3.1:
Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы
Мультиплеерные карты для Heroes V 3.1:
Легендарная война
Сердце вулкана
Передел мира