// 血战洛阳
int Rule = 1;
int RoundTime = 99;
int PlayerSpawn = 141;
int PlayerSpawnDir = 100;
int PlayerWeapon = 50;
int PlayerWeapon2 = 17;
int PlayerHP = 30000;

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 timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int timer5 = 0;
int gameover = 0;
int reborn = -1;
string rebornName;


OnStart()
{


	        AddNPC("洛阳侍卫1");
	        AddNPC("洛阳侍卫2");
	        AddNPC("洛阳侍卫3");
	        AddNPC("洛阳侍卫4");
	        AddNPC("洛阳侍卫5");
	        AddNPC("洛阳侍卫6");
	        AddNPC("洛阳侍卫7");
	        AddNPC("洛阳侍卫8");


}



OnUpdate()
{
	int player = GetChar("player");
	if (player < 0)
	{
		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("洛阳城长官");
		if (c >= 0)
		{
			Perform(c, "faceto", player);			
			PlayerPerform("use", 19);
			trg0 = 1;
		}
	}

  if (trg0 == 1)
	{	
		c = GetChar("洛阳城长官");
		if (c>=0)

                   {     
                        ChangeBehavior(c,"follow",player);
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "faceto", player);
                        Perform(c, "say", "是历史，不过是你死。拿命来吧。。");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
			Perform(c, "say", "废话少说。拿命来吧。。..");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
			Perform(c, "say", "当年在黄天城败给了你，今天该轮到你了。");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
			Perform(c, "say", "伊人君。。还认识老夫吗？");
			Perform(c, "faceto", player);

                   
			PlayerPerform("say", "还是这么不可取，那我就休了你。");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "难道还想历史重演..对吗？");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "哦？你有这么大能耐吗？你这么老了，还打打杀杀。");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "手下败将，滚开。");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			
			trg0 = 2;
		}
	}


	if (trg1 == 0)
	{
		c = GetAnyChar("洛阳城长官");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "你这小子还真有两下子..都过来给我杀勒他。。");
			Perform(c, "faceto", player);
	
			StopChat();								
			c2 = GetChar("洛阳侍卫1");
			if (c2 >= 0)
			{
                         ChangeBehavior(c2, "kill", player);
			        Perform(c2, "say", "是");
				Perform(c2, "guard", 2);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("洛阳侍卫2");
			if (c2 >= 0)
			{
                             ChangeBehavior(c2, "kill", player);
			        Perform(c2, "say", "是");
				Perform(c2, "guard", 2);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("洛阳侍卫3");
			if (c2 >= 0)
			{
                              ChangeBehavior(c2, "kill", player);
			        Perform(c2, "say", "是");
				Perform(c2, "guard", 2);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("洛阳侍卫4");
			if (c2 >= 0)
			{
        	                         ChangeBehavior(c2, "kill", player);
			        Perform(c2, "say", "是");
				Perform(c2, "guard", 2);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("洛阳侍卫5");
			if (c2 >= 0)
			{
                         ChangeBehavior(c2, "kill", player);
			        Perform(c2, "say", "是");
				Perform(c2, "guard", 2);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("洛阳侍卫6");
			if (c2 >= 0)
			{
       	                         ChangeBehavior(c2, "kill", player);
			        Perform(c2, "say", "是");
				Perform(c2, "guard", 2);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("洛阳侍卫7");
			if (c2 >= 0)
			{
                          ChangeBehavior(c2, "kill", player);
			        Perform(c2, "say", "是");
				Perform(c2, "guard", 2);
				Perform(c2, "faceto", player);
			}			
						
			PlayerPerform("say", "..那你们就放马过来吧!");
			PlayerPerform("pause", 4);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);


			trg1 = 1;
		}
	}

      if (trg1 == 1)
	{
		c = GetAnyChar("洛阳城长官");
		if (GetHP(c) <= 0)
		{
			Say(c, "我。。。。怎么又败给了你。。。。失败，好个伊人君阿。。");
			trg1 = 2;

		}
	}

	 if (trg1 == 2)
	{	
		c = GetChar("洛阳城长官");
		c1 = GetChar("洛阳侍卫1");
		c2 = GetChar("洛阳侍卫2");
		c3 = GetChar("洛阳侍卫3");
		c4 = GetChar("洛阳侍卫4");
		c5 = GetChar("洛阳侍卫5");
		c6 = GetChar("洛阳侍卫6");
		c7 = GetChar("洛阳侍卫7");

		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", 2);
			PlayerPerform("say", "洛阳侍卫 . .");
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);


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



 if (trg1 == 3 && now>timer0)
	{
              AddNPC("剑客1");
              AddNPC("剑客2");
              AddNPC("剑客3");
              AddNPC("剑客4");
              AddNPC("剑客5");
              AddNPC("剑客6");
                RemoveNPC(GetAnyChar("洛阳城长官"));
		RemoveNPC(GetAnyChar("洛阳侍卫1"));
                RemoveNPC(GetAnyChar("洛阳侍卫2"));
		RemoveNPC(GetAnyChar("洛阳侍卫3"));
                RemoveNPC(GetAnyChar("洛阳侍卫4"));
		RemoveNPC(GetAnyChar("洛阳侍卫5"));
                RemoveNPC(GetAnyChar("洛阳侍卫6"));
		RemoveNPC(GetAnyChar("洛阳侍卫7"));
		trg1 = 4;
	}



        if (trg1 == 4)
	{
		c = GetChar("剑客1");		
		if (c>=0 && GetEnemy(c)==player)
		{
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "say", "伊人君。我来会会你。让你尝尝我们的快剑的威力。");
			Perform(c, "faceto", player);

			StopChat();								
			c2 = GetChar("贴身护卫1");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 99999);
			}			
			c2 = GetChar("贴身护卫2");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 99999);
			}			
			c2 = GetChar("贴身护卫3");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 99999);
			}

			PlayerPerform("say", "我也会会你们的快剑。..");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);

			trg1 = 5;

	}
}

