// 纒竇
int Rule = 2;
int RoundTime = 99;
int PlayerSpawn = 18;
int PlayerSpawnDir = 90;
int PlayerWeapon = 14;
int PlayerWeapon2 = 35;
int PlayerHP = 5000;

int trg0 = 0;
int timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int gameover = 0;

OnStart()
{
	AddNPC("npc+21+01");
}

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("林娜娜");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && Distance(0, 1)<300)
		{	
			ChangeBehavior(c, "patrol", 40);
			Perform(c, "say", "是啊是啊，我说可以时你才能找喔~~");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
				
			PlayerPerform("say", "（也许我真的应该过过自己的生活了﹒﹒﹒﹒﹒）");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "（这，才是我想要的生活吧）");
			PlayerPerform("pause", 2);				
			PlayerPerform("say", "（感到了从没有过的充实、自由和快乐）");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "（这段日子一直与娜娜一起生活）");
			PlayerPerform("pause", 2);				
			PlayerPerform("say", "（为什么呢﹒﹒﹒﹒﹒）");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "（首领却一直没下新任务）");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "（任务完成一个多月了）");
			PlayerPerform("pause", 4);			
			PlayerPerform("say", "﹒﹒﹒﹒﹒玩﹒﹒﹒捉迷藏？？");
			PlayerPerform("block", 1);
		
			trg0 = 1; 
			timer1 = now + 20;			
		}		
	}
	if (trg0 == 1 && now>timer1)
	{
		c = GetChar("林娜娜");

		if (c>=0 && GetHP(player)>0)
		{
			StopPerform(player);
			StopPerform(c);

			Perform(c, "pause", 5);
			Perform(c, "say", "峰，我藏好了，来找我吧");

			PlayerPerform("block", 0);
			PlayerPerform("say", "（还是别多想了）");
			PlayerPerform("pause", 4);			
			PlayerPerform("say", "哦，来了");
			PlayerPerform("pause", 3);	
			PlayerPerform("block", 1);

			trg0 = 2;
		}
	}
	if (trg0 == 2)
	{
		c = GetChar("林娜娜");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && Distance(0, 1)<150)
		{	
			Perform(c, "pause", 100);
			Perform(c, "say", "别人？谁啊？");
			Perform(c, "pause", 4);
			Perform(c, "say", "是啊，怎么了？");
			Perform(c, "pause", 5);
			Perform(c, "say", "又被你找到了，你怎么这么厉害啊");
			Perform(c, "faceto", player);
										
			PlayerPerform("block", 0);	
			PlayerPerform("say", "娜娜退后！");
			PlayerPerform("pause", 4);	
			PlayerPerform("say", "你认为你会成功？");
			PlayerPerform("pause", 6);			
			PlayerPerform("say", "我可不这么认为");
			PlayerPerform("pause", 4);	
			PlayerPerform("say", "首领派你来的？");
			PlayerPerform("pause", 4);			
			PlayerPerform("say", "什么任务？");
			PlayerPerform("pause", 4);	
			PlayerPerform("say", "李明楠？？你来干什么？");
			PlayerPerform("pause", 10);	
			PlayerPerform("say", "出来吧，让我们认识认识你");
			PlayerPerform("pause", 2);	
			PlayerPerform("say", "这个问题我也想知道呢");
			PlayerPerform("pause", 4);			
			PlayerPerform("say", "你没发现这里还有别人吗？");
			PlayerPerform("pause", 4);			
			PlayerPerform("say", "娜娜，你一直藏在这里吗？？");
			PlayerPerform("pause", 3);			
			PlayerPerform("block", 1);
		
			trg0 = 3; 
			timer2 = now + 15;			
		}		
	}
	if (trg0 == 3 && now>timer2)
	{
		AddNPC("npc+21+02");
		AddNPC("npc+21+03");
		AddNPC("npc+21+04");
		AddNPC("npc+21+05");
		AddNPC("npc+21+06");

		trg0 = 4;
	}
	if (trg0 == 4)
	{
		c = GetAnyChar("李明楠");
		c2 = GetAnyChar("天网杀手﹒甲");
		c3 = GetAnyChar("天网杀手﹒乙");
		c4 = GetAnyChar("天网杀手﹒丙");
		c5 = GetAnyChar("天网杀手﹒丁");
		if (c>=0)
		{
			ChangeBehavior(c5, "Kill", "player");
			Perform(c5, "guard", 28);
			Perform(c5, "faceto", player);

			ChangeBehavior(c4, "Kill", "player");
			Perform(c4, "guard", 28);
			Perform(c4, "faceto", player);

			ChangeBehavior(c3, "Kill", "player");
			Perform(c3, "guard", 28);
			Perform(c3, "faceto", player);

			ChangeBehavior(c2, "Kill", "player");
			Perform(c2, "guard", 28);
			Perform(c2, "faceto", player);

			ChangeBehavior(c, "Kill", "player");
			Perform(c, "say", "对，我会成功，上！！");
			Perform(c, "pause", 4);
			Perform(c, "say", "顺便除掉你，天网头号杀手的位子就是我的了");
			Perform(c, "pause", 2);
			Perform(c, "say", "哼，我就知道你会出手");
			Perform(c, "pause", 4);
			Perform(c, "say", "是，今天就是她的死期");
			Perform(c, "pause", 4);
			Perform(c, "say", "杀林娜娜");
			Perform(c, "pause", 4);
			Perform(c, "say", "执行任务");
			Perform(c, "pause", 6);
			Perform(c, "say", "不愧是天网头号杀手，果然厉害");
			Perform(c, "faceto", player);

			trg0 = 5; 
			timer3 = now + 20;
		}
	}
	if (trg0 == 5 && now>timer3)
	{
		c = GetAnyChar("林娜娜");
		if (c>=0)
		{
			RemoveNPC(c);

			trg0 = 6;
		}
	}
	if (trg0 == 6)
	{
		c = GetAnyChar("李明楠");

		if (c>=0 && GetHP(c)<=0)
		{
			Say(c, "你犯了个大错误﹒﹒﹒你不该让林娜娜一个人离开﹒﹒﹒哈哈﹒﹒﹒﹒﹒﹒");


			PlayerPerform("say", "糟了！");
			PlayerPerform("pause", 3);			
			trg0 = 7;
			timer4 = now + 6;
		}
	}
	if (trg0 == 7 && now>timer4)
	{
		trg0 = 8;
		gameover = 1;
	}
	if (gameover!=-1 && GetHP(player)<=0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}

}
