// 暗杀孙玉城
int Rule = 1;
int RoundTime = 990;
int PlayerSpawn = 41;
int PlayerSpawnDir = 0;
int PlayerWeapon = 18;
int PlayerWeapon2 = 51;
int PlayerHP = 18000;

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;
int reborn = -1;
string rebornName;

OnStart()
{
		
     AddNPC("制作人3");


}
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("(兵兵)");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && Distance(0, 1)<300)
		{	
                        Perform(c, "use", 34);
                        Perform(c, "use", 33);
                        Perform(c, "use", 41);
                        Perform(c, "use", 3);
                        Perform(c, "use", 19);
                        Perform(c, "use", 5);
			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, "pause", 2);
			Perform(c, "say", "哈哈.这是我的责任..总不能看你这么让人欺负吧..");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
			

			PlayerPerform("use", 33);
			PlayerPerform("use", 34);
			PlayerPerform("use", 19);
			PlayerPerform("use", 5);
			PlayerPerform("say", "（阿...。。）");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "（你说的有理..又麻烦你了。。）");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "（那应该怎么做呢？）");
			PlayerPerform("pause", 2);	
			PlayerPerform("say", "（你说的也对﹒﹒看来杀死孙玉城老大就会出来跟我绝一死战了。）");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "（那会是谁..怎么也不从不出面的？）");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "（恩，..这里的老大想必就是孙玉城了吧..）");
			PlayerPerform("pause", 4);			
			PlayerPerform("say", "﹒要不是有你相助。我想我就挂了");
			PlayerPerform("block", 1);
		
			trg0 = 1; 
			timer0 = now + 15;			
		}		
	}

	if (trg0 == 1 && now>timer0)
	{
		AddNPC("风雪镖客1");
		AddNPC("风雪镖客2");
		AddNPC("风雪镖客3");
		AddNPC("风雪镖客4");
		AddNPC("风雪镖客5");
		AddNPC("风雪镖客6");
		AddNPC("风雪镖客7");
		AddNPC("风雪镖客8");

		trg0 = 2;
	}


	if (trg0 == 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");
		c8 = GetAnyChar("(兵兵)");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<800)
		{



			Perform(c, "say", "你。哈哈，小子们，我们杀。");
			Perform(c, "guard", 4);
			Perform(c, "say", "你已经在中毒了。。哼..还不毒死你。");
			Perform(c, "guard", 2);
			Perform(c, "say", "这次我们不会在失败了。.你受死吧。。.");
			Perform(c, "guard", 2);
			Perform(c, "say", "我们的绝就是放毒..这是我们的本能。。");
			Perform(c, "guard", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "你们给我站住...你真是不知死活..敢闯入这里。");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 10);
			Perform(c1, "faceto", c);
				
			Perform(c2, "pause", 10);
			Perform(c2, "faceto", c);	


			Perform(c3, "pause", 10);
			Perform(c3, "faceto", c);
				
			Perform(c4, "pause", 10);
			Perform(c4, "faceto", c);		
			
			Perform(c5, "pause", 10);
			Perform(c5, "faceto", c);
			
			Perform(c6, "pause", 10);
			Perform(c6, "faceto", c);


			Perform(c7, "pause", 10);
			Perform(c7, "faceto", c);

			Perform(c8, "pause", 10);
			Perform(c8, "faceto", c);

			PlayerPerform("say", "受死吧...");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "哼..中毒一样收拾你们。，.");
			PlayerPerform("pause", 3);
			PlayerPerform("use", 11);
			PlayerPerform("use", 12);
			PlayerPerform("use", 13);
			PlayerPerform("use", 14);
			PlayerPerform("use", 18);
			PlayerPerform("use", 10);
			PlayerPerform("say", "你以为我真的怕你们么？就你们的毒对我是没有用的。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "那你们的头叫出来。对于你们，我不杀。你们不想死就滚。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "又是镖客。没有功夫的家伙..只是来送死。除了放毒还会什么。");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);

			trg0 = 3;
		}
	}


	if (trg0 == 3)
	{
		c = GetAnyChar("镖客1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "好棘手的家伙..中毒还这么厉害...");

			PlayerPerform("say", "哼哼～");
			PlayerPerform("pause", 2);
			trg0 = 4;
		}
	}
	if (trg0 == 4)
	{
		c = GetAnyChar("镖客1");
		if (GetHP(c) <= 0)
		{
			Say(c, "我不甘心阿......你这家伙！！！！");
			trg0 = 5;
		}
	}

	if (trg1 == 0)
	{
		c = GetAnyChar("(兵兵)");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "小兄弟..支援我！我死你就过不了关了。");

			PlayerPerform("say", "我知道了～马上支援你。");
			PlayerPerform("pause", 2);
			trg1 = 1;
		}
	}
	if (trg1 == 1)
	{
		c = GetAnyChar("(兵兵)");
		if (GetHP(c) <= 0)
		{
			Say(c, "不用灰心！！我们重来！！");
			trg1 = 2;
			timer0 = now + 5;
		}
	}

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

		        gameover = -1;
			trg1 = 3;

	}


	if (trg0 == 5)
	{
		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);

			trg0 = 6;
			timer0 = now + 5;
		}
	}

   if (trg0 == 6 && 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"));

	                trg0 = 7;    
			timer1 = now + 1;           
      
		}

        if (trg0 == 7 && now>timer1)
	{
                    AddNPC("风雪人1");
                    AddNPC("风雪人2");
                    AddNPC("风雪人3");
                    AddNPC("风雪人4");
                    AddNPC("风雪人5");
                    AddNPC("风雪人6");
                    AddNPC("风雪人7");
                    AddNPC("风雪人8");
      	                trg0 = 8;        
      
		}


