// 炼铁狱
int Rule = 1;
int RoundTime = 99;
int PlayerSpawn = 76;
int PlayerSpawnDir = 100;
int PlayerWeapon = 50;
int PlayerWeapon2 = 17;
int PlayerHP = 32000;

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 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("npc10_01");
		AddNPC("npc10_15");
		AddNPC("npc10_16");
		AddNPC("npc10_17");
		AddNPC("npc10_18");
		AddNPC("npc10_19");
		AddNPC("npc10_20");
		AddNPC("npc10_21");

}

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("孙剑");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<200)
		{	
			Perform(c, "pause", 20);
			Perform(c, "say", "你们慢慢玩，哈哈，我先去吃点饭，可不要我吃玩饭你就G了哦。");
			Perform(c, "faceto", player);
			Perform(c, "say", "我给了你们报仇的机会，就看你们的了。");
			Perform(c, "say", "那多不好玩阿，我要让他们杀死你，算是还他们个人情吧。。");
			Perform(c, "pause", 2);
			Perform(c, "say", "你以为你还会杀死他们吗？笑话。");
			Perform(c, "pause", 2);
			Perform(c, "say", "哈哈哈哈，就凭你那点小功夫，我还救不活他们。");
			Perform(c, "pause", 2);
			Perform(c, "say", "还早着狠，你看看我后面都是谁阿。");
			Perform(c, "pause", 2);
			Perform(c, "say", "你果然是厉害，竟然能活着来见我。");
			Perform(c, "faceto", player);
			
                        StopChat();								
			c2 = GetChar("五毒队长");
			if (c2 >= 0)

			{
                        ChangeBehavior(c2,"follow",player);
                         	Perform(c2, "say", "我们今天要报仇，杀阿..");
				Perform(c2, "guard", 20);
				Perform(c2, "faceto", player);
			        Perform(c2, "crouch", 1);
			}			
			c2 = GetChar("无名杀手");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "报仇");
				Perform(c2, "guard", 25);
				Perform(c2, "faceto", player);
			        Perform(c2, "crouch", 1);
			}			
			c2 = GetChar("黄天城队长");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "报仇");
				Perform(c2, "guard", 24);
				Perform(c2, "faceto", player);
			        Perform(c2, "crouch", 1);
			}			
								
			c2 = GetChar("皇宫总管");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "是？");
				Perform(c2, "guard", 23);
				Perform(c2, "faceto", player);
			        Perform(c2, "crouch", 1);
			}			
								
			c2 = GetChar("干死大队长");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "杀阿。");
				Perform(c2, "guard", 21);
				Perform(c2, "faceto", player);
			        Perform(c2, "crouch", 1);
			}			
								
			c2 = GetChar("一线天首领");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "我们要报仇。拿命来。。");
				Perform(c2, "guard", 22);
				Perform(c2, "faceto", player);
			        Perform(c2, "crouch", 1);
			}			
				
			c2 = GetChar("黄天城首领");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "我们要报仇。拿命来。。");
				Perform(c2, "guard", 22);
				Perform(c2, "faceto", player);
			        Perform(c2, "crouch", 1);
			}				


			PlayerPerform("block", 0);
			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);
		
			trg0 = 2; 
			timer0 = now + 13;			
		}		
	}

        if (trg0 == 2 && now>timer0)
	{
		c = GetAnyChar("孙剑");
		if (c>=0)
		{
			RemoveNPC(c);

		trg0 = 3;
		}
	}


      if (trg1 == 0)
	{
		c = GetAnyChar("五毒队长");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "难道还要失败吗？");
			trg1 = 1;
		}
	}
      if (trg1 == 1)
	{
		c = GetAnyChar("五毒队长");
		if (GetHP(c) <= 0)
		{
			Say(c, "我不配当队长。。。");
			trg1 = 2;
		}
	}	

      if (trg2 == 0)
	{
		c = GetAnyChar("无名杀手");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "不会的。。");
			trg2 = 1;
		}
	}
      if (trg2 == 1)
	{
		c = GetAnyChar("无名杀手");
		if (GetHP(c) <= 0)
		{
			Say(c, "我哪配当什么杀手阿。。");
			trg2 = 2;
		}
	}
      if (trg3 == 0)
	{
		c = GetAnyChar("黄天城队长");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "呜。。");
			trg3 = 1;
		}
	}
      if (trg3 == 1)
	{
		c = GetAnyChar("黄天城队长");
		if (GetHP(c) <= 0)
		{
			Say(c, "伊人君，我F你。。。");
			trg3 = 2;
		}
	}
      if (trg4 == 0)
	{
		c = GetAnyChar("皇宫总管");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "阿。。不会的。。");
			trg4 = 1;
		}
	}
      if (trg4 == 1)
	{
		c = GetAnyChar("皇宫总管");
		if (GetHP(c) <= 0)
		{
			Say(c, "20年后，我一定比你强。。");
			trg4 = 2;
		}
	}
      if (trg5 == 0)
	{
		c = GetAnyChar("干死大队长");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "你是我今生中见过的唯一高手。。");
			trg5 = 1;
		}
	}
      if (trg5 == 1)
	{
		c = GetAnyChar("干死大队长");
		if (GetHP(c) <= 0)
		{
			Say(c, "我今天会死在你的手下，我也满足了。");
			trg5 = 2;
		}
	}
      if (trg6 == 0)
	{
		c = GetAnyChar("一线天首领");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "老大救活我们，我可不能在让他失望。");
			trg6 = 1;
		}
	}
      if (trg6 == 1)
	{
		c = GetAnyChar("一线天首领");
		if (GetHP(c) <= 0)
		{
			Say(c, "老大，属下没用。。。。");
			trg6 = 2;
		}
	}
      if (trg7 == 0)
	{
		c = GetAnyChar("黄天城首领");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "阿，不可能，这么多人，还会失败么？。");
			trg7 = 1;
		}
	}
      if (trg7 == 1)
	{
		c = GetAnyChar("黄天城首领");
		if (GetHP(c) <= 0)
		{
			Say(c, "我想我永远都不会是你的对手。。。");
			trg7 = 2;
		}
	}
      if (trg0 == 3)
	{
		c = GetAnyChar("五毒队长");
		c3 = GetAnyChar("黄天城首领");
		c4 = GetAnyChar("黄天城队长");
		c5 = GetAnyChar("无名杀手");
		c6 = GetAnyChar("干死大队长");
		c7 = GetAnyChar("一线天首领");
		
		if (GetHP(c)<=0 && GetHP(c4)<=0 && GetHP(c3)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 &&  GetHP(c7)<=0 && player>=0 && GetHP(player)>0)
		{
	                AddNPC("npc10_01");
			RemoveNPC(c);
			RemoveNPC(c3);
			RemoveNPC(c4);
			RemoveNPC(c5);
			RemoveNPC(c6);
			RemoveNPC(c7);

			PlayerPerform("say", "这些人都是你逼死的。。");

			trg0 = 4;
		}
	}
        if (trg0 == 4)
	{
		c = GetChar("孙剑");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<200)
		{
                        ChangeBehavior(c,"follow",player);
			Perform(c, "say", "好。出招吧。。");
			Perform(c, "pause", 3);
			Perform(c, "say", "我本来就没有人性。。哈哈。");
			Perform(c, "pause", 2);
			Perform(c, "say", "我不管他们是不是好汉。只要功夫不到家，我留着他们有什么用。");
			Perform(c, "pause", 2);
			Perform(c, "say", "不，是这些人的力量不到家。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);


			PlayerPerform("block", 0);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("say", "好。赐教了。。。");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "你，，你。有本事你不要在跑了。。给我决一死战阿。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "你真是条魔鬼。。没有一点的人性。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "放屁，他们都是一些忠心的好汉，为什么一定要让他们为你卖命。");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);
			
			trg0 = 5;
		}
         }

       if (trg0 == 5)
	{
		c = GetChar("孙剑");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "哎哟，，这么就我们两个人多没意思阿。找个人出来一起玩阿。。。。");
			Perform(c, "faceto", player);

			PlayerPerform("say", "懦夫，又要叫人。。靠。。");
			PlayerPerform("pause", 4);
			PlayerPerform("block", 1);
			trg0 = 6;
			timer1 = now + 4;
		}
	}

