//  黑夜行刺皇上
int Rule = 1;
int RoundTime = 450;
int PlayerSpawn = 0;
int PlayerSpawnDir = 80;
int PlayerWeapon = 15;
int PlayerWeapon2 = 24;
int PlayerHP = 32000+10000;

int trg0;
int tiao0;
int now;
int sj;
int sj1;
int s1;
int gameover;
int timer0;
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 c11;   
int ca11; 
int c12;
int ca12;
int c13;
int ca13;
int c14;
int ca14;
int c15; 
int ca15;
int c16;
int ca16; 

int r1;        
int ra1;      
int r2;      
int ra2;   
int r3;   
int ra3; 
int r4;
int ra4;
int r5;
int ra5;
int r6;
int ra6;
int r7; 
int ra7;
int r8;
int ra8;

int z1;        
int za1;      
int z2;      
int za2;   
int z3;   
int za3; 
int z4;
int za4;
int z5;
int za5;


int l1;        
int la1;      
int l2;      
int la2;   
int l3;   
int la3; 
int l4;
int la4;


int j1;    // F条件    
int j2;    
int j3; 
int j4;    
int j5;  
int j6; 
int j7; 
int j8; 

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

diannaoren() 
{
   c1=GetChar("夜间巡逻兵1");
   c2=GetChar("夜间巡逻兵2");
   c3=GetChar("夜间巡逻兵3");
   c4=GetChar("夜间巡逻兵4");
   c5=GetChar("夜间巡逻兵5");
   c6=GetChar("夜间巡逻兵6");
   c7=GetChar("夜间巡逻兵7");
   c8=GetChar("夜间巡逻兵8");

   c9 =GetChar("夜行杀手1");
   c10=GetChar("夜行杀手2");
   c11=GetChar("夜行杀手3");
   c12=GetChar("夜行杀手4");
   c13=GetChar("夜行杀手5");
   c14=GetChar("夜行杀手6");
   c15=GetChar("夜行杀手7");
   c16=GetChar("夜行杀手8");

   ca1=GetAnyChar("夜间巡逻兵1");
   ca2=GetAnyChar("夜间巡逻兵2");
   ca3=GetAnyChar("夜间巡逻兵3");
   ca4=GetAnyChar("夜间巡逻兵4");
   ca5=GetAnyChar("夜间巡逻兵5");
   ca6=GetAnyChar("夜间巡逻兵6");
   ca7=GetAnyChar("夜间巡逻兵7");
   ca8=GetAnyChar("夜间巡逻兵8");

   ca9 =GetAnyChar("夜行杀手1");
   ca10=GetAnyChar("夜行杀手2");
   ca11=GetAnyChar("夜行杀手3");
   ca12=GetAnyChar("夜行杀手4");
   ca13=GetAnyChar("夜行杀手5"); 
   ca14=GetAnyChar("夜行杀手6");
   ca15=GetAnyChar("夜行杀手7");
   ca16=GetAnyChar("夜行杀手8");



   r1=GetChar("锦衣卫1");
   r2=GetChar("锦衣卫2");
   r3=GetChar("锦衣卫3");
   r4=GetChar("锦衣卫4");
   r5=GetChar("锦衣卫5");
   r6=GetChar("锦衣卫6");
   r7=GetChar("锦衣卫7");
   r8=GetChar("锦衣卫8");

   ra1=GetAnyChar("锦衣卫1");
   ra2=GetAnyChar("锦衣卫2");
   ra3=GetAnyChar("锦衣卫3");
   ra4=GetAnyChar("锦衣卫4");
   ra5=GetAnyChar("锦衣卫5");
   ra6=GetAnyChar("锦衣卫6");
   ra7=GetAnyChar("锦衣卫7");
   ra8=GetAnyChar("锦衣卫8");

   z1=GetChar("皇宫重臣1");
   z2=GetChar("皇宫重臣2");
   z3=GetChar("皇宫重臣3");
   z4=GetChar("皇宫重臣4");
   z5=GetChar("皇宫重臣5");

   za1=GetAnyChar("皇宫重臣1");
   za2=GetAnyChar("皇宫重臣2");
   za3=GetAnyChar("皇宫重臣3");
   za4=GetAnyChar("皇宫重臣4");
   za5=GetAnyChar("皇宫重臣5");

   l1=GetChar("公主");
   l2=GetChar("皇帝（耶律才）");
   l3=GetChar("上官金洪");
   l4=GetChar("耶律总官");

   la1=GetAnyChar("公主");
   la2=GetAnyChar("皇帝（耶律才）");
   la3=GetAnyChar("上官金洪");
   la4=GetAnyChar("耶律总官");
} 

