// 我也在现场.
int Rule = 1;
int RoundTime = 990;
int PlayerSpawn = 27;
int PlayerSpawnDir = 0;
int PlayerWeapon = 16;
int PlayerWeapon2 = 23;
int PlayerHP = 15000;

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;
int reborn = -1;
string rebornName;


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 now = GetGameTime();

	if (trg0 == 0)
	{
		c = GetChar("(兵兵)");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && Distance(0, 1)<300)
		{	
			Perform(c, "pause", 10000);
			Perform(c, "say", "有杀机.你小心哟要。..");
			Perform(c, "pause", 2);
			Perform(c, "say", "是啊..~我来是观看一下闯关的情况怎样..");
			Perform(c, "pause", 3);
			Perform(c, "faceto", player);
				
			PlayerPerform("say", "（看我是怎么闯关的﹒﹒﹒）");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "（你看着吧..）");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "（呵呵，你竟会开玩笑了..）");
			PlayerPerform("pause", 4);			
			PlayerPerform("say", "﹒你不是制作人？兵兵吗");
			PlayerPerform("block", 1);
		
			trg0 = 1; 
			timer0 = now + 10;			
		}		
	}
	if (trg0 == 1 && now>timer0)
	{
		AddNPC("圣诞僵尸1");
		AddNPC("圣诞僵尸2");
		AddNPC("圣诞僵尸3");
		AddNPC("圣诞僵尸4");
		AddNPC("圣诞僵尸5");
		AddNPC("圣诞僵尸6");
		AddNPC("圣诞僵尸7");
		AddNPC("圣诞僵尸8");

		trg0 = 2;
	}
	if (trg0 == 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 (c>=0)
		{



			ChangeBehavior(c7, "Kill", "player");
			Perform(c7, "guard", 18);
			Perform(c7, "faceto", player);

			ChangeBehavior(c6, "Kill", "player");
			Perform(c6, "guard", 18);
			Perform(c6, "faceto", player);


			ChangeBehavior(c5, "Kill", "player");
			Perform(c5, "guard", 18);
			Perform(c5, "faceto", player);

			ChangeBehavior(c4, "Kill", "player");
			Perform(c4, "guard", 18);
			Perform(c4, "faceto", player);

			ChangeBehavior(c3, "Kill", "player");
			Perform(c3, "guard", 18);
			Perform(c3, "faceto", player);

			ChangeBehavior(c2, "Kill", "player");
			Perform(c2, "guard", 18);
			Perform(c2, "faceto", player);

			ChangeBehavior(c1, "Kill", "player");
			Perform(c1, "guard", 18);
			Perform(c1, "faceto", player);

			ChangeBehavior(c, "Kill", "player");
			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, "pause", 6);
			Perform(c, "say", "哈哈..我们不愧为僵尸..");
			Perform(c, "faceto", player);

			trg0 = 3; 
		}
	}
	if (trg0 == 3)
	{
		c = GetAnyChar("雪地僵尸1");

		if (c>=0 && GetHP(c)<=0)
		{
			Say(c, "﹒﹒哈哈﹒﹒﹒﹒﹒﹒");


			PlayerPerform("say", "？？？？？");
			PlayerPerform("pause", 3);			
			trg0 = 4;
			timer1 = now + 6;
		}
	}
 if (trg0 == 4 && now>timer1)
	{
                RemoveNPC(GetAnyChar("雪地僵尸1"));
		RemoveNPC(GetAnyChar("雪地僵尸2"));
                RemoveNPC(GetAnyChar("雪地僵尸3"));
		RemoveNPC(GetAnyChar("雪地僵尸4"));
                RemoveNPC(GetAnyChar("雪地僵尸5"));
		RemoveNPC(GetAnyChar("雪地僵尸6"));
                RemoveNPC(GetAnyChar("雪地僵尸7"));
                RemoveNPC(GetAnyChar("雪地僵尸8"));

	                trg0 = 5;    
			timer2 = now + 1;           
      
		}

        if (trg0 == 5 && now>timer2)
	{
                    AddNPC("圣诞1");
                    AddNPC("圣诞2");
                    AddNPC("圣诞3");
                    AddNPC("圣诞4");
                    AddNPC("圣诞5");
                    AddNPC("圣诞6");
      	                trg0 = 6;        
      
		}


