// 果然是余党。
int Rule = 1;
int RoundTime = 990;
int PlayerSpawn = 91;
int PlayerSpawnDir = 0;
int PlayerWeapon = 25;
int PlayerWeapon2 = 17;
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 timer6 = 0;
int gameover = 0;
int reborn = -1;
string rebornName;

OnStart()
{
	AddNPC("烽火1");
	AddNPC("烽火2");
}

OnUpdate()
{
	int player = GetAnyChar("player");
	if (player < 0)
	{
		return 0;
	}
	if (gameover == 2)
	{
		return 0;
	}
	
	int c;
	int c1;
	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("无名队长");
		c2 = GetChar("无名1");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "那你就跟他们玩一会吧....");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "伊人君...我不是什么孙剑的余党，我其实是律香川身边的一个杀手..");
			Perform(c, "pause", 8);
			Perform(c, "faceto", player);
			Perform(c, "say", "哦，那通报完了，你就去吧...");
			Perform(c, "pause", 4);
			Perform(c, "say", "伊人君一个人攻入了伏虎山？你怎么不杀死他");
			Perform(c, "faceto", c2);
			
			Perform(c2, "use", 35);
			Perform(c2, "say", "队﹒﹒﹒队长﹒﹒﹒﹒");
			Perform(c2, "pause", 4);
			Perform(c2, "say", "我不是他的对手，所有跑回来跟您通报...");
			Perform(c2, "pause", 2);
			Perform(c2, "faceto", c);
			
			PlayerPerform("block", 0);
			PlayerPerform("say", "果真是你们..受死吧！！");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "如果你们执意这样..我不会对你们客气的。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "原来你们都认识我，说。..你们是不是孙剑的余党？我不想滥杀..");
			PlayerPerform("pause", 8);
			PlayerPerform("block", 1);
			
			timer0 = now + 15;
			trg0 = 1;
		}
	}
	if (trg0 == 1 && now>timer0)
	{
                RemoveNPC(GetAnyChar("无名1"));
		RemoveNPC(GetAnyChar("无名队长"));

		trg0 = 2;
		timer1 = now + 1;
	}

	if (trg0 == 2 && now>timer1)
	{
	AddNPC("烽火黑客1");
	AddNPC("烽火黑客2");
	AddNPC("烽火黑客3");

		trg0 = 3;
	}

	if (trg0 == 3)
	{
		c = GetChar("黑客1");
		c2 = GetChar("黑客2");
		c3 = GetChar("黑客3");
		if (c>=0 && c2>=0 && c3>=0 && GetHP(player)>0)
		{
                        Perform(c, "use", 19);
                        Perform(c2, "use", 19);
                        Perform(c3, "use", 19);
                        Perform(c, "use", 40);

			Perform(c, "say", "我瞧瞧你的厉害..竟没事找事的家伙。");
			Perform(c, "say", "我们领教你的高招了？..");
			Perform(c, "faceto", player);
			
			PlayerPerform("block", 0);
			PlayerPerform("say", "好久没杀人了..先过过瘾");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);

			trg0 = 4;
		}
	}
	if (trg0 == 4)
	{
		c = GetAnyChar("黑客1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/3 && GetHP(player)>0)
		{			
			Perform(c, "say", "有两下子阿！！真是小看你了。");
			Perform(c, "faceto", player);

			PlayerPerform("say", "哼，不自量力，受死！");
			PlayerPerform("pause", 6);
			trg0 = 5;
		}
	}
	if (trg0 == 5)
	{
		c2 = GetChar("黑客1");
		c3 = GetChar("黑客2");
		c4 = GetChar("黑客3");
		if (c2<=0 && c3<=0 && c4<=0 && GetHP(player)>0)
		{
			
			PlayerPerform("use", 15);

			trg0 = 6;
		        timer1 = now + 1;
		}
	}

	if (trg0 == 6 && now>timer1)
	{
                RemoveNPC(GetAnyChar("黑客1"));
		RemoveNPC(GetAnyChar("黑客2"));
		RemoveNPC(GetAnyChar("黑客3"));

		trg0 = 7;
		timer2 = now + 1;
	}

	if (trg0 == 7 && now>timer2)
	{
	AddNPC("烽火道士1");
	AddNPC("烽火道士2");
	AddNPC("烽火道士3");
	AddNPC("烽火道士4");
	AddNPC("烽火道士5");
	AddNPC("烽火道士6");
	AddNPC("烽火道士7");
	AddNPC("烽火道士8");

		trg0 = 8;
	}

if (trg1 == 0)
	{
		c = GetChar("道士1");
		c1 = GetChar("道士2");
		c2 = GetChar("道士3");
		c3 = GetChar("道士4");
		c4 = GetChar("道士5");
		c5 = GetChar("道士6");
		c6 = GetChar("道士7");
		c7 = GetChar("道士8");
		if (c>=0 && GetEnemy(c)==player)
		{

			ChangeBehavior(c, "follow", player);
                        Perform(c, "use", 19);
                        Perform(c, "use", 41);
			Perform(c, "say", "你这家伙！在伏虎败给你..今天是来报仇的！！");
			Perform(c, "faceto", player);

		       ChangeBehavior(c1, "kill", player);
                        Perform(c1, "use", 19);
                        Perform(c1, "use", 5);
		       ChangeBehavior(c2, "kill", player);
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);
		       ChangeBehavior(c3, "kill", player);
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
		       ChangeBehavior(c4, "kill", player);
                        Perform(c4, "use", 19);
                        Perform(c4, "use", 5);
		       ChangeBehavior(c5, "kill", player);
                        Perform(c5, "use", 19);
                        Perform(c5, "use", 5);
		       ChangeBehavior(c6, "kill", player);
                        Perform(c6, "use", 19);
                        Perform(c6, "use", 5);
		       ChangeBehavior(c7, "kill", player);
                        Perform(c7, "use", 19);
                        Perform(c7, "use", 5);

			PlayerPerform("block", 0);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("say", "...........受打------------佩服！！");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);


			trg1 = 1;

		}		
	}

	if (trg1 == 1)
	{
		c = GetAnyChar("道士1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/3 && GetHP(player)>0)
		{			
			Perform(c, "say", "！真是小看你了。");
			Perform(c, "faceto", player);

			PlayerPerform("say", "哼，受死就行了！不要废话");
			PlayerPerform("pause", 6);
			trg1 = 2;
		}
	}

if (trg1 == 2)
	{
		c = GetAnyChar("道士1");
		c1 = GetAnyChar("道士2");
		c2 = GetAnyChar("道士3");
		c3 = GetAnyChar("道士4");
		c4 = GetAnyChar("道士5");
		c5 = GetAnyChar("道士6");
		c6 = GetAnyChar("道士7");
		c7 = GetAnyChar("道士8");
		
		if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c7)<=0 && player>=0 && GetHP(player)>0)
		{



			PlayerPerform("say", "......忽忽！！有点累！！");
			PlayerPerform("pause", 1);

			trg1 = 3;
			timer0 = now + 3;
		}
	}

	if (trg1 == 3 && now>timer0)
	{
                RemoveNPC(GetAnyChar("道士1"));
		RemoveNPC(GetAnyChar("道士2"));
		RemoveNPC(GetAnyChar("道士3"));
                RemoveNPC(GetAnyChar("道士4"));
		RemoveNPC(GetAnyChar("道士5"));
		RemoveNPC(GetAnyChar("道士6"));
                RemoveNPC(GetAnyChar("道士7"));
		RemoveNPC(GetAnyChar("道士8"));

		trg1 = 4;
		timer1 = now + 1;
	}

