// 火岛
int Rule = 1;
int RoundTime = 99;
int PlayerSpawn = 35;
int PlayerSpawnDir = 100;
int PlayerWeapon = 50;
int PlayerWeapon2 = 54;
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 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("僵尸1");
			AddNPC("僵尸2");
			AddNPC("僵尸3");
			AddNPC("僵尸4");
			AddNPC("僵尸5");
			AddNPC("僵尸6");
			AddNPC("僵尸7");
			AddNPC("僵尸8");


}



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("僵尸1");
		c1 = GetChar("僵尸2");
		c2 = GetChar("僵尸3");
		c3 = GetChar("僵尸4");
		c4 = GetChar("僵尸5");
		c5 = GetChar("僵尸6");
		c6 = GetChar("僵尸7");
		c7 = GetChar("僵尸8");
		if (c >= 0)
		{
			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);
			trg0 = 1;
		}
	}

	if (trg1 == 1)
	{
		c = GetChar("僵尸1");
		c2 = GetChar("僵尸2");
		c3 = GetChar("僵尸3");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "尸王-发现了。");
			Perform(c2, "faceto", player);
			trg1 = 1;
		}
		if (c3>=0 && GetEnemy(c3)==player)
		{
			ChangeBehavior(c3, "follow", c);
			Perform(c3, "say", "尸王-发现了。");
			Perform(c3, "faceto", player);
			trg1 = 1;
		}		
	}
	if (trg2 == 0)
	{
		c = GetChar("僵尸1");
		c2 = GetChar("僵尸4");
		c3 = GetChar("僵尸5");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "尸王-发现了。");
			Perform(c2, "faceto", player);
			trg2 = 1;
		}
		if (c3>=0 && GetEnemy(c3)==player)
		{
			ChangeBehavior(c3, "follow", c);
			Perform(c3, "say", "尸王-发现了。");
			Perform(c3, "faceto", player);
			trg2 = 1;
		}		
	}


	if (trg3 == 0)
	{
		c = GetChar("僵尸1");
		c2 = GetChar("僵尸6");
		c3 = GetChar("僵尸7");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "尸王-发现了。");
			Perform(c2, "faceto", player);
			trg3 = 1;
		}
		if (c3>=0 && GetEnemy(c3)==player)
		{
			ChangeBehavior(c3, "follow", c);
			Perform(c3, "say", "尸王-发现了。");
			Perform(c3, "faceto", player);
			trg3 = 1;
		}		
	}
	if (trg4 == 0)
	{
		c = GetChar("僵尸1");
		c2 = GetChar("僵尸8");
		
		if (c2>=0 && GetEnemy(c2)==player)
		{
			ChangeBehavior(c2, "follow", c);
			Perform(c2, "say", "尸王-发现了。");
			Perform(c2, "faceto", player);
			trg4 = 1;
		}
		if (c3>=0 && GetEnemy(c3)==player)
		{
			ChangeBehavior(c3, "follow", c);
			Perform(c3, "say", "尸王-发现了。");
			Perform(c3, "faceto", player);
			trg4 = 1;
		}		
	}

