// 遗忘之谷
int Rule = 1;
int RoundTime = 99;
int PlayerSpawn = 36;
int PlayerSpawnDir = 270;
int PlayerWeapon = 18;
int PlayerWeapon2 = 1;
int PlayerHP = 5000;

int trg0 = 0;
int timer1 = 0;
int gameover = 0;

OnStart()
{
	AddNPC("npc+34+01");
	AddNPC("npc+34+02");
	AddNPC("npc+34+03");
	AddNPC("npc+34+04");
	AddNPC("npc+34+05");
	AddNPC("npc+34+06");
	AddNPC("npc+34+07");
	AddNPC("npc+34+08");
	AddNPC("npc+34+09");
	AddNPC("npc+34+10");
}

OnUpdate()
{
	int player = GetAnyChar("player");
	if (player < 0)
	{
		return 0;
	}
	if (gameover == 2)
	{
		return 0;
	}
	
	int c;
	int c2;
	int c3;
	int c4;
	int c5;
	int c6;
	int c7;
	int c8;
	int c9;
	int c10;
	int now = GetGameTime();

	if (trg0 == 0)
	{
		c = GetChar("张剑熹");
		if (c>=0)
		{
			Perform(c, "say", "大概是你知道的东西太多了吧");
			Perform(c, "pause", 2);
			Perform(c, "say", "我只是执行命令罢了");
			Perform(c, "pause", 2);
			Perform(c, "say", "我怎么知道");
			Perform(c, "pause", 5);
			Perform(c, "say", "否则我们是没有把握将击败封宙的人一下杀死的");
			Perform(c, "pause", 3);
			Perform(c, "say", "没什么意思,只有这样你才会乖乖的出现在我们面前");
			Perform(c, "pause", 14);
			Perform(c, "say", "停，这不是耿佳峰大人嘛");
			Perform(c, "faceto", player);

			c2 = GetChar("张天岳");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}
			c2 = GetChar("商倩");
			if (c2 >= 0)
			{
				Perform(c2, "pause", 20);
				Perform(c2, "say", "被他们抓走了");
				Perform(c2, "pause", 4);
				Perform(c2, "say", "然后他们就来了");
				Perform(c2, "pause", 2);
				Perform(c2, "say", "刚才娜娜来找我们,说你遇到麻烦,让我们去帮你");
				Perform(c2, "pause", 4);
				Perform(c2, "faceto", player);
			}		

			StopChat();					
			c2 = GetChar("天网杀手-1");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("天网杀手-2");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("天网杀手-3");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("天网杀手-4");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("天网杀手-5");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("天网杀手-6");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("天网杀手-7");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("天网杀手-8");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("天网杀手-9");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 30);
				Perform(c2, "faceto", player);
			}			
							
			PlayerPerform("say", "（看来只有杀了他们然后直闯天网了）");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "（可恶，我太大意了）");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "（果然，他们攻到这里来了）");
			PlayerPerform("pause", 2);	
			PlayerPerform("block", 0);
			PlayerPerform("say", "首领吗...放马过来吧!");
			PlayerPerform("pause", 10);
			PlayerPerform("say", "为何一定要至我于死地？");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "你什么意思？");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "娜娜呢？");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "张剑熹，你为什么攻击他们？");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			
			trg0 = 2;
		}
	}	

	if (trg0 == 2)
	{	
		c3 = GetChar("张剑熹");
		c4 = GetChar("天网杀手-1");
		c5 = GetChar("天网杀手-2");
		c6 = GetChar("天网杀手-3");
		c7 = GetChar("天网杀手-4");
		c8 = GetChar("天网杀手-5");
		c9 = GetChar("天网杀手-6");
		c10 = GetChar("天网杀手-7");

		if (GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c7)<=0 && GetHP(c8)<=0 && GetHP(c9)<=0 && GetHP(c10)<=0 && player>=0 && GetHP(player)>0)
		{
			trg0 = 3;
		}
	}
	if (trg0 == 3)
	{
		trg0 = 4;
		gameover = 1;
	}
	if (gameover!=-1 && GetHP(player)<=0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}

}
