// 风云2;
//Creater by wireman 

int Rule = 2;
int RoundTime = 88;
int PlayerSpawn = 38;
int PlayerSpawnDir = 100;
int PlayerWeapon = 26;
int PlayerWeapon2 = 0;
int PlayerHP = 4000;



int trg0;
int stm0;
int trg1;
int stm1;
int trg2;
int stm2;
int trg3;
int stm3;
int trg4;
int stm4;
int trg5;
int stm5;
int trg6;
int stm6;
int trg7;
int stm7;
int trg8;
int stm8;
int trg9;
int stm9;




int r1;
int ra1;
int tm1;
int r2;
int ra2;
int tm2;
int r3;
int ra3;
int tm3;
int r4;
int ra4;
int tm4;
int r5;
int ra5;
int tm5;
int r6;
int ra6;
int tm6;
int r7;
int ra7;
int tm7;
int r8;
int ra8;
int tm8;
int r9;
int ra9;
int tm9;
int r10;
int ra10;
int tm10;
int r11;
int ra11;
int tm11;
int r12;
int ra12;
int tm12;
int r13;
int ra13;
int tm13;
int player;

int xtimer;
int dtimer;

int bl;
int blhong;
int bllv;
int blwind;
int blshen;
int blyang;

int ds;
int lds;
int ods;

int dd;

int fre;
int fretime;
int st;

int nbl;

GetDistance(int c1,int c2) {
   SetTarget(0, "char", c1);
   SetTarget(1, "char", c2);
   return Distance(0,1);
}



GetNPCChar() {
   r1=GetChar("楚楚");
   ra1=GetAnyChar("楚楚");
   r2=GetChar("楚楚");
   ra2=GetAnyChar("楚楚");
   r3=GetChar("第二梦");
   ra3=GetAnyChar("第二梦");
   r4=GetChar("第二梦");
   ra4=GetAnyChar("第二梦");
   r5=GetChar("剑晨");
   ra5=GetAnyChar("剑晨");
   r6=GetChar("聂人王");
   ra6=GetAnyChar("聂人王");
   r7=GetChar("绝无神");
   ra7=GetAnyChar("绝无神");
   r8=GetChar("傲天");
   ra8=GetAnyChar("傲天");
   r9=GetChar("秦霜");
   ra9=GetAnyChar("秦霜");
   r10=GetChar("幽若");
   ra10=GetAnyChar("幽若");
   r11=GetChar("步惊云");
   ra11=GetAnyChar("步惊云");
   r12=GetChar("文丑丑");
   ra12=GetAnyChar("文丑丑");
   r13=GetChar("雄霸");
   ra13=GetAnyChar("雄霸");
}

DuelMode(int dis,int pl) {
int dd=GetDistance(player,pl);
if (dd>=dis)  {
 if (bl==0) {
	bl=GetGameTime();
 } else
 {
   if (bl+30>=GetGameTime()) {
    PlayerPerform("block",1);
   }
   else
   {
     PlayerPerform("block",0);
   }
 }
}  	

 if (dd<dis-50 && dd>lds && nbl+2<GetGameTime())  {
    bl=0;
    nbl=GetGameTime();
    PlayerPerform("block",0);
 }
}


YangAbility() {
if (tm9+40<=GetGameTime()) {
 tm9=GetGameTime();
 Perform(r9,"use",8);
 Perform(r9,"use",3);
}
}

