// 暗杀继承人
int Rule = 1;
int RoundTime = 990;
int PlayerSpawn = 30;
int PlayerSpawnDir = 270;
int PlayerWeapon = 17;
int PlayerWeapon2 = 58;
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 timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int gameover = 0;

OnStart()
{
	AddNPC("地狱1");
	AddNPC("地狱杀手1");
	AddNPC("地狱杀手2");
	AddNPC("地狱杀手3");
	AddNPC("地狱杀手4");
	AddNPC("地狱杀手5");
	AddNPC("地狱杀手6");
	AddNPC("地狱杀手7");
}

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("继承手下1");
		c2 = GetChar("继承手下2");
		c3 = GetChar("继承手下3");
		c4 = GetChar("继承手下4");
		c5 = GetChar("继承手下5");
		c6 = GetChar("继承手下6");
		c7 = GetChar("继承手下7");	
		if (c>=0 && c2>=0)
		{
		       ChangeBehavior(c, "kill", player);
			Perform(c, "say", "那我就了断你的生命。。一起杀了他。");
			Perform(c, "say", "你真是..是不是非的找死阿？");
			Perform(c, "pause", 5);
			Perform(c, "say", "你很有本能，我们也佩服，不过我们也不是好惹的。");
			Perform(c, "pause", 2);
			Perform(c, "say", "孙玉城已经死了，请你安稳一点。不要惹恼了我们。");
			Perform(c, "pause", 2);
			Perform(c, "say", "不过你现在马上给我离开，我们不追究。");
			Perform(c, "pause", 2);
			Perform(c, "say", "我们不招惹你，你竟来骚扰我们。");
			Perform(c, "pause", 2);
			Perform(c, "say", "你这家伙..真是不知死活。");
			Perform(c, "faceto", player);
			
		       ChangeBehavior(c2, "kill", player);
			Perform(c2, "say", "是");
			Perform(c2, "pause", 20);
			Perform(c2, "faceto", player);

		       ChangeBehavior(c3, "kill", player);
			Perform(c3, "say", "是");
			Perform(c3, "pause", 20);
			Perform(c3, "faceto", player);

		       ChangeBehavior(c4, "kill", player);
			Perform(c4, "say", "是");
			Perform(c4, "pause", 20);
			Perform(c4, "faceto", player);

		       ChangeBehavior(c5, "kill", player);
			Perform(c5, "say", "是");
			Perform(c5, "pause", 20);
			Perform(c5, "faceto", player);

		       ChangeBehavior(c6, "kill", player);
			Perform(c6, "say", "是");
			Perform(c6, "pause", 20);
			Perform(c6, "faceto", player);

		       ChangeBehavior(c7, "kill", player);
			Perform(c7, "say", "是");
			Perform(c7, "pause", 20);
			Perform(c7, "faceto", player);
			
			PlayerPerform("block", 0);
			PlayerPerform("say", "你们果然是厉害......");
			PlayerPerform("pause", 50);
			PlayerPerform("say", "得罪了....");
			PlayerPerform("pause", 10);
			PlayerPerform("say", "我既然来了，怎么会走呢，继承人亲口告诉我他是孙剑的贴身。");
			PlayerPerform("pause", 15);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			PlayerPerform("block", 1);
			
			trg0 = 1;
		}
	}


