Skip to content

Scripts for beginners.

User Avatar
#250
Auto-translated

Syryus
Another related question – how can I add a feature so that the trigger resets after a specific player loses?

after losing specifically in this battle? Here's how you can do it:
preserve_heroes={"Elleshar", "Linaas", "Gillion", "Diraya", "Itil", "Ossir", "Nadaur"}
function Def( heroName )
if not contains(preserve_heroes, heroName) then
local owner = GetObjectOwner(heroName)
local fight_id = GetLastSavedCombatIndex()
StartCombat(heroName, "Metlirn",7,44,24,146,80,148,16,147,48,50,16,48,48,44,24)
while GetLastSavedCombatIndex() == fight_id do
sleep()
end
if not IsHeroAlive(heroName) and owner == player_number then
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "def", nil)
end
end;
end;
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "def", "Def" );
Нет войне.