// ヱ
int Rule = 1;
int RoundTime = 99;
int PlayerSpawn = 66;
int PlayerSpawnDir = 0;
int PlayerWeapon = 50;
int PlayerWeapon2 = 17;
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;

OnStart()
{
		AddNPC("npc03_09");
		AddNPC("npc03_10");

}
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 (trg1 == 0)
	{
		c = GetChar("律香彬");	
		c2 = GetChar("伊人梦");	
	
		if (c>=0 && GetEnemy(c)==player)
		{
                     ChangeBehavior(c,"follow",player);
			Perform(c, "use", 33);
			Perform(c, "say", " 不自量力.");
			Perform(c, "faceto", player);
			Perform(c, "pause", 5);
			Perform(c, "say", "﹒﹒﹒﹒﹒﹒就让我先来会会你吧。。");
			Perform(c, "faceto", player);
                        Perform(c, "aggress");			
			Perform(c, "say", "伊人君，有我在，你休想暗杀孙主子，");
			Perform(c, "faceto", player);    

                     ChangeBehavior(c2,"follow",player);
			Perform(c2, "pause", 20);
			Perform(c2, "faceto", player);

                        PlayerPerform("use", 34);
                        PlayerPerform("say", "（好阿。。我也想会会你。。。）"); 
			PlayerPerform("pause", 5);
			PlayerPerform("say", "﹒﹒？？？？？？）");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "（哦，。是吗？）");
			PlayerPerform("pause", 4);
			PlayerPerform("block", 1);
                              trg1 = 1;
                
                    }   

           } 


        if (trg1 == 1)
	{
		c = GetChar("律香彬");
		if (c>=0 && GetHP(c)<5000)
		{
			


			Perform(c, "say", "伊人君，我现在有事，咱们金华比高低。。");
			Perform(c, "faceto", player);

			PlayerPerform("say", "想跑。。");
			PlayerPerform("pause", 4);
					

			PlayerPerform("block", 1);
			trg1 = 2;
			timer0 = now + 3;
		}	
	}



         if (trg1 == 2 && now>timer0)
	{
		AddNPC("npc03_11");
		AddNPC("npc03_12");
		AddNPC("npc03_13");
		RemoveNPC(GetAnyChar("律香彬"));

		trg1 = 3;
	}


