//  血洗、ay-vip、上官
int Rule = 1;
int RoundTime = 600;
int PlayerSpawn = 515;
int PlayerSpawnDir = 180;
int PlayerWeapon = 18;
int PlayerWeapon2 =17;
int PlayerHP = 12000;

int trg0;
int shi0;
int trg1;
int shi1;
int trg2;
int shi2;
int trg3;
int shi3;
int trg4;
int shi4;
int trg5;
int shi5;

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;



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

npc() 
{
   c1=GetChar("魔兽vip");
   ca1=GetAnyChar("魔兽vip");
   c2=GetChar("暗月s-无名杀手");
   ca2=GetAnyChar("暗月s-无名杀手");
   c3=GetChar("暗月侍卫、刀卫");
   ca3=GetAnyChar("暗月侍卫、刀卫");
   c4=GetChar("暗月侍卫、枪卫");
   ca4=GetAnyChar("暗月侍卫、枪卫");
   c5=GetChar("暗月vip-1");
   ca5=GetAnyChar("暗月vip-1");
   c6=GetChar("暗月vip-2");
   ca6=GetAnyChar("暗月vip-2");
   c7=GetChar("暗月vip-使者");
   ca7=GetAnyChar("暗月vip-使者");
   c8=GetChar("暗月vip-护月");
   ca8=GetAnyChar("暗月vip-护月");

   b1=GetChar("ay-vip、上官");
   ba1=GetAnyChar("ay-vip、上官");

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

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

}
scene1(){

if (trg0==0  && c3>=0  && c4>=0  && c5>=0  && c6>=0 ){ 

ChangeBehavior(c3, "run");
ChangeBehavior(c4, "run");
ChangeBehavior(c5, "patrol", 55, 56, 66, 65, 61, 67, 68, 67, 65);
ChangeBehavior(c6, "patrol", 36, 35, 49, 39, 46, 45);
PlayerPerform("block", 0);
PlayerPerform("say","  想必这里都是高手了！我要小心应付了！.");  // 时刻:4
PlayerPerform("pause",2);
PlayerPerform("say","  快去看看这里是谁在把守吧，！.");  // 时刻:2
PlayerPerform("pause",2);
PlayerPerform("say","  呵呵！看来完成任务指日苛待了！.");  // 时刻:1
PlayerPerform("pause",1);
PlayerPerform("say","  这里应该就是暗月的基地了！看上去就像！.");  // 时刻:4
PlayerPerform("block", 1);

trg0++;
  }



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


ChangeBehavior(c4,"follow",c3);
Perform(c3,"guard",2);
Perform(c3,"say","  大胆！你是谁，竟然闯进暗月！·...  快来人啊，有人闯入了！  ");  // 时刻:2
Perform(c3, "faceto", player);

trg0++;

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


ChangeBehavior(c3,"follow",c4);
Perform(c4,"guard",2);
Perform(c4,"say","  大胆！你是谁，竟然闯进暗月！·...  快来人啊，有人闯入了！  ");  // 时刻:2
Perform(c4, "faceto", player);

trg0++;

  }

if (trg0==2 && GetHP(c3)<2000) {Perform(c3,"say","  真有一套.  ");trg0++;}
if (trg0==2 && GetHP(c4)<2000) {Perform(c4,"say","  真有一套.  ");trg0++;}


//暗月侍卫、刀卫 暗月侍卫、枪卫
//////////////////////////////////////////////////////////////////////



if (trg1==0  && c5>=0 && GetDistance(player,c5)<=100 ){ 


ChangeBehavior(c6,"follow",c5);
Perform(c5,"guard",2);
Perform(c5,"say","  你终于来了！受死吧，这里不是你闹的地方  ");  // 时刻:2
Perform(c5, "faceto", player);

trg1++;

  }if (trg1==0  && c6>=0 && GetDistance(player,c6)<=100 ){ 

ChangeBehavior(c5,"follow",c6);
Perform(c6,"guard",2);
Perform(c6,"say","  你终于来了！受死吧，这里不是你闹的地方  ");  // 时刻:2
Perform(c6, "faceto", player);

trg1++;

  }