if (trg2 == 0)
	{
		c = GetAnyChar("恶煞1");
		c1 = GetAnyChar("恶煞2");
		c2 = GetAnyChar("恶煞3");
		c3 = GetAnyChar("恶煞4");
		c4 = GetAnyChar("恶煞5");
		c5 = GetAnyChar("恶煞6");
		c6 = GetAnyChar("恶煞7");
		c7 = GetAnyChar("恶煞8");
		c8 = GetAnyChar("(兵兵)");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<200)
		{



			Perform(c, "say", "哈哈。小子！。到底是谁死现在还不知道呢。");
			Perform(c, "guard", 3);
			Perform(c, "faceto", player);
			Perform(c, "say", "不知道你能不能打的赢我们，所以来会会你。。");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 5);
			Perform(c1, "faceto", c);
				
			Perform(c2, "pause", 5);
			Perform(c2, "faceto", c);	


			Perform(c3, "pause", 5);
			Perform(c3, "faceto", c);
				
			Perform(c4, "pause", 5);
			Perform(c4, "faceto", c);		
			
			Perform(c5, "pause", 5);
			Perform(c5, "faceto", c);
			
			Perform(c6, "pause", 5);
			Perform(c6, "faceto", c);


			Perform(c7, "pause", 5);
			Perform(c7, "faceto", c);

			Perform(c8, "pause", 5);
			Perform(c8, "faceto", c);

			PlayerPerform("pause", 3);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 20);
			PlayerPerform("say", "那我就送你去见阎王。");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "你们来也只是送死..。");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);

			trg2 = 1;
		}
	}

	if (trg2 == 1)
	{
		c = GetAnyChar("恶煞1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "好棘手的家伙...");

			PlayerPerform("say", "哼哼～");
			PlayerPerform("pause", 2);
			trg2 = 2;
		}
	}
	if (trg2 == 2)
	{
		c = GetAnyChar("恶煞1");
		if (GetHP(c) <= 0)
		{
			Say(c, "....你这家伙！！！！");
			trg2 = 3;
		}
	}

	if (trg2 == 3)
	{
		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);

			trg2 = 4;
			timer0 = now + 5;
		}
	}

   if (trg2 == 4 && 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"));

	                trg2 = 5;    
			timer1 = now + 1;           
      
		}

        if (trg2 == 5 && now>timer1)
	{
                    AddNPC("风雪1");
      	                trg2 = 6;        
      
		}

	if (trg2 == 6)
	{
		c = GetAnyChar("孙玉城");
		c1 = GetAnyChar("(兵兵)");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<200)
		{

                        Perform(c, "use", 34);
                        Perform(c, "use", 33);
                        Perform(c, "use", 41);
                        Perform(c, "use", 3);
                        Perform(c, "use", 19);
                        Perform(c, "use", 5);
			Perform(c, "say", "不...。。我不会死的.会死的是你。");
			Perform(c, "guard", 4);
			Perform(c, "say", "死？。不会的..不会的。");
			Perform(c, "guard", 4);
			Perform(c, "faceto", player);
			Perform(c, "say", "哈哈。你果然厉害..还不死");
			Perform(c, "faceto", player);

                        ChangeBehavior(c1, "follow", c);
			Perform(c1, "guard", 3);
			Perform(c1, "say", "我当制作人的不多说什么。只想说，你今天会死..");
			Perform(c1, "guard", 3);
			Perform(c1, "faceto", player);

			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 20);
			PlayerPerform("say", "哈哈。怕了，制作人都这么说，今天定是你的死期，受死吧。。");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "当然没有你想象中的那样软弱...。");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);

			trg2 = 7;
			timer2 = now + 10;  
		}
	}

        if (trg2 == 7 && now>timer2)
	{
                 AddNPC("风雪杀手1");
                 AddNPC("风雪杀手2");
                 AddNPC("风雪杀手3");
                 AddNPC("风雪杀手4");
                 AddNPC("风雪杀手5");
                 AddNPC("风雪杀手6");
      	                trg2 = 8;        
      
		}