if (trg1 == 5)
	{
		c = GetChar("剑客1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "哎呦。。。棘手。。");
			Perform(c, "faceto", player);
			PlayerPerform("block", 1);
			trg1 = 6;
		}
	}

 if (trg1 == 6)
	{
		c = GetAnyChar("剑客1");
		if (GetHP(c) <= 0)
		{
			Say(c, "果然厉害，在下佩服...");
			trg1 = 7;
		}
	}


        if (trg2 == 0)
	{
		c = GetChar("剑客2");		
		if (c>=0 && GetEnemy(c)==player)
		{

                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "say", "受死吧。。。小子。");
			Perform(c, "faceto", player);
			PlayerPerform("block", 1);
			trg2 = 1;

	}
}

if (trg2 == 1)
	{
		c = GetChar("剑客2");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "哼。。有一套...");
			Perform(c, "faceto", player);
			trg2 = 2;
		}
	}

 if (trg2 == 2)
	{
		c = GetAnyChar("剑客2");
		if (GetHP(c) <= 0)
		{
			Say(c, "干拜下风..");
			trg2 = 3;
		}
	}

        if (trg3 == 0)
	{
		c = GetChar("剑客3");		
		if (c>=0 && GetEnemy(c)==player)
		{

                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "say", "让你尝尝本公子的厉害。。。。");
			Perform(c, "faceto", player);
			PlayerPerform("block", 1);
			trg3 = 1;

	}
}
if (trg3 == 1)
	{
		c = GetChar("剑客3");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "哼。。有一套");
			Perform(c, "faceto", player);
			PlayerPerform("block", 1);
			trg3 = 2;
		}
	}

 if (trg3 == 2)
	{
		c = GetAnyChar("剑客3");
		if (GetHP(c) <= 0)
		{
			Say(c, "干拜下风");
			trg3 = 3;
		}
	}



	 if (trg3 == 3)
	{	
		c = GetChar("剑客1");
		c1 = GetChar("剑客2");
		c2 = GetChar("剑客3");
if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c2)<=0 && player>=0 && GetHP(player)>0)

		{

			StopChat();								
			c2 = GetChar("贴身护卫1");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "kill", player);
                        Perform(c2, "use", 5);
                        Perform(c2, "use", 19);
			Perform(c2, "say", "让本小姐尝尝你的厉害。");
			Perform(c2, "faceto", player);
                        Perform(c2, "pause", 1);
			}			
			c2 = GetChar("贴身护卫2");
			if (c2 >= 0)
			{
                         ChangeBehavior(c2, "kill", player);
                        Perform(c2, "use", 5);
                        Perform(c2, "use", 19);
			Perform(c2, "say", "受死吧，伊人君。。");
			Perform(c2, "faceto", player);
                        Perform(c2, "pause", 2);
			}			
			c2 = GetChar("贴身护卫3");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "kill", player);
                        Perform(c2, "use", 5);
                        Perform(c2, "use", 19);
			Perform(c2, "say", "不要小看我们女人哟。上次在炎黄岛败给你，今天不会让你过了。");
			Perform(c2, "faceto", player);
                        Perform(c2, "pause", 4);
			}


			PlayerPerform("say", "轮到你们勒。。贴身护卫.");


			trg3 = 4;
		}
	}



      if (trg3 == 4)
	{
		c = GetAnyChar("贴身护卫1");
		c1 = GetAnyChar("贴身护卫2");
		c2 = GetAnyChar("贴身护卫3");
		c3 = GetAnyChar("剑客1");
		c4 = GetAnyChar("剑客2");
		c5 = GetAnyChar("剑客3");
		
		if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 &&  GetHP(c5)<=0 && player>=0 && GetHP(player)>0)
		{


			PlayerPerform("use", 15);	
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);	
			PlayerPerform("use", 15);	
			PlayerPerform("say", "呜....洛阳城里的人果然厉害。");
			PlayerPerform("say", "剑客-贴身护卫武功不错阿。。。");

			trg3 = 5;
			timer0 = now + 5;

		}
	}

 if (trg3 == 5 && now>timer0)
	{
	  AddNPC("八卦1");
	  AddNPC("八卦2");
	  AddNPC("八卦3");
	  AddNPC("八卦4");
	  AddNPC("八卦5");
	  AddNPC("八卦6");
	  AddNPC("八卦7");
	  AddNPC("八卦8");
                RemoveNPC(GetAnyChar("贴身护卫1"));
		RemoveNPC(GetAnyChar("贴身护卫2"));
                RemoveNPC(GetAnyChar("贴身护卫3"));
		RemoveNPC(GetAnyChar("剑客1"));
                RemoveNPC(GetAnyChar("剑客2"));
		RemoveNPC(GetAnyChar("剑客3"));
		trg3 = 6;

	}

	if (trg4 == 0)
	{
		c2 = GetChar("八卦连环阵8");
		c3 = GetChar("八卦连环阵1");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c3, "follow", c2);
			Perform(c2, "say", "发现了！老大。这家伙闯入了。");
			Perform(c2, "faceto", player);
			trg4 = 1;
		}
		if (c3>=0 && GetEnemy(c3)==player)
		{
			ChangeBehavior(c2, "follow", c3);
			Perform(c3, "say", "哼。。。...");
			Perform(c3, "faceto", player);
			trg4 = 1;
		}		
	}



 if (trg4==1)
	{
		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, "pause", 3);
                 	Perform(c, "say", "。一起杀了他。！...");
                        Perform(c, "faceto", player);
			Perform(c, "say", "不管怎么说。你太不把我们当回事了。今天就让你见识见识我们八卦连环阵的厉害。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "伊人君，你太欺人太甚了。");
			Perform(c, "faceto", player);
			

                        ChangeBehavior(c1,"follow",player);
			Perform(c1, "say", "是！");
			Perform(c1, "pause", 8);
			Perform(c1, "faceto", player);


                     ChangeBehavior(c2,"follow",player);
			Perform(c2, "say", "是！");
			Perform(c2, "pause", 8);
			Perform(c2, "faceto", player);
			
                     ChangeBehavior(c3,"follow",player);
			Perform(c3, "say", "是！");
			Perform(c3, "pause", 8);
			Perform(c3, "faceto", player);

                     ChangeBehavior(c4,"follow",player);
			Perform(c4, "say", "是！");
			Perform(c4, "pause", 8);
			Perform(c4, "faceto", player);

                     ChangeBehavior(c5,"follow",player);
			Perform(c5, "say", "是。。！");
			Perform(c5, "pause", 8);
			Perform(c5, "faceto", player);


                     ChangeBehavior(c6,"follow",player);
			Perform(c6, "say", "是！");
			Perform(c6, "pause", 8);
			Perform(c6, "faceto", player);


                       ChangeBehavior(c7,"follow",player);
			Perform(c7, "say", "是！");
			Perform(c7, "pause", 8);
			Perform(c7, "faceto", player);
			
			PlayerPerform("use", 15);			
			PlayerPerform("say", "呜。。领教了。。");
			PlayerPerform("pause", 9);			
			PlayerPerform("say", "此话怎样，我并不想杀他们。是他们执意要和我斗。");
			PlayerPerform("pause", 2);			
			PlayerPerform("block", 1);
			trg4 = 2; 
			
		}		
	}


      if (trg4 == 2)
	{
		c = GetAnyChar("八卦连环阵1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "阿。不错阿。连我的八卦阵都不怕。");
			trg4 = 3;
		}
	}
      if (trg4 == 3)
	{
		c = GetAnyChar("八卦连环阵1");
		if (GetHP(c) <= 0)
		{
			Say(c, "我。阿......伊人君，算你狠，小子们，不要做无谓的牺牲。");

                         StopChat();								
			c2 = GetChar("八卦连环阵8");
			if (c2 >= 0)
			{
                                Perform(c2, "use", 35);
			        Perform(c2, "say", "老大。。。");
				Perform(c2, "guard", 2);
				Perform(c2, "faceto", c);
			}			
			c2 = GetChar("八卦连环阵2");
			if (c2 >= 0)
			{
                                Perform(c2, "use", 35);
			        Perform(c2, "say", "伊人君，我们会在回来的。");
				Perform(c2, "guard", 3);
				Perform(c2, "faceto", c);
			}			
			c2 = GetChar("八卦连环阵3");
			if (c2 >= 0)
			{
                                Perform(c2, "use", 35);
			        Perform(c2, "say", "伊人君，我们会在回来的。");
				Perform(c2, "guard", 3);
				Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("八卦连环阵4");
			if (c2 >= 0)
			{
                                Perform(c2, "use", 35);
			        Perform(c2, "say", "伊人君，我们会在回来的。");
				Perform(c2, "guard", 3);
				Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("八卦连环阵5");
			if (c2 >= 0)
			{
                                Perform(c2, "use", 35);
			        Perform(c2, "say", "伊人君，我们会在回来的。");
				Perform(c2, "guard", 3);
				Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("八卦连环阵6");
			if (c2 >= 0)
			{
                                Perform(c2, "use", 35);
			        Perform(c2, "say", "伊人君，我们会在回来的。");
				Perform(c2, "guard", 3);
				Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("八卦连环阵7");
			if (c2 >= 0)
			{
                    
                                Perform(c2, "use", 35);
			        Perform(c2, "say", "伊人君，我们会在回来的。");
				Perform(c2, "guard", 3);
				Perform(c2, "faceto", c);
			}		
			PlayerPerform("say", "阿。。为什么，我并不想杀你们。");
			PlayerPerform("pause", 8);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);



			trg4 = 4;
			timer1 = now + 10;

		}
	}




 if (trg4 == 4 && now>timer1)
	{
	  AddNPC("铜人1");
	  AddNPC("铜人2");
	  AddNPC("铜人3");
	  AddNPC("铜人4");
	  AddNPC("铜人5");
	  AddNPC("铜人6");
	  AddNPC("铜人7");
	  AddNPC("铜人8");
                RemoveNPC(GetAnyChar("八卦连环阵1"));
		RemoveNPC(GetAnyChar("八卦连环阵2"));
                RemoveNPC(GetAnyChar("八卦连环阵3"));
		RemoveNPC(GetAnyChar("八卦连环阵4"));
                RemoveNPC(GetAnyChar("八卦连环阵5"));
		RemoveNPC(GetAnyChar("八卦连环阵6"));
                RemoveNPC(GetAnyChar("八卦连环阵7"));
		RemoveNPC(GetAnyChar("八卦连环阵8"));
		trg4 = 5;

	}

        if (trg4==5)
	{
		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 && GetEnemy(c)==player)
		{
                        ChangeBehavior(c,"follow",player);
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
                        Perform(c, "aggress");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
                 	Perform(c, "say", "。施主若能闯过去，老衲就F你的功夫，一起上。。");
                        Perform(c, "faceto", player);
			Perform(c, "say", "既然施主这样想，那老衲不客气了，施主能破的了八卦阵，不知道能不能破的了老衲的铜人阵法呢。");
			Perform(c, "pause", 2);
			Perform(c, "say", "施主请留步。。。");
			Perform(c, "faceto", player);
			
                        ChangeBehavior(c2,"follow",player);
                        Perform(c2, "use", 5);
                        Perform(c2, "use", 19);
			Perform(c2, "aggress");
			Perform(c2, "say", "失礼了。");
			Perform(c2, "pause", 8);
			Perform(c2, "faceto", player);
			
                        ChangeBehavior(c3,"follow",player);
                        Perform(c3, "use", 5);
                        Perform(c3, "use", 19);
			Perform(c3, "aggress");
			Perform(c3, "say", "失礼了。");
			Perform(c3, "pause", 8);
			Perform(c3, "faceto", player);

                        ChangeBehavior(c4,"follow",player);
                        Perform(c4, "use", 5);
                        Perform(c4, "use", 19);
			Perform(c4, "aggress");
			Perform(c4, "say", "得罪了。。");
			Perform(c4, "pause", 8);
			Perform(c4, "faceto", player);

                        ChangeBehavior(c5,"follow",player);
                        Perform(c5, "use", 5);
                        Perform(c5, "use", 19);
			Perform(c5, "aggress");
			Perform(c5, "say", "失礼了。");
			Perform(c5, "pause", 8);
			Perform(c5, "faceto", player);


                        ChangeBehavior(c6,"follow",player);
                        Perform(c6, "use", 5);
                        Perform(c6, "use", 19);
			Perform(c6, "aggress");
			Perform(c6, "say", "失礼了。");
			Perform(c6, "pause", 8);
			Perform(c6, "faceto", player);


                        ChangeBehavior(c7,"follow",player);
                        Perform(c7, "use", 5);
                        Perform(c7, "use", 19);
			Perform(c7, "aggress");
			Perform(c7, "say", "失礼了。");
			Perform(c7, "pause", 8);
			Perform(c7, "faceto", player);


                        ChangeBehavior(c8,"follow",player);
                        Perform(c8, "use", 5);
                        Perform(c8, "use", 19);
			Perform(c8, "aggress");
			Perform(c8, "say", "失礼了。");
			Perform(c8, "pause", 8);
			Perform(c8, "faceto", player);


			
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 20);
			PlayerPerform("say", "我倒要会会你们的铜人阵法。");
			PlayerPerform("pause", 9);			
			PlayerPerform("say", "我不想杀你们，请你们让开..");
			PlayerPerform("pause", 2);			
			PlayerPerform("block", 1);
			trg4 = 6; 			
		}		
	}



if (trg5 == 0)
	{
		c = GetAnyChar("铜人阵法1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "施主的武功不错，老衲不客气了。");
			trg5 = 1;
		}
	}


	if (trg5 == 1)
	{
		c = GetAnyChar("铜人阵法1");
		if (GetHP(c) <= 1000)
		{
			Say(c, "施主果然厉害，老衲佩服。。。后面的施主自己保重。。");
			trg5 = 2;
			timer0 = now + 2;
		}
	}


 if (trg5 == 2 && now>timer0)
	{
	  AddNPC("镖客1");
	  AddNPC("镖客2");
	  AddNPC("镖客3");
	  AddNPC("镖客4");
	  AddNPC("镖客5");
	  AddNPC("镖客6");
	  AddNPC("镖客7");
	  AddNPC("镖客8");
                RemoveNPC(GetAnyChar("铜人阵法1"));
		RemoveNPC(GetAnyChar("铜人阵法2"));
                RemoveNPC(GetAnyChar("铜人阵法3"));
		RemoveNPC(GetAnyChar("铜人阵法4"));
                RemoveNPC(GetAnyChar("铜人阵法5"));
		RemoveNPC(GetAnyChar("铜人阵法6"));
                RemoveNPC(GetAnyChar("铜人阵法7"));
		RemoveNPC(GetAnyChar("铜人阵法8"));
		trg5 = 3;

	}

       if (trg6 == 0)
	{
		c = GetChar("铜人阵法1");
		if (c>=0 && GetHP(player)<GetMaxHP(player)/5)
	        { 

	         	Perform(c, "aggress");
			Perform(c, "faceto", player);
                 	Perform(c, "say", "。阿米驼佛..");
                        Perform(c, "pause", 5);
			Perform(c, "faceto", player);
			Perform(c, "say", "但是出家人以慈悲为怀，老衲不想杀生，请施主还是自行了断吧。");
			Perform(c, "pause", 1);
			Perform(c, "faceto", player);
			Perform(c, "say", "施主你不是老衲的对手，也破不了老衲的阵法。。。。");
			Perform(c, "faceto", player);
			
                         StopChat();								
			c2 = GetChar("铜人阵法2");
			if (c2 >= 0)
			{
				Perform(c2, "guard", 20000);
				Perform(c2, "faceto", c);
			}			
			c2 = GetChar("铜人阵法3");
			if (c2 >= 0)
			{

				Perform(c2, "guard", 3000);
				Perform(c2, "faceto", c);
			}			
			c2 = GetChar("铜人阵法4");
			if (c2 >= 0)
			{

				Perform(c2, "guard", 3000);
				Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("铜人阵法5");
			if (c2 >= 0)
			{

				Perform(c2, "guard", 3000);
				Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("铜人阵法6");
			if (c2 >= 0)
			{

				Perform(c2, "guard", 3000);
				Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("铜人阵法7");
			if (c2 >= 0)
			{

				Perform(c2, "guard", 30000);
				Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("铜人阵法8");
			if (c2 >= 0)
			{
                    

				Perform(c2, "guard", 30000);
				Perform(c2, "faceto", c);
			}		

		        PlayerPerform("use", 35);
			PlayerPerform("say", "阿。。我会在回来的。");
			PlayerPerform("pause", 4);
                        PlayerPerform("block", 1);
			trg6 = 1;
			timer0 = now + 6;

		      }
	        }

        if (trg6 == 1 && now>timer0)
	{
		        gameover = -1;
			trg6 = 2;

		      }


	if (trg5 == 3)
	{
		c = GetChar("镖客1");
		c2 = GetChar("镖客7");
		c3 = GetChar("镖客8");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "阿？老大。老大");
			Perform(c2, "faceto", player);
			trg5 = 4;
		}
		if (c3>=0 && GetEnemy(c3)==player)
		{
			ChangeBehavior(c3, "follow", c);
			Perform(c3, "say", "阿？老大。老大。");
			Perform(c3, "faceto", player);
			trg5 = 4;
		}		
	}

	if (trg7 == 0)
	{
		c = GetChar("镖客1");
		c2 = GetChar("镖客6");
		c3 = GetChar("镖客5");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "阿？老大。老大");
			Perform(c2, "faceto", player);
			trg7 = 1;
		}
		if (c3>=0 && GetEnemy(c3)==player)
		{
			ChangeBehavior(c3, "follow", c);
			Perform(c3, "say", "阿？老大。老大。");
			Perform(c3, "faceto", player);
			trg7 = 1;
		}		
	}


	if (trg8 == 0)
	{
		c = GetChar("镖客1");
		c2 = GetChar("镖客4");
		c3 = GetChar("镖客3");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "老大。老大");
			Perform(c2, "faceto", player);
			trg8 = 1;
		}
		if (c3>=0 && GetEnemy(c3)==player)
		{
			ChangeBehavior(c3, "follow", c);
			Perform(c3, "say", "阿？老大。老大。");
			Perform(c3, "faceto", player);
			trg8 = 1;
		}		
	}

	if (trg9 == 0)
	{
		c = GetChar("镖客1");
		c2 = GetChar("镖客2");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "老大。老大。。有人闯入了。");
			Perform(c2, "faceto", player);
			trg9 = 1;

		}		
	}

	if (trg10 == 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, "say", "把这小子给我毒死。。");
			Perform(c, "faceto", player);

		       ChangeBehavior(c1, "follow", player);
		       ChangeBehavior(c2, "follow", player);
		       ChangeBehavior(c3, "follow", player);
		       ChangeBehavior(c4, "follow", player);
		       ChangeBehavior(c5, "follow", player);
		       ChangeBehavior(c6, "follow", player);
		       ChangeBehavior(c7, "follow", player);

			PlayerPerform("block", 0);
			PlayerPerform("say", "我靠，又是镖客。靠。");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);


			trg10 = 1;

		}		
	}


      if (trg10 == 1)
	{
		c = GetAnyChar("镖客1");
		c3 = GetAnyChar("镖客2");
		c4 = GetAnyChar("镖客3");
		c5 = GetAnyChar("镖客4");
		c6 = GetAnyChar("镖客5");
		c7 = GetAnyChar("镖客6");
		c8 = GetAnyChar("镖客7");
		c9 = GetAnyChar("镖客8");
		if (GetHP(c)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 &&  GetHP(c7)<=0 &&  GetHP(c8)<=0 &&  GetHP(c9)<=0 && player>=0 && GetHP(player)>0)
		{

			PlayerPerform("say", "镖客始终是镖客。就会放镖。没有一点的真工夫，呜...");
			PlayerPerform("pause", 3);


			trg10 = 2;
			timer0 = now + 4;
		}		
	}