if (trg0==6 && now>timer1)
	{

              AddNPC("npc10_04");
              AddNPC("npc10_05");
		trg0 = 7;


	}

	
        if (trg0 == 7)
	{
		c = GetChar("律香彬");
		c2 = GetChar("孙剑");	
		c3 = GetChar("无名高手");		
		if (c>=0 && GetEnemy(c)==player)
		{
                        ChangeBehavior(c, "idle");
			Perform(c,"guard", 99999);
			Perform(c, "aggress");
			Perform(c, "say", "无名，杀死他。。");
			Perform(c, "pause", 2);
			Perform(c, "say", "看到底谁死哈。。主子，这里交给我吧，你回去等我的好消息吧。");
			Perform(c, "pause", 2);
			Perform(c, "say", "哈哈哈哈。我们又见面了，伊人君。");
			Perform(c, "faceto", player);

			Perform(c2, "pause", 6);
			Perform(c2, "say", "那我就回去等你的好消息。可别让我失望。。");
			Perform(c2, "pause", 6);
                        Perform(c2, "faceto", c);


			ChangeBehavior(c3, "follow", player);
			Perform(c3, "say", "是。。");
			Perform(c3, "pause", 7);
                        Perform(c3, "faceto", c);
			Perform(c3, "crouch", 1);


			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 20);				
			PlayerPerform("block", 0);
			PlayerPerform("say", "这家伙看起来不是一般的货色。。。");
			PlayerPerform("pause", 9);
			PlayerPerform("say", "见面还不是你死。。");
			PlayerPerform("pause", 1);
			PlayerPerform("block", 1);

	                trg0 = 8;
		        timer1 = now + 8;

	}
}

    if (trg0==8 && now>timer1)
	{
		c = GetAnyChar("孙剑");
                c2 = GetAnyChar("皇宫总管");
		if (c>=0 &&  c2>=0 )
		{
		
                RemoveNPC(c);
                RemoveNPC(c2);
		trg0 = 9;


	}

}

