// 抢救同门师弟
int Rule = 5;
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("伊人梦2");
	        AddNPC("凤凤1");
	        AddNPC("小何1");
	        AddNPC("叶翔1");
	        AddNPC("高老大1");
	        AddNPC("二公子1");
	        AddNPC("三公子1");


}



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("伊人梦");
		c1 = GetChar("凤凤");
		c2 = GetChar("小何");
		c4 = GetChar("叶翔");
		c5 = GetChar("高老大");
		c6 = GetChar("二公子");
		c7 = GetChar("三公子");
		if (c >= 0)
		{
			Perform(c, "faceto", player);	
                        Perform(c, "faceto", player);	
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
                        Perform(c1, "use", 5);
                        Perform(c1, "use", 19);
                        Perform(c2, "use", 5);
                        Perform(c2, "use", 19);
                        Perform(c3, "use", 5);
                        Perform(c3, "use", 19);
                        Perform(c4, "use", 5);
                        Perform(c4, "use", 19);
                        Perform(c5, "use", 5);
                        Perform(c5, "use", 19);
                        Perform(c6, "use", 5);
                        Perform(c6, "use", 19);
                        Perform(c7, "use", 5);
                        Perform(c7, "use", 19);
			PlayerPerform("use", 19);
			PlayerPerform("use", 33);
			PlayerPerform("use", 34);
			PlayerPerform("use", 5);
		
			PlayerPerform("use", 19);
			trg0 = 1;
		}
	}

        if (trg0 == 1)
        {          
                c = GetAnyChar("二公子"); 
		c1 = GetAnyChar("伊人梦");
		c2 = GetAnyChar("凤凤");
		c3 = GetAnyChar("小何");
		c4 = GetAnyChar("叶翔");
		c5 = GetAnyChar("高老大");
		c6 = GetAnyChar("三公子");        
                if (c>=0 && GetEnemy(c)==player)
                {           
                        ChangeBehavior(c, "kill", player);
			Perform(c, "faceto", player);
                        Perform(c, "say", "好，今天就好好的来一场血战吧。。");
                        Perform(c, "pause", 5);
			Perform(c, "faceto", player);
                        Perform(c, "say", "真有这么厉害吗？，我想杀你为我哥哥报仇。。。今天我一定会杀了你。.");
                        Perform(c, "pause", 5);
			Perform(c, "faceto", player);
                        Perform(c, "say", "哼哼。。是吗？杀不死，但我能杀他们。。");
                        Perform(c, "pause", 4);
			Perform(c, "faceto", player);
                        Perform(c, "say", "当然是想杀你喽。。要不然我抓他们干什么。");
                        Perform(c, "pause", 3);
			Perform(c, "faceto", player);
                        Perform(c, "say", "哈哈，伊人君，你的同门师姐弟都在这里，还有你的老大。");
			Perform(c, "faceto", player);	

		        Perform(c1, "pause", 300);
		        Perform(c2, "pause", 300);
		        Perform(c3, "pause", 300);
			Perform(c4, "pause", 300);  
		        Perform(c5, "pause", 300);
                        ChangeBehavior(c6, "kill", player);
		        Perform(c6, "pause", 20); 
      
			PlayerPerform("block", 0);
                        PlayerPerform("say", "我今天也不会对你客气。..");
                        PlayerPerform("say", "那就放马过来吧。。.");
                        PlayerPerform("pause", 7); 
                        PlayerPerform("say", "......哼哼。。");
                        PlayerPerform("pause", 4);
                        PlayerPerform("say", "你敢动他们一根寒毛，我要你的命。");
                        PlayerPerform("pause", 4);
                        PlayerPerform("say", "杀我，你不是我的对手，你杀我也只不过像你哥哥一样。");
                        PlayerPerform("pause", 3);
                        PlayerPerform("say", "阿...为什么会这样，你们是如何抓住他们的，可恶。。你们究竟想怎样。");
                        PlayerPerform("pause", 2);
                        PlayerPerform("block", 1);
                        
                        trg0 = 2;     
			timer0 = now + 40;
                }          
        }

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

                AddNPC("律香彬1");

		trg0 = 3;


	}
        if (trg0 == 3)
        {          
                c = GetAnyChar("律香彬"); 
                c1 = GetAnyChar("二公子"); 
		c2 = GetAnyChar("三公子");        
                if (c>=0 && GetEnemy(c)==player)
                {           
                        ChangeBehavior(c, "kill", player);
			Perform(c, "faceto", player);
                        Perform(c, "say", "哈哈，我们不会杀他们。只是想杀你一个人。看招吧，公子，给你大哥报仇的机会来了，还不动手。");
                        Perform(c, "pause", 5);
			Perform(c, "faceto", player);
                        Perform(c, "say", "卑鄙？.不卑鄙怎么会把你的老大们抓来。");
                        Perform(c, "pause", 5);
			Perform(c, "faceto", player);
                        Perform(c, "say", "哼哼。。你可不要对自己这么有信心阿。今天有两位公子在，我还怕你。");
                        Perform(c, "pause", 4);
			Perform(c, "faceto", player);
                        Perform(c, "say", "哎哟，我怕阿。我不骗你能活到今天吗？");
                        Perform(c, "pause", 3);
			Perform(c, "faceto", player);
                        Perform(c, "say", "呵。。。伊人君，你好。。");
			Perform(c, "faceto", player);	

                        ChangeBehavior(c1, "kill", player);
                        Perform(c1, "say", "我只想为我哥报仇。");
		        Perform(c1, "pause", 25);

                        ChangeBehavior(c2, "kill", player);
                        Perform(c2, "say", "我只想为我哥报仇。");
		        Perform(c2, "pause", 25); 
      
			PlayerPerform("block", 0);
                        PlayerPerform("say", "我今天不会对你们任何一个仁慈的。。受死吧。");
                        PlayerPerform("say", "1 2 3.你们三个，死期到了。");
                        PlayerPerform("pause", 7); 
                        PlayerPerform("say", "你们把我的老大，和师弟门弄哪了。。可恶。.");
                        PlayerPerform("pause", 4);
                        PlayerPerform("say", "狗仗人势，绝种的卑鄙。。");
                        PlayerPerform("pause", 4);
                        PlayerPerform("say", "小人，活着一点意思没有，今天我就灭了你。");
                        PlayerPerform("pause", 3);
                        PlayerPerform("say", "（你他吗的骗我，今天我就要你的命。）");
                        PlayerPerform("pause", 2);
                        PlayerPerform("block", 1);
                        
                        trg0 = 4;     
                }          
        }



 if (trg1 == 0)
	{
		c = GetAnyChar("二公子");
                c2 = GetChar("伊人梦"); 
		if (c2>=0 && GetHP(c2)<GetMaxHP(c2))
	        {
			Perform(c, "say", "你去死吧...");
			Perform(c, "pause", 2);
			Perform(c, "say", "自己的老婆都敢杀。...");
			Perform(c, "faceto", player);
			Perform(c, "say", "哈哈。");


			PlayerPerform("use", 35);	
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			trg1 = 1;
		}
	}             
     if (trg2 == 0)
	{
		c = GetAnyChar("二公子");
                c2 = GetChar("凤凤"); 
		if (c2>=0 && GetHP(c2)<GetMaxHP(c2))
	        {
			Perform(c, "say", "你去死吧...");
			Perform(c, "pause", 3);
			Perform(c, "say", "自己的同门师姐弟都敢杀，...");
			Perform(c, "faceto", player);


			PlayerPerform("use", 35);	
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			trg2 = 1;
		}
	}   
     if (trg3 == 0)
	{
		c = GetAnyChar("二公子");
                c2 = GetChar("小何"); 
		if (c2>=0 && GetHP(c2)<GetMaxHP(c2))
	        {
			Perform(c, "say", "你去死吧...");
			Perform(c, "pause", 3);
			Perform(c, "say", "自己的同门师姐弟都敢杀，...");
			Perform(c, "faceto", player);


			PlayerPerform("use", 35);	
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			trg3 = 1;
		}
	}  
     if (trg4 == 0)
	{
		c = GetAnyChar("二公子");
                c2 = GetChar("叶翔"); 
		if (c2>=0 && GetHP(c2)<GetMaxHP(c2))
	        {
			Perform(c, "say", "你去死吧...");
			Perform(c, "pause", 3);
			Perform(c, "say", "自己的同门师姐弟都敢杀，..");
			Perform(c, "faceto", player);


			PlayerPerform("use", 35);	
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			trg4 = 1;
		}
	}  
     if (trg5 == 0)
	{
		c = GetAnyChar("二公子");
                c2 = GetChar("高老大"); 
		if (c2>=0 && GetHP(c2)<GetMaxHP(c2))
	        {
			Perform(c, "say", "你去死吧...");
			Perform(c, "pause", 3);
			Perform(c, "say", "自己的老大你也敢杀，你去死吧。...");
			Perform(c, "faceto", player);


			PlayerPerform("use", 35);	
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);

			trg5 = 1;
		}
	}  
      if (trg6 == 0)
	{
		c = GetAnyChar("律香彬");
		if (c>=0 && GetHP(c)<5000)
		{

			Perform(c, "say", "呜。。很棘手。。伊人君阿。。。");
			Perform(c, "faceto", player);

			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)<3000)
		{

			Perform(c, "say", "这么厉害，难道我报不了仇吗？");
			Perform(c, "faceto", player);
			trg7 = 1; 


                }
		c = GetAnyChar("三公子");
		if (c>=0 && GetHP(c)<3000)
		{

			Perform(c, "say", "操。。这么厉害，难道我报不了仇吗？");
			Perform(c, "faceto", player);

			trg7 = 1; 
		}		

         }

        if (trg7 == 1)
	{
		c = GetAnyChar("二公子");
		c1 = GetAnyChar("三公子");
		c2 = GetAnyChar("伊人梦");
		c3 = GetAnyChar("律香彬");
if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c3)<=0 && player>=0 && GetHP(player)>0)
		{

                        RemoveNPC(c);
                        RemoveNPC(c1);
                        RemoveNPC(c3);
			Perform(c2, "pause", 100000);
			Perform(c2, "say", "老公，我跟你一起去金华。。。");
			Perform(c2, "pause", 1);
		        Perform(c2, "faceto", player);	

			StopChat();	
			c2 = GetChar("凤凤");
			if (c2 >= 0)
			{
			Perform(c2,"guard", 99999);
			Perform(c2, "faceto", player);
			}			
			c2 = GetChar("高老大");
			if (c2 >= 0)
			{

			Perform(c2,"guard", 99999);
			Perform(c2, "faceto", player);
			}
			c2 = GetChar("小何");
			if (c2 >= 0)
			{
			Perform(c2,"guard", 99999);
			Perform(c2, "faceto", player);
			}
			c2 = GetChar("叶翔");
			if (c2 >= 0)
			{
			Perform(c2,"guard", 99999);
			Perform(c2, "faceto", player);
			}


			PlayerPerform("say", "我们走。。。赶紧赶去金华。去那里跟他们做个（了断），杀不死孙剑的弟弟我们是不会安宁的。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "梦，你就跟我一起去金华。叶翔-小何-凤凤.你们马上送老大回去。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "此地不宜久留。。。");
			trg7 = 2;
		        gameover = 1;
			timer1 = now + 8;

		}
	}





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

}
