Форум HeroesWorld-а - Показать сообщение отдельно - Скрипты
Тема: Скрипты
Показать сообщение отдельно
#1181
Старый 19.04.2013, 16:12
  #1181
^
Warrior777
 
Аватар для Warrior777
📖
Регистрация: 15.09.2012
Адрес: Под кроватью
Сообщения: 602
Регистрация: 15.09.2012
Адрес: Под кроватью
Сообщения: 602
По умолчанию
Re: Скрипты

	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);
__________________
502 Bad Gateway

__________________________________

nginx/0.8.54
502 Bad Gateway

__________________________________

nginx/0.8.54
Warrior777 вне форума
Ответить с цитированием