if (trg1 == 0)
	{
		c = GetAnyChar("继承人");
		c1 = GetAnyChar("继承手下1");
		c2 = GetAnyChar("继承手下2");
		c3 = GetAnyChar("继承手下3");
		c4 = GetAnyChar("继承手下4");
		c5 = GetAnyChar("继承手下5");
		c6 = GetAnyChar("继承手下6");
		c7 = GetAnyChar("继承手下7");
		SetTarget(0, "char", c);
		SetTarget(1, "char", player);
		if (c>=0 && GetEnemy(c)==player && Distance(0, 1)<150)
		{

			Perform(c, "say", "老大。在这里，我就是老大，你受死吧...");
			Perform(c, "pause", 6);
			Perform(c, "say", "你真这么肯定阿。。哼");
			Perform(c, "pause", 6);
			Perform(c, "say", "孙玉城也死在你的手里..好吧，今天我就收拾一下你这小子。。");
			Perform(c, "pause", 6);
			Perform(c, "say", "你..孙剑已经死了，你还不够吗？你打算想杀多少人。");
			Perform(c, "pause", 6);
			Perform(c, "faceto", player);
			Perform(c, "say", "你真的打算死在这里吗？...");
			Perform(c, "faceto", player);

                        ChangeBehavior(c1, "follow", c);
			Perform(c1, "pause", 25);
			Perform(c1, "faceto", c);
                        ChangeBehavior(c2, "follow", c);				
			Perform(c2, "pause", 25);
			Perform(c2, "faceto", c);	
                        ChangeBehavior(c3, "follow", c);
			Perform(c3, "pause", 25);
			Perform(c3, "faceto", c);
                        ChangeBehavior(c4, "follow", c);				
			Perform(c4, "pause", 25);
			Perform(c4, "faceto", c);		
                        ChangeBehavior(c5, "follow", c);			
			Perform(c5, "pause", 25);
			Perform(c5, "faceto", c);
			ChangeBehavior(c6, "follow", c);
			Perform(c6, "pause", 25);
			Perform(c6, "faceto", c);
                        ChangeBehavior(c7, "follow", c);
			Perform(c7, "pause", 25);
			Perform(c7, "faceto", c);

			PlayerPerform("say", "我受死...？？？？");
			PlayerPerform("pause", 8);
			PlayerPerform("say", "杀你..我想应该会很容易吧，说，你们老大究竟是谁？说出来，我不杀你。");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "不错？他们都死在我的手下，更何况你。");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "怎么你怕了.。不是你挺厉害的..");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "你是孙剑的贴身，也就是我的敌人。。");
			PlayerPerform("pause", 5);
			PlayerPerform("block", 1);

			trg1 = 1;
		}
	}

	if (trg1 == 1)
	{
		c = GetAnyChar("继承人");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			

			Perform(c, "say", "先杀死你。哈哈。");
			Perform(c, "pause", 4);
			Perform(c, "say", "好家伙..看来我是不行的了。");

			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 34);
			PlayerPerform("use", 33);
			PlayerPerform("use", 19);
			PlayerPerform("use", 5);
			PlayerPerform("say", "那就让我杀了你。...");
			PlayerPerform("pause", 5);
			PlayerPerform("say", "那就自行了断吧...");
			PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			trg1 = 2;
		}
	}
	if (trg1 == 2)
	{
		c = GetAnyChar("继承人");
		if (GetHP(c) <= 0)
		{
			Say(c, "你真行.......老大！！！呜呜...");
			trg1 = 3;
		}
	}

	if (trg1 == 3)
	{
		c = GetAnyChar("继承人");
		c1 = GetAnyChar("继承手下2");
		c2 = GetAnyChar("继承手下3");
		c3 = GetAnyChar("继承手下4");
		c4 = GetAnyChar("继承手下5");
		c5 = GetAnyChar("继承手下6");
		c6 = GetAnyChar("继承手下7");
		c7 = GetAnyChar("继承手下1");
		
		if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c7)<=0 && player>=0 && GetHP(player)>0)
		{



			PlayerPerform("say", ".哼！！！");
			PlayerPerform("pause", 1);

			trg1 = 4;
			timer0 = now + 5;
		}
	}

   if (trg1 == 4 && now>timer0)
	{
                RemoveNPC(GetAnyChar("继承人"));
		RemoveNPC(GetAnyChar("继承手下2"));
                RemoveNPC(GetAnyChar("继承手下3"));
		RemoveNPC(GetAnyChar("继承手下4"));
                RemoveNPC(GetAnyChar("继承手下5"));
		RemoveNPC(GetAnyChar("继承手下6"));
                RemoveNPC(GetAnyChar("继承手下7"));
                RemoveNPC(GetAnyChar("继承手下1"));
			trg1 = 5;
			timer1 = now + 2;
		}

        if (trg1 == 5 && now>timer1)
	{
                    AddNPC("地狱煞星1");
                    AddNPC("地狱煞星2");
                    AddNPC("地狱煞星3");
                    AddNPC("地狱煞星4");
                    AddNPC("地狱煞星5");
      	                trg1 = 6;        
      
		}


	if (trg1 == 6)
	{
		c = GetAnyChar("地狱煞星1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "有两下子.....");


			trg1 = 7;
		}
	}
	if (trg1 == 7)
	{
		c = GetAnyChar("地狱煞星1");
		if (GetHP(c) <= 0)
		{
			Say(c, "....我不F....");
			trg1 = 8;
		}
	}
	if (trg2 == 0)
	{
		c = GetAnyChar("地狱煞星2");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "有两下子.....");


			trg2 = 1;
		}
	}
	if (trg2 == 1)
	{
		c = GetAnyChar("地狱煞星2");
		if (GetHP(c) <= 0)
		{
			Say(c, "....你...");
			trg2 = 2;
		}
	}

	if (trg3 == 0)
	{
		c = GetAnyChar("地狱煞星3");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "有一套.....");


			trg3 = 1;
		}
	}
	if (trg3 == 1)
	{
		c = GetAnyChar("地狱煞星3");
		if (GetHP(c) <= 0)
		{
			Say(c, "....你......行");
			trg3 = 2;
		}
	}

	if (trg3 == 2)
	{
		c = GetAnyChar("地狱煞星1");
		c1 = GetAnyChar("地狱煞星2");
		c2 = GetAnyChar("地狱煞星3");
		c3 = GetAnyChar("地狱煞星4");
		c4 = GetAnyChar("地狱煞星5");
		if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c7)<=0 && player>=0 && GetHP(player)>0)
		{



			PlayerPerform("say", "....这里真阴森啊。");
			PlayerPerform("pause", 1);

			trg3 = 3;
			timer0 = now + 5;
		}
	}
   if (trg3 == 3 && now>timer0)
	{
                RemoveNPC(GetAnyChar("地狱煞星1"));
		RemoveNPC(GetAnyChar("地狱煞星2"));
                RemoveNPC(GetAnyChar("地狱煞星3"));
		RemoveNPC(GetAnyChar("地狱煞星4"));
                RemoveNPC(GetAnyChar("地狱煞星5"));
			trg3 = 4;
			timer1 = now + 2;
		}

        if (trg3 == 4 && now>timer1)
	{
                    AddNPC("地狱魔王1");
                    AddNPC("地狱魔王2");
                    AddNPC("地狱魔王3");
                    AddNPC("地狱魔王4");
                    AddNPC("地狱魔王5");
      	                trg3 = 5;        
      
		}



	if (trg4 == 0)
	{
		c = GetAnyChar("地狱魔王2");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "有两下子.....");


			trg4 = 1;
		}
	}
	if (trg4 == 1)
	{
		c = GetAnyChar("地狱魔王2");
		if (GetHP(c) <= 0)
		{
			Say(c, "....你...");
			trg4 = 2;
		}
	}

	if (trg5 == 0)
	{
		c = GetAnyChar("地狱魔王3");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "有一套.....");


			trg5 = 1;
		}
	}
	if (trg5 == 1)
	{
		c = GetAnyChar("地狱魔王3");
		if (GetHP(c) <= 0)
		{
			Say(c, "....你......行");
			trg5 = 2;
		}
	}

	if (trg6 == 0)
	{
		c = GetAnyChar("地狱魔王1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "真厉害阿.....果真是高手");


			trg6 = 1;
		}
	}
	if (trg6 == 1)
	{
		c = GetAnyChar("地狱魔王1");
		if (GetHP(c) <= 0)
		{
			Say(c, "...全队撤退..");

			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 20);
			trg6 = 2;
			timer0 = now + 2;
		}
	}

   if (trg6 == 2 && now>timer0)
	{
                RemoveNPC(GetAnyChar("地狱魔王1"));
		RemoveNPC(GetAnyChar("地狱魔王2"));
                RemoveNPC(GetAnyChar("地狱魔王3"));
		RemoveNPC(GetAnyChar("地狱魔王4"));
                RemoveNPC(GetAnyChar("地狱魔王5"));
			trg6 = 3;
			timer1 = now + 2;
		}


        if (trg6 == 3 && now>timer1)
	{
                    AddNPC("地狱人1");
                    AddNPC("地狱人2");
                    AddNPC("地狱人3");
                    AddNPC("地狱人4");
                    AddNPC("地狱人5");
                    AddNPC("地狱人6");
                    AddNPC("地狱人7");
                    AddNPC("地狱人8");
      	                trg6 = 4;        
      
		}

