// 雪城
int Rule = 1;
int RoundTime = 50;
int PlayerSpawn = 163;
int PlayerSpawnDir = 100;
int PlayerWeapon = 50;
int PlayerWeapon2 = 15;
int PlayerHP = 20000;

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 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("npc04_02");    
              AddNPC("npc04_10");
              AddNPC("npc04_11");
              AddNPC("npc04_12");
              AddNPC("npc04_13");
              AddNPC("npc04_15");
              AddNPC("npc04_16");
              AddNPC("npc04_17");
              AddNPC("npc04_20");


}

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 now = GetGameTime();
 
if (trg0 == 0)
	{
		c = GetChar("五毒队长");
		if (c>=0)
		{
                     ChangeBehavior(c,"follow",player);
			Perform(c, "say", "兄弟们，一起杀吧。。");
			Perform(c, "pause", 13);
			Perform(c, "say", "哼是吗？那就让你见识一下我们的厉害。");
			Perform(c, "pause", 2);
			Perform(c, "say", "你看我后面的，你还有力而战吗？");
			Perform(c, "pause", 2);
			Perform(c, "say", "请问你就是伊人君吗？");
			Perform(c, "faceto", player);

			c2 = GetChar("伊人梦");
			if (c2 >= 0)
			{
				Perform(c2, "say", "看招吧。");
				Perform(c2, "pause", 2);
				Perform(c2, "say", "今我就教养教养你们，。");
				Perform(c2, "pause", 2);
				Perform(c2, "say", "一群废物。。");
				Perform(c2, "pause", 12);
				Perform(c2, "faceto", player);
			}		

			StopChat();								
			c2 = GetChar("五毒蒙面人1");
			if (c2 >= 0)
			{
                     ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "是？");
				Perform(c2, "guard", 20);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("五毒蒙面人2");
			if (c2 >= 0)
			{
                     ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "是？");
				Perform(c2, "guard", 20);
				Perform(c2, "faceto", player);
			}			
			c2 = GetChar("五毒蒙面人3");
			if (c2 >= 0)
			{
                     ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "是？");
				Perform(c2, "guard", 20);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("五毒蒙面人4");
			if (c2 >= 0)
			{
                     ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "是？");
				Perform(c2, "guard", 20);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("五毒蒙面人5");
			if (c2 >= 0)
			{
                     ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "是？");
				Perform(c2, "guard", 20);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("五毒蒙面人6");
			if (c2 >= 0)
			{
                     ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "是？");
				Perform(c2, "guard", 20);
				Perform(c2, "faceto", player);
			}			
								
			c2 = GetChar("五毒蒙面人7");
			if (c2 >= 0)
			{
                     ChangeBehavior(c2,"follow",player);
			        Perform(c2, "say", "是？");
				Perform(c2, "guard", 20);
				Perform(c2, "faceto", player);
			}			
											
								
			PlayerPerform("block", 0);
			PlayerPerform("say", "..那你们就放马过来吧!");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "都是一群废物吧。。。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "还厉害哦？，，我看谁厉害。。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "人是不少，不过没有一个中用的。？");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "恩？");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			
			trg0 = 2;
		}
	}	

	 if (trg0 == 2)
	{	
		c4 = GetChar("五毒队长");
		c5 = GetChar("五毒蒙面人1");
		c6 = GetChar("五毒蒙面人2");
		c7 = GetChar("五毒蒙面人3");
		c8 = GetChar("五毒蒙面人4");
		c9 = GetChar("五毒蒙面人5");
		c10 = GetChar("五毒蒙面人6");

		if (GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c7)<=0 && GetHP(c8)<=0 && GetHP(c9)<=0 && GetHP(c10)<=0 && player>=0 && GetHP(player)>0)
		{
			PlayerPerform("say", "虽然都是孙剑的手下,但他们也有我的的作风");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "五毒杀手 . .");


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




        if (trg0 == 3 && now>timer0)
	{
              AddNPC("npc04_05");
              AddNPC("npc04_06");
              AddNPC("npc04_07");
              AddNPC("npc04_09");
                RemoveNPC(GetAnyChar("五毒队长"));
		RemoveNPC(GetAnyChar("五毒蒙面人1"));
                RemoveNPC(GetAnyChar("五毒蒙面人2"));
		RemoveNPC(GetAnyChar("五毒蒙面人3"));
                RemoveNPC(GetAnyChar("五毒蒙面人4"));
		RemoveNPC(GetAnyChar("五毒蒙面人5"));
                RemoveNPC(GetAnyChar("五毒蒙面人6"));
		RemoveNPC(GetAnyChar("五毒蒙面人7"));
		trg0 = 4;
	}


		
        if (trg0==4)
	{
		c = GetChar("无名杀手");
		c2 = GetChar("无名杀手1");
		c3 = GetChar("无名杀手2");
		c4 = GetChar("无名杀手3");
                c5 = GetChar("伊人梦");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<200)
		{
                     ChangeBehavior(c2,"follow",player);
			Perform(c, "pause", 3);
                 	Perform(c, "say", "。一起杀了他。！");
                        Perform(c, "faceto", player);
			Perform(c, "say", "口气不小吗？那么今天就让你尝尝我的厉害。");
			Perform(c, "pause", 2);
			Perform(c, "say", "你真是厉害阿，？竟然已1敌9");
			Perform(c, "faceto", player);
			
                     ChangeBehavior(c2,"follow",player);
			Perform(c2, "say", "是！");
			Perform(c2, "pause", 8);
			Perform(c2, "faceto", c);
			
                     ChangeBehavior(c3,"follow",player);
			Perform(c3, "say", "是！");
			Perform(c3, "pause", 8);
			Perform(c3, "faceto", c);

                     ChangeBehavior(c4,"follow",player);
			Perform(c4, "say", "是！");
			Perform(c4, "pause", 8);
			Perform(c4, "faceto", c);

                        Perform(c5, "use", 15);
                        Perform(c5, "use", 15);
			Perform(c5, "say", "给你们脸不要脸，拿命吧。。！");
			Perform(c5, "pause", 8);
			Perform(c5, "faceto", player);
				
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);		
			PlayerPerform("say", "哼..。！你们也是。。不可取。");
			PlayerPerform("pause", 9);			
			PlayerPerform("say", "因为他们全是废物，不可取..");
			PlayerPerform("pause", 2);			
			PlayerPerform("block", 1);
			trg0 = 5; 			
		}		
	}
      if (trg0 == 5)
	{
		c = GetAnyChar("无名杀手");
		if (GetHP(c) <= 0)
		{
			Say(c, "我。。。。你别以为杀了我就没事了，。。后面的，.阿。。。。");

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

		}
	}
	 if (trg0 == 6)
	{	
		c3 = GetChar("无名杀手");
		c4 = GetChar("无名杀手1");
		c5 = GetChar("无名杀手2");
		c6 = GetChar("无名杀手3");
if (GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c10)<=0 && player>=0 && GetHP(player)>0)
		{
			PlayerPerform("say", "是男人就快点滚出来。。。");
			PlayerPerform("pause", 2);
			PlayerPerform("say", "孙剑. .你给我滚出来，跟我决一死战，不要让你的下人在做无谓的牺牲。");


			timer0 = now + 10;
			trg0 = 7;
		}
	}

