Could you please provide information on how to define a condition that triggers when a unit or an enemy hero is defeated?
if GetSavedCombatArmyHero(a1,0)=="Giovanni" then
Loose();
end;
if (GetSavedCombatArmyHero(a1,1)=="Giovanni") and (GetSavedCombatArmyHero(a1,0)=="Zehir") then
MessageBox(GetMapDataPath().."talk_of_grigorio_6.txt");
SetObjectiveState("kill_pl5", OBJECTIVE_COMPLETED, PLAYER_1 );
SetPlayerResource(PLAYER_1 ,GOLD, GetPlayerResource(PLAYER_1 , GOLD)+20000);
end;if flag_bad_grig==1 then
if (GetSavedCombatArmyHero(a1,1)=="Giovanni") and (GetSavedCombatArmyHero(a1,0)=="Duncan") then
SetObjectiveState("kill_pl6", OBJECTIVE_COMPLETED, PLAYER_1 );
MessageBox(GetMapDataPath().."talk_of_grigorio_5.txt");
SetObjectEnabled("portal1", true);
end;
else
if (GetSavedCombatArmyHero(a1,1)=="Giovanni") and (flag_britt==1) then
count_stacks = GetSavedCombatArmyCreaturesCount(a1,0);
for i=0,count_stacks-1 do
cr, numer, dead = GetSavedCombatArmyCreatureInfo(a1,0,i);
if cr==cr_ded then
Strelki_dead= Strelki_dead + dead;
end;
end;
Here are some code examples. If you understand them, you'll get it; if not, ask for an explanation.This is a specific example where one hero defeats another, or a unit is destroyed, and their numbers are tallied.
Or do you need it to account for any enemy death?
Then, here's:
Procedure call format:
void sProc( sHeroName )
Stop:
Trigger(PLAYER_REMOVE_HERO_TRIGGER, nPlayerID, nil)
The procedure is called when player nPlayerID loses a hero. The name of this hero is passed to the procedure as a parameter.
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...