// 臥龙窟
int Rule = 5;
int RoundTime = 10;
int PlayerSpawn = 104;
int PlayerSpawnDir = 90;
int PlayerWeapon = 7;
int PlayerWeapon2 = 0;
int PlayerHP = 1000;
OnStart()
{
	AddNPC("npc20_01");
	AddNPC("npc20_02");
	AddNPC("npc20_03");
	AddNPC("npc20_04");
	AddNPC("npc20_05");
	AddNPC("npc20_06");
}
int player;
int trg0;
int trg1;
int trg2;
int timer0;
int timer1;
int timer2;
int timer3;
int s1;
int s2;
int s3;
int s4;
int k1;
int k2;
int k3;
int con;
int gameover; 
OnUpdate()
{	
	int now = GetGameTime();
	if (trg0==0)
	{
		int player = GetAnyChar("player");
		int c1 = GetChar("巡逻侍卫·甲");
		int c2 = GetChar("巡逻侍卫·乙");
		int c3 = GetChar("巡逻侍卫·丙");
		int c4 = GetChar("巡逻侍卫·丁");
		int c5 = GetChar("巡逻侍卫·戊");
		int c6 = GetChar("巡逻侍卫·己");
		if (GetHP(player) > 0 && player > 0 && c6 > 0)
		{

			PlayerPerform("block", 0);
			PlayerPerform("say", "(就潜过去吧！！不要和敌人冲突！)");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "(这路上的守卫真多，我不能在路上耽搁。)");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "(我得尽快赶过去！！)");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "(..剑仙带人到快活林去了！！)");
			PlayerPerform("block", 1);
			trg0 = 1;
		}

	}
	if (c1>=0 && GetEnemy(c1)==player && s1==0)
	{
		Say(c1,"我看到敌人了！！");
		Say(player,"可恶，被看到了！！");
		gameover = -1;
		timer1 = now + 2;
		s1=1; 
	}
	if (c2>=0 && GetEnemy(c2)==player && s1==0)
	{
		Say(c2,"我看到敌人了！！");
		Say(player,"可恶，被看到了！！");
		gameover = -1;
		timer1 = now + 2; 
		s1=1; 
	}
	if (c3>=0 && GetEnemy(c3)==player && s1==0)
	{
		Say(c3,"我看到敌人了！！");
		Say(player,"可恶，被看到了！！");
		gameover = -1;
		timer1 = now + 2; 
		s1=1; 
	}
	if (c4>=0 && GetEnemy(c4)==player && s1==0)
	{
		Say(c4,"我看到敌人了！！");
		Say(player,"可恶，被看到了！！");
		gameover = -1;
		timer1 = now + 2; 
		s1=1; 
	}
	if (c5>=0 && GetEnemy(c5)==player && s1==0)
	{
		Say(c5,"我看到敌人了！！");
		Say(player,"可恶，被看到了！！");
		gameover = -1;
		timer1 = now + 2; 
		s1=1; 
	}
	if (c6>=0 && GetEnemy(c6)==player && s1==0)
	{
		Say(c6,"我看到敌人了！！");
		Say(player,"可恶，被看到了！！");
		gameover = -1;
		timer1 = now + 2; 
		s1=1; 
	}
	if (player>0)
	{
		SetTarget(0, "waypoint", 32);
		SetTarget(1, "char", player);
		if (Distance(0, 1) < 50 && s1==0)
		{
			Say(player,"我终于通过了！！快点到快活林吧！！");
			gameover = 1;
			timer1 = now + 1;
			s1 =1;
		}
	}
	if ((gameover == 1 || gameover == -1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}
}