SetRegionBlocked("Block1", true, 2);
SetRegionBlocked("Block2", true, 2);
SetObjectiveVisible("killall", nil);
function am()
local old = 8
while 1 do
local count = 0
for i=36,43 do
count = count + (HasArtefact("Muscip", i) or 0)
end
if count ~= old then
if old == 8 then
SetObjectiveState("obj", OBJECTIVE_ACTIVE);
end
if count == 8 then
SetObjectiveState("obj", OBJECTIVE_COMPLETED);
else
SetObjectiveProgress('obj', count);
end;
old = count
end;
sleep(5);
end;
end;
function killallactive()
SetObjectiveVisible("killall", true);
startThread (am);
end;
function winF()
Win();
end;
function obj()
local old = 0
while 1 do
local count = 0
for i=36,43 do
count = count + (HasArtefact("Muscip", i) or 0)
end
if count == 8 then
print("Player 1 has all artifacts");
SetObjectiveState("obj", OBJECTIVE_COMPLETED);
QuestionBox(GetMapDataPath().."complete-game.txt", "killallactive", "winF");
break
end
if count ~= old then
print("Player 1 has "..count.."/8 artifacts");
SetObjectiveProgress("obj", count);
old = count
end
sleep(5);
end;
end;
startThread (obj);