if (trg1==1 && GetHP(c5)<2000) {Perform(c5,"say","  好家伙.看我怎么收拾你..  ");trg1++;}
if (trg1==1 && GetHP(c6)<2000) {Perform(c6,"say","  好家伙.看我怎么收拾你..  ");trg1++;}

//暗月vip-1 //暗月vip-2


if (trg2==0  && c2>=0 && GetDistance(player,c2)<=100 ){ 

ChangeBehavior(c5,"follow",c2);
ChangeBehavior(c6,"follow",c2);
Perform(c2,"use",41);
Perform(c2,"use",34);
Perform(c2,"say","  放马过来吧！ "); 
Perform(c2,"guard",2);
Perform(c2,"say","  等你许久了..看看你的厉害！竟敢与暗月作对，死路一条  "); 
Perform(c2, "faceto", player);
trg2++;trg0=2;trg1=1;

  }
if (trg2==1 && GetHP(c2)<2000) {

Perform(c2,"use",41);
Perform(c2,"use",34);
Perform(c2,"use",40);
Perform(c2,"use",15);
Perform(c2,"say","  想不到你还有两下子.  ");
Perform(c2, "faceto", player);
trg2++;}

if (trg2==2 && c2<0 && ca2>=0) {

Say(ca2,"   没想到. 我无名会败给你..恨呢！  ");

trg2++;}
//      暗月s-无名杀手

if (trg2==3 && c7<0 && ca7>=0) {  // 暗月vip-使者

Say(ca7,"   老大！小子没有用，要回暗月了..  ");

trg2++;}

if (trg2==3 && c8<0 && ca8>=0) {  // 暗月vip-护月

Say(ca7,"   老大！小子没有用，要回暗月了..  ");

trg2++;}

////////////////////////////////////////////


if (trg3==0  && c1>=0 && GetDistance(player,c1)<=60 ){ 

Perform(c1,"use",41);
Perform(c1,"use",34);
Perform(c1,"use",40);
Perform(c1,"use",19);
Perform(c1,"say","  口气好大！让你看看我的厉害..  ");  // 时刻:4
Perform(c1,"pause",4);
PlayerPerform("say","  既然我来了.. 也就代表你要牺牲了.. ");  // 时刻:2
PlayerPerform("pause",2);
Perform(c1,"say","  哈哈！总算让我盼来了，你胆子还真是大阿，好好好..那就给你点滋味看看  "); 
Perform(c1, "faceto", player);

trg3++;trg0=2;trg1=1;trg2=1;

  }
if (trg3==1 && GetHP(c1)<2000) {

ChangeBehavior(c1,"follow",player);
ChangeBehavior(c2,"follow",c1);
ChangeBehavior(c3,"follow",c1);
ChangeBehavior(c4,"follow",c1);
ChangeBehavior(c5,"follow",c1);
ChangeBehavior(c6,"follow",c1);
Perform(c2,"say","  是！.  ");
Perform(c1,"use",41);
Perform(c1,"use",34);
Perform(c1,"use",40);
Perform(c1,"use",15);
Perform(c1,"say","  都给我过来把这小子杀了！.  ");
Perform(c1, "faceto", player);
trg3++;}

if (trg3==2 && c1<0 && ca1>=0) {

ChangeBehavior(c2,"follow",player);
ChangeBehavior(c3,"follow",player);
ChangeBehavior(c4,"follow",player);
ChangeBehavior(c5,"follow",player);
ChangeBehavior(c6,"follow",player);
Say(ca1,"   老大！我对不起你，先走了..  ");

trg3++;
   }
}

// 魔兽vip