if (trg0 == 9)
	{
		c = GetChar("无名高手");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "想不到你的武功这么厉害。。");
			Perform(c, "faceto", player);

			PlayerPerform("say", "过奖了。。。");
			PlayerPerform("pause", 4);
			trg0 = 10;
		}
	}


   

        if (trg0 == 10)
	{
		c = GetChar("无名高手");
		c2 = GetChar("律香彬");
		if (c>=0 && GetHP(c)<5000)
		{

                        Perform(c, "use", 35);
			Perform(c, "say", "阿，为什么...。");
			Perform(c, "faceto", c2);
			Perform(c, "say", "阿，老大。我快不行了。。");
			Perform(c, "faceto", c2);



                        ChangeBehavior(c2, "kill", player);
			Perform(c2, "pause", 5);
			Perform(c2, "say", "那你去死吧。。");
			Perform(c2, "pause", 5);
			Perform(c2, "faceto", c);


			PlayerPerform("say", "你们这些所谓的老大，都是这样当的吗？。。。");				
			PlayerPerform("pause", 7);
			PlayerPerform("block", 1);
			trg0 = 11;

	}
    }




 if (trg8 == 0)
	{
		c = GetChar("律香彬");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "哼，就凭你是杀不死我的。。。。");
			Perform(c, "faceto", player);

			PlayerPerform("block", 1);

			trg8 = 1;
		}
	}



 if (trg8 == 1)
	{
		c = GetAnyChar("律香彬");
		if (GetHP(c) <= 0)
		{
			Say(c, "老大，小子没用，让您失望了，小子先走了，剩下的我帮。。。帮不了了。");
			trg8 = 2;
                        timer0 = now + 5;
		}
	}


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

              AddNPC("npc10_01");
                RemoveNPC(GetAnyChar("律香彬"));
		RemoveNPC(GetAnyChar("无名高手"));
		trg8 = 3;


	}


  if (trg8 == 3)
	{
		c = GetChar("孙剑");		
		if (c>=0 && GetEnemy(c)==player)
		{
                        ChangeBehavior(c,"follow",player);
			Perform(c, "aggress");
			Perform(c, "say", "吃里爬外。不识抬举。。");
			Perform(c, "pause", 3);
			Perform(c, "say", "我恐怕没有跑的机会了。因为这次我会杀死你。");
			Perform(c, "pause", 2);
			Perform(c, "say", "你这么肯定我不是你的对手？");
			Perform(c, "pause", 2);
			Perform(c, "say", "哎，都是废物啊。。难道我白教了他们。还是我自己来收拾你吧。");

			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("say", "谁死谁活。手底下见真章吧。。");		
			PlayerPerform("pause", 2);
			PlayerPerform("say", "好，那你就不要在跑了。跟我公平的打一场。");		
			PlayerPerform("pause", 2);
			PlayerPerform("say", "孙剑，是不是让你的手下死光你才甘心，你都不是我的对手，更何况你的手下。");		
			PlayerPerform("pause", 1);
			PlayerPerform("block", 1);

		trg8 = 4;


	}

  }
 if (trg8 == 4)
	{
		c = GetChar("孙剑");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "。。你打了这么久。。。竟毫无败象，果然是难得的高手。");
			Perform(c, "faceto", player);

			PlayerPerform("block", 1);

			trg8 = 5;
                        timer1 = now + 5;
		}
	}


