// 剑气+追风、狂战
int Rule = 1;
int RoundTime = 450;
int PlayerSpawn = 33;
int PlayerSpawnDir = 80;
int PlayerWeapon = 0;
int PlayerWeapon2 =33;
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 c10;
int ca10;

int b1;
int ba1;
int b2;
int ba2;
//
int he;int he1; 
int ye;int ye1;//

int j0;int sj0;
int j1;int sj1;
int j2;int sj2;

int xunhuan;  //循环

yiren(){
if (GetHP(player)<=0){ 
GameOver(-1);}}

GetDistance(int k1,int k2)
{
   SetTarget(0, "char", k1);
   SetTarget(1, "char", k2);
   return Distance(0,1);
}


npc() 
{
   c1=GetChar("暗月s-锤护法1");
   ca1=GetAnyChar("暗月s-锤护法1");
   c2=GetChar("暗月s-锤护法2");
   ca2=GetAnyChar("暗月s-锤护法2");
   c3=GetChar("暗月s-锤护法3");
   ca3=GetAnyChar("暗月s-锤护法3");
   c4=GetChar("暗月s-锤护法4");
   ca4=GetAnyChar("暗月s-锤护法4");
   c5=GetChar("暗月s-影子1");
   ca5=GetAnyChar("暗月s-影子1");
   c6=GetChar("暗月s-影子2");
   ca6=GetAnyChar("暗月s-影子2");
   c7=GetChar("暗月s-影子3");
   ca7=GetAnyChar("暗月s-影子3");
   c8=GetChar("无情莽夫-1");
   ca8=GetAnyChar("无情莽夫-1");
   c9=GetChar("无情莽夫-2");
   ca9=GetAnyChar("无情莽夫-2");
   c10=GetChar("无情莽夫-3");
   ca10=GetAnyChar("无情莽夫-3");

   b1=GetChar("暗月s-追风");
   ba1=GetAnyChar("暗月s-追风");
   b2=GetChar("暗月s-剑气");
   ba2=GetAnyChar("暗月s-剑气");

   ye=GetChar("sq-叶翔");
   ye1=GetAnyChar("sq-叶翔");

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

}

scene1(){

if (trg0==0 && he>=0){ 

ChangeBehavior(he,"follow",b1);
ChangeBehavior(ye,"follow",b2);
ChangeBehavior(b1,"follow",he);
ChangeBehavior(b2,"follow",he);
PlayerPerform("say","  放马过来吧！.");  // 时刻:17
PlayerPerform("pause",6);
//Perform(b1, "attack");Perform(b2, "attack");
Perform(he, "attack");Perform(ye, "attack");//
Perform(b1,"pause",2);
Perform(he,"pause",9);
Perform(ye,"pause",10);
Perform(b2,"say","  别说了！联手杀死这家伙，！ "); // 15
Perform(b2,"pause",7);
Perform(b1,"say","  哈哈！你连伤剑气2次，我要看看你的厉害！ "); // 13
Perform(b1,"pause",5);
PlayerPerform("say","  那我怎么没有中毒！.");  // 时刻:11
PlayerPerform("pause",10);
Perform(b1,"say","  不错..  你们中毒了！来我们的地盘，还不好好的折磨一下你们！ "); 
Perform(b1, "faceto", player);
Perform(b2, "faceto", player);
Perform(b1,"pause",8);
Perform(b2,"pause",8);
Perform(ye,"use",14);
Perform(he,"use",14);
Perform(ye,"use",13);
Perform(he,"use",13);
Perform(he,"say","  糟了，我们中毒了又！.. ");  // 时刻:6
Perform(he,"pause",4);
//
Perform(ye,"say","  顺便老大也让我来祝你们一臂之力！早日完成任务！.. ");  // 时刻:5
Perform(ye,"pause",5);//
Perform(he,"say","  领教剑气的快剑！看看多么的厉害.. ");  // 时刻:2
Perform(he,"pause",2);
PlayerPerform("say","  小何。叶翔..你们两个怎么都来了   ");  // 时刻:0
PlayerPerform("block", 1);
Perform(he, "faceto", player);
Perform(ye, "faceto", player);
trg0++;j0=1;
  }

if (trg0==1 && GetHP(b1)<6000) {

ChangeBehavior(b1,"follow",he);
ChangeBehavior(b2,"follow",he);
Perform(he,"use",15);
Perform(ye,"use",15);
PlayerPerform("use", 15);
PlayerPerform("say","  可恶！.   "); 
Perform(b1,"use",15);Perform(b2,"use",15);
Perform(b1,"use",15);Perform(b2,"use",15);
Perform(b1,"use",20);Perform(b2,"use",20);
Perform(b1,"use",15);Perform(b2,"use",15);
Perform(b1,"use",15);Perform(b2,"use",15);
Perform(b1,"use",20);Perform(b2,"use",20);
Perform(b1,"use",19);Perform(b2,"use",40);
Perform(b1,"use",40);Perform(b2,"use",34);
Perform(b1,"use",34);Perform(b2,"use",19);
Perform(b1,"say","  哈哈！你是不行的了！用心了！ "); 

trg0++;
}

if (trg0==1 &&  GetHP(b2)<6000) {

ChangeBehavior(b1,"follow",he);
ChangeBehavior(b2,"follow",he);
Perform(he,"use",15);Perform(ye,"use",15);
PlayerPerform("use", 15);
PlayerPerform("say","  可恶！.   "); 
Perform(b1,"use",15);Perform(b2,"use",15);
Perform(b1,"use",15);Perform(b2,"use",15);
Perform(b1,"use",20);Perform(b2,"use",20);
Perform(b1,"use",15);Perform(b2,"use",15);
Perform(b1,"use",15);Perform(b2,"use",15);
Perform(b1,"use",20);Perform(b2,"use",20);
Perform(b1,"use",19);Perform(b2,"use",40);
Perform(b1,"use",40);Perform(b2,"use",34);
Perform(b1,"use",34);Perform(b2,"use",19);
Perform(b1,"say","  哈哈！你是不行的了！用心了！ "); 

trg0++;

}

if (GetHP(he)<4000 && j0==1) {

Perform(b1,"pause",50);Perform(b2,"pause",50);
Perform(he,"pause",50);Perform(ye,"pause",50);
Perform(b2,"say","  你死定了！走吧，大哥  ");  // 时刻:2
Perform(b2,"pause",6);
Perform(b1,"say","  废物！竟然跑路！剑气，我们走，让这小子死在这里吧.  ");  // 时刻:2
Perform(b1,"pause",5);
Perform(he,"say","  回去先吧毒解掉，我在回来帮你. 叶翔，我们走！  ");  // 时刻:2
Perform(he,"pause",2);
PlayerPerform("say","  小何，叶翔。你们先离开！在这样下去时不行的！   "); 

j0=2;
sj0 = sj + 8;
}

if (sj>sj0 && j0==2) {

PlayerPerform("use", 15);
RemoveNPC(he1);RemoveNPC(ye1);
RemoveNPC(ba1);RemoveNPC(ba2);

    j0=3;sj0 = sj + 3;

  }

if (sj>sj0 && j0==3) {

	AddNPC("5关1");AddNPC("5关3");
	AddNPC("5关2");AddNPC("5关4");
	AddNPC("5关5");AddNPC("5关7");
	AddNPC("5关6");//却一个

    j0++;
   }
}

