// 查明原因，似乎孙剑的余党。
int Rule = 1;
int RoundTime = 990;
int PlayerSpawn = 3;
int PlayerSpawnDir = 0;
int PlayerWeapon = 17;
int PlayerWeapon2 = 51;
int PlayerHP = 15000;

int trg0 = 0;
int trg1 = 0;
int trg2 = 0;
int trg3 = 0;
int trg4 = 0;
int trg5 = 0;
int trg6 = 0;
int trg7 = 0;
int trg8 = 0;
int trg9 = 0;
int trg10 = 0;
int trg11 = 0;
int trg12 = 0;
int trg13 = 0;
int trg14 = 0;
int trg15 = 0;
int trg16 = 0;
int trg17 = 0;
int trg18 = 0;
int trg19 = 0;
int trg20 = 0;
int trg21 = 0;
int trg22 = 0;
int trg23 = 0;
int trg24 = 0;
int timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int timer5 = 0;
int gameover = 0;
OnStart()
{
		AddNPC("伏虎马贼1");
		AddNPC("伏虎马贼2");
		AddNPC("伏虎马贼3");
		AddNPC("伏虎马贼4");
		AddNPC("伏虎马贼5");
		AddNPC("伏虎马贼6");
		AddNPC("伏虎马贼7");
		AddNPC("伏虎马贼8");
}
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 (trg8 == 0)
	{

		c = GetChar("伏虎马贼1");
		if (c>=0 && GetHP(player)>0)
		{
			Perform(c, "pause", 100);

			PlayerPerform("block", 0);
			PlayerPerform("crouch", 0);
			PlayerPerform("pause", 3);
			PlayerPerform("say", "（这几年我是怎么过的！！！）");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "（就因为他们一家人..折腾了我好几年..）");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "（这次一定要斩除根。）");
			PlayerPerform("pause", 1);
			PlayerPerform("say", " 我想就算是余党也应该在附近吧..。）");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "（汗，。管他呢，既然来到这里，就在这里查一查，）");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "（这里是什么地方？.）");
			PlayerPerform("block", 1);

			trg8 = 1;
		}
	}


	if (trg0==0)
	{
		c = GetChar("伏虎马贼1");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "guard", 3);
			Perform(c, "say", "你﹒﹒你﹒﹒你是谁！竟敢擅自闯入禁地！找死！");
			Perform(c, "faceto", player);
			trg0 = 1;
		}
	}
	if (trg1==0)
	{
		c = GetChar("伏虎马贼2");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "哈，正愁着没乐子呢来过过招");
			Perform(c, "faceto", player);
			trg1 = 1;
		}
	}
	if (trg2==0)
	{
		c = GetChar("伏虎马贼3");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "伏虎山好久没来刺客了，让我来试试你");
			Perform(c, "faceto", player);
			trg2 = 1;
		}
	}
	if (trg3==0)
	{
		c = GetChar("伏虎马贼4");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "哼，既然有人能走到这来，来让爷练练手");
			Perform(c, "faceto", player);
			trg3 = 1;
		}
	}
	if (trg4==0)
	{
		c = GetChar("伏虎马贼5");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "没人能从这活着出去，你的死期到了");
			Perform(c, "faceto", player);
			trg4 = 1;
		}
	}
	if (trg5==0)
	{
		c = GetChar("伏虎马贼6");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "擅闯禁地的人都要死，你也不例外");
			Perform(c, "faceto", player);
			trg5 = 1;
		}
	}
	if (trg6==0)
	{
		c = GetChar("伏虎马贼7");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "guard", 3);
			Perform(c, "say", "既然你来了，你就别想活着出去了");
			Perform(c, "faceto", player);
			trg6 = 1;
		}
	}
	if (trg7==0)
	{
		c = GetChar("伏虎马贼8");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "我只想告诉你，擅闯此地，！死！！！");
			Perform(c, "pause", 4);
			Perform(c, "faceto", player);

			PlayerPerform("block", 0);
		        PlayerPerform("say", "是不是。你们是不是还屡次不改..");
			PlayerPerform("pause", 2);
		        PlayerPerform("say", "马贼..你们是不是孙剑的余党？");
			PlayerPerform("block", 1);
			trg7 = 1;
		}
	}
	if (trg0==1 && trg1==1 && trg2==1 && trg3==1 && trg4==1 && trg5==1 && trg6==1 && trg7==1)
	{
		c = GetAnyChar("伏虎马贼1");
		c2 = GetAnyChar("伏虎马贼2");
		c3 = GetAnyChar("伏虎马贼3");
		c4 = GetAnyChar("伏虎马贼4");
		c5 = GetAnyChar("伏虎马贼5");
		c6 = GetAnyChar("伏虎马贼6");
		c7 = GetAnyChar("伏虎马贼7");
		c8 = GetAnyChar("伏虎马贼8");

		if (GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c7)<=0 && GetHP(c8)<=0 && GetHP(c)<=0 && player>=0 && GetHP(player)>0)
		{

			PlayerPerform("say", "孙剑这一伙人，还真够劲阿！！");
			PlayerPerform("pause", 2);

			timer0 = now + 3;
			trg0 = 2;
		}
	}
	if (trg0 == 2 && now>timer0)
	{
			RemoveNPC(c);
			RemoveNPC(c2);
			RemoveNPC(c8);
			RemoveNPC(c7);
			RemoveNPC(c6);
			RemoveNPC(c5);
			RemoveNPC(c4);
			RemoveNPC(c3);
			timer1 = now + 3;
		trg0 = 3;
	}
	if (trg0 == 3 && now>timer1)
	{
		AddNPC("伏虎法师1");
		AddNPC("伏虎法师2");
		AddNPC("伏虎法师3");
		AddNPC("伏虎法师4");
		AddNPC("伏虎法师5");
		AddNPC("伏虎法师6");
		AddNPC("伏虎法师7");
		AddNPC("伏虎法师8");
		trg0 = 4;
	}
	if (trg0==4)
	{
		c = GetChar("法师1");
		c2 = GetChar("法师2");
		c3 = GetChar("法师3");
		c4 = GetChar("法师4");
		c5 = GetChar("法师5");
		c6 = GetChar("法师6");
		c7 = GetChar("法师7");
		c8 = GetChar("法师8");
		if (c>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0 && c7>=0 && c8>=0)
		{
			Perform(c, "say", "杀！！");

			trg0 = 5;
		}
	}
	if (trg0==5)
	{
		c = GetAnyChar("法师1");
		c2 = GetAnyChar("法师2");
		c3 = GetAnyChar("法师3");
		c4 = GetAnyChar("法师4");
		c5 = GetAnyChar("法师5");
		c6 = GetAnyChar("法师6");
		c7 = GetAnyChar("法师7");
		c8 = GetAnyChar("法师8");

		if (GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c)<=0 && GetHP(c7)<=0 && GetHP(c8)<=0 && player>=0 && GetHP(player)>0)
		{

			PlayerPerform("pause", 2);

			timer2 = now + 3;
			trg0 = 6;
		}
	}
	if (trg0 == 6 && now>timer2)
	{
			RemoveNPC(c);
			RemoveNPC(c2);
			RemoveNPC(c6);
			RemoveNPC(c5);
			RemoveNPC(c4);
			RemoveNPC(c3);
			RemoveNPC(c7);
			RemoveNPC(c8);
			timer3 = now + 3;
		trg0 = 7;
	}
	if (trg0 == 7 && now>timer3)
	{
		AddNPC("伏虎无名1");
		AddNPC("伏虎无名2");
		AddNPC("伏虎无名3");
		AddNPC("伏虎无名4");
		AddNPC("伏虎无名5");
		trg0 = 8;
	}
	if (trg0==8)
	{
		c = GetAnyChar("无名1");
		c2 = GetAnyChar("无名2");
		c3 = GetAnyChar("无名3");
		c4 = GetAnyChar("无名4");
		c4 = GetAnyChar("无名5");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "问阎王去吧！");
			Perform(c, "pause", 2);

		        PlayerPerform("say", "你们是不是孙剑的余党？");
			trg0 = 9;
		}
	}
	if (trg0==9)
	{
		c = GetAnyChar("无名1");
		if (c>=0 && GetHP(c)<=GetMaxHP(c)/3)
		{
			Perform(c, "say", "快去禀报我们主子..伊人君他吗的闯来了。");

		        PlayerPerform("say", "他肯定是.肯定是！！吗的，真是本性难改阿..");
			PlayerPerform("pause", 2);
		        PlayerPerform("say", "你知道我？你知道我是伊人君..");
			PlayerPerform("pause", 2);

			trg0 = 10;
		}
	}
	if (trg0==10)
	{
		c = GetChar("无名1");
		c2 = GetChar("无名2");
		c3 = GetChar("无名3");
		c4 = GetChar("无名4");
		c5 = GetChar("无名5");

		if (GetHP(c)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 &&  GetHP(c5)<=0 && player>=0 && GetHP(player)>0)
		{


			trg0 = 11;
		}
	}
	if (trg0 == 11)
	{
		trg0 = 12;
		gameover = 1;
	}


	if (gameover!=-1 && GetHP(player)<=0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}

}