if (trg8==5 && now>timer1)
	{

              AddNPC("npc10_02");
              AddNPC("npc10_03");
              AddNPC("npc10_06");
              AddNPC("npc10_07");
              AddNPC("npc10_08");

		trg8 = 6;


	}

if (trg9==0 && trg8==6)
	{
		c2 = GetAnyChar("守关人﹒甲");
		if (c2>=0 && GetHP(c2)<=0)
		{
			reborn = c2;
			rebornName = "npc10_02";
			trg9 = 1;
			timer1 = now + 25;
		}
		c3 = GetAnyChar("守关人﹒乙");
		if (c3>=0 && GetHP(c3)<=0)
		{
			reborn = c3;
			rebornName = "npc10_03";
			trg9 = 1;
			timer1 = now + 25;
		}
		c4 = GetAnyChar("守关人﹒丙");
		if (c4>=0 && GetHP(c4)<=0)
		{
			reborn = c4;
			rebornName = "npc10_06";
			trg9 = 1;
			timer1 = now + 25;
		}
		c5 = GetAnyChar("守关人﹒丁");
		if (c5>=0 && GetHP(c5)<=0)
		{
			reborn = c5;
			rebornName = "npc10_07";
			trg9 = 1;
			timer1 = now + 25;
		}
		c6 = GetAnyChar("黑衣守关人");
		if (c6>=0 && GetHP(c6)<=0)
		{
			reborn = c6;
			rebornName = "npc10_08";
			trg9 = 1;
			timer1 = now + 25;
		}
	}				
	if (trg9==1 && now>timer1)
	{
		RemoveNPC(reborn);
		timer1 = now + 5;
		trg9 = 2;
	}
	if (trg9==2 && now>timer1)
	{
		AddNPC(rebornName);
		trg9 = 0;
	}
	