if (trg5 == 0)
	{
		c = GetChar("僵尸1");
		c1 = GetChar("僵尸2");
		c2 = GetChar("僵尸3");
		c3 = GetChar("僵尸4");
		c4 = GetChar("僵尸5");
		c5 = GetChar("僵尸6");
		c6 = GetChar("僵尸7");
		c7 = GetChar("僵尸8");
		
		if (c>=0 && GetEnemy(c)==player)
		{

			ChangeBehavior(c, "follow", player);
			Perform(c, "say", "哈哈..我们有东西吃了。");
			Perform(c, "faceto", player);

		       ChangeBehavior(c1, "kill", player);
		       ChangeBehavior(c2, "kill", player);
		       ChangeBehavior(c3, "kill", player);
		       ChangeBehavior(c4, "kill", player);
		       ChangeBehavior(c5, "kill", player);
		       ChangeBehavior(c6, "kill", player);
		       ChangeBehavior(c7, "kill", player);

			PlayerPerform("block", 0);
			PlayerPerform("say", "我靠-这是什么玩意。");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);


			trg5 = 1;

		}		
	}

      if (trg5 == 1)
	{
		c = GetAnyChar("僵尸1");
		c3 = GetAnyChar("僵尸2");
		c4 = GetAnyChar("僵尸3");
		c5 = GetAnyChar("僵尸4");
		c6 = GetAnyChar("僵尸5");
		c7 = GetAnyChar("僵尸6");
		c8 = GetAnyChar("僵尸7");
		c9 = GetAnyChar("僵尸8");
		if (GetHP(c)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 &&  GetHP(c7)<=0 &&  GetHP(c8)<=0 &&  GetHP(c9)<=0 && player>=0 && GetHP(player)>0)
		{

			PlayerPerform("say", "僵尸真吓人。...");
			PlayerPerform("pause", 3);


			trg5 = 2;
			timer0 = now + 4;
		}		
	}

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

              AddNPC("律香彬1");
                RemoveNPC(GetAnyChar("僵尸1"));
		RemoveNPC(GetAnyChar("僵尸2"));
                RemoveNPC(GetAnyChar("僵尸3"));
		RemoveNPC(GetAnyChar("僵尸4"));
                RemoveNPC(GetAnyChar("僵尸5"));
		RemoveNPC(GetAnyChar("僵尸6"));
                RemoveNPC(GetAnyChar("僵尸7"));
		RemoveNPC(GetAnyChar("僵尸8"));

		trg5 = 3;


	}

  if (trg5==3)
	{
		c = GetAnyChar("律香彬");

		if (c>=0 && GetEnemy(c)==player)
		{

                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "say", "废话，受死吧，小人。。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "哟，是不是啊，为了你的梦，连声爷爷也不喊。那杀我的老大也不知道不杀，哼。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "你的梦阿？哈哈，除非你喊我声爷爷。我就告诉你。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "杀死我这游戏还玩不玩了。哈，。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);
			Perform(c, "say", "哼。。又见面了。");
			Perform(c, "faceto", player);

			PlayerPerform("block", 0);
			PlayerPerform("say", "我就不信杀不死你。");
			PlayerPerform("pause", 5);			
			PlayerPerform("say", "哼，我的作风不像你。随便就可以做出对不起自己的事情。至于你的老大，是他作恶多端。");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "靠。你真是找死。。");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "说，梦在哪里。。");
			PlayerPerform("pause", 2);			
			PlayerPerform("say", "你怎么就杀不死阿？靠。。");
			PlayerPerform("pause", 2);			
			PlayerPerform("block", 1);
			trg5 = 4; 

		}		
	}

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

			Perform(c, "say", "伊人君，我现在不想跟你打。。。去圆满楼找我吧。哈哈。");
			Perform(c, "faceto", player);

			PlayerPerform("say", "跑？？");
			PlayerPerform("pause", 2);

			trg6 = 1; 
		        timer0 = now + 5;

		}		
	}


if (trg6==1 && now>timer0)
	{
              AddNPC("剑客4");
              AddNPC("剑客5");
              AddNPC("剑客6");
                RemoveNPC(GetAnyChar("律香彬"));
		trg6 = 2;


	}






      if (trg7 == 0)
	{
		c = GetAnyChar("贴身护卫1");
		c1 = GetAnyChar("贴身护卫2");
		c2 = GetAnyChar("贴身护卫3");
		if (c>=0 && GetEnemy(c)==player)
		{			
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
		        Perform(c, "say", "我们一起上。。。");
			Perform(c, "pause", 5);
			Perform(c, "say", "让本小姐来取你的狗命，当年杀死我们的老大，今天就是你的葬日。");

                        ChangeBehavior(c1,"follow",player);
                        Perform(c1, "use", 5);
                        Perform(c1, "use", 19);
		        Perform(c1, "say", "哼哼。。");
			Perform(c1, "pause", 2);
			Perform(c1, "faceto", c);

                        ChangeBehavior(c2,"follow",player);
                        Perform(c2, "use", 5);
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 15);
                        Perform(c2, "use", 20);
		        Perform(c2, "say", "别以为我们是女流之辈就小看我们。");
			Perform(c2, "pause", 2);
			Perform(c2, "faceto", c);

			PlayerPerform("block", 1);

			trg7 = 1;
		}
	}
      if (trg7 == 1)
	{
		c = GetAnyChar("贴身护卫1");
		if (c>=0 && GetHP(c)<3000)
		{

			Perform(c, "say", "对女人温柔点好不好。。");
			Perform(c, "faceto", player);

			trg7 = 2; 

		}		
	}

      if (trg8 == 0)
	{
		c = GetAnyChar("贴身护卫2");
		if (c>=0 && GetHP(c)<3000)
		{

			Perform(c, "say", "对女人温柔点好不好。。");
			Perform(c, "faceto", player);

			trg8 = 1; 

		}		
	}

      if (trg9 == 0)
	{
		c = GetAnyChar("贴身护卫3");
		if (c>=0 && GetHP(c)<3000)
		{

			Perform(c, "say", "女人也下手这么狠，坏死了。。");
			Perform(c, "faceto", player);


			PlayerPerform("say", "你们是什么女人。。。");
			PlayerPerform("pause", 3);
			trg9 = 1; 

		}		
	}


      if (trg9 == 1)
	{
		c = GetAnyChar("贴身护卫1");
		c3 = GetAnyChar("贴身护卫2");
		c4 = GetAnyChar("贴身护卫3");
		if (GetHP(c)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && player>=0 && GetHP(player)>0)
		{

			PlayerPerform("say", "呜...");
			PlayerPerform("pause", 3);

			trg9 = 2;
		        gameover = 1;
			timer0 = now + 4;
		}		
	}


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

}