ziji()
{
        now = GetGameTime();

	    if (GetHP(player)>=0 && sj<now) 
		{
		   sj=sj+100;		
		PlayerPerform("use", 41);
		PlayerPerform("use", 34);
		PlayerPerform("use", 19);
		PlayerPerform("use", 5);
		} 
	        if (GetHP(player)>=0 && sj1<now) 
		{
		   sj1=sj1+5;		
		 PlayerPerform("use", 8);
		} 

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

scene1(){
if (trg0==0 ){ 
PlayerPerform("block", 0);
PlayerPerform("say","开始行动！。  （可谋） ");  // 时刻:11
PlayerPerform("pause",2);
PlayerPerform("block", 1);
PlayerPerform("say","已免被发现，那事情可就不好收拾了！");  // 时刻:9
PlayerPerform("pause",2);
PlayerPerform("block", 1);
PlayerPerform("say","我还是进去找找他。.还是飞檐走壁为好！");  // 时刻:7
PlayerPerform("pause",2);
PlayerPerform("block", 1);
PlayerPerform("say","最重要的就是拿皇帝的人头回去领功，这才是最正经的！");  // 时刻:5
PlayerPerform("pause",2);
PlayerPerform("block", 1);
PlayerPerform("say","这皇帝也是狡猾的狠，这里肯定有巡逻兵把守！不过他们应该好解决。");  // 时刻:3
PlayerPerform("pause",1);
PlayerPerform("block", 1);
PlayerPerform("say","我现在已经踏进皇宫里了，只是漆黑一片！还真的小心为好。");  // 时刻:2
PlayerPerform("pause",2);
PlayerPerform("block", 1);
PlayerPerform("say","哼..上次让他跑掉，可他万万想不到我会黑夜来行刺，这次不能在失败了，一定要解决。"); 
PlayerPerform("block", 1);
trg0++;timer0 = now + 15;}

if (trg0 == 1 && now>timer0){
PlayerPerform("say","哦！目标出现了！行动B计划！"); 
AddNPC("0夜间1");AddNPC("0夜间5");
AddNPC("0夜间2");AddNPC("0夜间6");
AddNPC("0夜间3");AddNPC("0夜间7");
AddNPC("0夜间4");AddNPC("0夜间8");trg0++;}

if (trg0 == 2 && c1>=0 && c2>=0 && c3>=0 && c4>=0 && c5>=0 && c6>=0 && c7>=0 && c8>=0){

ChangeBehavior(c1, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c2, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c3, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c4, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c5, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c6, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c7, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c8, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
trg0++;}

if (trg0==3 && c1<0&& c2<0 && c3<0 && c4<0 && c5<0 && c6<0 && c7<0 && c8<0){
   RemoveNPC(ca1);   RemoveNPC(ca5);
   RemoveNPC(ca2);   RemoveNPC(ca6);
   RemoveNPC(ca3);   RemoveNPC(ca7);
   RemoveNPC(ca4);   RemoveNPC(ca8);
   trg0++;timer0 = now + 5;}

if (trg0==4 && now>timer0){
AddNPC("0兵1");
AddNPC("0兵2");
AddNPC("0兵3");
AddNPC("0兵4");
AddNPC("0兵5");
AddNPC("0兵6");
AddNPC("0兵7");
AddNPC("0兵8");
trg0++;}

if (trg0 == 5 && c9>=0 && c10>=0 && c11>=0 && c12>=0 && c13>=0 && c14>=0 && c15>=0 && c16>=0){

ChangeBehavior(c9, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c10, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c11, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c12, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c13, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c14, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c15, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(c16, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
trg0++;}

if (trg0==6 && c9<0 && c10<0 && c11<0 && c12<0 && c13<0 && c14<0 && c15<0 && c16<0){
   RemoveNPC(ca9);    RemoveNPC(ca11);
   RemoveNPC(ca10);   RemoveNPC(ca12);
   RemoveNPC(ca13);   RemoveNPC(ca15);
   RemoveNPC(ca14);   RemoveNPC(ca16);
   trg0++;timer0 = now + 5;}

if (trg0==7 && now>timer0){
PlayerPerform("say","完了，出不去了！");
AddNPC("0侍卫1");
AddNPC("0侍卫2");
AddNPC("0侍卫3");
AddNPC("0侍卫4");
AddNPC("0侍卫5");
AddNPC("0侍卫6");
AddNPC("0侍卫7");
AddNPC("0侍卫8");
trg0++;}

if (trg0 == 8 && r1>=0 && r2>=0 && r3>=0 && r4>=0 && r5>=0 && r6>=0 && r7>=0 && r8>=0){

ChangeBehavior(r1, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(r2, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(r3, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(r4, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(r5, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(r6, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(r7, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
ChangeBehavior(r8, "patrol", 40, 39,38,35,37 , 41, 43,45,47,50, 52, 54,56,60,63, 65, 68,70,72,75,78, 80,82,85,88,90, 92,95,98,100);
trg0++;}


if (trg0==9 && r1<0 && r2<0 && r3<0 && r4<0 && r5<0 && r6<0 && r7<0 && r8<0){
   RemoveNPC(ra1);
   RemoveNPC(ra2);
   RemoveNPC(ra3);
   RemoveNPC(ra4);
   RemoveNPC(ra5);
   RemoveNPC(ra6);
   RemoveNPC(ra7);
   RemoveNPC(ra8);
   trg0++;timer0 = now + 5;}

if (trg0==10 && now>timer0){

AddNPC("0人1");
AddNPC("0人2");
AddNPC("0人3");
AddNPC("0人4");
trg0++;}

if (trg0==11 && l1>=0 &&  l2>=0 &&  l3>=0 &&  l4>=0 && GetDistance(player,l1)<=300 ){

ChangeBehavior(l1, "kill", player);
ChangeBehavior(l2, "kill", player);
ChangeBehavior(l3, "kill", player);
ChangeBehavior(l4, "kill", player);
Perform(l1,"use",40);
Perform(l1,"use",34);
Perform(l1,"use",19);
Perform(l1,"use",30);
Perform(l1,"use",4);
Perform(l2,"use",40);
Perform(l2,"use",34);
Perform(l2,"use",19);
Perform(l2,"use",30);
Perform(l2,"use",4);
Perform(l3,"use",40);
Perform(l3,"use",34);
Perform(l3,"use",19);
Perform(l3,"use",30);
Perform(l3,"use",4);
Perform(l4,"use",40);
Perform(l4,"use",34);
Perform(l4,"use",19);
Perform(l4,"use",30);
Perform(l4,"use",4);
Perform(l4, "aggress");
Perform(l3, "aggress");
Perform(l2, "aggress");
Perform(l1, "aggress");
Perform(l1,"pause",6);
Perform(l3,"pause",8);
Perform(l4,"pause",17);
PlayerPerform("block", 0);
Perform(l2,"say","那对不起了！我们要上了！。。");  // 时刻:17
Perform(l2,"pause",12);
PlayerPerform("say","在还没有分出胜负的时候，不要乱推测！。");  // 时刻:15
PlayerPerform("pause",4);
Perform(l1,"say","你好大的口气，死到临头还要耍嘴。。简直是惹人愤怒！");  // 时刻:13
Perform(l1,"pause",11);
PlayerPerform("say","对，你们4个。我一个，有可能还会有帮手你们。不过，杀不死他我是不会罢休的。");  // 时刻:11
PlayerPerform("pause",4);
Perform(l3,"say","难道凭我们还杀不死你吗？。你把你当成什么了？");  // 时刻:9
Perform(l3, "faceto", player);
Perform(l3,"pause",9);
PlayerPerform("say","你！哼。铲除我！你口气还真不小，你死是真的。");  // 时刻:7
PlayerPerform("pause",3);
Perform(l2,"say","哼。我怕什么。你既然来了，就别想活着出去，铲除不了你，看来我是过不上安慰的日子了。");  // 时刻:5
Perform(l2, "faceto", player);
Perform(l2,"pause",5);
PlayerPerform("say","哦？你爹现在怎么也不说话了。怎么？怕！");  // 时刻:4
PlayerPerform("pause",4);
Perform(l1,"say","废话！我们出来是要你的命。。。");  // 时刻:2
Perform(l1,"pause",2);
PlayerPerform("say","你们终于肯出来了，怎么，没兵可以发了？");  // 时刻:0
PlayerPerform("block", 1);
trg0++;tiao0++;}

if (trg0==12 && GetHP(l1)<GetMaxHP(l1)/2){
Perform(l3,"use",15);
Perform(l3,"use",15);
Perform(l4,"use",15);
Perform(l4,"use",15);
Perform(l1,"use",15);
Perform(l1,"use",15);
Perform(l1,"use",15);
Perform(l1,"use",15);
Perform(l1,"say","你这小子！！");
trg0++;s1=1;}

if (trg0==13 && l1>=0 && GetHP(l1)<5000){
Perform(l1,"pause",40);
Perform(l2,"pause",40);
Perform(l3,"pause",40);
Perform(l4,"pause",40);
PlayerPerform("say","相当无语！！！");
PlayerPerform("pause",4);
Perform(l1,"say","我恨你..我会报复你的！");
Perform(l1,"pause",4);
PlayerPerform("say","我不会杀你的！你走吧！");
PlayerPerform("pause",2);
Perform(l1,"say","你！!!");
Perform(l1, "faceto", player);
PlayerPerform("block", 1);
trg0++;timer0 = now + 10;}

if (trg0==14 && now>timer0){
GameOver(1); trg0++;}

if (s1==1 && l1<0){

GameOver(-1); s1++;}

if (tiao0==0 && l2>=0 && GetHP(l2)<8000){

Perform(l3,"use",15);
Perform(l3,"use",15);
Perform(l4,"use",15);
Perform(l4,"use",15);
Perform(l1,"use",15);
Perform(l1,"use",15);
Perform(l1,"use",15);
Perform(l2,"say","哼！不过你死定了！");  // 时刻:2
Perform(l2,"pause",2);
Perform(l2,"say","好家伙！你真行！");  // 时刻:0
PlayerPerform("block",1);
tiao0++;}

if (tiao0==1  && l2>=0 && GetHP(l2)<5000){

Perform(l2,"say","好家伙！你真行！");  // 时刻:0
PlayerPerform("block",1);
tiao0++;}

if (tiao0==2  && l2<0){

RemoveNPC(la2);
Perform(l1,"use",15);
Perform(l1,"use",15);
Perform(l3,"use",15);
Perform(l3,"use",15);
Perform(l4,"use",15);
Perform(l4,"use",15);
PlayerPerform("say","哈哈！！终于把你解决了·！剩下你们了！");

tiao0++;timer0 = now + 5;}


if (tiao0==3 && now>timer0){

AddNPC("0重1");
AddNPC("0重2");
AddNPC("0重3");
AddNPC("0重4");
AddNPC("0重5");

tiao0++;}


if (tiao0 == 4  && z1>=0 && z2>=0 && z3>=0 && z4>=0 && z5>=0){
Perform(z1,"use",34);
Perform(z2,"use",34);
Perform(z3,"use",34);
Perform(z4,"use",34);
Perform(z5,"use",34);
ChangeBehavior(z1, "kill", player);
ChangeBehavior(z2, "kill", player);
ChangeBehavior(z3, "kill", player);
ChangeBehavior(z4, "kill", player);
ChangeBehavior(z5, "kill", player);

tiao0++;}



if (j1==0 && c1>=0 && GetDistance(player,c1)<=300 ){ 
ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
ChangeBehavior(c6, "kill", player);
ChangeBehavior(c7, "kill", player);
ChangeBehavior(c8, "kill", player);
j1++;}


if (j2==0 && c2>=0 && GetDistance(player,c2)<=300 ){ 
ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
ChangeBehavior(c6, "kill", player);
ChangeBehavior(c7, "kill", player);
ChangeBehavior(c8, "kill", player);
j2++;}


if (j3==0 && c3>=0 && GetDistance(player,c3)<=300 ){ 
ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
ChangeBehavior(c6, "kill", player);
ChangeBehavior(c7, "kill", player);
ChangeBehavior(c8, "kill", player);
j3++;}

if (j4==0 && c4>=0 && GetDistance(player,c4)<=300 ){ 
ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
ChangeBehavior(c6, "kill", player);
ChangeBehavior(c7, "kill", player);
ChangeBehavior(c8, "kill", player);
j4++;}

if (j5==0 && c5>=0 && GetDistance(player,c5)<=300 ){ 
ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
ChangeBehavior(c6, "kill", player);
ChangeBehavior(c7, "kill", player);
ChangeBehavior(c8, "kill", player);
Perform(c5,"say","有人闯入！快来人！");
j5++;}

if (j6==0 && c6>=0 && GetDistance(player,c6)<=300 ){ 
ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
ChangeBehavior(c6, "kill", player);
ChangeBehavior(c7, "kill", player);
ChangeBehavior(c8, "kill", player);
j6++;}

if (j7==0 && c7>=0 && GetDistance(player,c7)<=300 ){ 
ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
ChangeBehavior(c6, "kill", player);
ChangeBehavior(c7, "kill", player);
ChangeBehavior(c8, "kill", player);
j7++;}


if (j8==0 && c8>=0 && GetDistance(player,c8)<=300 ){ 
ChangeBehavior(c1, "kill", player);
ChangeBehavior(c2, "kill", player);
ChangeBehavior(c3, "kill", player);
ChangeBehavior(c4, "kill", player);
ChangeBehavior(c5, "kill", player);
ChangeBehavior(c6, "kill", player);
ChangeBehavior(c7, "kill", player);
ChangeBehavior(c8, "kill", player);
j8++;}


if (j1==1 && c9>=0 && GetDistance(player,c9)<=300 ){ 
ChangeBehavior(c9, "kill", player);
ChangeBehavior(c10, "kill", player);
ChangeBehavior(c11, "kill", player);
ChangeBehavior(c12, "kill", player);
ChangeBehavior(c13, "kill", player);
ChangeBehavior(c14, "kill", player);
ChangeBehavior(c15, "kill", player);
ChangeBehavior(c16, "kill", player);
Perform(c9,"say","好家伙！都过来吧！");
j1++;}


if (j2==1 && c10>=0 && GetDistance(player,c10)<=300 ){ 
ChangeBehavior(c9, "kill", player);
ChangeBehavior(c10, "kill", player);
ChangeBehavior(c11, "kill", player);
ChangeBehavior(c12, "kill", player);
ChangeBehavior(c13, "kill", player);
ChangeBehavior(c14, "kill", player);
ChangeBehavior(c15, "kill", player);
ChangeBehavior(c16, "kill", player);
j2++;}


if (j3==1 && c11>=0 && GetDistance(player,c11)<=300 ){ 
ChangeBehavior(c9, "kill", player);
ChangeBehavior(c10, "kill", player);
ChangeBehavior(c11, "kill", player);
ChangeBehavior(c12, "kill", player);
ChangeBehavior(c13, "kill", player);
ChangeBehavior(c14, "kill", player);
ChangeBehavior(c15, "kill", player);
ChangeBehavior(c16, "kill", player);
j3++;}


if (j4==1 && c12>=0 && GetDistance(player,c12)<=300 ){ 
ChangeBehavior(c9, "kill", player);
ChangeBehavior(c10, "kill", player);
ChangeBehavior(c11, "kill", player);
ChangeBehavior(c12, "kill", player);
ChangeBehavior(c13, "kill", player);
ChangeBehavior(c14, "kill", player);
ChangeBehavior(c15, "kill", player);
ChangeBehavior(c16, "kill", player);
j4++;}

if (j5==1 && c13>=0 && GetDistance(player,c13)<=300 ){ 
ChangeBehavior(c9, "kill", player);
ChangeBehavior(c10, "kill", player);
ChangeBehavior(c11, "kill", player);
ChangeBehavior(c12, "kill", player);
ChangeBehavior(c13, "kill", player);
ChangeBehavior(c14, "kill", player);
ChangeBehavior(c15, "kill", player);
ChangeBehavior(c16, "kill", player);
j5++;}


if (j6==1 && c14>=0 && GetDistance(player,c14)<=300 ){ 
ChangeBehavior(c9, "kill", player);
ChangeBehavior(c10, "kill", player);
ChangeBehavior(c11, "kill", player);
ChangeBehavior(c12, "kill", player);
ChangeBehavior(c13, "kill", player);
ChangeBehavior(c14, "kill", player);
ChangeBehavior(c15, "kill", player);
ChangeBehavior(c16, "kill", player);
j6++;}


if (j7==1 && c15>=0 && GetDistance(player,c15)<=300 ){ 
ChangeBehavior(c9, "kill", player);
ChangeBehavior(c10, "kill", player);
ChangeBehavior(c11, "kill", player);
ChangeBehavior(c12, "kill", player);
ChangeBehavior(c13, "kill", player);
ChangeBehavior(c14, "kill", player);
ChangeBehavior(c15, "kill", player);
ChangeBehavior(c16, "kill", player);
j7++;}

if (j8==1 && c16>=0 && GetDistance(player,c16)<=300 ){ 
ChangeBehavior(c9, "kill", player);
ChangeBehavior(c10, "kill", player);
ChangeBehavior(c11, "kill", player);
ChangeBehavior(c12, "kill", player);
ChangeBehavior(c13, "kill", player);
ChangeBehavior(c14, "kill", player);
ChangeBehavior(c15, "kill", player);
ChangeBehavior(c16, "kill", player);
j8++;}

if (j1==2 && r1>=0 && GetDistance(player,r1)<=300 ){ 
ChangeBehavior(r1, "kill", player);
ChangeBehavior(r2, "kill", player);
ChangeBehavior(r3, "kill", player);
ChangeBehavior(r4, "kill", player);
ChangeBehavior(r5, "kill", player);
ChangeBehavior(r6, "kill", player);
ChangeBehavior(r7, "kill", player);
ChangeBehavior(r8, "kill", player);
j1++;}

if (j2==2 && r2>=0 && GetDistance(player,r2)<=300 ){ 
ChangeBehavior(r1, "kill", player);
ChangeBehavior(r2, "kill", player);
ChangeBehavior(r3, "kill", player);
ChangeBehavior(r4, "kill", player);
ChangeBehavior(r5, "kill", player);
ChangeBehavior(r6, "kill", player);
ChangeBehavior(r7, "kill", player);
ChangeBehavior(r8, "kill", player);
Perform(r1,"say","今天你是出不去的了！");
j2++;}


if (j3==2 && r3>=0 && GetDistance(player,r3)<=300 ){ 
ChangeBehavior(r1, "kill", player);
ChangeBehavior(r2, "kill", player);
ChangeBehavior(r3, "kill", player);
ChangeBehavior(r4, "kill", player);
ChangeBehavior(r5, "kill", player);
ChangeBehavior(r6, "kill", player);
ChangeBehavior(r7, "kill", player);
ChangeBehavior(r8, "kill", player);
j3++;}

if (j4==2 && r4>=0 && GetDistance(player,r4)<=300 ){ 
ChangeBehavior(r1, "kill", player);
ChangeBehavior(r2, "kill", player);
ChangeBehavior(r3, "kill", player);
ChangeBehavior(r4, "kill", player);
ChangeBehavior(r5, "kill", player);
ChangeBehavior(r6, "kill", player);
ChangeBehavior(r7, "kill", player);
ChangeBehavior(r8, "kill", player);
j4++;}
if (j5==2 && r5>=0 && GetDistance(player,r5)<=300 ){ 
ChangeBehavior(r1, "kill", player);
ChangeBehavior(r2, "kill", player);
ChangeBehavior(r3, "kill", player);
ChangeBehavior(r4, "kill", player);
ChangeBehavior(r5, "kill", player);
ChangeBehavior(r6, "kill", player);
ChangeBehavior(r7, "kill", player);
ChangeBehavior(r8, "kill", player);
j5++;}

if (j6==2 && r6>=0 && GetDistance(player,r6)<=300 ){ 
ChangeBehavior(r1, "kill", player);
ChangeBehavior(r2, "kill", player);
ChangeBehavior(r3, "kill", player);
ChangeBehavior(r4, "kill", player);
ChangeBehavior(r5, "kill", player);
ChangeBehavior(r6, "kill", player);
ChangeBehavior(r7, "kill", player);
ChangeBehavior(r8, "kill", player);
j6++;}

if (j7==2 && r7>=0 && GetDistance(player,r7)<=300 ){ 
ChangeBehavior(r1, "kill", player);
ChangeBehavior(r2, "kill", player);
ChangeBehavior(r3, "kill", player);
ChangeBehavior(r4, "kill", player);
ChangeBehavior(r5, "kill", player);
ChangeBehavior(r6, "kill", player);
ChangeBehavior(r7, "kill", player);
ChangeBehavior(r8, "kill", player);
j7++;}

if (j8==2 && r8>=0 && GetDistance(player,r8)<=300 ){ 
ChangeBehavior(r1, "kill", player);
ChangeBehavior(r2, "kill", player);
ChangeBehavior(r3, "kill", player);
ChangeBehavior(r4, "kill", player);
ChangeBehavior(r5, "kill", player);
ChangeBehavior(r6, "kill", player);
ChangeBehavior(r7, "kill", player);
ChangeBehavior(r8, "kill", player);
j8++;}}

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

        diannaoren() ; 

	ziji();

	scene1();
}

