Hello. I would like to implement the idea of elite squads without the involvement of an enemy hero.
The idea: on the map, there is a regular group of mixed mobs, which includes a leader stack that has a higher level than the rest of the units in the squad (Example: a squad of 100 skeleton warriors, 100 skeleton archers, and 40 archliches (leader)).
The point of the mod is that the battle ends in victory after the leader is killed, not the entire stack. Is it possible to implement this in the game without combat scripts? Because if it's done through scripts, it would involve giving the main hero the ability to track all the leader mobs I use on the map (and the map is large), which would mean that not only the squads in the desired battle would be tracked, but all of them – this is not an option, the map would be too large. How do I see it? When creating a mixed stack, add a specially trained checkbox that will indicate the "leader" of the squad, after which the battle will automatically end in victory.
You need to create a table that will contain pairs of "Script name of the mixed squad on the map" and "Leader ID". Attach a trigger to the interaction with this squad, after disabling the standard interaction. Upon touching the squad, set a GameVar, from which you pull the creature ID from the table (because we know the squad name, and we can pull this ID from the table). Then, collect data from the squad (what and how many creatures) and start the battle using startCombat, with an attached script. The script itself is not complex; it simply takes the recorded ID from GetGameVar and checks if these mobs have been killed, and if so, ends the battle. In the function that handles the result of the battle, you will need to check if your hero won, and remove the stack from the map if he did. That's the concept.
Будь яростней пред ночью всех ночей,
Не дай погаснуть свету своему!
Хоть мудрый знает – не осилишь тьму
Во мгле словами не зажжёшь лучей –
Не уходи безропотно во тьму.