// 玉女心精.秒杀
int Rule = 1;
int RoundTime = 90;
int PlayerSpawn = 141;
int PlayerSpawnDir = 0;
int PlayerWeapon = 50;
int PlayerWeapon2 = 54;
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 timer0 = 0;
int timer1 = 0;
int timer2 = 0;
int timer3 = 0;
int timer4 = 0;
int gameover = 0;

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 c11;
        int c12;
        int c13;
        int c14;
        int c15;
	int now = GetGameTime();

	

if (trg0 == 0)
	{
		c = GetChar("伊人梦");		
		if (c>=0 && GetEnemy(c)==player)
		{
                        ChangeBehavior(c,"follow",player);
			Perform(c, "aggress");
			Perform(c, "say", "恩，那你自己小心，我先走了。。");
			Perform(c, "pause", 4);
			Perform(c, "say", "快活林的人现在不会有事情，只是我们还不能与孙玉表皮对抗。");
			Perform(c, "pause", 1);
			Perform(c, "say", "恩，我来告诉你，这里的高手很多，你要多加小心，");
			Perform(c, "pause", 2);
			Perform(c, "say", "老公。你来了...");
			Perform(c, "faceto", player);


			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("say", "恩，你先离开，这里狠危险。。");		
			PlayerPerform("pause", 4);
			PlayerPerform("say", "我知道了，我先看看这里究竟是什么来路。。搞清楚之后，我立刻去救你们。");		
			PlayerPerform("pause", 4);
			PlayerPerform("say", "梦，你怎么也跟着来了..。你不是说在孙玉伯那里么？");		
			PlayerPerform("pause", 1);
			PlayerPerform("block", 1);

		         trg0 = 1;
		        timer0 = now + 10; 


	    }
    }

    if (trg0 == 1 && now>timer0)
	{

                RemoveNPC(GetAnyChar("伊人梦"));

		         trg0 = 2;
		        timer1 = now + 5; 


	}


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

                    AddNPC("洛阳人士1");
                    AddNPC("洛阳人士2");
                    AddNPC("洛阳人士3");
                    AddNPC("洛阳人士4");
                    AddNPC("洛阳人士5");
                    AddNPC("洛阳人士6");
                    AddNPC("洛阳人士7");
                    AddNPC("洛阳人士8");

		         trg0 = 3;


	}


if (trg0 == 3)
	{
		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);
                        Perform(c1, "use", 19);
                        Perform(c1, "use", 5);
		       ChangeBehavior(c2, "kill", player);
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);
		       ChangeBehavior(c3, "kill", player);
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
		       ChangeBehavior(c4, "kill", player);
                        Perform(c4, "use", 19);
                        Perform(c4, "use", 5);
		       ChangeBehavior(c5, "kill", player);
                        Perform(c5, "use", 19);
                        Perform(c5, "use", 5);
		       ChangeBehavior(c6, "kill", player);
                        Perform(c6, "use", 19);
                        Perform(c6, "use", 5);
		       ChangeBehavior(c7, "kill", player);
                        Perform(c7, "use", 19);
                        Perform(c7, "use", 5);

			PlayerPerform("block", 0);
			PlayerPerform("say", "难免会有这么多的人，洛阳城杀气重重...");
			PlayerPerform("pause", 3);
			PlayerPerform("block", 1);


			trg0 = 4;

		}		
	}

if (trg0 == 4)
	{
		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);


			trg0 = 5;
			timer1 = now + 4;
		}		
	}


if (trg0 == 5 && 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 = 6;
			 timer2 = now + 5;
                   }

     if (trg0 == 6 && now>timer2)
	{

                    AddNPC("洛阳守卫1");
                    AddNPC("洛阳守卫2");
                    AddNPC("洛阳守卫3");
                    AddNPC("洛阳守卫4");
                    AddNPC("洛阳守卫5");
                    AddNPC("洛阳守卫6");
                    AddNPC("洛阳守卫7");
                    AddNPC("洛阳守卫8");

		         trg0 = 7;


	}
