//  再次领教JQ
int Rule = 1;
int RoundTime = 600;
int PlayerSpawn = 1;
int PlayerSpawnDir = 0;
int PlayerWeapon = 52;
int PlayerWeapon2 =35;
int PlayerHP = 8000;


int trg0;
int shi0;
int trg1;
int shi1;
int trg2;
int shi2;
int trg3;
int shi3;

int sj;
int gameover;
int fshi;
int player;


int c1;            
int ca1;      
int c2;      
int ca2;   
int c3;   
int ca3; 
int c4;
int ca4;
int c5;
int ca5;
int c6;
int ca6;
int c7; 
int ca7;
int c8;
int ca8;
///////
int c9;
int ca9;
int cshi9;
///////
int he;int he1;//小何
int j0;int sj0;
int j1;int sj1;
int j2;int sj2;
//
AlwaysDo(){
if (GetHP(player)<=0){ 
GameOver(-1);}} //

GetDistance(int k1,int k2)
{
   SetTarget(0, "char", k1);
   SetTarget(1, "char", k2);
   return Distance(0,1);
}
GetNPCChar() 
{
   c1=GetChar("vip-1");
   c2=GetChar("vip-2");
   c3=GetChar("vip-3");
   c4=GetChar("狂刀-1 vs");
   c5=GetChar("狂刀-2 vs");
   c6=GetChar("狂刀-3 vs");
   c7=GetChar("魔神吸血");
   c8=GetChar("ay=夺命侍卫");
   ca1=GetAnyChar("vip-1");
   ca2=GetAnyChar("vip-2");
   ca3=GetAnyChar("vip-3");
   ca4=GetAnyChar("狂刀-1 vs");
   ca5=GetAnyChar("狂刀-2 vs");
   ca6=GetAnyChar("狂刀-3 vs");
   ca7=GetAnyChar("魔神吸血");
   ca8=GetAnyChar("ay=夺命侍卫");


   c9=GetChar("暗月s-剑气");
   ca9=GetAnyChar("暗月s-剑气");

   he=GetChar("JQ-小何");
   he1=GetAnyChar("JQ-小何");
}


