// 02炎硫岛大战-剑气;

int Rule = 5;
int RoundTime = 30;
int PlayerSpawn = 73;
int PlayerSpawnDir = 0;
int PlayerWeapon = 1;
int PlayerWeapon2 = 51;
int PlayerHP = 4000;

int trg0; 
int shi0; // 时间

int now; 
int player;   // 玩家
int timer0; 
int gameover; // 胜负

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 j1; int j2; int j3; 
GetDistance(int k1,int k2)
{
   SetTarget(0, "char", k1);
   SetTarget(1, "char", k2);
   return Distance(0,1);
}

GetNPCChar() {
   c1=GetChar("土匪-1");
   ca1=GetAnyChar("土匪-1");
   c2=GetChar("土匪-2");
   ca2=GetAnyChar("土匪-2");
   c3=GetChar("土匪-3");
   ca3=GetAnyChar("土匪-3");
   c4=GetChar("土匪-4");
   ca4=GetAnyChar("土匪-4");
   c5=GetChar("强盗头子");
   ca5=GetAnyChar("强盗头子");


   c6=GetChar("暗月侍卫、狂风");
   ca6=GetAnyChar("暗月侍卫、狂风");
   c7=GetChar("暗月侍卫、夺命枪");
   ca7=GetAnyChar("暗月侍卫、夺命枪");
   // 
   c8=GetChar("暗月s-剑气");
   ca8=GetAnyChar("暗月s-剑气");
   //
}

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

ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
/*
Perform(c1,"use",33);
Perform(c2,"use",33);
Perform(c3,"use",33);
Perform(c4,"use",33);
*/
Perform(c5,"use",40);
Perform(c5,"use",34);
Perform(c2,"pause",13);
Perform(c3,"pause",13);
Perform(c4,"pause",13);
Perform(c1,"pause",13);
PlayerPerform("block",0);
PlayerPerform("say"," 竟然遇见一堆强盗！真是倒霉，先解决他们吧！.  ");  // 时刻:13
PlayerPerform("pause",5);
Perform(c5,"say","  兄弟们！抢肉吧. 别楞着了..  ");  // 时刻:11
Perform(c5,"pause",1);
Perform(c5,"say","   慢..你想过去..不会这么容易，我们好久没生意做了，今天算你倒霉.. ");  // 时刻:10
Perform(c5,"pause",4);
PlayerPerform("say"," NB！呵呵.我就是要看看他们怎么NB..  ");  // 时刻:8
PlayerPerform("pause",3);
Perform(c5,"say"," 头领我不清楚！不过知道暗月是个杀手集团.里面的杀手都是很NB的！ ");  // 时刻:6
Perform(c5,"pause",2);
PlayerPerform("say"," 我此次来就是跟暗月死斗！请问他们的头领是什么人物... ");  // 时刻:5
PlayerPerform("pause",3);
Perform(c5,"say","  刺杀（暗月）！ 你不想活了真是，我们都不敢去惹，你这小子，哼哼.. ");  // 时刻:4
Perform(c5,"pause",4);
PlayerPerform("say","  暗月的组织在哪里，我要去... ");  // 时刻:2
PlayerPerform("pause",2);
Perform(c5,"say","  哈哈..好久没有生意了，今天这么走运阿！ ");  // 时刻:0
PlayerPerform("block",1);
Perform(c5, "faceto", player);
trg0++;shi0=GetGameTime();}

if (trg0==1 && c5>=0 && GetHP(c5)<GetMaxHP(c5) && shi0+13>GetGameTime()) {
GameOver(-1);}


if (trg0==1 && c5<0 && j1==0 ){ // 强盗死亡

// 重点加入
AddNPC("2关");
AddNPC("2关6");
AddNPC("2关7");

// 土匪自爆
Perform(c1,"use",35);Perform(c3,"use",35);
Perform(c2,"use",35);Perform(c4,"use",35);

j1=1;}

if (trg0==1  && c6>=0 && c7>=0 && c8>=0){

ChangeBehavior(c6, "follow", c8);
ChangeBehavior(c7, "follow", c8);
Perform(c8,"use",19);
Perform(c8,"use",40);
PlayerPerform("say","   想必是暗月组织那个蒙面安排的.. . ");
PlayerPerform("say"," 看来暗月里的人非同小可阿真是.  自己找我来了.. ");  // 时刻:3
PlayerPerform("pause",3);
Perform(c6,"use",34);
Perform(c7,"use",34);
Perform(c8,"say","  强盗也能猖狂吗！哈哈..  魔刀.夺命.给他点颜色看看. ");  // 时刻:0
trg0++;}

if (trg0==2  && GetDistance(player,c8)<=100 ){  // 剑气对话

ChangeBehavior(c6, "follow", c8);
ChangeBehavior(c7, "follow", c8);
ChangeBehavior(c8, "kill", player);
Perform(c6,"use",40);
Perform(c7,"use",40);
Perform(c8,"use",34);
PlayerPerform("use",15);
PlayerPerform("use",34);
Perform(c6,"pause",8);
Perform(c7,"pause",8);
Perform(c8,"say"," 让你看看我们暗月的人厉害不厉害..拿命来.. 猖狂.. ");  // 时刻:8
Perform(c8,"pause",4);
PlayerPerform("say"," 是吗. 你们组织有这么厉害吗。都这么害怕.我伊人君不会怕你们的..来吧. ");  // 时刻:6
PlayerPerform("pause",3);
Perform(c8,"say","  你有什么资格知道. 小子，就你多说了一句话，就必须的搭上你这条命. ");  // 时刻:4
Perform(c8,"pause",4);
PlayerPerform("say"," 正是.不过你先告诉我，暗月的头领是谁！.  ");  // 时刻:3
PlayerPerform("pause",3);
Perform(c8,"say","  就是你想跟暗月作对！你就是那个快活林的杀手伊人君是吧. ");  // 时刻:0
PlayerPerform("block",1);
Perform(c6, "faceto", player);
Perform(c7, "faceto", player);
Perform(c8, "faceto", player);
trg0++;shi0=GetGameTime();}

if (trg0==3 && c8>=0 && GetHP(c8)<GetMaxHP(c8) && shi0+8>GetGameTime()) { // 受攻击= -1
GameOver(-1);}

if (trg0==3 && GetHP(c8)<1000) {

// 狂加血+攻击+防御

Perform(c6,"use",15);
Perform(c7,"use",15);
Perform(c6,"use",19);
Perform(c7,"use",19);
Perform(c8,"use",15);
Perform(c8,"use",40);Perform(c8,"use",41);Perform(c8,"use",34); //
PlayerPerform("block",0);
PlayerPerform("pause",3);
Perform(c8,"say","  果然有两下子. 不过，你是没资格跟我们抗斗！  ");  // 时刻:0
PlayerPerform("block",1);
trg0++;}

if (trg0==4 && c8<0 && ca8>=0){ // 剑气死亡

Say(ca8," 你这家伙给我等着，等我*手*好了之后，会找你算帐的！靠..! ");

trg0++;}}

ziji(){
if (GetHP(player)<=0) 
{ GameOver(-1);}}
OnStart(){
AddNPC("2关1");
AddNPC("2关2");
AddNPC("2关3");
AddNPC("2关4");
AddNPC("2关5");}
OnUpdate()
{	
	player = GetAnyChar("player");
	if (player < 0){return 0;}
        now = GetGameTime();
        GetNPCChar() ; 
        diannao() ; 
	ziji();
	scene1();
}