if (trg10==0)
	{
		c = GetChar("黑衣守关人");
		c2 = GetChar("守关人﹒甲");
		c3 = GetChar("守关人﹒乙");
		c4 = GetChar("守关人﹒丙");
		c5 = GetChar("守关人﹒丁");
		c6 = GetChar("孙剑");
		if (c>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0)
                {
			SetTarget(0, "char", c);
			SetTarget(1, "char", c6);
			if (Distance(0, 1) < 100)
			{

                        ChangeBehavior(c,"follow",player);
                        Perform(c, "say", "兄弟们干掉他。。。。");
			Perform(c, "pause", 7);
                        Perform(c, "say", "回去先休息一下。。这里由我们来对付。。");
			Perform(c, "pause", 2);
                        Perform(c, "say", "老大你先回避一下吧。。");
			Perform(c, "pause", 2);
			Perform(c, "say", "老大。。我们来了。");
			Perform(c, "faceto", c6);
			Perform(c, "crouch", 1);
				
			ChangeBehavior(c2, "follow", player);
			Perform(c2, "say", "是。");
			Perform(c2, "pause", 15);
			Perform(c2, "faceto", c6);
			Perform(c2, "crouch", 1);

			ChangeBehavior(c3, "follow", player);
			Perform(c3, "say", "遵命。");
			Perform(c3, "pause", 15);
			Perform(c3, "faceto", c6);
			Perform(c3, "crouch", 1);

			ChangeBehavior(c4, "follow", player);
			Perform(c4, "say", "是");
			Perform(c4, "pause", 15);
			Perform(c4, "faceto", c6);
			Perform(c4, "crouch", 1);

			ChangeBehavior(c5, "follow", player);
			Perform(c5, "say", "遵命");
			Perform(c5, "pause", 15);
			Perform(c5, "faceto", c6);
			Perform(c5, "crouch", 1);

				Perform(c6, "say", "伊人君。我回去疗伤，回来在收拾你。");
				Perform(c6, "say", "好吧，我先回避一下。");
				Perform(c6, "pause", 6);
				Perform(c6, "faceto", c);		


			PlayerPerform("say", "想杀他，唉。。真是费劲呢。。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "孙剑老是这样，我到什么时候才能杀了他阿。。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "阿 ...这些人貌似狠有煞气");
			PlayerPerform("pause", 17);
			PlayerPerform("block", 1);


		        trg10 = 1;
			timer0 = now + 8;
	        }
            } 
   } 
 if (trg10==1 && now>timer0)
	{
		c = GetAnyChar("孙剑");
		if (c>=0 )
		{
		
                RemoveNPC(c);
		trg10 = 2;
		timer1 = now + 20;


	}
}



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

              AddNPC("npc10_09");
              AddNPC("npc10_10");
              AddNPC("npc10_11");
              AddNPC("npc10_12");

		trg10 = 3;


	}


         if (trg10 == 3)
	{
		c = GetChar("伊人梦");
		c1 = GetChar("小何");
		c2 = GetChar("凤凤");
		c3 = GetChar("叶翔");
                if (c>=0 &&  c1>=0 && c2>=0 && c3>=0)
		{

                        ChangeBehavior(c,"follow",player);
			Perform(c, "say", "我们知道了。老公。");
			Perform(c, "pause", 2);
			Perform(c, "say", "西西，这不是来了么。。。。");
			Perform(c, "pause", 2);
			Perform(c, "say", "老公，老大让我们来帮你。。");
			Perform(c, "faceto", player);

                        ChangeBehavior(c1,"follow",player);
			Perform(c1, "say", "让本公子教训教训你们这些人渣。");
			Perform(c1, "pause", 10);
			Perform(c1, "faceto", player);


                        ChangeBehavior(c2,"follow",player);
			Perform(c2, "say", "无名小人，都给我受死吧。。");
			Perform(c2, "pause", 11);
			Perform(c2, "faceto", player);

                        ChangeBehavior(c3,"follow",player);
			Perform(c3, "say", "呵呵，我不会对你们手下留情的。看招。。");
			Perform(c3, "pause", 12);
			Perform(c3, "faceto", player);

			PlayerPerform("block", 0);
			PlayerPerform("say", "孙剑很狡猾，你们当心要。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "梦，你们在不来，我就真的不行了。。。 .");
			PlayerPerform("pause", 1);
			PlayerPerform("block", 1);


			trg10 = 4;
		        timer1 = now + 20;
		}
	}

if (trg10==4 && now>timer1)
	{

              AddNPC("npc10_01");

		trg10 = 5;


	}



 if (trg10 == 5)
	{
		c = GetChar("孙剑");	
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "aggress");
			Perform(c, "say", "....你也有帮手了，现在公平了吧。。");

			PlayerPerform("say", "对。公平了。那你就尽管出招吧。");
			PlayerPerform("pause", 1);
			PlayerPerform("block", 1);

		trg10 = 6;


	}


}

 if (trg10 == 6)
	{
		c = GetChar("孙剑");
		if (c>=0 && GetHP(c)<20000)
		{			


                        Perform(c, "use", 15);
                        Perform(c, "use", 15);
			Perform(c, "use", 15);
                        Perform(c, "use", 15);
                        Perform(c, "use", 15);
			Perform(c, "use", 33);
			Perform(c, "say", "难道你打的一点也不累么？");
			Perform(c, "faceto", player);

			PlayerPerform("say", "如果累还指望杀你吗？");
			PlayerPerform("pause", 4);
			PlayerPerform("block", 1);
			trg10 = 7;
		        timer2 = now + 5;
		}
	}



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

              AddNPC("npc10_13");
              AddNPC("npc10_14");
                RemoveNPC(GetAnyChar("黑衣守关人"));
		RemoveNPC(GetAnyChar("守关人﹒甲"));
                RemoveNPC(GetAnyChar("守关人﹒乙"));
		RemoveNPC(GetAnyChar("守关人﹒丙"));
                RemoveNPC(GetAnyChar("守关人﹒丁"));

		trg10 = 8;


	}