if (trg1 == 4 && now>timer1)
	{
	  AddNPC("烽火哇蛇1");
	  AddNPC("烽火哇蛇2");
	  AddNPC("烽火哇蛇3");
	  AddNPC("烽火哇蛇4");
	  AddNPC("烽火哇蛇5");

		trg1 = 5;
		timer2 = now + 20;
	}


	if (trg1 == 5 && now>timer2)
	{
	  AddNPC("烽火伊人1");
	  AddNPC("烽火伊人2");
	  AddNPC("烽火伊人3");
	  AddNPC("烽火伊人4");
	  AddNPC("烽火伊人5");

		trg1 = 6;
	}


 if (trg1 == 6)        
        {   

		c = GetChar("伊人杀手1");
		c1 = GetChar("伊人杀手2");
		c2 = GetChar("伊人杀手3");  
		c3 = GetChar("伊人杀手4"); 
		c4 = GetChar("伊人杀手5");
                if (c>0 && c1>0 && c2>0 && c3>0 && c4>0)
                { 
			ChangeBehavior(c, "follow", player);
                        Perform(c, "use", 19);
                        Perform(c, "use", 5);
			Perform(c, "say", "老大，我们来帮你.现在是小子卖力的时候了，。我们上..。。");
			Perform(c, "faceto", player);	
			Perform(c, "crouch", 1);   

			ChangeBehavior(c1, "follow", player);
                        Perform(c1, "use", 19);
                        Perform(c1, "use", 5);
			Perform(c1, "faceto", player);	
			Perform(c1, "crouch", 1);

			ChangeBehavior(c2, "follow", player);
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);
			Perform(c2, "pause", 2);
			Perform(c2, "faceto", player);	
			Perform(c2, "crouch", 1);

			ChangeBehavior(c3, "follow", player);
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
			Perform(c3, "pause", 2);
			Perform(c3, "faceto", player);	
			Perform(c3, "crouch", 1);

			ChangeBehavior(c4, "follow", player);
                        Perform(c4, "use", 19);
                        Perform(c4, "use", 5);
			Perform(c4, "pause", 2);
			Perform(c4, "faceto", player);	
			Perform(c4, "crouch", 1);

                        PlayerPerform("say", "恩..你们来的正是时候！！。。");
                        PlayerPerform("pause", 2);

		          trg1 = 7;
	              }

           }
	if (trg1 == 7)
	{
		c = GetAnyChar("哇蛇1");
		if (GetHP(c) <= 0)
		{
			Say(c, "行阿....！");
			trg1 = 8;
		        timer0 = now + 2; 
		}
	}

	if (trg1 == 8 && now>timer0)
	{
                RemoveNPC(GetAnyChar("哇蛇1"));
		RemoveNPC(GetAnyChar("哇蛇2"));
		RemoveNPC(GetAnyChar("哇蛇3"));
                RemoveNPC(GetAnyChar("哇蛇4"));
		RemoveNPC(GetAnyChar("哇蛇5"));

		trg1 = 9;
		timer1 = now + 1;
	}

	if (trg1 == 9 && now>timer1)
	{
	   AddNPC("烽火2");

		trg1 = 10;
	}


	if (trg1==10)
	{
		c = GetChar("无名队长");
		c1 = GetChar("伊人杀手2");
		c2 = GetChar("伊人杀手3");  
		c3 = GetChar("伊人杀手4"); 
		c4 = GetChar("伊人杀手5");
		c5 = GetChar("伊人杀手1");
		if (c>=0 && GetEnemy(c)==player)
		{
			StopPerform(player);
			StopPerform(c);
                        Perform(c, "use", 19);
                        Perform(c, "use", 41);
			Perform(c, "say", "看你行不行了。哼...我今天会取掉你的狗命.");
			Perform(c, "pause", 6);
			Perform(c, "say", "现在律香彬跟孙剑都死了。。我现在也做上了老大。");
			Perform(c, "pause", 6);
			Perform(c, "say", "当初你跟他们斗的时候，我武功根本不行..。所以我就没出面。");
			Perform(c, "pause", 5);
			Perform(c, "faceto", player);
			Perform(c, "say", "不是说了！我以前是律香彬身边的杀手。");
			Perform(c, "pause", 1);

			Perform(c1, "pause", 19);
			Perform(c2, "pause", 19);
			Perform(c3, "pause", 19);
			Perform(c4, "pause", 19);
			Perform(c5, "pause", 19);


			PlayerPerform("block", 0);
			PlayerPerform("say", "孙剑身边的余党一个都不会活..。");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "不知羞耻..？今天就取掉你的狗命..");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "靠！...。..");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "那我为什么当初没见过你。...");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "你到底是谁？ .");
			PlayerPerform("block", 1);

			trg1 = 11;
			timer0 = now + 19;
		}
	}

	if (trg1 == 11 && now>timer0)
	{
	    AddNPC("烽火无限1");
	    AddNPC("烽火无限2");
	    AddNPC("烽火无限3");

		trg1 = 12;
	}