if (trg0 == 7)
	{
		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, "use", 19);
                        Perform(c, "use", 5);
			Perform(c, "say", "你有这么厉害吗？让我瞧瞧...。");
			Perform(c, "faceto", player);


		       ChangeBehavior(c1, "kill", player);
                        Perform(c1, "use", 19);
                        Perform(c1, "use", 5);
		       ChangeBehavior(c2, "kill", player);
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);
		       ChangeBehavior(c3, "kill", player);
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
		       ChangeBehavior(c4, "kill", player);
                        Perform(c4, "use", 19);
                        Perform(c4, "use", 5);
		       ChangeBehavior(c5, "kill", player);
                        Perform(c5, "use", 19);
                        Perform(c5, "use", 5);
		       ChangeBehavior(c6, "kill", player);
                        Perform(c6, "use", 19);
                        Perform(c6, "use", 5);
		       ChangeBehavior(c7, "kill", player);
                        Perform(c7, "use", 19);
                        Perform(c7, "use", 5);
		         trg0 = 8;
                   }

      }


	if (trg1 == 0)
	{
		c = GetAnyChar("洛阳守卫1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "，..果然有两下子阿。哼。。。。");
			trg1 = 1;
		}
	}
	if (trg1 == 1)
	{
		c = GetAnyChar("洛阳守卫1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/4)
		{			
			Perform(c, "say", "你这家伙。。都给我撤..这里我们待不下去了。");
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			trg1 = 2;
			 timer0 = now + 2;
		}
	}

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

                RemoveNPC(GetAnyChar("洛阳守卫1"));
                RemoveNPC(GetAnyChar("洛阳守卫2"));
                RemoveNPC(GetAnyChar("洛阳守卫3"));
                RemoveNPC(GetAnyChar("洛阳守卫4"));
                RemoveNPC(GetAnyChar("洛阳守卫5"));
                RemoveNPC(GetAnyChar("洛阳守卫6"));
                RemoveNPC(GetAnyChar("洛阳守卫7"));
                RemoveNPC(GetAnyChar("洛阳守卫8"));
		         trg1 = 3;
			 timer1 = now + 5;
                   }


	     if (trg1 == 3 && now>timer1)
	     {

                    AddNPC("洛阳杀手1");
                    AddNPC("洛阳杀手2");
                    AddNPC("洛阳杀手3");
                    AddNPC("洛阳杀手4");
                    AddNPC("洛阳杀手5");
                    AddNPC("洛阳杀手6");
                    AddNPC("洛阳杀手7");
                    AddNPC("洛阳杀手8");

		         trg1 = 4;


	}


	if (trg1 == 4)
	{
		c = GetChar("洛阳杀手1"); 
		
		if (c>=0 && GetEnemy(c)==player)
		{

                        Perform(c, "use", 5);
                        Perform(c, "use", 19);
			Perform(c, "say", "难怪你会闯入这里。原来你小子有两下子..！");
			
			trg1 = 5;
		}
	}
	if (trg1 == 5)
	{
		c = GetAnyChar("洛阳杀手1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
                        Perform(c, "use", 15);
			Perform(c, "say", "，..果然有两下子阿。哼。。。。");
			trg1 = 6;
		}
	}
	if (trg1 == 6)
	{
		c = GetAnyChar("洛阳杀手1");
		if (GetHP(c) <= 0)
		{
			Say(c, "没想到阿......");
			trg1 = 7;
		}
	}


if (trg1 == 7)
	{
		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("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("say", "呜...杀手已经敷衍了整个我...");
			PlayerPerform("pause", 3);


			trg1 = 8;
			timer1 = now + 4;
		}		
	}
if (trg1 == 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"));
		         trg1 = 9;
			 timer1 = now + 5;
                   }


	     if (trg1 == 9 && now>timer1)
	     {

                    AddNPC("洛阳和尚1");
                    AddNPC("洛阳和尚2");
                    AddNPC("洛阳和尚3");
                    AddNPC("洛阳和尚4");
                    AddNPC("洛阳和尚5");
                    AddNPC("洛阳和尚6");
                    AddNPC("洛阳和尚7");
                    AddNPC("洛阳和尚8");

		         trg1 = 10;

	}

if (trg1 == 10)
	{
		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, "aggress");
                        Perform(c, "use", 19);
                        Perform(c, "use", 5);
			Perform(c, "say", "施主，老衲得罪了....。");
			Perform(c, "faceto", player);


		       ChangeBehavior(c1, "kill", player);
			Perform(c1, "aggress");
                        Perform(c1, "use", 19);
                        Perform(c1, "use", 5);
		       ChangeBehavior(c2, "kill", player);
			Perform(c2, "aggress");
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);
		       ChangeBehavior(c3, "kill", player);
			Perform(c3, "aggress");
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
		       ChangeBehavior(c4, "kill", player);
			Perform(c4, "aggress");
                        Perform(c4, "use", 19);
                        Perform(c4, "use", 5);
		       ChangeBehavior(c5, "kill", player);
			Perform(c5, "aggress");
                        Perform(c5, "use", 19);
                        Perform(c5, "use", 5);
		       ChangeBehavior(c6, "kill", player);
			Perform(c6, "aggress");
                        Perform(c6, "use", 19);
                        Perform(c6, "use", 5);
		       ChangeBehavior(c7, "kill", player);
			Perform(c7, "aggress");
                        Perform(c7, "use", 19);
                        Perform(c7, "use", 5);
		         trg1 = 11;
                   }

      }
	if (trg2 == 0)
	{
		c = GetAnyChar("少林高僧1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "，施主的武功貌似高出老衲..阿米托佛。。");
			trg2 = 1;
		}
	}
	if (trg2 == 1)
	{
		c = GetAnyChar("少林高僧1");
		if (GetHP(c) <= 0)
		{
			Say(c, "出家人是不会杀生的....施主你却.....");
			trg2 = 2;
		}
	}

