Skip to content

Combat scripts and battle management.

User Avatar
#4
Auto-translated
RedHeavenHero
1-3) Most likely, it’s impossible.
Are there any ways to achieve similar effects without mods and combat scripts?
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...
RedHeavenHero

4) You can use the following construct:
repeat sleep() until combatReadyPerson()
, which will wait until someone’s turn comes.
Good method, thank you.
RedHeavenHero

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.
That is, you need to initially give the creature more mana and take it away after casting. But here, most likely, another problem will arise – the creature will roll back on the initiative order.
RedHeavenHero

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.
Here, I meant an additional shot per turn, i.e., not 2, but 3 shots at a time.
RedHeavenHero

7) You can emulate try using startThread and catch using errorHook. In the lualib library, I implemented the pcall function, which does approximately this.
I need to try it. Thank you.

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?
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира