//  前事为了.孙玉伯复仇
int Rule = 1;
int RoundTime = 90;
int PlayerSpawn = 269;
int PlayerSpawnDir = 30;
int PlayerWeapon = 6;
int PlayerWeapon2 = 50;
int PlayerHP = 30000;


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 = GetAnyChar("player");
	if (player < 0)
	{
		return 0;
	}
	if (gameover == 2)
	{
		return 0;
	}
	int now = GetGameTime();
	
	int c;
	int c1;
	int c3;
	int c4;
	int c5;
	int c6;
	int c7;
	int c8;
	int c9;
	int c10;
	int c11;
	int c12;

	if (trg0 == 0)
	{
		c = GetChar("三公子");
		c1 = GetChar("二公子");
		c3 = GetChar("律香彬");
		c4 = GetChar("无名高手");
		c5 = GetChar("律香川");
		c6 = GetChar("一级高官");
		c7 = GetChar("律香川一等杀手");
		c8 = GetChar("孙玉伯");
		if (c>=0 && c1>0 && c3>0 && c4>0 && c5>0 && c6>0 && c7>0 && c8>0)
		{


			Perform(c, "faceto", player);	
                        Perform(c, "use", 35);
                        Perform(c1, "use", 35);
                        Perform(c3, "use", 35);
                        Perform(c4, "use", 35);
			Perform(c5, "pause", 100);
                        Perform(c5, "use", 19);
			Perform(c6, "pause", 100);
                        Perform(c6, "use", 19);
			Perform(c7, "pause", 100);
                        Perform(c7, "use", 19);
			Perform(c8, "pause", 100);
                        Perform(c8, "use", 19);



			PlayerPerform("block", 0);
			PlayerPerform("use", 19);
			PlayerPerform("use", 5);
			PlayerPerform("use", 33);
			PlayerPerform("use", 34);
			PlayerPerform("use", 4);
			PlayerPerform("use", 20);
			PlayerPerform("use", 41);
			PlayerPerform("use", 42);
		        PlayerPerform("crouch", 1);
			PlayerPerform("say", "我早就料想他是不会就此罢休的。");
			PlayerPerform("pause", 2);
		        PlayerPerform("crouch", 1);
			PlayerPerform("say", "今日我能回到这里，就注定跟孙玉伯开战了。");
			PlayerPerform("pause", 2);
		        PlayerPerform("crouch", 1);
                        PlayerPerform("say", "我还是过去看看的好。"); 
			PlayerPerform("pause", 2);
		        PlayerPerform("crouch", 1);
			PlayerPerform("say", "但貌似真的有什么事，");
			PlayerPerform("pause", 2);
		        PlayerPerform("crouch", 1);
                        PlayerPerform("say", "不会有人设计我吧，像律香彬一样。"); 
			PlayerPerform("pause", 2);
		        PlayerPerform("crouch", 1);
			PlayerPerform("say", "前面好像有人，我要不要过去看看。！");
			PlayerPerform("pause", 2);
		        PlayerPerform("crouch", 1);
                        PlayerPerform("say", "要不然又来麻烦了。"); 
			PlayerPerform("pause", 2);
		        PlayerPerform("crouch", 1);
			PlayerPerform("say", "难道孙玉伯开始行动了。不行我的赶紧赶去快活林。");
			PlayerPerform("pause", 2);
		        PlayerPerform("crouch", 1);
                        PlayerPerform("say", "又回到了这个是非之地。。"); 
			PlayerPerform("block", 1);
		        PlayerPerform("crouch", 1);
						
			trg0 = 1;
                }          
        }     

if (trg0==1)
	{
		c = GetChar("孙玉伯");
		c5 = GetChar("律香川");
		c6 = GetChar("一级高官");
		c7 = GetChar("律香川一等杀手");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<150)
		{
			StopPerform(player);
			StopPerform(c);

			Perform(c, "say", "废话你就少说吧。我想了很久，他们是我的儿子阿。。");
			Perform(c, "pause", 4);
			Perform(c, "faceto", player);
			Perform(c, "say", "你看看这都是谁阿，都是你的手下败将阿，伊人君。");
			Perform(c, "pause", 2);
			Perform(c, "faceto", player);

                        ChangeBehavior(c5,"follow",player);
			Perform(c5, "pause", 8);
			Perform(c5, "faceto", c);
                        ChangeBehavior(c6,"follow",player);
			Perform(c6, "pause", 8);
			Perform(c6, "faceto", c);
                        ChangeBehavior(c7,"follow",player);
			Perform(c7, "pause", 8);
			Perform(c7, "faceto", c);

			PlayerPerform("block", 0);
			PlayerPerform("say", "我就知道这件事你放不下的..。我只好一起干掉你们了。");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "难道这些历史又出现了吗？..为什么一直挥洒不去了。");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "阿..孙剑-律香彬-无名高手-2 3公子怎么都在这里。");
			PlayerPerform("block", 1);

			trg0 = 2;
		}
	}	

	if (trg0 == 2)
	{
		c = GetChar("孙玉伯");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "老夫不会让你活命...老夫会让你死无葬身之地。我们走");
			Perform(c, "faceto", player);
			trg0 = 3;
			timer0 = now + 2;
		}
	}

     if (trg0==3 && now>timer0)
	{	
                RemoveNPC(GetAnyChar("律香彬"));
		RemoveNPC(GetAnyChar("无名高手"));
                RemoveNPC(GetAnyChar("律香川"));
		RemoveNPC(GetAnyChar("一级高官"));
                RemoveNPC(GetAnyChar("律香川一等杀手"));
		RemoveNPC(GetAnyChar("孙玉伯"));
                RemoveNPC(GetAnyChar("二公子"));
		RemoveNPC(GetAnyChar("三公子"));
		trg0 = 4;
	       timer1 = now + 5;


	}


if (trg0==4 && now>timer1)
	{

              AddNPC("金华蒙面1");
              AddNPC("金华蒙面2");
              AddNPC("金华蒙面3");
              AddNPC("金华蒙面4");
              AddNPC("金华蒙面5");
              AddNPC("金华蒙面6");
              AddNPC("金华蒙面7");
              AddNPC("金华蒙面8");
		trg0 = 5;


	}


if (trg0 == 5)
	{
		c = GetChar("蒙面人1");
		if (c>=0 && GetEnemy(c)==player)
		{

			ChangeBehavior(c, "follow", player);
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "say", "竟然杀害我们3个公子，今天我就让你偿命。。");

			Perform(c, "faceto", player);
			PlayerPerform("block", 0);
			PlayerPerform("say", "又回到以前那种杀气。。。。");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);


			trg0 = 6;

		}		
	}


	if (trg0 == 6)
	{
		c = GetChar("蒙面人1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "别以为我们蒙面人是浪得虚名！");
			Perform(c, "faceto", player);
			trg0 = 7;
		}
	}

	if (trg0 == 7)
	{
		c = GetAnyChar("蒙面人1");
		if (GetHP(c) <= 0)
		{
			Say(c, "都给我撤...﹒");
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			trg0 = 8;
			timer1 = now + 2;
		}

	}

      if (trg0 == 8 && 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 = 9;
		timer2 = now + 2;

	}
      if (trg0 == 9 && now>timer2)
	{

              AddNPC("金华哇蛇1");
              AddNPC("金华哇蛇2");
              AddNPC("金华哇蛇3");
              AddNPC("金华哇蛇4");
              AddNPC("金华哇蛇5");
              AddNPC("金华哇蛇6");
              AddNPC("金华哇蛇7");
              AddNPC("金华哇蛇8");

		trg0 = 10;

	}

if (trg0 == 10)
	{
		c = GetChar("复仇哇蛇1");
		if (c>=0 && GetEnemy(c)==player)
		{

			ChangeBehavior(c, "follow", player);
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "say", "都拿枪给我射死这家伙。。。");

			Perform(c, "faceto", player);
			PlayerPerform("block", 0);
			PlayerPerform("say", "可恶....。。");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);


			trg0 = 11;

		}		
	}

	if (trg0 == 11)
	{
		c = GetAnyChar("复仇哇蛇1");
		if (GetHP(c) <= 0)
		{
			Say(c, "你这个家伙，有两下子..﹒忽忽。");
			trg0 = 12;
		}

	}

      if (trg0 == 12)
	{
		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(c4)<=0 && GetHP(c3)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 &&  GetHP(c7)<=0 && GetHP(c8)<=0 && GetHP(c9)<=0 && player>=0 && GetHP(player)>0)
		{


			PlayerPerform("say", "火枪乱射的滋味，真他妈的。。孙玉伯，你这个老家伙。");

			trg0 = 13;
		        timer3 = now + 2;
		}
	}



      if (trg0 == 13 && now>timer3)
	{


                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 = 14;
		        timer4 = now + 2;
		}
      if (trg0 == 14 && now>timer4)
	{

              AddNPC("金华女者1");
              AddNPC("金华女者2");
              AddNPC("金华女者3");
              AddNPC("金华女者4");
              AddNPC("金华女者5");

		trg0 = 15;

	}

if (trg1 == 0)
	{
		c = GetChar("复仇女神1");
		if (c>=0 && GetEnemy(c)==player)
		{

			ChangeBehavior(c, "follow", player);
                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "say", "轮到我们了，受死吧。。。。");

			Perform(c, "faceto", player);
			PlayerPerform("block", 0);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("say", "........。。");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);


			trg1 = 1;

		}		
	}

	if (trg1 == 1)
	{
		c = GetAnyChar("复仇女神1");
		if (GetHP(c) <= 0)
		{
			Say(c, "你有种。你不会活命的，就凭你杀死我们的主子。。");
			trg1 = 2;
		        gameover = 1;
		        timer0 = now + 2;
		}

	}


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
















	
	