// 烽火雷4
int Rule = 1;
int RoundTime = 400;
int PlayerSpawn = 59;
int PlayerSpawnDir = 90;
int PlayerWeapon = 16;
int PlayerWeapon2 = 12;
int PlayerHP = 8000;


int trg0; 
int shi0; 
int trg1;

int now;  
int player;
int timer0;  
int timer1;  
int gameover;

int c1;   
int c1shi;    
int ca1;      
int c2;      
int ca2;  
int c2shi; 
int c3shi;  
int c3;   
int ca3; 
int c4;
int ca4;
int c5;   
int ca5; 
int c6;   
int ca6;
int wuming;
GetDistance(int k1,int k2)
{
   SetTarget(0, "char", k1);
   SetTarget(1, "char", k2);
   return Distance(0,1);
}
GetManPlaceDistance(int man,int place)
{
   SetTarget(0, "char", man);
   SetTarget(1, "waypoint", place);
   return Distance(0,1);
}

GetNPCChar() {
   c1=GetChar("2o10年、兵兵");
   ca1=GetAnyChar("2o10年、兵兵");

   c2=GetChar("只痛笑ZJ  ☆");
   ca2=GetAnyChar("只痛笑ZJ  ☆");

   c3=GetChar("晶晶");
   ca3=GetAnyChar("晶晶");

   c4=GetChar("上官");
   ca4=GetAnyChar("上官");

   c5=GetChar("无名");
   ca5=GetAnyChar("无名");

   c6=GetChar("豆豆");
   ca6=GetAnyChar("豆豆");

} 
xunhuan(){
if (c1shi+50<=GetGameTime()) {
c1shi = GetGameTime();	
Perform(c1,"use",40);
Perform(c1,"use",41);
Perform(c1,"use",5);
Perform(c1,"use",3);	
Perform(c1,"use",4);
Perform(c1,"use",34);}

if (c2shi+50<=GetGameTime()) {
c2shi = GetGameTime();	
Perform(c2,"use",40);
Perform(c2,"use",41);
Perform(c2,"use",5);
Perform(c2,"use",3);	
Perform(c2,"use",4);
Perform(c2,"use",34);}

if (c3shi+50<=GetGameTime()) {
c3shi = GetGameTime();	
Perform(c3,"use",40);
Perform(c3,"use",41);
Perform(c3,"use",5);
Perform(c3,"use",3);	
Perform(c3,"use",4);
Perform(c3,"use",34);}}