if (trg3==0 && trg2==8)
	{
		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;
		}
		c5 = GetAnyChar("无名蒙面4");
		if (c5>=0 && GetHP(c5)<=0)
		{
			reborn = c5;
			rebornName = "风雪杀手4";
			trg3 = 1;
			timer1 = now + 1;
		}
		c6 = GetAnyChar("无名蒙面5");
		if (c6>=0 && GetHP(c6)<=0)
		{
			reborn = c6;
			rebornName = "风雪杀手5";
			trg3 = 1;
			timer1 = now + 1;
		}
		c7 = GetAnyChar("无名蒙面6");
		if (c7>=0 && GetHP(c7)<=0)
		{
			reborn = c7;
			rebornName = "风雪杀手6";
			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 && now>timer1)
	{
		c = GetChar("无名蒙面1");
		c1 = GetChar("无名蒙面2");
		c3 = GetChar("无名蒙面3");
		c4 = GetChar("无名蒙面4");
		c5 = GetChar("无名蒙面5");
		c6 = GetChar("无名蒙面6");
		if (c>=0 && c1>0 && c3>0 && c4>0 && c5>0 && c6>0 && c7>0 )
		{

			ChangeBehavior(c, "follow", player);
			Perform(c, "faceto", player);	
                        Perform(c, "use", 5);
                        Perform(c, "use", 7);
			ChangeBehavior(c1, "follow", player);
                        Perform(c1, "use", 7);
                        Perform(c1, "use", 5);
			ChangeBehavior(c3, "follow", player);
                        Perform(c3, "use", 7);
                        Perform(c3, "use", 5);
			ChangeBehavior(c4, "follow", player);
                        Perform(c4, "use", 7);
                        Perform(c4, "use", 5);
			ChangeBehavior(c5, "follow", player);
                        Perform(c5, "use", 5);
                        Perform(c5, "use", 7);
			ChangeBehavior(c6, "follow", player);
                        Perform(c6, "use", 5);
                        Perform(c6, "use", 7);

		        trg4 = 1;
			timer1 = now + 10;

	    }

       }

	if (trg4 == 1 && now>timer1)
	{
		c = GetChar("无名蒙面1");
		c1 = GetChar("无名蒙面2");
		c3 = GetChar("无名蒙面3");
		c4 = GetChar("无名蒙面4");
		c5 = GetChar("无名蒙面5");
		c6 = GetChar("无名蒙面6");
		if (c>=0 && c1>0 && c3>0 && c4>0 && c5>0 && c6>0 && c7>0 )
		{

			ChangeBehavior(c, "follow", player);
			Perform(c, "faceto", player);	
                        Perform(c, "use", 19);
                        Perform(c, "use", 7);
			ChangeBehavior(c1, "follow", player);
                        Perform(c1, "use", 7);
                        Perform(c1, "use", 19);
			ChangeBehavior(c3, "follow", player);
                        Perform(c3, "use", 7);
                        Perform(c3, "use", 19);
			ChangeBehavior(c4, "follow", player);
                        Perform(c4, "use", 7);
                        Perform(c4, "use", 19);
			ChangeBehavior(c5, "follow", player);
                        Perform(c5, "use", 19);
                        Perform(c5, "use", 7);
			ChangeBehavior(c6, "follow", player);
                        Perform(c6, "use", 19);
                        Perform(c6, "use", 7);
		        trg4 = 0;
			timer1 = now + 10;

	           }

             }

	if (trg5 == 0)
	{
		c = GetAnyChar("孙玉城");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "我不会死的...我永远都是老大。");

			PlayerPerform("say", "是老大～但是你只有今天做老大的机会了。");
			PlayerPerform("pause", 2);
			trg5 = 1;
		}
	}
	if (trg5 == 1)
	{
		c = GetAnyChar("孙玉城");
		if (GetHP(c) <= 0)
		{
			Say(c, ".没想到......我真---的--死在你的——手里...主子...我不行了。");
			trg5 = 2;
		        timer1 = now + 5; 
		}
	}

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



		 gameover = 1;
		 trg5 = 3;


	}


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

}