if (trg0 == 0)
	{
		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", 1);   
			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,"guard", 9999);

			Perform(c2,"guard", 9999);

			Perform(c3,"guard", 9999);

               

			PlayerPerform("block", 0);
                        PlayerPerform("say", "那好。。那我就不客气了。。"); 
			PlayerPerform("pause", 3);
                        PlayerPerform("say", "（哈哈。笑话。。让开，别以为你是女人我就会对你客气。）"); 
			PlayerPerform("pause", 2);
                        PlayerPerform("say", "（哟。又来了几个找死的阿。。哈哈）"); 
			PlayerPerform("block", 1);

			trg0 = 1;
                }          
        }     
        if (trg0 == 1)
        {
                c = GetAnyChar("一线天-女侠");      
                if (c>=0 && GetHP(c)<6000)
                {
                        Perform(c, "say", "好！痛快，好久没这么爽过了");
                        trg0 = 2;
		}
	}          
        if (trg0 == 2)
        {
                c = GetAnyChar("一线天-女侠");      
                if (c>=0 && GetHP(c)<4000)
                {
                        Perform(c, "say", "恩，小子有点斤两！！！");
                        trg0 = 3;
		}
	}  
        if (trg0 == 3)
        {
                c = GetAnyChar("一线天-女侠");      
                if (c>=0 && GetHP(c)<2500)
                {
                        Perform(c, "say", "呃…………");

			PlayerPerform("block", 1);
                        trg0 = 4;
		}
	}  
        if (trg0 == 4)
        {
		c = GetChar("一线天-侠客"); 
		c1 = GetChar("一线天-女侠"); 
                if (c>=0 && c1>=0 && c2>=0)
                {

                        ChangeBehavior(c, "kill", player);
			Perform(c,"use", 15);
			Perform(c,"use", 15);
                        Perform(c, "say", "你先休息下，让我来。上！");
			Perform(c,"pause", 2);
                        Perform(c, "say", "（你不行了……这人好身手！！看来会有一场恶战……）");

                        ChangeBehavior(c1, "idle");
			Perform(c1,"guard", 9999);
			Perform(c1,"use", 16);
			Perform(c1,"use", 33);
			Perform(c1,"use", 15);
			Perform(c1,"use", 15);
			Perform(c1,"say", "唔……好了我知道了（总是那么麻烦，让我一刀宰了他不就好了？）"); 
			Perform(c1,"pause", 3);
			Perform(c1,"say", "为什么？？？我明明打的正爽呢！！！"); 
			Perform(c1,"pause", 1);


                        PlayerPerform("block", 1);
			PlayerPerform("pause", 14);

                        trg0 = 5;
		}
	}  
        if (trg0 == 5)
        {
                c = GetAnyChar("一线天-侠客");      
                if (c>=0 && GetHP(c)<6000)
                {
                        Perform(c, "say", "恩，不身手错（原来他不仅人长得帅，而且身手也不错，呜呜呜，）");
                        trg0 = 6;
		}
	}          
        if (trg0 == 6)
        {
                c = GetAnyChar("一线天-侠客");      
                if (c>=0 && GetHP(c)<4000)
                {
                        Perform(c, "say", "哎呀，我要用真功夫了哦！！！");
                        trg0 = 7;
		}
	}  
        if (trg0 == 7)
        {
                c = GetAnyChar("一线天-侠客");      
                if (c>=0 && GetHP(c)<2500)
                {
			Perform(c, "pause", 2);
                        Perform(c, "say", "（眼神：半痴半醉……）");

                        PlayerPerform("say", "…………");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
                        trg0 = 8;
		}
	}  
        if (trg0 == 8)
        {
		c = GetChar("一线天-怒火"); 
		c1 = GetChar("一线天-侠客");
                c2 = GetChar("一线天-女侠");   
                if (c>=0 && c1>=0 && c2>=0)
                {
                        ChangeBehavior(c, "kill", player);
			Perform(c,"use", 15);
			Perform(c,"use", 15);
                        Perform(c, "say", "你休息下，我来！");
			Perform(c,"pause", 2);
                        Perform(c, "say", "（这是怎么了？？？心不在焉的样子………）");
			Perform(c,"pause", 2);

                        ChangeBehavior(c2, "idle");
			Perform(c2,"guard", 9999);
			Perform(c2,"use", 16);
			Perform(c2,"use", 16);
			Perform(c2,"use", 15);
			Perform(c2,"use", 15);
			Perform(c2,"say", "......"); 
			Perform(c2,"pause", 6);

                        ChangeBehavior(c1, "idle");
			Perform(c1,"guard", 9999);


                        PlayerPerform("block", 1);
			PlayerPerform("pause", 7);
			
                        trg0 = 9;
		}
	}  
        if (trg0 == 9)
        {
                c = GetAnyChar("一线天-怒火");      
                if (c>=0 && GetHP(c)<6000)
                {
                        Perform(c, "say", "哦？……（看来我小瞧他了……）");
                        trg0 = 10;
		}
	}          
        if (trg0 == 10)
        {
                c = GetAnyChar("一线天-怒火");      
                if (c>=0 && GetHP(c)<5000)
                {
                        Perform(c, "say", "……（好厉害……难怪打不赢他）");
                        trg0 = 11;
		}
	}  
        if (trg0 == 11)
        {
                c = GetAnyChar("一线天-怒火");      
                if (c>=0 && GetHP(c)<4000)
                {
                        Perform(c, "say", "唔，好身手，佩服！");

			PlayerPerform("block", 1);
                        trg0 = 12;      

		}
	}  
        if (trg0 == 12)
        {
		c = GetChar("一线天-怒火"); 
                if (c>=0 && GetHP(c)<3000)
                {
			Perform(c,"use", 16);
			Perform(c,"use", 16);
			Perform(c,"use", 15);
			Perform(c,"use", 15);
			Perform(c,"pause", 1);
                        Perform(c, "say", "现在我们要一起上了！！阁下注意了！！");
			Perform(c,"pause", 4);
                        Perform(c, "say", "阁下好身手，让在下佩服不已");
			Perform(c,"pause", 2);

                        StopChat();								
			c2 = GetChar("一线天-侠客");
			if (c2 >= 0)
			{
                                ChangeBehavior(c2, "kill", player);
			Perform(c2,"use", 16);
			Perform(c2,"use", 16);
			Perform(c2,"use", 16);
			Perform(c2,"use", 16);
			        Perform(c2, "say", "那我们一起上蛤。。");
				Perform(c2, "guard", 10);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("一线天-女侠");
			if (c2 >= 0)
			{

                                ChangeBehavior(c2, "kill", player);
			Perform(c2,"use", 16);
			Perform(c2,"use", 16);
			Perform(c2,"use", 16);
			Perform(c2,"use", 16);
			        Perform(c2, "say", "帅哥。。我来了。");
				Perform(c2, "guard", 10);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("伊人梦");
			if (c2 >= 0)
			{

                                ChangeBehavior(c2, "kill", player);
			        Perform(c2, "say", "那我也不闲着喽。。");
				Perform(c2, "guard", 10);
				Perform(c2, "faceto", player);
			}		

			PlayerPerform("block", 0);
			PlayerPerform("say", "哦，来吧！！");
			PlayerPerform("pause", 4);
                        PlayerPerform("say", "过奖"); 
			PlayerPerform("pause", 4);
			PlayerPerform("block", 1);
                        trg0 = 13;
		}
	}  
        if (trg0 == 13)
        {
		c = GetAnyChar("一线天-怒火"); 
		c1 = GetAnyChar("一线天-侠客");
                c2 = GetAnyChar("一线天-女侠");  
                if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c2)<=0 && player>=0 && GetHP(player)>0)
                {

			
			PlayerPerform("block", 0);
                        PlayerPerform("say", "后会有期！！。"); 
			PlayerPerform("block", 1);
                        trg0 = 14;
                        timer1 = now + 5;
		}
       } 


         if (trg0 == 14 && now>timer1)
	{
		AddNPC("npc03_01");
		AddNPC("npc03_02");
		AddNPC("npc03_03");
		AddNPC("npc03_04");
		AddNPC("npc03_05");
		AddNPC("npc03_06");
		AddNPC("npc03_07");
		AddNPC("npc03_08");
		RemoveNPC(GetAnyChar("一线天-怒火"));
                RemoveNPC(GetAnyChar("一线天-侠客"));
		RemoveNPC(GetAnyChar("一线天-女侠"));
		trg0 = 15;
	}


     if (trg0==15)
	{
		c = GetChar("一线天首领");
		c2 = GetChar("一线天守卫1");
		c3 = GetChar("一线天守卫2");
		c4 = GetChar("一线天守卫3");
		c5 = GetChar("一线天守卫4");
		c6 = GetChar("一线天守卫5");
		c7 = GetChar("一线天守卫6");
		c8 = GetChar("一线天守卫7");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0 && c7>=0 && c8>=0 &&GetEnemy(c)==player && Distance(0, 1)<200)
		{

                        ChangeBehavior(c,"follow",player);
			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);
				
                        ChangeBehavior(c4,"follow",player);
			Perform(c4, "say", "是！");
			Perform(c4, "pause", 2);
			Perform(c4, "faceto", c);		
			
                        ChangeBehavior(c5,"follow",player);
			Perform(c5, "say", "是！");
			Perform(c5, "pause", 2);
			Perform(c5, "faceto", c);
			
                        ChangeBehavior(c6,"follow",player);
			Perform(c6, "say", "是！");
			Perform(c6, "pause", 2);
			Perform(c6, "faceto", c);

                        ChangeBehavior(c7,"follow",player);
			Perform(c7, "say", "是！");
			Perform(c7, "pause", 2);
			Perform(c7, "faceto", c);
			
                        ChangeBehavior(c8,"follow",player);
			Perform(c8, "say", "是！");
			Perform(c8, "pause", 2);
			Perform(c8, "faceto", c);

                 
			PlayerPerform("block", 0);
			PlayerPerform("say", "哈哈。就凭你们，都受死吧。。");
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			trg0 = 16;
		}
	}
    if (trg0 == 16)
	{	
		c = GetChar("一线天首领");
		c1 = GetChar("一线天守卫1");
		c2 = GetChar("一线天守卫2");
		c3 = GetChar("一线天守卫3");
		c4 = GetChar("一线天守卫4");
		c5 = GetChar("一线天守卫5");
		c6 = GetChar("一线天守卫6");
		c7 = GetChar("一线天守卫7");

		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", "梦，走。，去金华城。。");

			timer0 = now + 3;
		        gameover = 1;
			trg0 = 17;
		}
	}

c = GetAnyChar("伊人梦");
	if (gameover!=-1 && c>=0 && GetHP(c)<=0)
	{			
		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;
	}

}
