// 强化训练
int Rule = 1;
int RoundTime = 99;
int PlayerSpawn = 100;
int PlayerSpawnDir = 0;
int PlayerWeapon = 15;
int PlayerWeapon2 = 50;
int PlayerHP = 20000;


int player;
int trg0;
int trg1;
int trg2;
int s1;
int k1;
int obj1;
int timer0;
int timer1;
int timer2;
int timer3;
int gameover; 
OnStart()
{
		AddNPC("兵兵1");
}
OnUpdate()
{
	int player = GetAnyChar("player");
	if (player < 0)
	{
		return 0;
	}
	if (gameover == 2)
	{
		return 0;
	}
	int now = GetGameTime();

        if (trg0 == 0)
	{
	int c = GetChar("『流星奇迹』_兵兵");
	if (c > 0 && s1==0)
	{


			Perform(c, "say", "我是游戏的作者！你这关的对手就是我.！！");

			trg0 = 1;
		        s1=1; 
		}
        }
      if (s1==1 && GetDistance(player,c)<=300)
	{

	                   ChangeBehavior(c, "kill" , player);
	                   Perform(c, "aggress");
			   Perform(c, "say", "呵呵！！开始了！！.");
			   Perform(c, "pause", 4);
			   Perform(c, "say", "呵呵！！没事瞎玩的北..想跟你玩一玩..");
			   Perform(c, "pause", 3);
			   Perform(c, "say", "你﹒过来了！哈哈！！我欣赏所有玩本任务的玩家！");
			   Perform(c, "faceto", player);



				PlayerPerform("block", 0);
			PlayerPerform("say", "阿！来真的，那只好照办了");
			PlayerPerform("pause", 4);
			PlayerPerform("say", "无语！！！原来只痛笑ZJ  ☆说的任务就是跟你打阿？");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "为什么要这么做阿！！我无语了！！");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
		        s1=2; 
		        timer0 = now + 20; 
		}

        if ( s1==2 && now > timer0)
	{
	                Perform(c, "aggress");
			Perform(c, "say", "没事做做任务，也是我对你们的心意，来吧！！");
			Perform(c, "faceto", player);
			Perform(c, "say", "用心来·本任务只是娱乐，不像大侠乔峰那样！挨着剧情编写");
			Perform(c, "faceto", player);

	                PlayerPerform("say","呵呵！当然！！…");
			PlayerPerform("pause", 4);
      		        s1=3; 
		}
              if(GetHP(c) <= 20000 && s1 == 3 && obj1 == 0)
		{

				Perform(c, "say", "呵呵..技术真强！！");
				Perform(c, "faceto", player);

				PlayerPerform("say", "哈哈！我没作弊哦！！");
				PlayerPerform("pause", 3);
      		                s1=4; 
                                obj1= 1; 
		}
              if(GetHP(c) <= 10000 && obj1 == 1)
		{

		                AddNPC("兵兵2");
		                AddNPC("兵兵3");
		                AddNPC("兵兵4");
		                AddNPC("兵兵5");
		                AddNPC("兵兵6");
                                Perform(c,"use",15);
                                Perform(c,"use",15);
                                Perform(c,"use",15);
                                Perform(c,"use",15);
                                Perform(c,"use",20);
				Perform(c, "say", "不错！！难度要增加了");
				Perform(c, "faceto", player);

				PlayerPerform("say", "叫人！！");
				PlayerPerform("pause", 3);

                                obj1= 2; 
		}
              if(GetHP(c) <= 8000 && obj1 == 2)
		{

			       SetTarget(0, "waypoint", 160);
			        ChangeBehavior(c, "attacktarget", 0);
                                Perform(c,"use",15);
                                Perform(c,"use",15);
                                Perform(c,"use",15);
				Perform(c, "say", "看来你有机会通过哦！！");
				Perform(c, "faceto", player);
                                obj1= 3; 
		}
		if (c >= 0 && obj1 == 3)
		{
			SetTarget(0, "char", c);
			SetTarget(1, "waypoint", 160);
			if (Distance(0, 1) < 80)
			{

			ChangeBehavior(c, "follow", player);
			Perform(c, "aggress");
				Perform(c, "say", "哈哈！快不行了吧...");
				Perform(c, "faceto", player);

                                obj1= 4; 
		}
         }
              if(GetHP(c) <= 1000 && obj1 == 4 && k1 == 0)
		{
			        Perform(c, "aggress");
				Perform(c, "say", "哈哈！我只能玩到这里了！！去闯最后一关！..");
				Perform(c, "faceto", player);

                                obj1= 5; 
                                k1 =1; 
		                timer1 = now + 5; 
		}

                if ( obj1 == 5 && now > timer1)
	        {

		 gameover = 1;
                 obj1= 6; 
		}
		if (GetHP(c) <= 0 &&  k1 == 1)
		{

			Say(c,"连我你也杀阿...");
			PlayerPerform("use", 35);
			PlayerPerform("pause", 2);
                        k1 =2; 
		}

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

}