scene2(){  //   ay-vip、上官+入

if (trg3==3 && c1<0 && c2<0 && c3<0 && c4<0 && c5<0 && c6<0) {

PlayerPerform("use", 15);
PlayerPerform("say"," 他所说的老大难道就是首领吗！.."); 
RemoveNPC(ca1);RemoveNPC(ca3);
RemoveNPC(ca2);RemoveNPC(ca4);
RemoveNPC(ca5);RemoveNPC(ca6);
Say(ca3,"   我们在这里多年，怎么会败给你这小子，不甘心阿！  ");

trg3++;
    shi3 = sj + 3;
   }

if (sj>shi3 && trg3==4) {

AddNPC("6关");
AddNPC("6关7");
AddNPC("6关8");
PlayerPerform("say"," 谁.. 上去看看.. "); 
    trg3++;
   }
}

scene3(){   // ay-vip、上官
 
if (trg3==5  && b1>=0 && GetDistance(player,b1)<=100 ){ 


ChangeBehavior(c7,"follow",player);
ChangeBehavior(c8,"follow",player);
ChangeBehavior(b1,"follow",player);
PlayerPerform("use", 34);
Perform(c8,"use",41);
Perform(c8,"use",34);
Perform(c7,"use",41);
Perform(c7,"use",34);//
Perform(c7,"say","  是.. "); 
Perform(c7,"pause",8);
Perform(c8,"pause",8);
Perform(b1,"say","  杀了他！.. ");  // 时刻:7
Perform(b1,"use",41);
Perform(b1,"use",34);
Perform(b1,"use",40);
Perform(b1,"use",19);
Perform(b1,"say","  真是敬酒不吃吃罚酒！那我就为快活林清理一下.. ");  // 时刻:6
Perform(b1,"pause",2);
PlayerPerform("say","  凡是暗月的人都的死，因为这是任务.. ");  // 时刻:5
PlayerPerform("pause",3);
Perform(b1,"say","  我哪有服气当首领.不过我少说也有点地位，你不要太过分了。马上给我滚 ");  // 时刻:4
Perform(b1,"pause",4);
PlayerPerform("say","  你就是首领.. ");  // 时刻:2
PlayerPerform("pause",2);
Perform(b1,"say","  你就是伊人君..苗子不小啊，闯进我的地盘来了  "); 
Perform(b1, "faceto", player);

    trg3++;
   }

if (trg3==6 && GetHP(b1)<5000) {

PlayerPerform("use", 34);
Perform(c7,"use",15);
Perform(c8,"use",15);
Perform(c8,"use",41);
Perform(c8,"use",34);
Perform(c7,"use",41);
Perform(c7,"use",34);//
Perform(b1,"use",41);
Perform(b1,"use",34);
Perform(b1,"use",40);
Perform(b1,"use",15);
PlayerPerform("say","  认命吧，你不是我的对手. ");  // 时刻:2
PlayerPerform("pause",2);
Perform(b1,"say","  怎么可能-  "); 
Perform(b1, "faceto", player);

    trg3++;
   }


if (trg3==7 && GetHP(b1)<2000) {

PlayerPerform("use", 15);
Perform(c7,"use",15);
Perform(c8,"use",15);
Perform(b1,"use",15);Perform(b1,"use",15);
PlayerPerform("say","  还不觉悟！那你是必死无疑了.. ");  // 时刻:2
PlayerPerform("pause",5);
Perform(b1,"say","  宁愿死，也不愿意做背叛！ ");  // 时刻:3
Perform(b1,"pause",3);
PlayerPerform("say","  说，你们首领在哪. 我饶你的狗命 ");  // 时刻:2
Perform(b1, "faceto", player);

    trg3++;
   }
if (trg3==8 && b1<0 && ba1>=0) {


PlayerPerform("say","  阿！ ");  // 时刻:2
PlayerPerform("pause",2);
Say(ba1,"   暗月的组织全部都是你想象不到的.. 你不会成功的..   ");

trg3++;
   }
if (trg3==9 && b1<0 && c7<0 && c8<0 ) {GameOver(1);}} // 胜利结束


yiren(){
if (GetHP(player)<=0){ //自己死亡
GameOver(-1);
}}


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

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