Auto-translated
Okay, out of the first batch, everything worked except for the AI attractor. They run wherever they want.
And, before the battle starts, a message should pop up?
function show_mes(hero)
if hero=="EnemyHero" then
MessageBox(GetMapDataPath().."mes.txt");
end;
end;
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,"town","show_mes");
I also need this: you approach a unit, a message pops up, the unit disappears from the map, and troops are added to your army. + collect groups of creatures from the map.
if hero=="YourHero" then
MessageBox(GetMapDataPath().."mes2.txt");
AddHeroCreatures("YourHero",CR_ID,QUANTITY);
k=k+1;
if k==n then --number of creatures to collect
SetObjectiveState("Obj",OBJECTIVE_COMPLETED);
end;
end;
end;
SetObjectEnabled("monster",nil);
Trigger(OBJECT_TOUCH_TRIGGER,"monster","Add");
Second: you defeat a monster and a message pops up.
Just so that it appears and is marked as completed after the trigger with the video in the previous part.
SetObjectiveState("PrimObj0",OBJECTIVE_ACTIVE);--appearance
kill an enemy hero