if (trg10 == 8)
	{
		c = GetChar("孙剑");
		c2 = GetChar("守关孙剑");
		c3 = GetChar("贴身护卫");		
		if (c>=0 && GetHP(c)<15000)
		{


			Perform(c, "aggress");
			Perform(c, "say", "给我杀死他。。");

			ChangeBehavior(c2, "follow", player);
			Perform(c2, "say", "是。。");
			Perform(c2, "pause", 2);
                        Perform(c2, "faceto", c);


			ChangeBehavior(c3, "follow", player);
			Perform(c3, "say", "是。。");
			Perform(c3, "pause", 2);
                        Perform(c3, "faceto", c);


                        StopChat();	
                        c2 = GetChar("黑衣守关人");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}				

			c2 = GetChar("守关人﹒甲");
			if (c2 >= 0)
			{
                          ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("守关人﹒乙");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("守关人﹒丙");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
				
			c2 = GetChar("守关人﹒丁");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}				



				
			PlayerPerform("block", 1);								
			trg10 = 9;

           }

}


      if (trg10 == 9)
	{
		c = GetAnyChar("孙剑");
		if (c>=0 && GetHP(c)<10000)
		{	

                        Perform(c, "use", 15);
                        Perform(c, "use", 15);
			Perform(c, "use", 15);
                        Perform(c, "use", 15);
                        Perform(c, "use", 15);
			Perform(c, "use", 20);	
                        Perform(c, "use", 15);
                        Perform(c, "use", 15);
			Perform(c, "use", 15);
                        Perform(c, "use", 15);
                        Perform(c, "use", 34);
			Perform(c, "use", 33);
                        Perform(c, "use", 15);
                        Perform(c, "use", 15);
			Perform(c, "use", 5);
                        Perform(c, "use", 4);
                        Perform(c, "use", 41);
			Perform(c, "use", 40);	
			Perform(c, "say", "真够劲....这小子武功真行。");
			trg10 = 10;
		}
	}



        if (trg10 == 10)
        {
		c = GetAnyChar("孙剑");
		if (GetHP(c) <= 0)
		{
			Say(c, "我，，我，没想到会死在你..。。。的 。。。。手里。死不瞑目啊。。。");



                        StopChat();								
			c2 = GetChar("伊人梦");
			if (c2 >= 0)

			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
			c2 = GetChar("凤凤");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
			c2 = GetChar("小何");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("叶翔");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("守关孙剑");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("贴身护卫");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
				
			c2 = GetChar("黑衣守关人");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}				

			c2 = GetChar("守关人﹒甲");
			if (c2 >= 0)
			{
                          ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("守关人﹒乙");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
								
			c2 = GetChar("守关人﹒丙");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}			
				
			c2 = GetChar("守关人﹒丁");
			if (c2 >= 0)
			{
                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2, "faceto", c);
			}				




			PlayerPerform("say", "希望大家常来关注。。。。");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "QQ号码765739946。。");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "QQ号码765739946。。");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "QQ号码765739946。。");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "希望大家开心快乐，再见。。。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "我需要大家的支持，你们玩我的任务是我的荣幸。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "请加我的QQ765739946，如果有地方不懂的，或者还想玩本人的任务。请Q我");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "本次任务到此结束，如果大家还想玩");
			PlayerPerform("pause", 1);
			PlayerPerform("block", 1);
			trg10 = 11;
		        timer4 = now + 9;
		}
	}


if (trg10==11 && now>timer4)
	{

	trg10 = 12;
	gameover = 1;
	}

      if (trg11 == 0)
	{
		c = GetAnyChar("伊人梦");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "阿。好厉害。有打头哦。");
			trg11 = 1;
		}
	}
      if (trg11 == 1)
	{
		c = GetAnyChar("伊人梦");
		if (GetHP(c) <= 0)
		{
			Say(c, "老公。。我要回。。。。快活林了。");


			PlayerPerform("say", "冷燕。。我操，老子跟你拼了。。");
			PlayerPerform("pause", 1);
			trg11 = 2;
		}
	}



      if (trg12 == 0)
	{
		c = GetAnyChar("小何");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "好样的，竟然伤的了本公子。。。");
			trg12 = 1;
		}
	}
      if (trg12 == 1)
	{
		c = GetAnyChar("小何");
		if (GetHP(c) <= 0)
		{
			Say(c, "君。我先走了。");
			trg12 = 2;
		}
	}
      if (trg13 == 0)
	{
		c = GetAnyChar("叶翔");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "呜。..。敌方好强。");
			trg13 = 1;
		}
	}
      if (trg13 == 1)
	{
		c = GetAnyChar("叶翔");
		if (GetHP(c) <= 0)
		{
			Say(c, "我不行了。。先行离开。。");
			trg13 = 2;
		}
	}
      if (trg14 == 0)
	{
		c = GetAnyChar("凤凤");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "你们对女人不能温柔一点");
			trg14 = 1;
		}
	}
      if (trg14 == 1)
	{
		c = GetAnyChar("凤凤");
		if (GetHP(c) <= 0)
		{
			Say(c, "我只能帮到这里了。剩下的。。。。我。。。");
			trg14 = 2;
		}
	}
if (gameover!=-1 && GetHP(player)<=0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}

}