scene1(){
if (trg0 == 0){
PlayerPerform("block",0);
PlayerPerform("say"," 想过去还真不简单！用心闯吧！.. ");  // 时刻:6
PlayerPerform("pause",2);
PlayerPerform("say"," 先看看这里的情况吧！貌似不太好闯了！激怒了兵兵的助理！. ");  // 时刻:4
PlayerPerform("pause",2);
PlayerPerform("say","  这也是难免的.！毕竟他是（王）不过这里的人也不是好对付的！. ");  // 时刻:2
PlayerPerform("pause",2);
PlayerPerform("say","  这里就是禁地了！难免这么多的高手！但是兵兵还是不曾出现！. ");  // 时刻:0
PlayerPerform("block",1);
trg0++;timer0 = now + 10;}

if (trg0==1 && c1>=0 &&  c2>=0 &&  c3>=0 &&  c4>=0 &&  c5>=0 && c6>=0 && now>timer0){

ChangeBehavior(c5,"kill",player);
Perform(c5,"use",41);
Perform(c5,"use",5);
Perform(c5,"use",19);	
Perform(c5,"use",34);
Perform(c5,"use",4);
Perform(c5,"use",40);
Perform(c5,"use",3);
Perform(c5,"say","  好！我马上去！哈哈，终于有报仇的机会了  哈哈哈哈...");  // 时刻:14
Perform(c5,"pause",7);
Perform(c1,"say","  不错！无名你去吧！....");  // 时刻:12
Perform(c1,"pause",10);
Perform(c3,"say","  其他的就在这里看看无名的好戏吧！..");  // 时刻:11
Perform(c3,"say","  可不要让我们失望阿！..既然你想报仇，好，那你就速度解决！不行的话我们会去帮你的！..");  // 时刻:10
Perform(c3,"pause",5);
Perform(c5,"say","  那就交给我一个人吧！我是回来报仇的，我想亲手杀死他！..");  // 时刻:7
Perform(c5,"pause",7);
Perform(c3,"say","  就是！你怎么这么笨！..");  // 时刻:5
Perform(c3,"pause",5);
Perform(c2,"say","  很简单吗！怎么你现在这么笨了！在这里一定要解决掉就OK了吗！..");  // 时刻:4
Perform(c2,"pause",4);
Perform(c1,"say","  那想怎么样！..");  // 时刻:2
Perform(c1,"pause",2);
Perform(c3,"say","  现在我老公还不知道伊人君在这里！不过我也不想让老公知道！....");  // 时刻:2
Perform(c3,"faceto",player);
trg0++;}

if (trg0 == 2 &&  c3>=0 && GetDistance(player,c3)<=80 ){

PlayerPerform("pause",2);
PlayerPerform("use", 35);
PlayerPerform("pause",2);
PlayerPerform("say","  我应该尊重一下兵兵的老婆！ 在来！.. ");  // 时刻:4
PlayerPerform("pause",2);
Perform(c3,"say","  好厉害！竟敢乱闯此地！去死吧...");  // 时刻:2
Perform(c3,"faceto",player);
trg0++;}

if (trg0 == 2 &&  c4>=0 && GetDistance(player,c4)<=80 ){

PlayerPerform("pause",2);
PlayerPerform("use", 35);
PlayerPerform("pause",2);
PlayerPerform("say","  我应该尊重一下兵兵的老婆！ 在来！.. ");  // 时刻:4
PlayerPerform("pause",2);
Perform(c3,"say","  好厉害！竟敢乱闯此地！去死吧...");  // 时刻:2
Perform(c3,"faceto",player);
trg0++;}

if (trg0 == 2 &&  c6>=0 && GetDistance(player,c6)<=80 ){

PlayerPerform("pause",2);
PlayerPerform("use", 35);
PlayerPerform("pause",2);
PlayerPerform("say","  我应该尊重一下兵兵的老婆！ 在来！.. ");  // 时刻:4
PlayerPerform("pause",2);
Perform(c3,"say","  好厉害！竟敢乱闯此地！去死吧...");  // 时刻:2
Perform(c3,"faceto",player);
trg0++;}

if (c5>=0 && GetHP(c5)<2000 && trg0 == 2) {


SetTarget(0, "waypoint", 251);
ChangeBehavior(c5, "attacktarget", 0);
PlayerPerform("say","  废物！... ");  // 时刻:4
PlayerPerform("pause",2);
Perform(c5,"say"," 你给我等着！  哼·！看看你有多牛比！你在这别跑！..");  // 时刻:2
Perform(c5,"faceto",player);
Perform(c5,"use",15);
Perform(c5,"use",15);
Perform(c5,"use",15);
Perform(c5,"use",20);
trg0++;}

if (trg0 == 3 &&  c5>=0 && c3>=0 && GetDistance(c3,c5)<=50 ){

ChangeBehavior(c5,"kill",player);
ChangeBehavior(c2,"kill",player);
ChangeBehavior(c3,"kill",player);
ChangeBehavior(c4,"kill",player);
ChangeBehavior(c5,"kill",player);
ChangeBehavior(c6,"kill",player);
PlayerPerform("use", 15);
PlayerPerform("use", 15);
PlayerPerform("use", 20);
PlayerPerform("use", 19);
Perform(c1,"use",19);
Perform(c2,"use",19);
Perform(c3,"use",19);	
Perform(c1,"use",30);
Perform(c2,"use",30);
Perform(c3,"use",30);	
Perform(c5,"use",34);
Perform(c5,"use",4);
Perform(c5,"use",40);
Perform(c5,"use",3);
Perform(c4,"use",41);
Perform(c6,"use",41);
Perform(c6,"use",5);
Perform(c6,"use",19);	
Perform(c6,"use",34);
Perform(c6,"use",4);
Perform(c6,"use",40);
Perform(c6,"use",3);
Perform(c4,"use",5);
Perform(c4,"use",19);	
Perform(c4,"use",34);
Perform(c4,"use",4);
Perform(c4,"use",40);
Perform(c4,"use",3);
Perform(c5,"use",15);
Perform(c5,"use",15);
Perform(c5,"use",15);
Perform(c5,"use",20);
PlayerPerform("say","  完了！抵挡不住阿！... ");  // 时刻:4
PlayerPerform("pause",4);
Perform(c3,"say","  知道你也是不行的..  我们都已经准备好应战了！走！..");  // 时刻:2
Perform(c3,"pause",2);
Perform(c5,"say"," 报告！！这家伙，555555.  我一个人不行！.");  // 时刻:2
Perform(c5,"faceto",player);
trg0++;}

if (trg0 == 4 &&  c3>=0 && GetDistance(player,c3)<=200 ){

ChangeBehavior(c5,"kill",player);
ChangeBehavior(c2,"kill",player);
ChangeBehavior(c3,"kill",player);
ChangeBehavior(c4,"kill",player);
ChangeBehavior(c5,"kill",player);
ChangeBehavior(c6,"kill",player);
Perform(c1,"pause",2);
Perform(c3,"pause",6);
Perform(c4,"pause",6);
Perform(c5,"pause",6);
Perform(c6,"pause",4);
PlayerPerform("block",0);
Perform(c2,"say","  拿命吧！...");  // 时刻:6
Perform(c2,"pause",6);
PlayerPerform("block",1);
Perform(c1,"say","  你应该知道我了吧！我就不多说了！..");  // 时刻:4
Perform(c1,"pause",4);
PlayerPerform("block",1);
Perform(c6,"say","  我是兵兵的朋友！我们打架都是群欧！所以很抱歉！..");  // 时刻:2
Perform(c6,"pause",2);
PlayerPerform("block",1);
Perform(c3,"say","  呵呵！我来是帮我老公做事的！你也知道是什么事情！.");  // 时刻:2
Perform(c3,"faceto",player);
PlayerPerform("block",1);
trg0++;}

if (wuming == 0 &&  c5>=0 && GetDistance(player,c5)<=80 ){

ChangeBehavior(c5,"kill",player);
Perform(c5, "aggress");
Perform(c5,"say"," 终于哼   受死！.  你是死定了！..");  // 时刻:2
Perform(c5,"faceto",player);

wuming=1;}

if (c5>=0 && GetHP(c5)<3000 && wuming == 1) {


ChangeBehavior(c5,"kill",player);
Perform(c5,"use",15);
Perform(c5,"use",15);
Perform(c5, "aggress");
Perform(c5,"say"," 即使你在反抗！也是一个死！..");  // 时刻:2
Perform(c5,"faceto",player);

wuming=2;}}


scene2(){
if (trg0 == 5 &&  c3>=0 && GetHP(c3)<1000 && trg1 == 0){

Perform(c1,"pause",20);
Perform(c2,"pause",20);
Perform(c3,"pause",20);
Perform(c4,"pause",20);
Perform(c5,"pause",20);
Perform(c6,"pause",20);
PlayerPerform("block",1);
Perform(c3,"say","好！  好自为之吧！伊人君！.. ");  // 时刻:10
Perform(c3,"pause",10);
PlayerPerform("say","  我是不会退后的！即使我死在你们的手里.. ");  // 时刻:8
PlayerPerform("pause",4);
Perform(c1,"say"," 如果想救你的同门师弟和老婆！哼！....  就接着闯！");  // 时刻:4
Perform(c1,"pause",6);
PlayerPerform("say","  为什么要这么残忍·.. ");  // 时刻:4
PlayerPerform("pause",4);
Perform(c3,"say","  既然这样！让（无名）下去把快活林的人给我赶劲杀绝！.");  // 时刻:2
Perform(c3,"faceto",player);
PlayerPerform("block",1);
RemoveNPC(ca5);
trg1++;timer0 = now + 15;}

if (trg1==1 && now>timer0){GameOver(1);}

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

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