scene1(){
if (trg0==0 && he>=0){ 
//
ChangeBehavior(c1,"run");
ChangeBehavior(c2,"run");
ChangeBehavior(c3,"run");
ChangeBehavior(c8,"run");//
ChangeBehavior(he,"run");
Perform(he,"say","  恩，这里都是高手把手，小心点啊。. ");  // 时刻:5
Perform(he,"pause",3);
PlayerPerform("say","  走吧！前面看看吧！.");  // 时刻:4
PlayerPerform("pause",4);
Perform(he,"say","  呵呵。 ..这里是洛阳，暗月的组织很快就要找到了 ，现在还是查出谁是首领. ");  // 时刻:2
Perform(he,"pause",2);
PlayerPerform("say","  小何。 还是你的剑气比较厉害啊..   ");  // 时刻:0
PlayerPerform("block", 1);
Perform(he, "faceto", player);
trg0++;
  }


if (trg0==1  && c7>=0 && GetDistance(player,c7)<=100 ){ 

ChangeBehavior(c4,"follow",player);ChangeBehavior(c5,"follow",player);
ChangeBehavior(c6,"follow",player);
ChangeBehavior(c7,"follow",player);
ChangeBehavior(he,"follow",c7);
Perform(c7,"use",4);
Perform(c7,"use",41);
Perform(c7,"use",5);
Perform(c7,"use",34);
Perform(c7,"use",40);
PlayerPerform("block", 0);
Perform(c7,"say","  受死吧！ ");  // 时刻:2
Perform(c7,"pause",2);
Perform(c7,"say","  来了！我们等候多时了，你总算来送死了！ ");  // 时刻:2
Perform(c7,"pause",2);
PlayerPerform("block", 1);

trg0++;
shi0= sj + 50;
  }


if (sj>shi0 && trg0==2) {


ChangeBehavior(c8,"follow",player);
ChangeBehavior(c1,"follow",c8);
ChangeBehavior(c2,"follow",c8);
ChangeBehavior(c3,"follow",c8);
Perform(c8,"say","  是！。 ");  // 时刻:5
Perform(c8,"pause",5);
Perform(c7,"say","  那家伙太惹人了，本身他不该死的，现在通通杀死。 ");  // 时刻:2
Perform(c7,"pause",2);
Perform(c7,"say","  绝对不能让他跑掉了！把同伙的一起杀了， ");  // 时刻:0

trg0++;
shi0= sj + 80;
  }


if (sj>shi0 && trg0==3) {


Perform(c7,"pause",2);
Perform(c7,"say","  跑...抓住他！ ");  // 时刻:0

trg0++;
  }


if (trg0==4  &&  c7<0) {

Perform(he,"pause",20);
Perform(he,"say","  我想我也该回去禀报一下！那我先走了... ");  // 时刻:2
Perform(he,"pause",2);
PlayerPerform("say","  小何。 你先回去禀报吧.  这里不要麻烦你了。 ");  // 时刻:0
PlayerPerform("block", 1);
Perform(he, "faceto", player);

trg0++;
shi0= sj + 5;
  }


if (sj>shi0 && trg0==5) {


RemoveNPC(he1);

trg0++;
shi0= sj + 5;
  }

if (sj>shi0 && trg0==6) {


PlayerPerform("block", 0);
PlayerPerform("say","  不知道还会有什么！好可怕的暗月！ ");  // 时刻:0
PlayerPerform("block", 1);


trg0++;
  }

}
scene2(){

if (trg0==7 && c1<0 && c2<0 && c3<0 && c4<0 && c5<0 && c6<0 && c8<0 && trg1==0){ 


RemoveNPC(ca1);RemoveNPC(ca5);
RemoveNPC(ca2);RemoveNPC(ca6);
RemoveNPC(ca3);RemoveNPC(ca7);
RemoveNPC(ca4);RemoveNPC(ca8);

PlayerPerform("block", 0);
PlayerPerform("say","  结束了么0.0！ ");  // 时刻:0
PlayerPerform("block", 1);

trg1++;
shi1= sj + 5;

  }

if (sj>shi1 && trg1==1) {


AddNPC("4关aj");	

trg1++;

  }

if (trg1==2 && c9>=0) {


Perform(c9,"use",4);
Perform(c9,"use",41);
Perform(c9,"use",5);
Perform(c9,"use",34);
Perform(c9,"use",40);
PlayerPerform("use", 15);
PlayerPerform("use", 15);
PlayerPerform("use", 40);
PlayerPerform("use", 34);
PlayerPerform("say","  那只有是在输给我一次了..");  // 时刻:8
PlayerPerform("pause",2);
Perform(c9,"say","  我是回来报仇的！我说过手好了之后会回来的..  ");

trg1++;

  }

if (trg1==3 && cshi9+50<=GetGameTime()){ 
cshi9=GetGameTime();
Perform(c9,"use",34);
Perform(c9,"use",41);
Perform(c9,"use",5);
Perform(c9,"use",4);
Perform(c9,"use",3);}


if (trg1==3 && GetHP(c9)<6000) {


Perform(c9,"say","  我不会在输给你了.. 可恶！..  ");

trg1++;

  }

if (trg1==4 && GetHP(c9)<4000) {

Perform(c9,"use",15);
Perform(c9,"use",15);
Perform(c9,"use",19);
Perform(c9,"use",40);
Perform(c9,"use",34);
PlayerPerform("use", 15);
Perform(c9,"say","  好家伙阿！..   看我怎么收拾你.. ");

trg1++;

  }

if (trg1==5 && GetHP(c9)<1000) {


Perform(c9,"say"," 我不会这么算了的！  ");
Perform(c9,"use",15);
Perform(c9,"use",15);
Perform(c9,"say","  伊人君好样的..  慢慢的你就会死在我的手里。等着吧  ");


trg1++;

shi1= sj + 5;

  }

if (sj>shi1 && trg1==6) {GameOver(1);}

if (trg1==6 && c9<0) {GameOver(-1); }}






////////////////////////////////////////////////////////
OnStart()
{   
	AddNPC("4关自己");
	AddNPC("4关");	AddNPC("4关4");
	AddNPC("4关1");	AddNPC("4关5");
	AddNPC("4关2");	AddNPC("4关6");
	AddNPC("4关3");	AddNPC("4关7");
}
/////////////////////////////////////////////////////////
OnUpdate()
{	
	player = GetAnyChar("player");
	sj = GetGameTime();
	if (player < 0)
	{
		return 0;
	}

         GetNPCChar() ; 

	AlwaysDo();

	scene1();
        scene2();
        scene3();
}