XiaoYaoHouAbility() {
if (ra13<0) {
return 0;
}

if (tm13+15<=GetGameTime()) {
 tm13=GetGameTime();
 Perform(r13,"use",19);
 Perform(r13,"use",8);
 Perform(r13,"use",5); 
 Perform(r13,"use",3);
   Perform(r13,"use",16);
   //Perform(r13,"use",16);
 } 

ds=GetDistance(player,r13);
if (r13<0) {
 ds=500;
}
if (fre==0 && ds<lds) {
   if (bl>=0) {
 		PlayerPerform("block",1);
		bl=1;
	  }		
  } else {
	  if (bl==1) {	
         		PlayerPerform("block",0);
	   	bl=0;
	 }
   }

ds=GetDistance(r1,r13);
if (r13<0) {
 ds=500;
}

if (ds<ods) {
   if (blhong==0) {
 	//	Perform(r1,"block",1);
	ChangeBehavior(r1,"idle");
		blhong=1;
	  }		
  } else {
	  if (blhong==1) {	
           // 	Perform(r1,"block",0);
		ChangeBehavior(r1,"kill",r13);

	   	blhong=0;
	 }
   }

ds=GetDistance(r3,r13);
if (r13<0) {
 ds=500;
}
if (ds<ods) {
   if (bllv==0) {
 		ChangeBehavior(r3,"idle");
		bllv=1;
	  }		
  } else {
	  if (bllv==1) {	
            //		Perform(r3,"block",0);
		ChangeBehavior(r3,"kill",r13);

	   	bllv=0;
	 }
   }

ds=GetDistance(r10,r13);
if (r13<0) {
 ds=500;
}
if (ds<ods) {
   if (blshen==0) {
 		//Perform(r10,"block",1);
		ChangeBehavior(r10,"idle");
		blshen=1;
	  }		
  } else {
	  if (blshen==1) {	
            //		Perform(r10,"block",0);
		ChangeBehavior(r10,"follow",player);
	   	blshen=0;
	 }
   }

ds=GetDistance(r11,r13);
if (r13<0) {
 ds=500;
}
if (ds<ods) {
   if (blwind==0) {
 		//Perform(r11,"block",1);
		ChangeBehavior(r11,"idle");
		blwind=1;
	  }		
  } else {
	  if (blwind==1) {	
        //    		Perform(r11,"block",0);
			ChangeBehavior(r11,"kill",r13);

	   	blwind=0;
	 }
   }


ds=GetDistance(r9,r13);
if (r13<0) {
 ds=500;
}
if (ds<ods) {
   if (blyang==0) {
		//Perform(r9,"block",1);
		ChangeBehavior(r9,"idle");
		blyang=1;
	  }		
  } else {
	  if (blyang==1) {	
        //    		Perform(r9,"block",0);
			ChangeBehavior(r9,"kill",r13);


	   	blyang=0;
	 }
   }



}


XiaoGongZiAbility() {
if (tm12+30<=GetGameTime()) {
 tm12=GetGameTime();
 Perform(r12,"use",8);
  Perform(r12,"use",19);

  Perform(r5,"use",4);
  Perform(r6,"use",4);
  Perform(r7,"use",4);
  Perform(r8,"use",4);
  Perform(r5,"use",8);
  Perform(r6,"use",8);
  Perform(r7,"use",8);
  Perform(r8,"use",8);
}

}


HLAbility() {
if ( tm1+30<=GetGameTime()) {
 tm1=GetGameTime();
Perform(r1,"use",19);
Perform(r1,"use",8);
Perform(r1,"use",5);
Perform(r1,"use",3);
Perform(r3,"use",19);
Perform(r3,"use",8);
Perform(r3,"use",5);
Perform(r3,"use",3);
}
}





XiaoAbility() {
if (dtimer+30<=GetGameTime()) {

if (r13>=0) {
 PlayerPerform("block",0);
}
 PlayerPerform("use",8);
 PlayerPerform("use",4);
 dtimer=GetGameTime();
  
}
if (xtimer+60<=GetGameTime()) {
  xtimer=GetGameTime();
  int rd=Rand(5);
  int  addall=0;
    if (GetHP(player)<GetMaxHP(player)/2)
     {
     addall=1; 
   }
  if (rd==1) {
   PlayerPerform("use",3);
    }
  if (rd==2 || addall==1) {
   PlayerPerform("use",5);
    }
  if (rd==3 || addall==1) {
   PlayerPerform("use",8);
    }
  if (rd==4 || addall==1) {
   PlayerPerform("use",1);
    }
 }

}