if (trg3==0 && trg1==12)
	{
		c2 = GetAnyChar("无限人1");
		if (c2>=0 && GetHP(c2)<=0)
		{
			reborn = c2;
			rebornName = "烽火无限1";
			trg3 = 1;
			timer1 = now + 1;
		}
		c3 = GetAnyChar("无限人2");
		if (c3>=0 && GetHP(c3)<=0)
		{
			reborn = c3;
			rebornName = "烽火无限2";
			trg3 = 1;
			timer1 = now + 1;
		}
		c4 = GetAnyChar("无限人3");
		if (c4>=0 && GetHP(c4)<=0)
		{
			reborn = c4;
			rebornName = "烽火无限3";
			trg3 = 1;
			timer1 = now + 1;
		}

        }				
	if (trg3==1 && now>timer1)
	{
		RemoveNPC(reborn);
		timer1 = now + 1;
		trg3 = 2;
	}
	if (trg3==2 && now>timer1)
	{
		AddNPC(rebornName);
		trg3 = 0;
	}



      if (trg4 == 0)
	{
		c = GetAnyChar("无名队长");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "好样的，...。果真是一位高手，");
			trg4 = 1;
		}

       } 

      if (trg4 == 1)
	{
		c = GetAnyChar("无名队长");
		if (c>=0 && GetHP(c)<3000)
		{			
			Perform(c, "say", "你这家伙..。真是过分呢！！");
			trg4 = 2;
		}

       } 
	if (trg4 == 2)
	{
		c = GetAnyChar("无名队长");
		if (GetHP(c) <= 0)
		{
			Say(c, "死..能代表我的存在！！！");
			trg4 = 3;
		        timer2 = now + 2; 
		}
	}

	if (trg4==3 && now>timer2)
	{

		gameover = 1;

			trg4 = 4;

                }


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

}
