Skip to content

Scripts for beginners.

User Avatar
#328
Auto-translated
}{0TT@6bI4
StartCombat("ourHeroName", "enemyNameOrNil, numberOfUnits, id1, count1, ..., idN, countN, script, callback, arena, autobattle)

If any parameter is unclear or unnecessary, you can use nil. For example, a battle without a hero against a unit of swordsmen and archers is described as follows:

StartCombat("Hero", nil, 2, CREATURE_SWORDSMAN, 10, CREATURE_ARCHER, 17)
Now, let me explain what's going on. After capturing a certain town, a cutscene is played. Then, a scripted battle begins on a custom arena. After the battle, another cutscene is played. I implemented this as follows:
function CaptureTown() 
RazeTown("Haven")
sleep(2)
StartDialogScene("DialogScenes/S9/DialogScene.xdb#xpointer(/DialogScene)")
sleep(2)
StartCombat("HafadNecro", "Melhior", 4, 13, 22, 14, 22, 13, 22, 14, 22, MyScript, nil, MyArena, DisableAutobattle)



Added 3 minutes ago
But how do I start a battle on my arena, with my battle script and autobattle disabled?

Мои карты:
Падший рыцарь
Сердце Хаоса

Мои моды:
Визуальные:
Изменение внешнего вида героев-некромантов
Существа-жители и кое-что по мелочи в городах Ордена Порядка, Некрополиса и Инферно

NCF-существа:
Странствующие рыцари
Наемники