if (trg10==2 && now>timer0)
	{

              AddNPC("堂主1");
                RemoveNPC(GetAnyChar("镖客1"));
		RemoveNPC(GetAnyChar("镖客2"));
                RemoveNPC(GetAnyChar("镖客3"));
		RemoveNPC(GetAnyChar("镖客4"));
                RemoveNPC(GetAnyChar("镖客5"));
		RemoveNPC(GetAnyChar("镖客6"));
                RemoveNPC(GetAnyChar("镖客7"));
		RemoveNPC(GetAnyChar("镖客8"));

		trg10 = 3;


	}
    if (trg10==3)
	{
		c = GetAnyChar("孙玉伯");

		if (c>=0 && GetEnemy(c)==player)
		{

			Perform(c, "pause", 20);
			Perform(c, "faceto", player);
			Perform(c, "say", "不过老夫在下面等着你。。");
			Perform(c, "faceto", player);
			Perform(c, "say", "我今天是杀你的，我要为我的儿子报仇。。");
			Perform(c, "faceto", player);
			Perform(c, "say", "停。。。不要这样叫我。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "他作恶多端是他的事，你身为杀手就可以随便杀人？");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "孙剑是我最听话的一个儿子，你竟然杀死他，我为何不杀你。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "哼。你难道不知道你当年杀了一个人，叫孙剑吗？");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "哈哈，老夫终于看到你了。");
			Perform(c, "faceto", player);

			PlayerPerform("block", 0);
			PlayerPerform("use", 15);	
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);	
			PlayerPerform("use", 15);
			PlayerPerform("say", "好，那我就去下面跟你绝一死战");
			PlayerPerform("pause", 5);			
			PlayerPerform("say", "您想错了，孙前辈。。");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "你儿子作恶多端，我为何不杀他。");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "孙剑，他跟孙剑难道有什么关系？");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "孙玉伯，请问，为何你要把我的(梦)作弄。还有我跟你有什么仇");
			PlayerPerform("pause", 2);			
			PlayerPerform("block", 1);
			trg10 = 4; 
			timer1 = now + 15;

		}		
	}

        if (trg10 == 4 && now>timer1)
	{
		c = GetAnyChar("孙玉伯");
		if (c>=0)
		{
			RemoveNPC(c);

		trg10 = 5;
		timer2 = now + 15;
		}
	}


        if (trg10 == 5 && now>timer2)
	{

              AddNPC("堂主4");
              AddNPC("堂主2");
              AddNPC("堂主3");
		trg10 = 6;

	}

    if (trg10==6)
	{
		c = GetAnyChar("孙玉伯");
		c1 = GetAnyChar("二公子");
		c2 = GetAnyChar("三公子");
		if (c>=0 && c1>=0 && c2>=0 && GetEnemy(c)==player)
		{


                        ChangeBehavior(c,"follow",player);
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "pause", 2);
			Perform(c, "say", "伊人君，今天我就要为我的儿子报仇。。。你死定了。");
			Perform(c, "faceto", player);

                        ChangeBehavior(c1,"follow",player);
                        Perform(c1, "use", 5);
                        Perform(c1, "use", 19);
		        Perform(c1, "say", "为大哥报仇..");
			Perform(c1, "pause", 2);
			Perform(c1, "faceto", c);

                        ChangeBehavior(c2,"follow",player);
                        Perform(c2, "use", 5);
                        Perform(c2, "use", 19);
		        Perform(c2, "say", "为大哥报仇。。");
			Perform(c2, "pause", 2);
			Perform(c2, "faceto", c);

			PlayerPerform("block", 1);

		        trg10 = 7;
		}
	}


      if (trg11 == 0)
	{
		c = GetAnyChar("孙玉伯");
		c1 = GetAnyChar("二公子");
		c2 = GetAnyChar("三公子");
		if (c>=0 && GetHP(c)<5000)
		{			
			Perform(c, "pause", 5000);
			Perform(c, "faceto", player);
		        Perform(c, "say", "好吧，我回避一下，这里交给你跟三弟了。");
			Perform(c, "pause", 5);
			Perform(c, "faceto", player);
			Perform(c, "say", "呜。。你这小子真厉害。");
			Perform(c, "faceto", player);

                        ChangeBehavior(c1,"follow",player);
                        Perform(c1, "use", 15);
                        Perform(c1, "use", 20);
		        Perform(c1, "say", "是。。。");
			Perform(c1, "pause", 6);
		        Perform(c1, "say", "爹，你回避一下，让我跟三弟收拾他。");
			Perform(c1, "pause", 1);
			Perform(c1, "faceto", c);

                        ChangeBehavior(c2,"follow",player);
                        Perform(c2, "use", 15);
                        Perform(c2, "use", 20);
		        Perform(c2, "say", "是啊，爹，你回避一下。");
			Perform(c2, "pause", 3);
			Perform(c2, "faceto", c);

			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);

			trg11 = 1;
		        timer0 = now + 6;
		}
	}