scene2(){

if (trg1==0 && c1>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0 && c7>=0){ 


Perform(c1, "aggress");Perform(c5, "aggress");
Perform(c2, "aggress");Perform(c6, "aggress");
Perform(c3, "aggress");Perform(c7, "aggress");
Perform(c4, "aggress");
Perform(c1,"use",34);Perform(c1,"use",41);
Perform(c2,"use",34);Perform(c2,"use",41);
Perform(c3,"use",34);Perform(c3,"use",41);
Perform(c4,"use",34);Perform(c4,"use",41);
Perform(c5,"use",34);Perform(c5,"use",41);
Perform(c6,"use",34);Perform(c6,"use",41);
Perform(c7,"use",34);Perform(c7,"use",41);

    trg1++;
   }

if (trg1==1 && xunhuan+60<=GetGameTime()){ 

xunhuan=GetGameTime();
//
Perform(c1,"use",34);Perform(c1,"use",41);
Perform(c2,"use",34);Perform(c2,"use",41);
Perform(c3,"use",34);Perform(c3,"use",41);
Perform(c4,"use",34);Perform(c4,"use",41);
Perform(c5,"use",34);Perform(c5,"use",41);
Perform(c6,"use",34);Perform(c6,"use",41);
Perform(c7,"use",34);Perform(c7,"use",41);//

Perform(c5,"say","  认命吧. 伊人君！   ");
Perform(c1, "aggress");Perform(c5, "aggress");
Perform(c2, "aggress");Perform(c6, "aggress");
Perform(c3, "aggress");Perform(c7, "aggress");
Perform(c4, "aggress");//

}


if (trg1==1 && c1<0 && c2<0 && c3<0 && c4<0){ 

PlayerPerform("use", 15);
PlayerPerform("say"," 我只是想知道头领是谁，你们何必做无谓的牺牲！..");  // 时刻:8
PlayerPerform("pause",2);
RemoveNPC(ca1);RemoveNPC(ca2);
RemoveNPC(ca3);RemoveNPC(ca4);
Perform(c5,"say","  好家伙！怎么跟暗月斗，认命吧！   ");

    trg1++;
    shi1 = sj + 3;
   }

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

AddNPC("5关8");AddNPC("5关9");AddNPC("5关10");

    trg1++;
   }



if (trg1==3 && c5<0 && c6<0 && c7<0 && c8<0 && c9<0 && c10<0 && ca5>=0){ 

Say(ca5,"   你这家伙!  有本事你跟我们老大比试一场，你会死的很难看.. ");

    trg1++;
    shi1 = sj + 3;

   }

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


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

        npc(); 
	yiren();
	scene1();
        scene2();
        scene3();
}