Scene1() {

   if (trg0==0 &&  r1>=0  && r3>=0 && (GetDistance(player,r1)<200 || GetDistance(player,r3)<200))  {
      //Insert Code Here;


PlayerPerform("block",0);
PlayerPerform("pause",6);
ChangeBehavior(r1,"follow",player);
ChangeBehavior(r3,"follow",player);

Perform(r1,"use",15);
Perform(r3,"use",15);

Perform(r1,"use",19);
Perform(r1,"use",8);
Perform(r1,"use",5);
Perform(r1,"use",3);
Perform(r3,"use",19);
Perform(r3,"use",8);
Perform(r3,"use",5);
Perform(r3,"use",3);
Perform(r1,"pause",2);
Perform(r3,"pause",2);

Perform(r3,"say","看剑！");
Perform(r3,"pause",6);
Perform(r1,"say","接招。");
Perform(r1,"pause",6);
PlayerPerform("say","那好吧.领教了！");
PlayerPerform("pause",6);
Perform(r3,"say","我不能让你去冒险.除非你能打过我们两人我就让你去！");
Perform(r3,"pause",4);
Perform(r1,"say","风你怎么来这里。");
Perform(r1,"pause",2);
PlayerPerform("say","这里就是山谷阵？文丑丑呢？怎么突然不见了？");
PlayerPerform("block",1);
Perform(r1,"faceto",player);
Perform(r1,"faceto",player);

      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==1 && stm0+10<=GetGameTime() && (GetHP(r1)<=GetMaxHP(r1)/8 || GetHP(r3)<=GetMaxHP(r3)/8))  {  // Please Complete the Condition
      //Insert Code Here;

ChangeBehavior(r1,"idle");
ChangeBehavior(r3,"idle");

PlayerPerform("block",0);
Perform(r1,"say","我们找到帮手就会来帮你的.你要小心啊...");
Perform(r1,"pause",6);
Perform(r3,"say","风你先在这里等我们。");
Perform(r3,"pause",8);
Perform(r1,"say","行我们这就去......");
Perform(r1,"pause",10);
PlayerPerform("say","你们在去找几个帮手......");
PlayerPerform("pause",4);
Perform(r3,"say","行.你要小心啊。");
Perform(r3,"pause",4);
PlayerPerform("say","我先去找雄霸了.你们先回去吧");
PlayerPerform("pause",2);
Perform(r1,"say","我们输了。");
PlayerPerform("block",1);
Perform(r1,"block",1);
Perform(r3,"block",1);

Perform(r1,"use",15);
Perform(r3,"use",15);


      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==2 && stm0+20<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;

   	RemoveNPC(ra1);   	RemoveNPC(ra3);



  
      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==3 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==4 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==5 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==6 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==7 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==8 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==9 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==10 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==11 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==12 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==13 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

   if (trg0==14 && stm0+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm0=GetGameTime();
      trg0++;
   }

}



Scene2() {

SetTarget(1,"char",player);
SetTarget(2,"waypoint",67);


   if (trg1==0 && trg0>=3 && Distance(1,2)<300)  {
      //Insert Code Here;


   AddNPC("jianchei");
   AddNPC("nierenwang");
   AddNPC("juewushen");
   AddNPC("aotian");
   AddNPC("weichouchou9");

      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==1 && stm1+3<=GetGameTime() && player>=0 && r12>=0 && r5>=0 && r6>=0 && r7>=0 && r8>=0)  {  // Please Complete the Condition
      //Insert Code Here;

PlayerPerform("pause",2);
PlayerPerform("say","那就要看看我手中的血饮刀了！");
PlayerPerform("pause",8);
ChangeBehavior(r8,"follow",player);
ChangeBehavior(r7,"follow",player);
ChangeBehavior(r6,"follow",player);
ChangeBehavior(r5,"follow",player);
ChangeBehavior(r12,"kill",player);

Perform(r12,"say","今天就让你看看我们天下会的厉害！");
Perform(r12,"pause",4);
Perform(r5,"say","把他给我杀了！");
Perform(r5,"pause",12);
PlayerPerform("block",0);
Perform(r12,"say","你别狂妄，来人");
Perform(r12,"pause",4);
PlayerPerform("say","哈哈就凭你这三脚猫的功夫还敢给我斗？");
PlayerPerform("pause",4);
Perform(r12,"say","你先过了我这关在说吧！");
Perform(r12,"pause",4);
PlayerPerform("say","少废话，雄霸在那里让他滚出来？");
PlayerPerform("pause",4);
Perform(r12,"say","不要急，好戏在后头。");
Perform(r12,"pause",2);
PlayerPerform("say","文丑丑你个大狼狗雄霸呢？");
PlayerPerform("block",1);


      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==2 && stm1+10<=GetGameTime() && r12<0 && r5<0 && r6<0 && r7<0 && r8<0)  {  // Please Complete the Condition
      //Insert Code Here;

	PlayerPerform("say","雄霸你快滚出来！");

      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==3 && stm1+5<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==4 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==5 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==6 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==7 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==8 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==9 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==10 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==11 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==12 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==13 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

   if (trg1==14 && stm1+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm1=GetGameTime();
      trg1++;
   }

}



Scene3() {

   if (trg2==0 && trg1>=4)  {
      //Insert Code Here;

	AddNPC("xiongba");

      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==1 && stm2+5<=GetGameTime() && r13>=0)  {  // Please Complete the Condition
      //Insert Code Here;

	PlayerPerform("say","好，今天就让你看看我的真正实力！");
PlayerPerform("pause",4);
Perform(r13,"say","哈哈就凭你一个人就能打过我你别妄想了！");
Perform(r13,"pause",4);
PlayerPerform("say","我今天要除掉你这个恶魔？？？");
PlayerPerform("pause",2);
Perform(r13,"say","风你来了我正想找你！");

      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==2 && stm2+10<=GetGameTime() && GetDistance(r13,player)<=150 )  {  // Please Complete the Condition
      //Insert Code Here;
ChangeBehavior(r13,"kill",player);
PlayerPerform("use",16);
Perform(r13,"pause",5);
PlayerPerform("block",0);
PlayerPerform("pause",2);
PlayerPerform("say","放屁！要我加入你的什么狗屁的会别妄想了看招！");
PlayerPerform("pause",4);
Perform(r13,"say","看我们以前是师徒的份上只要你加如天下会我会放过你的！");
Perform(r13,"pause",4);
PlayerPerform("say","放人！");
PlayerPerform("pause",4);
Perform(r13,"say","好啊.我等这天已经等很久了来吧。");
Perform(r13,"pause",2);
PlayerPerform("say","今天就要除掉你个大恶魔？");
PlayerPerform("block",1);
Perform(r13,"faceto",player);
PlayerPerform("use",16);

      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==3 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;

   
      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==4 && stm2+5<=GetGameTime() )  {  // Please Complete the Condition
      //Insert Code Here;


      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==5 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==6 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==7 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==8 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==9 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==10 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==11 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==12 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==13 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

   if (trg2==14 && stm2+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm2=GetGameTime();
      trg2++;
   }

}



Scene4() {

   if (trg3==0 && trg2>=3 && GetHP(player)<=GetMaxHP(player)/4 && r13>=0)  {
      //Insert Code Here;

fretime=GetGameTime();
fre=1;

Perform(r13,"say","太可惜了。不过你的性格我很喜欢今天就让你看看老夫这几十年的功力！");
Perform(r13,"pause",4);
PlayerPerform("say","狗屁会我不会加入的...");
PlayerPerform("pause",4);

Perform(r13,"block",0);
PlayerPerform("block",0);

Perform(r13,"say","在问你一遍加入我的天下会包？");
Perform(r13,"pause",4);
PlayerPerform("say","把你的吃奶劲使出来也没用....");
PlayerPerform("pause",2);
Perform(r13,"say","小子的武功不错吗看来我要认真了？");
Perform(r13,"block",1);
PlayerPerform("block",1);

lds=50;
      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==1 && stm3+20<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;

      AddNPC("qinshuang9");
  AddNPC("diermeng");
AddNPC("chuchu");
   AddNPC("youruo9");
   AddNPC("bujingyun4_9");




      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==2 && stm3+10<=GetGameTime() && r1>=0 &&  r13>=0  && r3>=0  && r11>=0  && r9>=0 && r10>=0)  {  // Please Complete the Condition
      //Insert Code Here;

ChangeBehavior(r13,"run");
ChangeBehavior(r1,"kill",r13);
ChangeBehavior(r3,"kill",r13);
ChangeBehavior(r9,"kill",r13);
ChangeBehavior(r10,"follow",player);
ChangeBehavior(r11,"kill",r13);

Perform(r13,"say","哈哈...成也风云.敗也风云...！风云又能耐我何...哈哈哈...");
Perform(r13,"pause",10);
PlayerPerform("say","大家要小心啊！雄霸要成魔了.快点除掉他");
PlayerPerform("pause",18);
Perform(r10,"say","我们多说无益让我们合力去斩魔吧！");
Perform(r10,"pause",16);
Perform(r9,"say","好！我以血饮刀封其经脉.你伺机破其魔性真元");
Perform(r9,"pause",14);
Perform(r11,"say","风.云你们快去趁五十没有来临之前把雄霸给杀掉！");
Perform(r11,"pause",12);
Perform(r13,"say","就凭你们几个人能打过老夫吗？");
Perform(r13,"pause",2);
Perform(r13,"say","我雄霸一向是逆天运转.魔又耐我何呢！哈哈哈...");
Perform(r13,"pause",6);
Perform(r1,"say","但你别忘了.等你成魔之后你也不过是魔的一颗棋子罢了！");
Perform(r1,"pause",6);
Perform(r3,"say","雄霸你一生多行不义.想让别人成为你的棋子？");
Perform(r3,"pause",4);
Perform(r13,"say","你们都到齐了啊？");
Perform(r13,"pause",2);
Perform(r1,"say","雄霸今天就是你的死期！");




      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==3 && stm3+10<=GetGameTime() && r1<0 && r3<0 && r9<0 && r10<0 && r11<0)  {  // Please Complete the Condition
      //Insert Code Here;

fretime=GetGameTime();
fre=1;


	ChangeBehavior(r13,"kill",player);
	PlayerPerform("use",19);
	xtimer=0;
	dtimer=0;
	
	PlayerPerform("say","......雄霸去死吧...我和你拼了！！！");
	PlayerPerform("pause",2);
	Say(ra11,"风云两位除掉雄霸就看你们两人了？快风云合璧！成也风云*败也风云....");
//lds=30;
      stm3=GetGameTime();
      trg3++;
   }

   if ((trg3==3 || trg3==4) && stm3+10<=GetGameTime() && r13<0 && r10<0)  {  // Please Complete the Condition
      //Insert Code Here;

        	PlayerPerform("say","云师弟......！");

      stm3=GetGameTime();
      trg3=5;
   }

   if (trg3==5 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3=5;
   }

   if (trg3==6 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==7 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==8 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==9 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==10 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==11 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==12 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==13 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

   if (trg3==14 && stm3+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm3=GetGameTime();
      trg3++;
   }

}



Scene5() {



   if (trg4==0 && ra13>=0 && r13<0 && ra10>=0 && GetDistance(player,ra10)<30)  {
      //Insert Code Here;
	if (r10<0) {

PlayerPerform("say","我们终于打败雄霸这个恶魔了，但是...为什么？为什么！！！");
PlayerPerform("pause",2);
PlayerPerform("say","云师弟，云师弟...你醒醒呀！！！");
PlayerPerform("crouch",1);

 dd=8;
	}
else
{
PlayerPerform("say","那就好.哈哈哈...我们走吧！...");
PlayerPerform("pause",4);
Perform(r10,"say","聂师兄他没事的回家调养今日就好了。");
Perform(r10,"pause",4);
PlayerPerform("say","云师弟你醒了还好吧？...");
PlayerPerform("pause",4);
Perform(r10,"say","好！山谷阵和天下会从此要在江湖消失！");
Perform(r10,"pause",4);
PlayerPerform("say","我们毁掉这个山谷阵吧！");
PlayerPerform("pause",4);
Perform(r10,"say","雄霸终于死了。");
Perform(r10,"pause",2);
PlayerPerform("say","云师弟，我们...终于打败雄霸了...");
Perform(r10,"faceto",player);
dd=18;
}


      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==0 && ra13>=0 && r13<0 && ra10<0)  {  // Please Complete the Condition
      //Insert Code Here;

dd=8;
PlayerPerform("say","成也风云*败也风云哈哈哈....我们赢了。");
PlayerPerform("pause",2);
PlayerPerform("say","云师弟我们打败了雄霸我们胜利了...");

      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==1 && stm4+dd<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;
	GameOver(1);


      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==3 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==4 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==5 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==6 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==7 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==8 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==9 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==10 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==11 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==12 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==13 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

   if (trg4==14 && stm4+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm4=GetGameTime();
      trg4++;
   }

}



Scene6() {

   if (st==0 && r13>=0 && GetHP(r13)<GetMaxHP(r13)/2 )  {
      //Insert Code Here;
	Perform(r13,"say","好好好，果然有两下子，不过我很喜欢看人垂死挣扎的样子，哈哈哈！"); 
	st=1;
	

      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==1 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==2 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==3 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==4 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==5 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==6 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==7 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==8 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==9 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==10 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==11 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==12 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==13 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

   if (trg5==14 && stm5+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm5=GetGameTime();
      trg5++;
   }

}



Scene7() {

   if (trg6==0)  {
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==1 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==2 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==3 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==4 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==5 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==6 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==7 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==8 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==9 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==10 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==11 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==12 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==13 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

   if (trg6==14 && stm6+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm6=GetGameTime();
      trg6++;
   }

}



Scene8() {

   if (trg7==0)  {
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==1 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==2 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==3 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==4 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==5 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==6 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==7 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==8 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==9 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==10 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==11 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==12 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==13 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

   if (trg7==14 && stm7+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm7=GetGameTime();
      trg7++;
   }

}



Scene9() {

   if (trg8==0)  {
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==1 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==2 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==3 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==4 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==5 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==6 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==7 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==8 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==9 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==10 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==11 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==12 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==13 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

   if (trg8==14 && stm8+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm8=GetGameTime();
      trg8++;
   }

}



Scene10() {

   if (trg9==0)  {
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==1 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==2 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==3 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==4 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==5 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==6 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==7 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==8 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==9 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==10 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==11 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==12 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==13 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

   if (trg9==14 && stm9+10<=GetGameTime())  {  // Please Complete the Condition
      //Insert Code Here;



      stm9=GetGameTime();
      trg9++;
   }

}



AlwaysDo() {
if (GetHP(player)<=0) { GameOver(-1); }
//Insert Code Here;
XiaoAbility();
YangAbility();
XiaoGongZiAbility();
HLAbility();
XiaoYaoHouAbility();

if (trg3==4 && r13>=0) {
 DuelMode(200,r13);
}

//if (ra1>=0 && trg0>=1) {DuelMode(500,r1);} //test

if (fre>0 && fretime+10<GetGameTime()) {
 fre=0;
}
}



OnStart()
{
 
//trg1=4; trg0=10; //; 

lds=50;
ods=70;

   AddNPC("chuchuEne"); 
     AddNPC("diermengEne");  

/*   
     AddNPC("diermeng");
   AddNPC("jianchei");
   AddNPC("nierenwang");
   AddNPC("juewushen");
   AddNPC("aotian");
   AddNPC("chuchu8");
   AddNPC("youruo8");
   AddNPC("bujingyun4_9");
   AddNPC("weichouchou9");
   AddNPC("xiongba");
*/
}



OnUpdate()
{
    player = GetAnyChar("player");
    if (player < 0)  {
      return 0;
   }


   GetNPCChar();

   AlwaysDo();

   Scene1();
   Scene2();
   Scene3();
   Scene4();
   Scene5();
   Scene6();
   Scene7();
   Scene8();
   Scene9();
   Scene10();


}