if (trg11==1 && now>timer0)
	{

              AddNPC("镖客1");
              AddNPC("镖客2");
              AddNPC("镖客3");
              AddNPC("镖客4");
              AddNPC("镖客5");
              AddNPC("镖客6");
                RemoveNPC(GetAnyChar("孙玉伯"));
		trg11 = 2;


	}

if (trg12==0 && trg11==2)
	{
		c2 = GetAnyChar("镖客1");
		if (c2>=0 && GetHP(c2)<=0)
		{
			reborn = c2;
			rebornName = "镖客1";
			trg12 = 1;
			timer1 = now + 1;
		}
		c3 = GetAnyChar("镖客2");
		if (c3>=0 && GetHP(c3)<=0)
		{
			reborn = c3;
			rebornName = "镖客2";
			trg12 = 1;
			timer1 = now + 1;
		}
		c4 = GetAnyChar("镖客3");
		if (c4>=0 && GetHP(c4)<=0)
		{
			reborn = c4;
			rebornName = "镖客3";
			trg12 = 1;
			timer1 = now + 1;
		}
		c5 = GetAnyChar("镖客4");
		if (c5>=0 && GetHP(c5)<=0)
		{
			reborn = c5;
			rebornName = "镖客4";
			trg12 = 1;
			timer1 = now + 1;
		}
		c6 = GetAnyChar("镖客5");
		if (c6>=0 && GetHP(c6)<=0)
		{
			reborn = c6;
			rebornName = "镖客5";
			trg12 = 1;
			timer1 = now + 1;
		}
		c7 = GetAnyChar("镖客6");
		if (c7>=0 && GetHP(c7)<=0)
		{
			reborn = c7;
			rebornName = "镖客6";
			trg12 = 1;
			timer1 = now + 1;
		}
	}				
	if (trg12==1 && now>timer1)
	{
		RemoveNPC(reborn);
		timer1 = now + 1;
		trg12 = 2;
	}
	if (trg12==2 && now>timer1)
	{
		AddNPC(rebornName);
		trg12 = 0;
	}


    if (trg13==0)
	{
		c = GetAnyChar("二公子");
		c1 = GetAnyChar("三公子");
		c2 = GetAnyChar("镖客1");
		c3 = GetAnyChar("镖客2");
		c4 = GetAnyChar("镖客3");
		c5 = GetAnyChar("镖客4");
		c6 = GetAnyChar("镖客5");
		c7 = GetAnyChar("镖客6");
		if (c>=0 && c1>=0 && c2>=0 && GetEnemy(c)==player)
		{
		       Perform(c, "say", " 想救你的(梦)，就的付出代价。。镖客，快他吗的给我毒死这小子。。");
			Perform(c, "faceto", player);

		       ChangeBehavior(c2, "follow", player);
		       ChangeBehavior(c3, "follow", player);
		       ChangeBehavior(c4, "follow", player);
		       ChangeBehavior(c5, "follow", player);
		       ChangeBehavior(c6, "follow", player);
		       ChangeBehavior(c7, "follow", player);

		      trg13 = 1;
	}

}

      if (trg13 == 1)
	{
		c = GetChar("二公子");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "哼，就你这点的功夫。。。");
			Perform(c, "faceto", player);
			trg13 = 2;
		}
		c1 = GetChar("三公子");
		if (c1>=0 && GetHP(c1)<GetMaxHP(c1)/2)
		{			
			Perform(c1, "say", "哼，就你这点的功夫。。。");
			Perform(c1, "faceto", player);
			trg13 = 2;
		}
	}

 if (trg13 == 2)
	{
		c = GetAnyChar("二公子");
		if (c>=0 && GetHP(c)<2000)
		{
			Say(c, "三弟。。我们不是他的对手。撤。。。伊人君，你去威震八方，有你意想不到的事情。。哈哈哈哈。。");

			PlayerPerform("block", 1);
			trg13 = 3;
                        timer1 = now + 2;
		}
	}


        if (trg13 == 3 && now>timer1)
	{
		c = GetAnyChar("二公子");
		c1 = GetAnyChar("三公子");
		c2 = GetAnyChar("镖客1");
		c3 = GetAnyChar("镖客2");
		c4 = GetAnyChar("镖客3");
		c5 = GetAnyChar("镖客4");
		c6 = GetAnyChar("镖客5");
		c7 = GetAnyChar("镖客6");
		if (c>=0 && c1>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0 && c7>=0 )
		{
			RemoveNPC(c);
			RemoveNPC(c1);
			RemoveNPC(c2);
			RemoveNPC(c3);
			RemoveNPC(c4);
			RemoveNPC(c5);
			RemoveNPC(c6);
			RemoveNPC(c7);
		        gameover = 1;
		        trg13 = 4;


		}
	}
 if (trg14 == 0)
	{
		c = GetAnyChar("三公子");
		if (c>=0 && GetHP(c)<5000)
		{
			Say(c, "你这小子。哼。。");

			PlayerPerform("block", 1);
			trg14 = 1;
		}
	}

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

}