if (trg1==0)
	{
		c = GetChar("孙玉城");
		c1 = GetChar("玉城 ！-！剑气");
		c2 = GetChar("玉城 ！-！乾坤");  
		c3 = GetChar("玉城 ！-！魔刀"); 
		c4 = GetChar("玉城 ！-！怒刺");
		c5 = GetChar("玉城 ！-！怒匕");
		c6 = GetChar("(兵兵)");
		if (c>=0 && GetEnemy(c)==player)
		{

			ChangeBehavior(c3, "follow", player);
                        Perform(c, "use", 19);
                        Perform(c, "use", 5);
                        Perform(c, "use", 34);
                        Perform(c, "use", 33);
                        Perform(c, "use", 41);
                        Perform(c, "use", 3);
			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);

			ChangeBehavior(c1, "follow", player);
                        Perform(c1, "use", 19);
                        Perform(c1, "use", 5);
			Perform(c1, "pause", 19);

			ChangeBehavior(c2, "follow", player);
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);
			Perform(c2, "pause", 19);

			ChangeBehavior(c3, "follow", player);
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
			Perform(c3, "pause", 19);

			ChangeBehavior(c4, "follow", player);
                        Perform(c4, "use", 19);
                        Perform(c4, "use", 5);
			Perform(c4, "pause", 19);


			ChangeBehavior(c5, "follow", player);
                        Perform(c5, "use", 19);
                        Perform(c5, "use", 5);
			Perform(c5, "pause", 19);


			ChangeBehavior(c6, "follow", player);
                        Perform(c6, "use", 19);
                        Perform(c6, "use", 5);
			Perform(c6, "say", "我来帮你一起收拾....");
			Perform(c6, "pause", 20);
			PlayerPerform("block", 0);
			PlayerPerform("say", "呀..那我太幸运了..");
			PlayerPerform("pause", 6);
			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);

			trg1 = 1;
			timer0 = now + 50;
		}
	}


if (trg1 == 1 && now>timer0)
	{
	    AddNPC("圣诞无限1");
	    AddNPC("圣诞无限2");

		trg1 = 2;
	}

if (trg2==0 && trg1==2)
	{
		c2 = GetAnyChar("无限乾坤1");
		if (c2>=0 && GetHP(c2)<=0)
		{
			reborn = c2;
			rebornName = "圣诞无限1";
			trg2 = 1;
			timer1 = now + 1;
		}
		c3 = GetAnyChar("无限乾坤2");
		if (c3>=0 && GetHP(c3)<=0)
		{
			reborn = c3;
			rebornName = "圣诞无限2";
			trg2 = 1;
			timer1 = now + 1;
		}
        }				
	if (trg2==1 && now>timer1)
	{
		RemoveNPC(reborn);
		timer1 = now + 1;
		trg2 = 2;
	}
	if (trg2==2 && now>timer1)
	{
		AddNPC(rebornName);
		trg2 = 0;
	}


   if (trg4 == 0)
	{
		c = GetAnyChar("孙玉城");
		c2 = GetAnyChar("无限乾坤1");
		c3 = GetAnyChar("无限乾坤2");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "好样的，...。果真是一位高手，");

			ChangeBehavior(c2, "follow", player);
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);

			ChangeBehavior(c3, "follow", player);
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
			trg4 = 1;
		}

       } 

      if (trg4 == 1)
	{
		c = GetAnyChar("孙玉城");
		if (c>=0 && GetHP(c)<3000)
		{			
			Perform(c, "say", "你这家伙..。真是过分呢！！");
			trg4 = 2;
		        timer2 = now + 2; 
		}

       } 

	if (trg4==2 && now>timer2)
	{

		gameover = 1;

			trg4 = 3;

                }





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

}
