Скрипт:
w = "Maps/SingleMissions/The Dragons City/"
eh1p = 0
eh2p = 0
eh3p = 0
fac = random(4,5);
eac = random(20, 30);
SetObjectEnabled("eh1",false);
SetObjectEnabled("eh2",false);
SetObjectEnabled("eh3",false);
function AddCreatures(x)
local tmp = GetPlayerHeroes(GetCurrentPlayer());
for i = 0, length(tmp)-1 do
AddHeroCreatures(tmp[i],x,1000);
end;
if length(tmp) > 0 then print("done"); sleep(5); end;
end;
function CheatsGuide()
print("@AddCreatures(xCreatureID) - добавляет 1000 заданных существ");
sleep(5);
end;
function complete()
SetObjectiveState("obj",OBJECTIVE_COMPLETED);
BlockGame();
sleep(5);
Win();
UnblockGame();
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"target","complete");
function EHR()
if GetDate(DAY_OF_WEEK) == 1 then
eh1p = 0
eh2p = 0
eh3p = 0
sleep(5);
end;
end;
Trigger(NEW_DAY_TRIGGER,"EHR");
function eh1F(heroname) -- та самая 46 строка
if eh1p == 0 then
eh1p = 1
AddHeroCreatures(heroname,91,fac);
AddHeroCreatures(heroname,85,eac);
AddHeroCreatures(heroname,86,eac);
AddHeroCreatures(heroname,87,eac);
AddHeroCreatures(heroname,88,eac);
ShowFlyingSign(w.."ehe.txt");
sleep(5);
end;
else -- 57 строка
MessageBox(w.."ehp.txt");
end;
end;
function eh2F(heroname)
if eh2p == 0 then
eh2p = 1
AddHeroCreatures(heroname,91,fac);
AddHeroCreatures(heroname,85,eac);
AddHeroCreatures(heroname,86,eac);
AddHeroCreatures(heroname,87,eac);
AddHeroCreatures(heroname,88,eac);
ShowFlyingSign(w.."ehe.txt");
sleep(5);
end;
else
MessageBox(w.."ehp.txt");
end;
end;
function eh3F(heroname)
if eh3p == 0 then
eh3p = 1
AddHeroCreatures(heroname,91,fac);
AddHeroCreatures(heroname,85,eac);
AddHeroCreatures(heroname,86,eac);
AddHeroCreatures(heroname,87,eac);
AddHeroCreatures(heroname,88,eac);
ShowFlyingSign(w.."ehe.txt");
sleep(5);
end;
else
MessageBox(w.."ehp.txt");
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER,"eh1","eh1F");
Trigger(OBJECT_TOUCH_TRIGGER,"eh1","eh1F");
Trigger(OBJECT_TOUCH_TRIGGER,"eh1","eh1F");
Это как