if (trg0 == 7 && now>timer0)
	{
              AddNPC("npc04_01");
              AddNPC("npc04_03");
              AddNPC("npc04_04");
                RemoveNPC(GetAnyChar("无名杀手"));
		RemoveNPC(GetAnyChar("无名杀手1"));
                RemoveNPC(GetAnyChar("无名杀手2"));
		RemoveNPC(GetAnyChar("无名杀手3"));

			trg0 = 8;
		}
         if (trg1 == 0)
	{
		c = GetAnyChar("孙剑");
                c1 = GetAnyChar("守卫1");
                c2 = GetAnyChar("守卫2");
                c3 = GetAnyChar("伊人梦");
		if (c>=0 && GetEnemy(c)==player)
		{
                     ChangeBehavior(c,"follow",player);
			Perform(c, "guard", 5);
                        Perform(c, "use", 34);
                        Perform(c, "use", 33);
			Perform(c, "say", "好阿，我就陪你玩玩。。");
			Perform(c, "pause", 5);
			Perform(c, "say", "哈哈。到头？是你的到头了吧，，");
			Perform(c, "pause", 4);
			Perform(c, "say", "哼，我不会在对你这种人客气了。");
			Perform(c, "pause", 4);
			Perform(c, "say", "你是不是以为我是个懦夫阿。？");
			Perform(c, "pause", 4);
			Perform(c, "say", "你竟然敢骂我？");
			Perform(c, "faceto", player);

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

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

                        Perform(c3, "use", 15);
                        Perform(c3, "use", 15);
			Perform(c3, "pause", 20);
			Perform(c3, "faceto", player);




			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("block", 0);
			PlayerPerform("say", "玩？玩你的命，看招。。");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "那就手底下见真章吧。。？");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "你的（人生）到头了。。");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "懦夫都不配，你只配东亚病夫..");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "为什么不敢阿，？不但骂你，我还要杀你。");
			PlayerPerform("pause", 4);
			PlayerPerform("block", 1);

			trg1 = 1;
		}
	}
	if (trg1 == 1)
	{
		c = GetChar("孙剑");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "guard", 4);
			Perform(c, "say", "你给我玩，你老婆也不能闲着，我找几个人陪你老婆玩玩。。。");
			Perform(c, "faceto", player);

			PlayerPerform("say", "懦夫，不可取。。。");
			PlayerPerform("pause", 4);
			trg1 = 2;
			timer1 = now + 4;
		}
	}


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

              AddNPC("npc04_21");
              AddNPC("npc04_22");
              AddNPC("npc04_23");
              AddNPC("npc04_24");
              AddNPC("npc04_25");
			trg1 = 3;


	}

  if (trg2 == 0)
	{
		c = GetAnyChar("暗杀部落1");
                c1 = GetAnyChar("暗杀部落2");
                c2 = GetAnyChar("暗杀部落3");
                c3 = GetAnyChar("暗杀部落4");
		c4 = GetAnyChar("暗杀部落5");

		if (c>=0 &&  c1>=0 && c2>=0 && c3>=0 && c4>=0)
		{
			Perform(c, "say", "走，把伊人梦享受一下。。。！");
			Perform(c, "faceto", c2);
			
		        ChangeBehavior(c1, "follow", c);	
			Perform(c1, "say", "是！");
			Perform(c1, "pause", 1);
			Perform(c1, "faceto", c);
			
		        ChangeBehavior(c2, "follow", c);	
			Perform(c2, "say", "蛤。！");
			Perform(c2, "pause", 1);
			Perofrm(c2, "faceto", c);
                        
		        ChangeBehavior(c3, "follow", c);	
			Perform(c3, "say", "哈哈 。，哇。。！");
			Perform(c3, "pause", 9);
			Perofrm(c3, "faceto", c);

		        ChangeBehavior(c3, "follow", c);	
			Perform(c3, "say", "伊人梦，果然长的不错阿。！");
			Perform(c3, "pause", 8);
			Perofrm(c3, "faceto", c);

		        ChangeBehavior(c4, "follow", c);	
			Perform(c4, "say", "我上定你了。！");
			Perform(c4, "pause", 7);
			Perofrm(c4, "faceto", c);

			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("block", 1);

			trg2 = 1;
		}
	}

     if (trg3 == 0)
	{
		c = GetAnyChar("伊人梦");
		if (GetHP(c) <= 0)
		{
			Say(c, "我，，我，要回快活林，﹒﹒﹒老公，，你带，带我回去。。");
			trg3 = 1;
		}
	}	

     if (trg4 == 0)
	{
		c = GetAnyChar("孙剑");
		if (GetHP(c) <= 0)
		{
			Say(c, "三天之后，我在找你算帐。。呜.....");

			PlayerPerform("block", 1);
			trg4 = 1;

		}
	}

        if (trg5 == 0)
	{
		c = GetChar("孙剑");
		if (c>=0 && GetHP(c)<3000)
		{

                        Perform(c, "use", 35);
			Perform(c9, "pause", 3);
			Perform(c, "say", "伊人君，我很赏识你，你很有本事。我会报仇的，你给我等着");
			Perform(c9, "pause", 2);
			Perform(c, "faceto", player);

			PlayerPerform("block", 1);
					
			trg5 = 1;
		        gameover = 1;
                        timer1 = now + 6;
	}
    }

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

}

	