//  伊人君的杀手之路
int Rule = 1;
int RoundTime = 990;
int PlayerSpawn = 47;
int PlayerSpawnDir = 135;
int PlayerWeapon = 33;
int PlayerWeapon2 = 47;
int PlayerHP = 10000;

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 gameover = 0;

OnStart()
{
	AddNPC("圆满楼1");
}

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 c11;
        int c12;
        int c13;
        int c14;
        int c15;
        int c16;
        int c17;
        int c18;
        int c19;
        int c20;
        int c21;
	int now = GetGameTime();
	
	if (trg0 == 0)
	{

		c = GetChar("高老大");
		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);

			trg0 = 1;
		}
	}
	if (trg0==1)
	{
		c = GetChar("高老大");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && Distance(0, 1)<150)
		{
			StopPerform(player);
			StopPerform(c);

			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);

			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);

			trg0 = 2;
			timer0 = now + 19;
		}
	}	
	if (trg0==2 && now>timer0)
	{


                RemoveNPC(GetAnyChar("高老大"));

			timer1 = now + 2;
			trg0 = 3;
		}
	if (trg0==3 && now>timer2)
	{

		AddNPC("圆满1");
		AddNPC("圆满2");
		AddNPC("圆满3");
		AddNPC("圆满4");
		AddNPC("圆满5");
		AddNPC("圆满6");
		AddNPC("圆满7");
			trg0 = 4;
		}



 if (trg0 == 4)        
        {   

		c = GetChar("伊人手下杀手1");
		c1 = GetChar("伊人手下杀手2");
		c2 = GetChar("伊人手下杀手3");  
		c3 = GetChar("伊人手下杀手4"); 
		c4 = GetChar("伊人手下杀手5");
		c5 = GetChar("伊人手下杀手6");
		c6 = GetChar("伊人手下杀手7");  
                if (c>0 && c1>0 && c2>0 && c3>0 && c4>0 && c5>0 && c6>0)
                { 
			ChangeBehavior(c, "follow", player);
                        Perform(c, "use", 19);
                        Perform(c, "use", 5);
			Perform(c, "say", "是老大，我们决对不会耽误你。。我们只是当你的助手。。。");
			Perform(c, "pause", 3);
			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, "say", "是。。");
			Perform(c1, "pause", 4);
			Perform(c1, "faceto", player);	
			Perform(c1, "crouch", 1);

			ChangeBehavior(c2, "follow", player);
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);
			Perform(c2, "say", "是。。");
			Perform(c2, "pause", 4);
			Perform(c2, "faceto", player);	
			Perform(c2, "crouch", 1);

			ChangeBehavior(c3, "follow", player);
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
			Perform(c3, "say", "是。。");
			Perform(c3, "pause", 4);
			Perform(c3, "faceto", player);	
			Perform(c3, "crouch", 1);

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


			ChangeBehavior(c5, "follow", player);
                        Perform(c5, "use", 19);
                        Perform(c5, "use", 5);
			Perform(c5, "say", "是。。");
			Perform(c5, "pause", 4);
			Perform(c5, "faceto", player);	
			Perform(c5, "crouch", 1);


			ChangeBehavior(c6, "follow", player);
                        Perform(c6, "use", 19);
                        Perform(c6, "use", 5);
			Perform(c6, "say", "是。。");
			Perform(c6, "pause", 4);
			Perform(c6, "faceto", player);	
			Perform(c6, "crouch", 1);

                        PlayerPerform("block", 0);
                        PlayerPerform("say", "好。。那我们走！！！");
                        PlayerPerform("pause", 3);
                        PlayerPerform("say", "但是你们要自己小心，我可顾不着管你们，因为咱老大有任务让办。");
                        PlayerPerform("say", "恩..也好，让你们熟悉一下外面的世界。。");
                        PlayerPerform("pause", 2);
                        PlayerPerform("block", 1);

                        trg0 = 5;
			timer2 = now + 10;
		}
	}
	if (trg0==5 && now>timer2)
	{

		AddNPC("圆满蒙面1");
		AddNPC("圆满蒙面2");
		AddNPC("圆满蒙面3");
		AddNPC("圆满蒙面4");
		AddNPC("圆满蒙面5");
		AddNPC("圆满蒙面6");
		AddNPC("圆满蒙面7");
		AddNPC("圆满蒙面8");
			trg0 = 6;
		}





        if (trg0==6)
	{
		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("伊人手下杀手1");
		c9 = GetAnyChar("伊人手下杀手2");
		c10 = GetAnyChar("伊人手下杀手3");
		c11 = GetAnyChar("伊人手下杀手4");
		c12 = GetAnyChar("伊人手下杀手5");
		c13 = GetAnyChar("伊人手下杀手6");
		c14 = GetAnyChar("伊人手下杀手7");
if (c>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0 && c7>=0 && c8>=0 && c9>=0 && c10>=0 && c11>=0 &&  c12>=0 && c13>=0 && GetHP(player)>0)
		{
			Perform(c, "say", "你以为我们会怕你吗？！上...");
			Perform(c, "pause", 3);
			Perform(c, "say", "-_-||,...～你知道了，孙玉伯那老家伙现在什么也没有了。我们也不在听命于他。");
			Perform(c, "pause", 2);
			Perform(c, "say", "你不知道我们，我们可是记得你，");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);


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


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


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

			Perform(c8, "say", "可恶，敢这样跟我们老大说话，受死。。");
			Perform(c8, "pause", 8);
			Perform(c8, "faceto", c);	


			Perform(c9, "pause", 8);
			Perform(c9, "faceto", c);
				
			Perform(c10, "pause", 8);
			Perform(c10, "faceto", c);		
			
			Perform(c11, "pause", 8);
			Perform(c11, "faceto", c);
			
			Perform(c12, "pause", 8);
			Perform(c12, "faceto", c);

			Perform(c13, "pause", 8);
			Perform(c13, "faceto", c);

			Perform(c14, "pause", 8);
			Perform(c14, "faceto", c);

			PlayerPerform("block", 0);
			PlayerPerform("say", "卑鄙的家伙！！！我好久没教训过你们这类的人了，今天就拿你开招。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "果真是孙剑的余党。～～");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "你们是谁？为什么会在这里。。说。。");
			PlayerPerform("block", 1);

			trg0 = 7;
		}
	}
	if (trg1 == 0)
	{
		c = GetAnyChar("圆满蒙面杀手-1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "哟..原来现在你也当上高官了，这也算的上是我们的功劳。");

			PlayerPerform("say", "不知羞耻～");
			PlayerPerform("pause", 2);
			trg1 = 1;
		}
	}
	if (trg1 == 1)
	{
		c = GetAnyChar("圆满蒙面杀手-1");
		if (GetHP(c) <= 0)
		{
			Say(c, "要不是有人帮你﹒我怎么会....");
			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 + 5;
		}
	}
   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");
                    AddNPC("圆满凶神6");
                    AddNPC("圆满凶神7");
                    AddNPC("圆满凶神8");
      	                trg1 = 5;        
      
		}





	if (trg1 == 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");
		c8 = GetAnyChar("伊人手下杀手1");
		c9 = GetAnyChar("伊人手下杀手2");
		c10 = GetAnyChar("伊人手下杀手3");
		c11 = GetAnyChar("伊人手下杀手4");
		c12 = GetAnyChar("伊人手下杀手5");
		c13 = GetAnyChar("伊人手下杀手6");
		c14 = GetAnyChar("伊人手下杀手7");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<800)
		{
			Perform(c, "say", "竟然小看我们，兄弟们，干掉他。");
			Perform(c, "guard", 6);
			Perform(c, "say", "你在不滚..我真对你不客气了。。");
			Perform(c, "guard", 6);
			Perform(c, "say", "3年前，圆满楼大战之后，我已经占领了，你独自闯入，你很无理..");
			Perform(c, "guard", 6);
			Perform(c, "say", "你这家伙好大的口气。..你知道我们是谁吗..");
			Perform(c, "guard", 6);
			Perform(c, "faceto", player);
			Perform(c, "say", "你们给我站住...");


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


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


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

			Perform(c8, "say", "受死吧。。。。。");
			Perform(c8, "pause", 25);
			Perform(c8, "faceto", c);	


			Perform(c9, "pause", 25);
			Perform(c9, "faceto", c);
				
			Perform(c10, "pause", 25);
			Perform(c10, "faceto", c);		
			
			Perform(c11, "pause", 25);
			Perform(c11, "faceto", c);
			
			Perform(c12, "pause", 25);
			Perform(c12, "faceto", c);

			Perform(c13, "pause", 25);
			Perform(c13, "faceto", c);

			Perform(c14, "pause", 25);
			Perform(c14, "faceto", c);

			PlayerPerform("say", "上.....");
			PlayerPerform("pause", 8);
			PlayerPerform("say", "哼...就你..");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "3年前？？？我和律香川曾在这相斗。。这家伙跟他有什么关系吗？");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "我刚刚好象问过你了。是你没回答我。。");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "你又是谁？不是我杀的，请你不要让我杀你。");
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			trg1 = 6;
		}
	}

	if (trg2 == 0)
	{
		c = GetAnyChar("凶神恶煞1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "哟.....。ni 还真行阿———111");

			PlayerPerform("say", "不知羞耻～");
			PlayerPerform("pause", 2);
			trg2 = 1;
		}
	}
	if (trg2 == 1)
	{
		c = GetAnyChar("凶神恶煞1");
		if (GetHP(c) <= 0)
		{
			Say(c, "我才当3年的老大...");
			trg2 = 2;
		}
	}	
	if (trg2 == 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);

			trg2 = 3;
			timer0 = now + 5;
		}
	}
   if (trg2 == 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"));
                RemoveNPC(GetAnyChar("伊人手下杀手1"));
		RemoveNPC(GetAnyChar("伊人手下杀手2"));
                RemoveNPC(GetAnyChar("伊人手下杀手3"));
		RemoveNPC(GetAnyChar("伊人手下杀手4"));
                RemoveNPC(GetAnyChar("伊人手下杀手5"));
		RemoveNPC(GetAnyChar("伊人手下杀手6"));
                RemoveNPC(GetAnyChar("伊人手下杀手7"));

	                trg2 = 4;    
			timer1 = now + 1;           
      
		}

        if (trg2 == 4 && now>timer1)
	{
                    AddNPC("圆满镖客1");
                    AddNPC("圆满镖客2");
                    AddNPC("圆满镖客3");
                    AddNPC("圆满镖客4");
                    AddNPC("圆满镖客5");
                    AddNPC("圆满镖客6");
                    AddNPC("圆满镖客7");
                    AddNPC("圆满镖客8");
      	                trg2 = 5;        
      
		}

if (trg3 == 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, "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", 19);
			PlayerPerform("use", 5);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("say", "......好似面熟...");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);


			trg3 = 1;

		}		
	}

	if (trg3 == 1)
	{
		c = GetAnyChar("圆满镖客-1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "好棘手的家伙...");

			PlayerPerform("say", "哼哼～");
			PlayerPerform("pause", 2);
			trg3 = 2;
		}
	}
	if (trg3 == 2)
	{
		c = GetAnyChar("圆满镖客-1");
		if (GetHP(c) <= 0)
		{
			Say(c, "我不甘心阿....");
			trg3 = 3;
		}
	}	
	if (trg3 == 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);

			trg3 = 4;
		        gameover = 1;
			timer0 = now + 5;
		}
	}



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

}