if (trg7==0)
	{
		c = GetChar("复仇月姬1");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "我们报仇的机会到了。");
			Perform(c, "faceto", player);

			PlayerPerform("use", 33);
			PlayerPerform("use", 34);
			PlayerPerform("use", 19);
			PlayerPerform("use", 5);

			trg7 = 1;
		}
	}
	if (trg7 == 1)
	{
		c = GetAnyChar("复仇月姬1");
		if (GetHP(c) <= 0)
		{
			Say(c, "你行......");
			trg7 = 2;
		}
	}
	if (trg12==0)
	{
		c = GetChar("复仇月姬2");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "上次败给你，今天就要你的命");
			Perform(c, "faceto", player);
			trg12 = 1;
		}
	}
	if (trg12 == 1)
	{
		c = GetAnyChar("复仇月姬2");
		if (GetHP(c) <= 0)
		{
			Say(c, "你行......");
			trg12 = 2;
		}
	}
	if (trg8==0)
	{
		c = GetChar("复仇月姬3");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "你死期到了...");
			Perform(c, "faceto", player);
			trg8 = 1;
		}
	}
	if (trg8 == 1)
	{
		c = GetAnyChar("复仇月姬3");
		if (GetHP(c) <= 0)
		{
			Say(c, "你行......");
			trg8 = 2;
		}
	}
	if (trg9==0)
	{
		c = GetChar("复仇白姬1");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "没人能从这活着出去");
			Perform(c, "faceto", player);
			trg9 = 1;
		}
	}
	if (trg9 == 1)
	{
		c = GetAnyChar("复仇白姬1");
		if (GetHP(c) <= 0)
		{
			Say(c, "难道就不能报仇吗？.");
			trg9 = 2;
		}
	}
	if (trg10==0)
	{
		c = GetChar("复仇白姬2");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "say", "擅闯禁地的人都要死，");
			Perform(c, "faceto", player);
			trg10 = 1;
		}
	}
	if (trg10 == 1)
	{
		c = GetAnyChar("复仇白姬2");
		if (GetHP(c) <= 0)
		{
			Say(c, "难道就不能报仇吗？.");
			trg10 = 2;
		}
	}
	if (trg11==0)
	{
		c = GetChar("复仇白姬3");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "guard", 3);
			Perform(c, "say", "既然你来了，你就别想活着出去了");
			Perform(c, "faceto", player);
			trg11 = 1;
		}
	}
	if (trg11 == 1)
	{
		c = GetAnyChar("复仇白姬3");
		if (GetHP(c) <= 0)
		{
			Say(c, "难道就不能报仇吗？.");
			trg11 = 2;
		}
	}

	if (trg13==0)
	{
		c = GetChar("复仇日姬1");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "guard", 3);
			Perform(c, "say", "既然你来了，你就别想活着出去了");
			Perform(c, "faceto", player);
			trg13 = 1;
		}
	}
	if (trg13 == 1)
	{
		c = GetAnyChar("复仇日姬1");
		if (GetHP(c) <= 0)
		{
			Say(c, "我不会在回来了....");
			trg13 = 2;
		}
	}
	if (trg14==0)
	{
		c = GetChar("复仇日姬2");
		if (c>=0 && GetEnemy(c)==player)
		{
			Perform(c, "guard", 3);
			Perform(c, "say", "既然你来了，你就别想活着出去了");
			Perform(c, "faceto", player);
			trg14 = 1;
		}
	}

	if (trg14 == 1)
	{
		c = GetAnyChar("复仇日姬2");
		if (GetHP(c) <= 0)
		{
			Say(c, "我不会在回来了....");
			trg14 = 2;
		}
	}
	if (trg14 == 2)
	{
		c = GetAnyChar("复仇月姬1");
		c1 = GetAnyChar("复仇月姬2");
		c2 = GetAnyChar("复仇月姬3");
		c3 = GetAnyChar("复仇白姬1");
		c4 = GetAnyChar("复仇白姬2");
		c5 = GetAnyChar("复仇白姬3");
		c6 = GetAnyChar("复仇日姬1");
		c7 = GetAnyChar("复仇日姬2");
		
		if (GetHP(c)<=0 && GetHP(c1)<=0 && GetHP(c2)<=0 && GetHP(c3)<=0 && GetHP(c4)<=0 && GetHP(c5)<=0 && GetHP(c6)<=0 && GetHP(c7)<=0 && player>=0 && GetHP(player)>0)
		{



			trg14 = 3;
		        gameover = 1;
			timer0 = now + 5;
		}
	}



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