//  伏虎
int Rule = 1;
int RoundTime = 60;
int PlayerSpawn = 121;
int PlayerSpawnDir = 180;
int PlayerWeapon = 15;
int PlayerWeapon2 = 6;
int PlayerHP = 5000;

int trg0 = 0;
int trg1 = 0;
int trg2 = 0;
int trg3 = 0;
int trg4 = 0;
int trg5 = 0;
int trg6 = 0;
int timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int timer5 = 0;
int timer6 = 0;
int timer7 = 0;
int timer8 = 0;
int timer9 = 0;
int gameover = 0;

OnStart()
{
	AddNPC("npc-17-02");
}

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("履面使"); 		
		if (c>=0)
		{
			Perform(c, "say", "前面就是第一个目标少林了，我们动手吧");
			Perform(c, "pause", 4);
			Perform(c, "say", "主人已经知道了，现在我将帮助你完成第二个任务……用此剑分别杀死三大门派的掌门");
			Perform(c, "pause", 4);
			Perform(c, "say", "不，我是新的履面使，上一位已经死了……");
			Perform(c, "pause", 4);
			Perform(c, "faceto", player);
		
			PlayerPerform("block", 0);
                        PlayerPerform("say", "恩！"); 
			PlayerPerform("pause", 8);
                        PlayerPerform("say", "是么……那你告诉主人我已取得飞焱宝剑……"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "！！！！你还活着？？？？"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);

			trg0 = 1;
                        timer0 = now + 12;
		}
	}
	if (trg1 == 0)
	{
		c = GetChar("少林和尚-甲");
		c1 = GetChar("履面使"); 
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "既然施主不走，贫僧也不客气了…………");
			Perform(c, "pause", 4);
			Perform(c, "say", "是……");
			Perform(c, "pause", 4);
			Perform(c, "say", "施主请留步，前方乃少林驻地不可参观");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 10);

			PlayerPerform("block", 0);
                        PlayerPerform("say", "把你们主持叫出来，我要杀了他"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "你是和尚？？"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			trg1 = 1;
		}
	}
	if (trg2 == 0)
	{
		c = GetChar("少林和尚-乙");
		c1 = GetChar("履面使"); 
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "那请先打败贫僧…………");
			Perform(c, "pause", 2);
			Perform(c, "say", "…………");
			Perform(c, "pause", 4);
			Perform(c, "say", "少林好久没来外人了，施主有何贵干？？");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 10);

			PlayerPerform("block", 0);
                        PlayerPerform("say", "哼！！！"); 
			PlayerPerform("pause", 6);
                        PlayerPerform("say", "杀了你们主持"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			trg2 = 1;
		}
	}
	if (trg3 == 0)
	{
		c = GetChar("少林和尚-丙");
		c1 = GetChar("履面使"); 
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "那贫僧领教了……");
			Perform(c, "pause", 4);
			Perform(c, "say", "那可不行……");
			Perform(c, "pause", 4);
			Perform(c, "say", "施主何干？？");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 10);

			PlayerPerform("block", 0);
                        PlayerPerform("say", "滚，要不连你也杀了！！！"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "杀. 主. 持"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			trg3 = 1;
		}
	}
	if (trg4 == 0)
	{
		c = GetChar("少林和尚-丁");
		c1 = GetChar("履面使"); 
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "施主请勿口出狂言…………");
			Perform(c, "pause", 4);
			Perform(c, "say", "…………");
			Perform(c, "pause", 4);
			Perform(c, "say", "施主留步，此处游人不得参观…………");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 10);

			PlayerPerform("block", 0);
                        PlayerPerform("say", "哼，去死吧！！！"); 
			PlayerPerform("pause", 8);
                        PlayerPerform("say", "滚！！！！！"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			trg4 = 1;
		}
	}
        if (trg0 == 1 && now>timer0)
	{
	                AddNPC("npc-17-03");
	                AddNPC("npc-17-04");
	                AddNPC("npc-17-05");
	                AddNPC("npc-17-06");

	                trg0 = 2; 
	}
	if (trg1 == 1 && trg2 == 1 && trg3 == 1 && trg4 == 1 && trg0 == 2)
	{
		c = GetAnyChar("少林和尚-甲");
		c2 = GetAnyChar("少林和尚-乙");
		c3 = GetAnyChar("少林和尚-丙");
		c4 = GetAnyChar("少林和尚-丁");

		if (GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c)<=0 && player>=0 && GetHP(player)>0)
		{
			PlayerPerform("say", "这下主持该滚出来了吧！！！");
			timer1 = now + 3;
			trg0 = 3;
		}
	}
	if (trg0 == 3 && now>timer1)
	{
			RemoveNPC(c);
			RemoveNPC(c2);
			RemoveNPC(c3);
			RemoveNPC(c4);
			timer2 = now + 3;
		trg0 = 4;
	}
	if (trg0 == 4 && now>timer2)
	{
	                AddNPC("npc-17-07");
	                AddNPC("npc-17-08");
	                AddNPC("npc-17-09");
	                AddNPC("npc-17-10");
		trg0 = 5;
	}
	if (trg0 == 5)
	{
		c = GetChar("少林武僧-甲");
		c2 = GetChar("少林武僧-乙");
		c3 = GetChar("少林武僧-丙");
		c4 = GetChar("少林武僧-丁");
		if (c>=0 && c2>=0 && c3>=0 && c4>=0)
		{
			ChangeBehavior(c, "kill", player);
			Perform(c, "say", "大家去把那个刺客拿下！！！！");

			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "是！！！！");
			Perform(c2, "pause", 2);

			ChangeBehavior(c4, "follow", c);
			Perform(c4, "say", "是！！！！");
			Perform(c4, "pause", 2);

			ChangeBehavior(c3, "follow", c);
			Perform(c3, "say", "是！！！！");
			Perform(c3, "pause", 2);
			trg0 = 6;
		}
	}
	if (trg0 == 6)
	{
		c = GetChar("少林武僧-甲");
		c1 = GetChar("履面使"); 
		c2 = GetChar("少林武僧-乙");
		c3 = GetChar("少林武僧-丙");
		c4 = GetChar("少林武僧-丁");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "好语相劝阁下不知，那就兵刃上见功夫吧！！！");
			Perform(c, "pause", 4);
			Perform(c, "say", "主持大师正在闭关修炼……阁下若有事就找方丈吧");
			Perform(c, "pause", 4);
			Perform(c, "say", "少林乃清静之地，阁下在此大开杀戒，似乎也太不把我们放在眼里了吧………");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 10);

			Perform(c2, "pause", 10);

			Perform(c3, "pause", 10);

			Perform(c4, "pause", 10);

			PlayerPerform("block", 0);
                        PlayerPerform("say", "哦，知道了，现在，你可以死了。"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "你是主持么？"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			trg0 = 7;
		}
	}
	if (trg0 == 7)
	{
		c = GetAnyChar("少林武僧-甲");
		c1 = GetAnyChar("履面使"); 
		c2 = GetAnyChar("少林武僧-乙");
		c3 = GetAnyChar("少林武僧-丙");
		c4 = GetAnyChar("少林武僧-丁");
		if (GetHP(c)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && player>=0 && GetHP(player)>0)
		{
			PlayerPerform("say", "哼，少林也不过尔尔……");

			timer3 = now + 3;
			trg0 = 8;
		}
	}
	if (trg0 == 8 && now>timer3)
	{
			RemoveNPC(c);
			RemoveNPC(c2);
			RemoveNPC(c4);
			RemoveNPC(c3);
			timer4 = now + 3;
		trg0 = 9;
	}
	if (trg0 == 9 && now>timer4)
	{
		        AddNPC("npc-17-11");
		        AddNPC("npc-17-12");
		        AddNPC("npc-17-13");
		        AddNPC("npc-17-14");
		trg0 = 10;
	}
        if (trg0 == 10)
        {
		c = GetChar("少林禅师-甲");
		c1 = GetChar("履面使"); 
		c2 = GetChar("少林禅师-乙");
		c3 = GetChar("少林禅师-丙");
		c4 = GetChar("少林禅师-丁");
		if (c>=0 && c2>=0 && c3>=0 && c4>=0)
		{
			Perform(c, "say", "杀………");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 3);

			Perform(c2, "pause", 3);

			Perform(c3, "pause", 3);

			Perform(c4, "pause", 3);

                        PlayerPerform("say", "来吧！！！！"); 
			PlayerPerform("pause", 2);
			trg0 = 11;
		}
        }
	if (trg0 == 11)
	{
		c = GetAnyChar("少林禅师-甲");
		c1 = GetAnyChar("履面使"); 
		c2 = GetAnyChar("少林禅师-乙");
		c3 = GetAnyChar("少林禅师-丙");
		c4 = GetAnyChar("少林禅师-丁");
		if (GetHP(c)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && player>=0 && GetHP(player)>0)
		{
                        PlayerPerform("say", "一群又一群的杂碎，什么时候才可以见到主持啊！！！！"); 
			PlayerPerform("pause", 2);
			PlayerPerform("say", "这样下去太没完没了了……");

			timer5 = now + 3;
			trg0 = 12;
		}
	}
	if (trg0 == 12 && now>timer5)
	{
			RemoveNPC(c);
			RemoveNPC(c2);
			RemoveNPC(c4);
			RemoveNPC(c3);
			timer6 = now + 3;
		trg0 = 13;
	}
	if (trg0 == 13 && now>timer6)
	{
		        AddNPC("npc-17-15");
		        AddNPC("npc-17-16");
		        AddNPC("npc-17-17");
		trg0 = 14;
	}
        if (trg0 == 14)
        {
		c = GetChar("长老-空明");
		c1 = GetChar("履面使"); 
		c2 = GetChar("长老-空见");
		c3 = GetChar("长老-空闻");
		if (c>=0 && c2>=0 && c3>=0)
		{

			ChangeBehavior(c, "kill", player);
			Perform(c, "say", "是，我们不是主持。");
			Perform(c, "pause", 4);
			Perform(c, "say", "我们会帮施主转达的");
			Perform(c, "pause", 2);
			Perform(c, "say", "主持正在闭关中，所以有什么事请于老衲谈。");
			Perform(c, "pause", 2);
			Perform(c, "say", "够了，施主来此必是有事了");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 12);

			ChangeBehavior(c2, "kill", player);
			Perform(c2, "pause", 12);

			ChangeBehavior(c3, "kill", player);
			Perform(c3, "pause", 12);

			PlayerPerform("block", 0);
                        PlayerPerform("say", "那你们就去死吧！！！"); 
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "意思是你们不是主持？？"); 
			PlayerPerform("pause", 8);
			PlayerPerform("block", 1);
			trg0 = 15;
		}
        }
	if (trg0 == 15)
	{
		c = GetAnyChar("长老-空明");
		c1 = GetChar("履面使"); 
		c2 = GetAnyChar("长老-空见");
		c3 = GetAnyChar("长老-空闻");
		if (GetHP(c)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && player>=0 && GetHP(player)>0)
		{
                        PlayerPerform("say", "少林都要给我踏平了！！！"); 
			PlayerPerform("pause", 2);
                        PlayerPerform("say", "靠，那个鸟主持还不出来么？？？"); 
			PlayerPerform("pause", 2);
			PlayerPerform("say", "………………");

			timer7 = now + 5;
			trg0 = 16;
		}
	}
	if (trg0 == 16 && now>timer7)
	{
			RemoveNPC(c);
			RemoveNPC(c2);
			RemoveNPC(c3);
		        AddNPC("npc-17-18");
		        trg0 = 17;
	}
	if (trg0 == 17)
	{
		c = GetChar("主持-天照");
		c1 = GetChar("履面使"); 
		if (c>=0 && c1>=0)
		{
			Perform(c, "say", "既然阁下都如此说了，老衲就来试试你吧！！！");
			Perform(c, "pause", 4);
			Perform(c, "say", "………………");
			Perform(c, "pause", 4);
			Perform(c, "say", "阁下应当知道");
			Perform(c, "pause", 2);
			Perform(c, "say", "少林不是随便杀人的地方！！！");
			Perform(c, "pause", 2);
			Perform(c, "say", "阁下的那招千里传音很不错啊");
			Perform(c, "pause", 4);
			Perform(c, "faceto", player);

			Perform(c1, "pause", 14);

			PlayerPerform("block", 0);
           		PlayerPerform("use", 15);
           		PlayerPerform("use", 15);
           		PlayerPerform("use", 15);
           		PlayerPerform("use", 15);
           		PlayerPerform("use", 20);
			PlayerPerform("pause", 2);
                        PlayerPerform("say", "少废话，少林那么多人的命都是因为你不肯出来而丢的！！！"); 
			PlayerPerform("pause", 6);
                        PlayerPerform("say", "你终于肯出来了………"); 
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			trg0 = 18;
		}
	}
	if (trg5 == 0)
	{
		c = GetAnyChar("主持-天照");
		c1 = GetAnyChar("履面使");
		if (GetHP(player)<GetMaxHP(player)/3)
		{
			Perform(c, "say", "怎么，阁下只有这点实力么？？？");
			Perform(c, "pause", 3);

			Perform(c1, "pause", 6);

			PlayerPerform("say", "（少林功夫真不是盖的………）");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "（可恶………）");
			PlayerPerform("pause", 4);
					
			trg5 = 1;	
		}	
	}
	if (trg6 == 0)
	{
		c = GetAnyChar("主持-天照");
		c1 = GetAnyChar("履面使");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 8);
			Perform(c, "use", 5);
			Perform(c, "use", 4);
			Perform(c, "use", 3);
			Perform(c, "say", "看来我得认真了");
			Perform(c, "pause", 2);
			Perform(c, "say", "阁下果然好本事！！！");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 6);

			PlayerPerform("pause", 4);			
			trg6 = 1;
		}	
	}
	if (trg6 == 1)
	{
		c = GetAnyChar("主持-天照");
		c1 = GetChar("履面使");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/3)
		{
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 16);
			Perform(c, "use", 8);
			Perform(c, "use", 5);
			Perform(c, "use", 4);
			Perform(c, "use", 3);
			Perform(c, "say", "果然是高手！！！看我的！！！");
			Perform(c, "pause", 2);
			Perform(c, "say", "好厉害！！！");
			Perform(c, "faceto", player);

			Perform(c1, "pause", 6);

			PlayerPerform("pause", 4);			
			trg6 = 2;
			timer8 = now + 3;
		}	
	}
	if (trg6 == 2 && now>timer8)
        {
		AddNPC("npc-17-19");
		AddNPC("npc-17-20");

		trg6 = 3;
        }
	if (trg6 == 3)
	{
		c = GetAnyChar("主持-天照");
		c1 = GetChar("履面使");
		c2 = GetAnyChar("幻影");
		c3 = GetAnyChar("分身");
		if (c>=0 && GetHP(c)<0)
		{
			Perform(c2, "use", 35);

			Perform(c3, "use", 35);

			Perform(c1, "pause", 6);

			PlayerPerform("pause", 4);			
			trg6 = 4;
		}	
	}
	if (trg6 == 4)
	{
		trg6 = 5;
		gameover = 1;
	}
	if (gameover!=-1 && GetHP(player)<=0)
	{
		gameover = -1;
		timer1 = now + 2; 
	}
	if ((gameover==1 || gameover==-1) && now>timer1)
	{
		GameOver(gameover);
		gameover = 2;
	}
}