if (trg2 == 2)
	{
		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);


			trg2 = 3;
			timer1 = now + 4;
		}		
	}

if (trg2 == 3 && 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"));
		         trg2 = 4;
			 timer1 = now + 5;
                   }





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

                    AddNPC("洛阳火枪1");
                    AddNPC("洛阳火枪2");
                    AddNPC("洛阳火枪3");
                    AddNPC("洛阳火枪4");
                    AddNPC("洛阳火枪5");
                    AddNPC("洛阳火枪6");
                    AddNPC("洛阳火枪7");
                    AddNPC("洛阳火枪8");

		         trg2 = 5;

	}


if (trg2 == 5)
	{
		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, "aggress");
                        Perform(c, "use", 19);
                        Perform(c, "use", 5);
			Perform(c, "say", "在次感受......。受死吧，小小伊人君。");
			Perform(c, "faceto", player);


		       ChangeBehavior(c1, "kill", player);
			Perform(c1, "aggress");
                        Perform(c1, "use", 19);
                        Perform(c1, "use", 5);
		       ChangeBehavior(c2, "kill", player);
			Perform(c2, "aggress");
                        Perform(c2, "use", 19);
                        Perform(c2, "use", 5);
		       ChangeBehavior(c3, "kill", player);
			Perform(c3, "aggress");
                        Perform(c3, "use", 19);
                        Perform(c3, "use", 5);
		       ChangeBehavior(c4, "kill", player);
			Perform(c4, "aggress");
                        Perform(c4, "use", 19);
                        Perform(c4, "use", 5);
		       ChangeBehavior(c5, "kill", player);
			Perform(c5, "aggress");
                        Perform(c5, "use", 19);
                        Perform(c5, "use", 5);
		       ChangeBehavior(c6, "kill", player);
			Perform(c6, "aggress");
                        Perform(c6, "use", 19);
                        Perform(c6, "use", 5);
		       ChangeBehavior(c7, "kill", player);
			Perform(c7, "aggress");
                        Perform(c7, "use", 19);
                        Perform(c7, "use", 5);
		         trg2 = 6;
                   }

      }
	if (trg2 == 6)
	{
		c = GetAnyChar("火枪手1");
		if (c>=0 && GetHP(c)<GetMaxHP(c)/2)
		{			
			Perform(c, "say", "，...。这家伙....吗的。。");
			trg2 = 7;
		}
	}
	if (trg2 == 7)
	{
		c = GetAnyChar("火枪手1");
		if (GetHP(c) <= 0)
		{
			Say(c, "又一次败在你的手中.....");
			trg2 = 8;
		}
	}



if (trg2 == 8)
	{
		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);


			trg2 = 9;
			timer1 = now + 4;
		}		
	}

if (trg2 == 9 && 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"));
		         trg2 = 10;
			 timer2 = now + 1;
                   }



	     if (trg2 == 10 && now>timer2)
	     {

                    AddNPC("洛阳玉女1");

		         trg2 = 11;

	}


	if (trg3 == 0)
	{
		c = GetChar("玉女心精"); 
		
		if (c>=0 && GetEnemy(c)==player)
		{

                        Perform(c, "use", 19);
                        Perform(c, "use", 5);
			Perform(c, "say", "受死吧..！小小伊人君....");
			
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			PlayerPerform("use", 15);
			trg3 = 1;
			timer0 = now + 4;
		}
	}

	     if (trg3 == 1 && now>timer0)
	     {

                    AddNPC("洛阳火枪1");
                    AddNPC("洛阳火枪2");
                    AddNPC("洛阳火枪3");
                    AddNPC("洛阳火枪4");
                    AddNPC("洛阳火枪5");
                    AddNPC("洛阳火枪6");
                    AddNPC("洛阳火枪7");

		         trg3 = 2;

	}




        if (trg3 == 2)
	{
                c = GetChar("玉女心精");
		if (c>=0 && GetHP(c)<4000)
		{     
                        Perform(c, "pause", 200000);
                        Perform(c, "say", "不过你是活不了多久的了。你马上会死的，你等着吧，哈哈。");
                        Perform(c, "pause", 1);
                        Perform(c, "say", "没想到连我都不是你的对手。。呜...");
                        Perform(c, "pause", 2);
			Perform(c, "faceto", player);	

                        PlayerPerform("block", 0);
                        PlayerPerform("pause", 2);
                        PlayerPerform("say", "都说我会死。但是死也要杀死你们。。");
                        PlayerPerform("pause", 5);
                        PlayerPerform("block", 1);

			trg3 = 3;
			timer1 = now + 5;
		}
	} 


        if (trg3 == 3 && now>timer1)
	{
                RemoveNPC(GetAnyChar("玉女心精"));


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