// 第五章
int Rule = 1;
int RoundTime = 90;
int PlayerSpawn = 147;
int PlayerSpawnDir = 90;
int PlayerWeapon = 5;
int PlayerWeapon2 = 0;
int PlayerHP = 4000;

int cd=0;
int q=0;
int q1=0;
int qj1=0;
int qj2=0;
int zs=0;
int zs1=0;
int cq=0;
int cq1=0;
int cq2=0;
int cq3=0;
int cq4=0;
int cq5=0;
int cq6=0;
int cq7=0;
int cq8=0;
int cq9=0;
int cq10=0;
int cq11=0;
int cq12=0;
int cq13=0;
int cq14=0;
int cq15=0;
int cq16=0;
int cq17=0;
int cq18=0;
int cq19=0;
int cq20=0;
int cq21=0;
int cq22=0;
int cq23=0;
int cq24=0;
int cq25=0;
int cq26=0;
int cq27=0;
int cq28=0;
int yx=0;
int yx2=0;
int yx3=0;
int yx4=0;
int yx5=0;
int yx6=0;
int yx7=0;
int ys=0;
int sc=0;
int bj=0;
int bj1=0;
int st=0;
int x=0;
int sl=0;
int sl1=0;
int llz1=0;
int llz2=0;
int llz=0;
int ylh=0;
int ylh1=0;
int ylh2=0;
int ylh3=0;
int shu=0;
int t=0;
int xt=0;
int tzs=0;
int tx=0;
int tys=0;
int tsc=0;
int tbj=0;
int tbj1=0;
int tst=0;
int slt=0;
int slt1=0;
int slt2=0;
int ct=0;
int tllz=0;
int tllz1=0;
int tllz2=0;
int tylh=0;
int tylh1=0;
int tshu=0;
int t5=0;
int v= 0;

Save(string SFile, int s)
{
	int f = OpenFile(SFile,"w");
	WriteFile(f,s);
	CloseFile(f);
	return 1;
}
Load(string SFile)
{
	int f = OpenFile(SFile,"r");
	return ReadFile(f);
	CloseFile(f);
}

OnUpdate()
{
	int player = GetAnyChar("player");
	if (player < 0)
	{
		return 0;
	}
	
	int c = GetAnyChar("夜巡卒");
	int c2= GetAnyChar("夜巡·甲");
	int c3= GetAnyChar("夜巡·乙");
	int c4= GetAnyChar("夜巡·丙");
	int c5= GetAnyChar("夜巡·丁");
	int c6= GetAnyChar("夜巡·戊");
	int c7= GetAnyChar("夜巡·己");
	int c8= GetAnyChar("夜巡·庚");
	int c9= GetAnyChar("隐三爷");
	int c10= GetAnyChar("李守才");
	int c11= GetAnyChar("陈杯具");
    int c12= GetAnyChar("老栓头");
	int c13= GetAnyChar("窃贼");
	int c14= GetAnyChar("赵金莲");
	int c15= GetAnyChar("黄春申");
	int c16= GetAnyChar("衡向风");
	int c17= GetAnyChar("李朝宗");
	int c18= GetAnyChar("吴老实");
	int c19= GetAnyChar("滑茹儿");
	int c20= GetAnyChar("值守·甲");
	int c21= GetAnyChar("值守·乙");
	int c22= GetAnyChar("天枢石灵");
	int c23= GetAnyChar("天璇石灵");
	int c24= GetAnyChar("天玑石灵");
	int c25= GetAnyChar("天权石灵");
	int c26= GetAnyChar("玉衡石灵");
	int c27= GetAnyChar("开阳石灵");
	int c28= GetAnyChar("摇光石灵");
    int c29= GetAnyChar("北斗星君");
	int c30= GetAnyChar("药罗汉");
	int c31= GetAnyChar("飞贼");
	int c32= GetAnyChar("褚夫子");
	int c33= GetAnyChar("匪兵·甲");
	int c34= GetAnyChar("匪兵·乙");
	int c35= GetAnyChar("玲珑子");
	int c36= GetAnyChar("戏班女");
	int c37= GetAnyChar("傀儡鬼");
	int c38= GetAnyChar("书童");
	int c39= GetAnyChar("李知言");
	int c40= GetAnyChar("李知言");
	int c41= GetAnyChar("刽子手");
	int c42= GetAnyChar("看守·甲");
	int c43= GetAnyChar("看守·乙");
	int c44= GetAnyChar("看守·丙");
	int c45= GetAnyChar("武营军·甲");
	int c46= GetAnyChar("武营军·乙");
	int c47= GetAnyChar("武营军·丙");
	int c48= GetAnyChar("武营军·丁");
	int c49= GetAnyChar("武营军·戊");
	int c50= GetAnyChar("武营军·己");
	
	int now=GetGameTime();
	int gameover = 0;
	
	if(cd==0)
	{
		if(Load("Level\sa04.sav")==0)
		{
			cd=9;
			q=0;
			q1=0;
			t=now+3;
		}
		if(Load("Level\sa04.sav")==1)
		{
			cd=9;
			q=11;
			q1=9;
			t=now+3;
		}
		if(Load("Level\sa04.sav")==2)
		{
			cd=9;
			q=28;
			q1=9;
			t=now+3;
		}
		
	}
	if(q1==0)
	{
		AddNPC("5-1");
		q1=9;
		q=0;
	}
	if(q==0)
	{
		if(c>=0)
		{
		    SetTarget(0, "waypoint", 12);
		    ChangeBehavior(c, "attacktarget", 0);
			
			
			PlayerPerform("say", "【注意！追上并击杀敌人！】");
			PlayerPerform("pause", 1);
			PlayerPerform("say", "不好！不可让他跑了！");
			PlayerPerform("pause", 1);
			Perform(c, "say", "来人呐！有人闯营！");
			q=1;
			t=now+2;
			zs=1;
			zs1=1;
			cq=1;
			cq1=1;
			cq2=1;
			cq3=1;
			cq4=1;
			cq5=1;
			cq6=1;
			cq7=1;
			cq8=1;
			cq9=1;
			cq10=1;
			cq11=1;
			cq12=1;
			cq13=1;
			cq14=1;
			cq15=1;
			cq16=1;
			cq17=1;
			cq18=1;
			cq19=1;
			cq20=1;
			cq21=1;
			cq22=1;
			cq23=1;
			cq24=1;
			cq25=1;
			cq26=1;
			cq27=1;
			cq28=1;
		}
	}
	if(q==1&&c>=0&&GetHP(c)<=0)
	{
		PlayerPerform("say", "【温馨提示：本关有隐藏支线，找到并完成，可获得相应奖励。】");
		PlayerPerform("say", "【温馨提示：本关有隐藏支线，找到并完成，可获得相应奖励。】");
		PlayerPerform("pause", 8);
		PlayerPerform("say", "【( *>.<* )注意！不可登上城墙！！】");
		PlayerPerform("say", "【( *>.<* )注意！不可登上城墙！！】");
		PlayerPerform("pause", 4);
		PlayerPerform("say", "【提示：绕开夜巡，或者突袭暗杀，不可引起警戒。】");
		PlayerPerform("say", "【提示：绕开夜巡，或者突袭暗杀，不可引起警戒。】");
		PlayerPerform("pause", 3);
		PlayerPerform("say", "（营中夜巡必然不少，须得万分当心。）");
		PlayerPerform("pause", 1);
		PlayerPerform("say", "（眼下还是先找到李姑娘要紧。）");
		PlayerPerform("pause", 1);
		PlayerPerform("say", "（好险！所幸未曾惊动其余守卫。）");
		PlayerPerform("pause", 2);
		Say(c,"啊~！可怜我那小相好……还在城墙下等我……");
		q=2;
		t=now+2;
	}
	if(q==2&&now>t)
	{
		RemoveNPC(c);
		t=now+1;
		q=3;
	}
	if(q==3&&now>t)
	{
		AddNPC("5-2");
		AddNPC("5-3");
		AddNPC("5-4");
		AddNPC("5-5");
		AddNPC("5-6");
		AddNPC("5-7");
		AddNPC("5-8");
		AddNPC("5-9");
		AddNPC("5-10");
		AddNPC("5-11");
		AddNPC("5-12");
		q=4;
		t=now+5;
	}
	if(q==4&&c2>=0&&c3>=0&&c4>=0&&c5>=0&&c6>=0&&c7>=0&&c8>=0&&c9>=0&&c10>=0&&c11>=0&&c12>=0&&now>t)
	{
		q=5;
		yx2=1;
        yx3=1;
        yx4=1;
        yx5=1;
        yx6=1;
        yx7=1;
        yx=1;
        ys=1;
        sc=1;
        st=1;
	}
	if(q==5)
	{
		SetTarget(0, "char", player);
		SetTarget(1, "waypoint", 157);
		if (Distance(0, 1) <=50)
		{
			q=6;
		}
	}
	if(q==6)
	{
		RemoveNPC(c2);
		RemoveNPC(c3);
		RemoveNPC(c4);
		RemoveNPC(c5);
		RemoveNPC(c6);
		RemoveNPC(c7);
		RemoveNPC(c8);
		RemoveNPC(c9);
		RemoveNPC(c10);
		RemoveNPC(c11);
		RemoveNPC(c12);
		RemoveNPC(c13);
		q=7;
		t=now+2;
	}
	if(q==7&&now>t)
	{
		PlayerPerform("crouch", 0);
		PlayerPerform("pause", 4);
		PlayerPerform("say", "（柱子上有绳索勒过的痕迹，地上脚印凌乱，看来李姑娘果然曾被缚于此地。）");
		PlayerPerform("crouch", 1);
		q=8;
		t=now+3;
	}
	if(q==8&&now>t)
	{
		AddNPC("5-15");
		q=9;
	}		
	if(q==9)
	{
		if(c15>=0 && GetEnemy(c15)==player)
		{
			PlayerPerform("block", 0);
			PlayerPerform("say", "哼，如此倒行逆施，不见得只为区区武状元罢！");
		    PlayerPerform("pause", 16);
			PlayerPerform("say", "如此说来，死在营门的那名武生，便是‘不顺天意’了？");
		    PlayerPerform("pause", 13);
			PlayerPerform("say", "原来你已被萧别恨收买，甘做柴桂的鹰犬！");
		    PlayerPerform("pause", 11);
			PlayerPerform("say", "阁下此言何意？");
		    PlayerPerform("pause", 11);
			PlayerPerform("say", "你是……汤阴校场上的武生？！");
			PlayerPerform("block", 1);
		    PlayerPerform("pause", 4);
			PlayerPerform("say", "【注意！对话中请勿偷袭！】");
			
			Perform(c15,"say", "无可奉告。你左右也是死，多问又有何益！出招吧！");
		    Perform(c15,"pause", 15);
			Perform(c15,"say", "不错！不肯归顺公子爷，只有死。");
		    Perform(c15,"pause", 15);
			Perform(c15,"say", "呸！识时务者为俊杰天经地义！鄙人不过顺应天意而已。");
		    Perform(c15,"pause", 11);
			Perform(c15,"say", "哼，当日校场上你坏我大事，如今还装聋作哑么！");
		    Perform(c15,"pause", 7);
			Perform(c15,"say", "不说与你知晓，免得你不知死于谁之手。");
		    Perform(c15,"pause", 2);
			Perform(c15,"say", "好记性。鄙人姓黄，叫做‘黄春申’，");
		    Perform(c15,"pause", 8);
			Perform(c15, "say", "岳鹏举，你好哇！");
			Perform(c15,"pause", 1);
			Perform(c15, "faceto", player);
			q=10;
			x=1;
			t=now+15;
		}
	}
	if(x==1&&GetHP(c15)<7000)
	{
	    Perform(c15,"say", "【偷袭警告！】原以为你是英雄，却也是偷鸡摸狗之徒！");
		x=2;
		xt=now+3;
			
	}
	if(x==2&&now>xt)
	{
		v=1;
	}
	if(q==10&&now>t)
	{
		x=3;
		if(c15>=0 && GetHP(c15)<=0)
		{
			PlayerPerform("block", 0);
			PlayerPerform("say", "（罢了，还是先寻李姑娘要紧。）");
		    PlayerPerform("pause", 3);
			PlayerPerform("say", "（看来如今武营之中的人，都已魔障，也不知那小梁王究竟有何阴谋。）");
		    PlayerPerform("pause", 4);
			PlayerPerform("say", "……");
		    PlayerPerform("pause", 4);
			PlayerPerform("say", "被你们抓来的姑娘现在何处！");
		    PlayerPerform("pause", 2);
			PlayerPerform("block", 1);
			Say(c15,"……好个岳鹏举……");
			q=11;
			t=now+10;
		}
	}
	if(q==11&&now>t)
	{
		RemoveNPC(c15);
		q=12;
		t=now+2;
		PlayerPerform("say", "【关卡已自动保存。】");
		PlayerPerform("say", "【关卡已自动保存。】");
		Save("Level\sa04.sav",1);
	}
	if(q==12&&now>t)
	{
		AddNPC("5-18");
		q=13;
	}
	if(q==13)
	{
		
		if(c18>=0 && GetEnemy(c18)==player)
		{
			PlayerPerform("say", "【提示：靠近院内小桌，可补充血量。】");
			PlayerPerform("say", "【提示：靠近院内小桌，可补充血量。】");
		    PlayerPerform("pause", 2);
			PlayerPerform("block", 0);
			PlayerPerform("say", "有劳官人。");
		    PlayerPerform("pause", 15);
			
			Perform(c18, "say", "小人桌上备了一些吃食，还望壮士笑纳。");
			Perform(c18,"pause", 3);
			Perform(c18, "say", "适才壮士出手惩奸，小人才得以返家，实在感激涕零。");
			Perform(c18,"pause", 3);
			Perform(c18, "say", "只因这伙人无故霸占小人房屋，小人有气也不敢出。");
			Perform(c18,"pause", 3);
			Perform(c18, "say", "壮士请留步！刚才的事，小的都看见了。");
			PlayerPerform("block", 1);
			Perform(c18, "faceto", player);
			q=14;
		}
	}
	if(q==14)
	{
		SetTarget(0, "waypoint", 162);
		SetTarget(1, "char", player);
		if (c18>=0 && Distance(0, 1) <=20)
		{
			PlayerPerform("use",16);
			PlayerPerform("use",16);
			PlayerPerform("use",16);
			q=15;
		}
	}
	if(q==15)
	{
		if(c18>=0 && GetEnemy(c18)==player)
		{
			PlayerPerform("block", 0);
	 	    PlayerPerform("say", "【提示：前往隔壁【滑氏祠堂】");
		    PlayerPerform("say", "【提示：前往隔壁【滑氏祠堂】");
		    PlayerPerform("pause", 2); 
		    PlayerPerform("say", "果真如此？多谢官人指点。");
		    PlayerPerform("pause", 9);
			
		    Perform(c18, "say", "壮士或可前去一看。");
		    Perform(c18,"pause", 3);
		    Perform(c18, "say", "小人倒是听到隔壁【滑氏祠堂】外有女子在哭泣，");
		    Perform(c18,"pause", 3);
		    Perform(c18, "say", "适才听闻壮士在寻一位姑娘，");
		    PlayerPerform("block", 1);
		    Perform(c18, "faceto", player);
		    q=16;
		    t=now+10;
		}
	}
	if(q==16&&now>t)
	{
		RemoveNPC(c18);
		q=17;
		t=now+2;
	}
	if(q==17&&now>t)
	{
		AddNPC("5-19");
		q=18;
	}
	if(q==18)
	{
		if(c19>=0 && GetEnemy(c19)==player)
		{
			PlayerPerform("block", 0);
		    Perform(c19, "say", "公子可愿帮帮奴家？只要【找到石灵】，奴家必有重谢！");
		    Perform(c19,"pause", 2);
			Perform(c19, "say", "可奴家误将祠堂内的【镇守石灵】惊扰了，导致无法归位。");
		    Perform(c19,"pause", 2);
		    Perform(c19, "say", "爹爹今日命奴家打扫祠堂，");
		    Perform(c19,"pause", 6);
		    Perform(c19, "say", "呜呜呜~~这可如何是好……爹爹……定会责罚我……");
			
			PlayerPerform("say", "（原来哭泣的女子不是李姑娘 ）姑娘发生何事，竟而如此悲戚？");
		    PlayerPerform("pause", 3);
			PlayerPerform("block", 1);
		    Perform(c19, "faceto", player);
			q=19;
			t=now+12;
		}
	}
	if(q==19&&now>t)
	{
		
		PlayerPerform("say", "【提示：若不愿帮忙，请【转身离开】。】");
		PlayerPerform("pause", 2);
		PlayerPerform("say", "【提示：若要帮忙【找到石灵】，请【走进院内】。】");
		q=99;
		sl1=1;
		sl=1;
		slt1=now+10;
	}
	if(sl1==1&&now>slt1)
	{
	    Perform(c19, "say", "呜呜呜~~谁能帮帮我……");
		sl1 =3;
		q=20;
		t=now+2;	
	}
	if(q==20&&now>t)
	{
		RemoveNPC(c19);
		q=21;
		t=now+1;
	}
	if(q==21&&now>t)
	{
		AddNPC("5-16");
		AddNPC("5-20");
		AddNPC("5-21");
		q=22;
		t=now+2;
	}
	if(q==22&&now>t)
	{
		if(c16>=0&&c20>=0&&c21>=0&& GetEnemy(c16)==player)
		{
			
			Perform(c16,"guard",6);
			PlayerPerform("say", "想必你也做了柴桂的鹰犬。");
		    PlayerPerform("pause", 3);
			
			PlayerPerform("block", 0);
			Perform(c16, "say", "少逞口舌之利！当日汤阴校场之恨，今日我衡向风便向你讨了！");
			Perform(c16,"pause", 5);
			Perform(c16, "say", "姓岳的，咱们又见面了。");
			Perform(c16, "faceto", player);
			PlayerPerform("block", 1);
			q=23;
		}
	}
	if(q==23)
	{
		if(c16>=0 && GetHP(c16)<=1000 && GetHP(c16)>0&&GetHP(c21)<=0&&GetHP(c20)<=0)
		{
			PlayerPerform("block", 0);
			Perform(c16, "say", "无可奉告！再来打过！");
			Perform(c16,"pause", 16);
			Perform(c16, "say", "咄！大丈夫立世但求万古留名，柴相公乃天命之人，岂是你这村夫可懂！");
			Perform(c16,"pause", 15);
			Perform(c16, "say", "今日不是你死便是我亡，多费唇舌又有何益！");
			Perform(c16,"pause", 9);
			Perform(c16, "say", "姓岳的，何必装腔作势！");
			Perform(c16,"pause", 3);
			Perform(c16, "faceto", player);
			
			PlayerPerform("say", "难道柴桂想要造反不成！");
		    PlayerPerform("pause", 3);
			PlayerPerform("say", "！！什么！！");
		    PlayerPerform("pause", 16);
			PlayerPerform("say", "小梁王收买天下武生，究竟有何阴谋？你白白牺牲，便是值得？");
		    PlayerPerform("pause", 12);
			PlayerPerform("say", "兄台武艺不凡，却为了那小梁王甘心送命，岂是大丈夫所为？");
		    PlayerPerform("pause", 6);
			PlayerPerform("say", "且慢！你我并无深仇大怨，何苦以命相搏？");
			PlayerPerform("block", 1);
			q=24;
		}
	}
	if(q==24)
	{
		if(c16>=0 && GetHP(c16)<=0)
		{
			PlayerPerform("block", 0);
			PlayerPerform("say", "…………");
		    PlayerPerform("pause", 3);
			PlayerPerform("block", 1);
			Say(c16,"……岳飞……我知道你想救县令千金……只可惜……");
			q=25;
			t=now+2;
		}
	}
	if(q==25&&now>t)
	{
		RemoveNPC(c16);
		RemoveNPC(c20);
		RemoveNPC(c21);
		q=26;
		t=now+2;
	}
	if(q==26&&now>t)
	{
		AddNPC("5-30");
		AddNPC("5-32");
		AddNPC("5-33");
		AddNPC("5-34");
		AddNPC("5-35");
		AddNPC("5-36");
		AddNPC("5-37");
		AddNPC("5-38");
		
		q=27;
	}
	if(q==27)
	{
		if(c30>=0&&c32>=0&&c33>=0&&c34>=0&&c35>=0&&c36>=0&&c37>=0&&c38>=0)
		{
			PlayerPerform("block", 0);
			PlayerPerform("say", "【注意！靠近凉亭后，支线NPC将退场。】");
			PlayerPerform("say", "【注意！靠近凉亭后，支线NPC将退场。】");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "【提示：支线NPC已出现，完成支线可获得奖励。】");
			PlayerPerform("block", 1);
			
			q=28;
			llz=1;
			ylh=1;
			shu=1;
			
		}
	}
	if(q==28)
	{
		SetTarget(0, "waypoint", 194);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			RemoveNPC(c30);
		    RemoveNPC(c32);
		    RemoveNPC(c33);
			RemoveNPC(c34);
		    RemoveNPC(c35);
		    RemoveNPC(c36);
			RemoveNPC(c37);
		    RemoveNPC(c38);
			q=29;
			t=now+2;
			PlayerPerform("say", "【关卡已自动保存。】");
			PlayerPerform("say", "【关卡已自动保存。】");
		    Save("Level\sa04.sav",2);
		    
		}
	}
	if(q==29&&now>t)
	{
	    AddNPC("5-39");
	    AddNPC("5-41");
	    AddNPC("5-42");
	    AddNPC("5-43");
	    AddNPC("5-44");
		q=30;
	}
    if(q==30)
	{
		if(c39>=0&&c41>=0&&c42>=0&&c43>=0&&c44>=0)
		{
			PlayerPerform("block", 0);
			PlayerPerform("pause", 1);
			PlayerPerform("say", "那是李姑娘！");
			PlayerPerform("block", 1);
			q=31;
		}
	}
    if(q==31&&GetHP(c41)<=0)
	{
		PlayerPerform("block", 0);
		Perform(c39, "say", "城门旁的小院里，有劳岳公子了。");
		Perform(c39,"pause", 6);
		Perform(c39, "say", "岳公子，此刻不是说话之时，烦请你护我去取回兵器，其他的等出营再说。");
		Perform(c39,"pause", 3);
		Perform(c39, "say", "不过幸好……幸好你及时赶到了……");
		Perform(c39,"pause", 3);
		Perform(c39, "say", "岳公子，只因你夜探武营已被他们知觉，所以……");
		Perform(c39,"pause", 6);
		Perform(c39, "say", "岳公子！你真的来了……我……我还好……");
		Perform(c39,"pause", 3);
	    Perform(c39, "faceto", player);
		
		PlayerPerform("say", "正该如此，兵器藏于何处？");
		PlayerPerform("pause", 12);
		PlayerPerform("say", "洪先竟然真敢加害于你！");
		PlayerPerform("pause", 6);
		PlayerPerform("say", "李姑娘，你可还好？");
	    PlayerPerform("block", 1);
		q=32;
		t=now+18;
	} 
    if(q==32&&now>t)
	{
		ChangeBehavior(c39, "follow", player);
		q=33;
	}		
	if(q==33)
	{
	    SetTarget(0, "waypoint", 210);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "好，李姑娘，你跟在我身后，千万当心。");
		    PlayerPerform("pause", 2);
			
			Perform(c39, "say", "就是这里面。");
			q=99;
			qj1=1;
		}
	}
	if(qj1==1)
	{
		Perform(c42, "say", "大胆小贼！给我拿下了！");
		qj1=9;
		q=34;
	}
	if(q==34&&GetHP(c42)<=0&&GetHP(c43)<=0&&GetHP(c44)<=0)
	{
		Perform(c39, "say", "是，有劳岳公子。");
		Perform(c39,"pause", 3);
		
		PlayerPerform("say", "李姑娘，你快去取回兵器，我在外面警戒。");
		PlayerPerform("pause", 2);
		PlayerPerform("block", 1);
		q=35;
		t=now+5;
	}
	if(q==35&&now>t)
	{
		RemoveNPC(c39);
	    RemoveNPC(c41);
	    RemoveNPC(c42);
		RemoveNPC(c43);
	    RemoveNPC(c44);
		q=36;
		t=now+2;
	}
	if(q==36&&now>t)
	{
		AddNPC("5-17");
	    AddNPC("5-40");
	    AddNPC("5-45");
	    AddNPC("5-46");
	    AddNPC("5-47");
		AddNPC("5-48");
	    AddNPC("5-49");
	    AddNPC("5-50");
		q=37;
	}
	if(q==37)
	{
		if(c17>=0&&c40>=0&&c45>=0&&c46>=0&&c47>=0&&c48>=0&&c49>=0&&c50>=0)
		{
			PlayerPerform("block", 0);
			PlayerPerform("use", 15);
			PlayerPerform("pause", 1);
			Perform(c40, "say", "岳公子,你将这颗伤药服下。");
			q=38;
		}
			
	}
	if(q==38&&GetEnemy(c17)==player)
	{
		PlayerPerform("block", 0);
		PlayerPerform("say", "李姑娘，你跟紧我！咱们冲出去！");
	    PlayerPerform("pause", 2);
			
		Perform(c17, "say", "好小子，果然是你！大伙儿上！拿住岳飞！");
		Perform(c17, "faceto", player);
		PlayerPerform("block", 1);
		q=99;
		qj2=1;
		t=now+2;
	}
	if(qj2==1&&now>t)
	{
		ChangeBehavior(c17, "follow", player);
		qj2=9;
		q=39;
	}
	if(q==39)
	{
		if(GetHP(c17)>0&&GetHP(c45)<=0&&GetHP(c46)<=0&&GetHP(c47)<=0&&GetHP(c48)<=0&&GetHP(c49)<=0&&GetHP(c50)<=0)
		{
			
			Perform(c17,"guard", 20);
			Perform(c17, "say", "少拿言语唬我，我倒要看看你有何花招！");
			Perform(c17,"pause", 9);
			Perform(c17, "say", "岳飞！你无故闯入武营，伤了许多人，还有脸面叫嚣？");
			Perform(c17,"pause", 3);
			
			PlayerPerform("say", "李朝宗，我乃是见你本性憨厚，不忍伤了你，你可识趣！你且随我来！");
			PlayerPerform("pause", 6);
			PlayerPerform("say", "且住！你还不停手么！");
			PlayerPerform("block", 1);
			Perform(c40,"guard", 20);
			
			q=40;
			t=now+9;
			Save("Level\sa04.sav",0);
		}
	}
	if(q==40&&now>t)
	{
		v=2;
	}
	
	
	if(llz==1)
	{
		if(GetEnemy(c36)==player)
		{
			
			PlayerPerform("block", 0);
			Perform(c36, "say", "奴家一家子性命，全仰仗壮士了。");
			Perform(c36,"pause", 3);
			Perform(c36, "say", "只知在园子里某处，我们找不到，况且师兄目前正发狂，我们也不敢靠近。");
			Perform(c36,"pause", 10);
			Perform(c36, "say", "算命的说，玲珑子师兄是中了‘傀儡鬼’，只要找到‘傀儡鬼’打碎，师兄即可恢复。");
			Perform(c36,"pause", 6);
			Perform(c36, "say", "壮士可否搭救搭救？");
			Perform(c36,"pause", 3);
			Perform(c36, "say", "其余兄弟姊妹害怕，俱各离去，爹爹也因此卧病不起。");
			Perform(c36,"pause", 3);
			Perform(c36, "say", "不料近日戏班却出了一件怪事，玲珑子师兄忽然中邪，变得六亲不认。");
			Perform(c36,"pause", 3);
			Perform(c36, "say", "奴家本是外乡人，随爹爹来此处搭台唱戏营生。");
			Perform(c36,"pause", 6);
			Perform(c36, "say", "壮士，可救奴家一救！");
			Perform(c36, "faceto", player);
			
			PlayerPerform("say", "那什么‘傀儡鬼’在何处？");
		    PlayerPerform("pause", 8);
			PlayerPerform("say", "这捉鬼驱邪，在下可不会。");
		    PlayerPerform("pause", 18);
			PlayerPerform("say", "发生何事？");
		    PlayerPerform("pause", 3);
			PlayerPerform("block", 1);
			llz=2;
			tllz=now+30;
		}
	}
	if(llz==2&&now>tllz)
	{
		PlayerPerform("say", "【提示：若不愿帮忙，请【转身离开】。】");
		PlayerPerform("pause", 2);
		PlayerPerform("say", "【提示：若要帮忙，请【走进院内】。】");
		q=99;
		llz=3;
		llz1=1;
		tllz1=now+10;
	}
	if(llz1==1&&now>tllz1)
	{
		Perform(c36, "say", "这可如何是好……");
		llz1 =2;
		tllz1=now+3;
	}
	if(llz1==2&&now>tllz1)
	{
		RemoveNPC(c35);
		RemoveNPC(c36);
		RemoveNPC(c37);
		llz1=9;
		q=28;
	}
	if(llz==3&&now>tllz)
	{
		
		if(c35>=0&&GetEnemy(c35)==player)
		{
			PlayerPerform("say", "此人神志不清，先制服了再说。");
		    PlayerPerform("pause", 4);
			
			Perform(c35,"use",34);
			Perform(c35,"use",40);
			Perform(c35,"use",41);
			Perform(c35, "say", "杀……杀……杀……");
			llz=4;
			llz2=1;
			llz1=9;
			tllz=now+60;
		}
	}
	if(llz2==1)
	{
		tllz2=now+10;
		llz2=2;
			
	}
	if(llz2==2&&now>tllz2)
	{
		if(GetHP(c35)<=1500 && GetHP(c35)>0&&GetHP(c37)>=10)
		{
			Perform(c35,"use",15);
			llz2=1;
		}
	}
	if(llz==4&&now>tllz)
	{
		PlayerPerform("say", "（看来戏班女所言不差，须得先找到傀儡鬼。）");
		PlayerPerform("pause", 4);
		PlayerPerform("say", "（此人身手平庸，却似乎不知疼痛，如此耗将下去，实是得不偿失。）");
		llz=5;
	}
	if(llz==5)
	{
		if(GetHP(c37)<=0)
		{
			llz2=9;
			llz=6;
		}
	}
	if(llz==6)
	{
		if(GetHP(c35)<=1500)
		{
			Perform(c36, "say", "师兄，你可吓死我了！咱们走吧。");
			Perform(c36,"pause", 3);
			Perform(c36, "say", "这是我家祖传的灵丹，还请壮士莫要嫌弃。");
			Perform(c36,"pause", 3);
			Perform(c36, "say", "师兄！你终于恢复啦~！多谢壮士！");
			Perform(c36,"pause", 3);
			
			Perform(c35,"guard",20);
			Perform(c35, "say", "这……是怎么回事？师妹？");
			
			PlayerPerform("block", 1);
			llz=7;
			tllz=now+10;
		}
	}
	if(llz==7&&now>tllz)
	{
		RemoveNPC(c35);
		RemoveNPC(c36);
		RemoveNPC(c37);
		llz=8;
	}
	if(llz==8)
	{
		PlayerPerform("block", 0);
		PlayerPerform("use",19);
		PlayerPerform("block", 1);
		llz=9;
		q=28;
	}
	if(ylh==1)
	{
		if(c30>=0&&GetEnemy(c30)==player)
		{
			
			Perform(c30, "say", "施主可愿帮贫僧追回？");
			Perform(c30,"pause", 1);
			Perform(c30, "say", "贫僧在此行医济世，却不曾想被飞贼光顾，偷走了贫僧炼制的丹药。");
			Perform(c30,"aggress");
			Perform(c30, "say", "施主请留步！");
			Perform(c30, "faceto", player);
			
			PlayerPerform("say", "【提示：若不愿帮忙，请【直接离开】。】");
		    PlayerPerform("pause", 3);
			PlayerPerform("block", 0);
			PlayerPerform("say", "【提示：若愿帮忙，请【攻击药罗汉一次】。】");
		    PlayerPerform("pause", 15);
			PlayerPerform("block", 1);
			ylh=2;
			ylh1=1;
			tylh1=now+25;
		}
	}
	if(ylh1==1&&now>tylh1)
	{
		Perform(c30, "say", "罢了罢了！");
		ylh1=2;
		tylh1=now+2;
	}
	if(ylh1==2&&now>tylh1)
	{
		RemoveNPC(c30);
		ylh1=9;
		q=28;
	}
	if(ylh==2&&GetHP(c30)<10000)
	{
		ylh1=9;
		ylh=3;
	}
	if(ylh==3)
	{
		AddNPC("5-31");
		ylh=4;	
	}
	if(ylh==4)
	{
		if(c31>=0&&GetEnemy(c31)==player)
		{
			
			PlayerPerform("block", 0);
			Perform(c31, "faceto", player);
			PlayerPerform("say", "小贼！哪里跑！");
			PlayerPerform("block", 1);
			
			ylh=5;
			
		}
	}
	if(ylh==5)
	{
		SetTarget(0, "waypoint", 115);
		ChangeBehavior(c31, "attacktarget", 0);
		ylh=6;
		ylh2=1;
	}	
	if(ylh2==1)	
	{
		SetTarget(0, "waypoint", 115);
		SetTarget(1, "char", c31);
		if (c>=0&&Distance(0, 1) <50)
		{
			RemoveNPC(c31);
			RemoveNPC(c30);
			PlayerPerform("say", "可惜，被他给跑了！");
			ylh2=2;
		}
	}
	if(ylh==6)
	{
		ylh2=2;
		if(c31>=0&&GetHP(c31)<=0)
		{
			PlayerPerform("say", "将药还给药罗汉。");
			ylh=7;
		}
	}
	if(ylh==7&&GetHP(c31)<=0)
	{
		if(c30>=0&&GetEnemy(c30)==player)
		{
			PlayerPerform("use", 15);
		    PlayerPerform("pause", 2);
			Perform(c30, "say", "多谢施主，此药疗伤颇有奇效，便赠与施主一枚。");
			ylh=8;
			tylh=now+2;
		}
	}
	if(ylh==8&&now>tylh)
	{
		RemoveNPC(c30);
		RemoveNPC(c31);
		ylh=9;
		q=28;
	}
	if(shu==1)
	{
		if(c38>=0&&GetEnemy(c38)==player)
		{
			
			Perform(c38, "say", "英雄，救救我家夫子吧，他被匪徒困在院里了。");
			Perform(c38, "faceto", player);
			PlayerPerform("block", 0);
			PlayerPerform("say", "【提示：若不愿帮忙，请【直接离开】。】");
			PlayerPerform("pause", 3);
			PlayerPerform("say", "【提示：若愿帮忙，请【进入院中】。】");
		    PlayerPerform("pause", 3);
			PlayerPerform("block", 1);
			shu=2;
		}
	}
	if(shu==2)
	{
		SetTarget(0, "waypoint", 203);
		SetTarget(1, "char", player);
		if (Distance(0, 1) < 200)
		{
			Perform(c33, "say", "小子！看什么看！没事滚远点！");
			shu=3;
		}
	}
	if(shu==3&&GetHP(c33)<=0&&GetHP(c34)<=0)
	{
		shu=4;
	}
	if(shu==4&&c32>=0&&GetEnemy(c32)==player)
		{
			PlayerPerform("use", 39);
		    PlayerPerform("pause", 2);
			Perform(c32, "say", "多谢壮士，小小玩意儿，不成敬意，望兄台笑纳。");
			shu=5;
			tshu=now+2;
		}
	if(shu==5&&now>tshu)
	{
		RemoveNPC(c32);
		RemoveNPC(c33);
		RemoveNPC(c34);
		RemoveNPC(c38);
		shu=9;
		q=28;
	}

	if(sl==1)
	{
		SetTarget(0, "waypoint", 178);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=30)
		{
			sl1=9;
			sl=2;
		}
	}
	if(sl==2)
	{
		AddNPC("5-22");
		AddNPC("5-23");
		AddNPC("5-24");
		AddNPC("5-25");
		AddNPC("5-26");
		AddNPC("5-27");
		AddNPC("5-28");
		
		sl=3;
	}
	if(sl==3&&c22>=0&&c23>=0&&c24>=0&&c25>=0&&c26>=0&&c27>=0&&c28>=0)
	{
		PlayerPerform("block", 0);
		PlayerPerform("say", "【找到后攻击一下即可。】");
		PlayerPerform("pause", 4);
		PlayerPerform("say", "【【石灵】共有七个，散布在【祠堂周围】。】");
		PlayerPerform("block", 1);
		sl=4;
	}
	if(sl==4)
	{
		if(GetHP(c22)<=0&&GetHP(c23)<=0&&GetHP(c24)<=0&&GetHP(c25)<=0&&GetHP(c26)<=0&&GetHP(c27)<=0&&GetHP(c28)<=0)
		{
			PlayerPerform("say", "（总算找全了……）");
			sl=5;
			slt2=now+1;
		}
	}
	if(sl==5&&now>slt2)
	{
		RemoveNPC(c22);
		RemoveNPC(c23);
		RemoveNPC(c24);
		RemoveNPC(c25);
		RemoveNPC(c26);
		RemoveNPC(c27);
		RemoveNPC(c28);
		sl=6;
		slt2=now+1;
	}
	if(sl==6&&now>slt2)
	{
		AddNPC("5-29");
		sl=7;
	}
	if(sl==7)
	{
		PlayerPerform("block", 0);
		PlayerPerform("say", "（祠堂里好像有什么变化，过去看看。）");
		PlayerPerform("block", 1);
		sl=8;
		slt2=now+2;
	}
	if(sl==8&&now>slt2)
	{
		if(c29>=0&&GetEnemy(c29)==player)
		{
			PlayerPerform("block", 0);
			PlayerPerform("say", "【攻击石灵】");
		    PlayerPerform("pause", 2);
			Perform(c19, "say", "多谢公子！七星石灵都已归位，这件兵器便赠与公子了。");
			Perform(c29, "faceto", player);
			PlayerPerform("block", 1);
			sl=9;
		}
	}
	if(sl==9)
	{
		if(c29>=0&&GetHP(c29)<=0)
		{
			sl=10;
			slt2=now+1;
		}
	}
	if(sl==10&&now>slt2)
	{
		RemoveNPC(c19);
		RemoveNPC(c29);
		sl=11;
		q=21;
		t=now+2;
	}
	
	if(ys==1)
	{
		if(c9>=0 && GetEnemy(c9)==player)
		{
			PlayerPerform("block", 0);
			Perform(c9, "say", "这个送你，飞去吧~");
			Perform(c9,"pause", 2);
			Perform(c9, "say", "哎呀呀，本想给你个惊喜，被你找到了(#^.^#)……");
			Perform(c9, "faceto", player);
			PlayerPerform("block", 1);
			ys=2;
			tys=now+4;
		}
	}
	if(ys==2&&now>tys)
	{
		PlayerPerform("use",36);
		ys=3;
		tys=now+1;
	}
	if(ys==3&&now>tys)
	{
		RemoveNPC(c9);
		ys=4;
	}
	
	if(sc==1)
	{
		if(c10>=0 && GetEnemy(c10)==player)
		{
			PlayerPerform("block", 0);
			PlayerPerform("say", "好说，交给在下便是。");
		    PlayerPerform("pause", 15);
			PlayerPerform("say", "兄台何事烦恼？");
		    PlayerPerform("pause", 3);
			
			Perform(c10, "say", "你若帮我教训那小贼，便送给你也无妨！");
			Perform(c10,"pause", 3);
			Perform(c10, "say", "可是今日不知被哪个小贼偷了去！");
			Perform(c10,"pause", 3);
			Perform(c10, "say", "那日我在城外捡了一柄小剑，吹毛立断光可鉴人，");
			Perform(c10,"pause", 6);
			Perform(c10, "say", "哇呀呀！可恶的小贼！气煞我也！");
			Perform(c10, "faceto", player);
			PlayerPerform("block", 1);
			sc=2;
			tsc=now+15;
		}
	}	
	if(sc==2&&now>tsc)	
	{
		
		AddNPC("5-13");
		sc=3;
		tsc=now+2;
	}
	if(sc==3&&now>tsc)
	{
		if(c13>=0 && GetEnemy(c13)==player)
		{
			RemoveNPC(c10);
			sc=4;
			tsc=now+1;
		}
	}
	if(sc==4&&now>tsc)
	{
		PlayerPerform("block", 0);
		PlayerPerform("say", "未必便是闲事！");
		PlayerPerform("pause", 6);
		PlayerPerform("say", "小贼，偷了东西还想跑么！");
		
		Perform(c13, "guard", 5);
		Perform(c13, "say", "多管闲事！");
		Perform(c13,"pause", 3);
		Perform(c13, "faceto", player);
		PlayerPerform("block", 1);
		sc=5;
	}
	if(sc==5&&GetHP(c13)<=0)
	{
		PlayerPerform("say", "【此匕首攻、防、速各+5】");
		PlayerPerform("pause", 2);
		Say(c13,"小子……我饶不了……");
		sc=6;
		tsc=now+2;
	}
	if(sc==6&&now>tsc)
	{
		RemoveNPC(c13);
		sc=7;
	}
	
	if(bj==0)
	{
		if(c11>=0 && GetEnemy(c11)==player)
		{
			AddNPC("5-14");
			
			bj=1;
			tbj=now+1;
		}
	
	}
	if(bj==1&&c14>=0&&now>tbj)
	{
		PlayerPerform("block", 0);
		PlayerPerform("say", "兄台切莫悲戚，待在下去寻那贱男女的晦气！");
	    PlayerPerform("pause", 2);
		PlayerPerform("say", "如此奸夫淫妇，人人得而诛之！");
	    PlayerPerform("pause", 3);
		PlayerPerform("say", "（夜巡卒？莫非便是死于我剑下那人？）");
	    PlayerPerform("pause", 12);
		PlayerPerform("say", "兄台，男子汉大丈夫，岂能哭哭啼啼？");
	    PlayerPerform("pause", 3);
			
		Perform(c11, "say", "一切全仰仗英雄！");
		Perform(c11,"pause", 19);
		Perform(c11, "say", "卷走我家中所有钱财，跟武营一个夜巡卒私奔了……呜呜~~");
		Perform(c11,"pause", 3);
		Perform(c11, "say", "阁下有所不知……我那刚过门的媳妇儿……");
		Perform(c11,"pause", 6);
	    Perform(c11, "say", "┭┮﹏┭┮呜呜呜~~");
	    Perform(c11, "faceto", player);
	    PlayerPerform("block", 1);
		bj=2;
		
        tbj=now+20;		
	}
	if(bj==2&&now>tbj)
	{
		if(c14>=0 && GetEnemy(c14)==player)
		{
			
			bj=3;
			
			tbj=now+1;
		}
	}
	if(bj==3&&now>tbj)
	{
		PlayerPerform("block", 0);
		PlayerPerform("say", "【如果不杀，请直接离开。】");
		PlayerPerform("pause", 3);
		PlayerPerform("say", "看剑！【请选择杀或者不杀】");
		PlayerPerform("pause", 3);
		PlayerPerform("say", "果然是个不知廉耻的贱人！");
		PlayerPerform("pause", 5);
		
		Perform(c14, "say", "你是什么人！");	
		Perform(c14, "say", "Σ⊙▽⊙a！啊！");
		Perform(c14,"pause", 2);
		Perform(c14, "faceto", player);
		Perform(c14, "say", "军爷~~你可算来了~~让奴家等得好生心痒~~");
		PlayerPerform("block", 1);
		bj=4;
		bj1=1;
		tbj1=now+20;
	}
	if(bj==4&&GetHP(c14)<=0)
	{
		PlayerPerform("say", "（回去告知她相公。）");
		PlayerPerform("pause", 2);
		Say(c14,"啊！早知今日……");
		bj=5;
		tbj=now+4;
	}
	if(bj==5&&now>tbj)
	{
		RemoveNPC(c14);
		bj=6;
	}
	if(bj==6&&GetHP(c14)<=0)
	{
		if(c11>=0 && GetEnemy(c11)==player)
		{
			PlayerPerform("use", 5);
			PlayerPerform("pause", 2);
			Perform(c11, "say", "多谢英雄！");
			bj=7;
			tbj=now+2;
		}
	}
	if(bj==7&&now>tbj)
	{
		RemoveNPC(c11);
		bj=8;
	}
	if(bj1==1&&now>tbj1)
	{
		
		Perform(c14, "say", "哎哟，英雄果然懂得怜香惜玉，奴家祝愿英雄此生多妻多妾~");
		bj1=2;
		tbj1=now+2;
	}
	if(bj1==2&&now>tbj1)
	{
		ChangeBehavior(c14,"patrol",156);
		
		bj1=3;
	}
	if(bj1==3)
	{
		SetTarget(0, "char", c14);
		SetTarget(1, "waypoint", 156);
		if (c14>=0&&Distance(0, 1) <=20)
		{
			PlayerPerform("use", 11);
		    PlayerPerform("use", 13);
			bj1=4;
		}
	}
	if(bj1==4)
	{
		RemoveNPC(c11);
		RemoveNPC(c14);
		tbj1=now+2;
		bj1=5;
	}
	if(bj1==5&&now>tbj1)
	{
		PlayerPerform("say", "【黑白不明，善恶不分，应受此罚。】");
	    
		bj1=6;
	}
	if(st==1)
	{
		if(c12>=0 && GetEnemy(c12)==player)
		{
			PlayerPerform("block", 0);
			Perform(c12, "say", "壮士且慢，你是要去救那女子吧？老朽此处有一物，可助你一臂之力。");
			Perform(c12,"pause", 13);
			Perform(c12, "say", "并不在，好像昨日便出城去了。");
			Perform(c12,"pause", 11);
			Perform(c12, "say", "我看那什么小梁王，也不似个贤明的好官。");
			Perform(c12,"pause", 3);
			Perform(c12, "say", "如今这营中驻扎的守卫，兵不像兵贼不像贼，");
			Perform(c12,"pause", 12);
			Perform(c12, "say", "喏，就在隔壁，不过半夜后便没了声响，也不知那女子是死是活。");
			Perform(c12,"pause", 8);
			Perform(c12, "say", "落入他们手中，可不知要遭受多少磨难哟……");
			Perform(c12,"pause", 3);
			Perform(c12, "say", "日前他们不知从何处抓回了一名女子，娇滴滴的如花似玉，");
			Perform(c12,"pause", 3);
			Perform(c12, "say", "好好的一座武营镇，自从那什么小梁王驻扎之后，搞得乌烟瘴气。");
			Perform(c12,"pause", 6);
			Perform(c12, "say", "唉……真是作孽……");
			
			PlayerPerform("say", "多谢老丈！在下叨扰了，告辞。");
			PlayerPerform("pause", 12);
			PlayerPerform("say", "那小梁王就在这武营之中么？");
			PlayerPerform("pause", 17);
			PlayerPerform("say", "！！！");
			PlayerPerform("pause", 11);
			PlayerPerform("say", "一名女子！？老丈可知在何处？");
			PlayerPerform("pause", 13);
			PlayerPerform("say", "老丈有何苦楚，这般唉声叹气？");
			PlayerPerform("pause", 3);
			Perform(c12, "faceto", player);
			PlayerPerform("block", 1);
			st=2;
			tst=now+46;
		}
	}
	if(st==2&&now>tst)
	{
		PlayerPerform("say", "多谢老丈！");
		PlayerPerform("use", 4);
		st=3;
	}
	if (yx==1)
	{
		if (c2>=0 && GetEnemy(c2)==player)
		{
			Perform(c2, "say", "什么人鬼鬼祟祟！");
			Perform(c2, "faceto", player);
			yx = 2;
			tx = now + 2;
		}
	}
	if (yx == 2)
	{
		if (c2>=0 && GetEnemy(c2)==player && GetHP(c2)>0 && now>tx)
		{
			Perform(c2, "guard", 10);
			Say(c2, "有敌人！全营警戒！");
			Perform(c2, "faceto", player);
			
			PlayerPerform("say", "不好！行踪败露，反害了李姑娘！");
			PlayerPerform("pause", 2);
			yx = 3;
			tx = now + 4;
		}
	}
	if(yx==3&&now>tx)
	{
		v=1;
	}
	
	
	if (yx2==1)
	{
		if (c3>=0 && GetEnemy(c3)==player)
		{
			Perform(c3, "say", "你是何人！");
			Perform(c3, "faceto", player);
			yx2 = 2;
			tx = now + 2;
		}
	}
	if (yx2 == 2)
	{
		if (c3>=0 && GetEnemy(c3)==player && GetHP(c3)>0 && now>tx)
		{
			Perform(c3, "guard", 10);
			Say(c3, "有敌人！全营警戒！");
			Perform(c3, "faceto", player);
			
			PlayerPerform("say", "不好！行踪败露，反害了李姑娘！");
			PlayerPerform("pause", 2);
			yx2 = 3;
			tx = now + 4;
		}
	}
	if(yx2==3&&now>tx)
	{
		v=1;
	}
	
	if (yx3==1)
	{
		if (c4>=0 && GetEnemy(c4)==player)
		{
			Perform(c4, "say", "好小子！胆子不小！");
			Perform(c4, "faceto", player);
			yx3 = 2;
			tx = now + 2;
		}
	}
	if (yx3 == 2)
	{
		if (c4>=0 && GetEnemy(c4)==player && GetHP(c4)>0 && now>tx)
		{
			Perform(c4, "guard", 10);
			Say(c4, "有敌人！全营警戒！");
			Perform(c4, "faceto", player);
			
			PlayerPerform("say", "不好！行踪败露，反害了李姑娘！");
			PlayerPerform("pause", 2);
			yx3 = 3;
			tx = now + 4;
		}
	}
	if(yx3==3&&now>tx)
	{
		v=1;
	}
	
	if (yx4==1)
	{
		if (c5>=0 && GetEnemy(c5)==player)
		{
			Perform(c5, "say", "大爷正愁没乐子！");
			Perform(c5, "faceto", player);
			yx4 = 2;
			tx = now + 2;
		}
	}
	if (yx4 == 2)
	{
		if (c5>=0 && GetEnemy(c5)==player && GetHP(c5)>0 && now>tx)
		{
			Perform(c5, "guard", 10);
			Say(c5, "有敌人！全营警戒！");
			Perform(c5, "faceto", player);
			
			PlayerPerform("say", "不好！行踪败露，反害了李姑娘！");
			PlayerPerform("pause", 2);
			yx4 = 3;
			tx = now + 4;
		}
	}
	if(yx4==3&&now>tx)
	{
		v=1;
	}
	
	if (yx5==1)
	{
		if (c6>=0 && GetEnemy(c6)==player)
		{
			Perform(c6, "say", "啊哟！何方贼子！");
			Perform(c6, "faceto", player);
			yx5 = 2;
			tx = now + 2;
		}
	}
	if (yx5 == 2)
	{
		if (c6>=0 && GetEnemy(c6)==player && GetHP(c6)>0 && now>tx)
		{
			Perform(c6, "guard", 10);
			Say(c6, "有敌人！全营警戒！");
			Perform(c6, "faceto", player);
			
			PlayerPerform("say", "不好！行踪败露，反害了李姑娘！");
			PlayerPerform("pause", 2);
			yx5 = 3;
			tx = now + 4;
		}
	}
	if(yx5==3&&now>tx)
	{
		v=1;
	}
	
	if (yx6==1)
	{
		if (c7>=0 && GetEnemy(c7)==player)
		{
			Perform(c7, "say", "小子，还真敢进来！");
			Perform(c7, "faceto", player);
			yx6 = 2;
			tx = now + 2;
		}
	}
	if (yx6 == 2)
	{
		if (c7>=0 && GetEnemy(c7)==player && GetHP(c7)>0 && now>tx)
		{
			Perform(c7, "guard", 10);
			Say(c7, "有敌人！全营警戒！");
			Perform(c7, "faceto", player);
			
			PlayerPerform("say", "不好！行踪败露，反害了李姑娘！");
			PlayerPerform("pause", 2);
			yx6 = 3;
			tx = now + 4;
		}
	}
	if(yx6==3&&now>tx)
	{
		v=1;
	}
	
	if (yx7==1)
	{
		if (c8>=0 && GetEnemy(c8)==player)
		{
			Perform(c8, "say", "妈呀~~有有有鬼~~~");
			Perform(c8, "faceto", player);
			yx7 = 2;
			tx = now + 2;
		}
	}
	if (yx7 == 2)
	{
		if (c8>=0 && GetEnemy(c8)==player && GetHP(c8)>0 && now>tx)
		{
			Perform(c8, "guard", 10);
			Say(c8, "有鬼啊！全营警戒！");
			Perform(c8, "faceto", player);
			
			PlayerPerform("say", "不好！行踪败露，反害了李姑娘！");
			PlayerPerform("pause", 2);
			yx7 = 3;
			tx = now + 4;
		}
	}
	if(yx7==3&&now>tx)
	{
		v=1;
	}
	
	if(zs1==1)	
	{
		SetTarget(0, "waypoint", 12);
		SetTarget(1, "char", c);
		if (c>=0&&Distance(0, 1) <50)
		{
			RemoveNPC(c);
			PlayerPerform("say", "（遭了！被他跑了！）");
			zs1=2;
			tzs=now+2;
		}
	}
	if(zs1==2&&now>tzs)
	{
		
		v=1;
	}
	
	if(cq==1)
	{
		SetTarget(0, "waypoint", 13);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq=2;
			ct=now+2;
		}
	}
	if(cq==2&&now>ct)
	{
		v=1;
	}
	
	if(cq1==1)
	{
		SetTarget(0, "waypoint", 17);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq1=2;
			ct=now+2;
		}
	}
	if(cq1==2&&now>ct)
	{
		v=1;
	}
	
	if(cq2==1)
	{
		SetTarget(0, "waypoint", 22);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq2=2;
			ct=now+2;
		}
	}
	if(cq2==2&&now>ct)
	{
		v=1;
	}
	
	if(cq3==1)
	{
		SetTarget(0, "waypoint", 25);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq3=2;
			ct=now+2;
		}
	}
	if(cq3==2&&now>ct)
	{
		v=1;
	}	
	
	if(cq4==1)
	{
		SetTarget(0, "waypoint", 29);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq4=2;
			ct=now+2;
		}
	}
	if(cq4==2&&now>ct)
	{
		v=1;
	}
	
	if(cq5==1)
	{
		SetTarget(0, "waypoint", 32);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq5=2;
			ct=now+2;
		}
	}
	if(cq5==2&&now>ct)
	{
		v=1;
	}
	
	if(cq6==1)
	{
		SetTarget(0, "waypoint", 34);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq6=2;
			ct=now+2;
		}
	}
	if(cq6==2&&now>ct)
	{
		v=1;
	}
	
	if(cq7==1)
	{
		SetTarget(0, "waypoint", 36);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq7=2;
			ct=now+2;
		}
	}
	if(cq7==2&&now>ct)
	{
		v=1;
	}
	
	if(cq8==1)
	{
		SetTarget(0, "waypoint", 39);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq8=2;
			ct=now+2;
		}
	}
	if(cq8==2&&now>ct)
	{
		v=1;
	}
	
	if(cq9==1)
	{
		SetTarget(0, "waypoint", 41);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq9=2;
			ct=now+2;
		}
	}
	if(cq9==2&&now>ct)
	{
		v=1;
	}
	
	if(cq10==1)
	{
		SetTarget(0, "waypoint", 43);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq10=2;
			ct=now+2;
		}
	}
	if(cq10==2&&now>ct)
	{
		v=1;
	}
	
	if(cq11==1)
	{
		SetTarget(0, "waypoint", 45);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq11=2;
			ct=now+2;
		}
	}
	if(cq11==2&&now>ct)
	{
		v=1;
	}
	
	if(cq12==1)
	{
		SetTarget(0, "waypoint", 47);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq12=2;
			ct=now+2;
		}
	}
	if(cq12==2&&now>ct)
	{
		v=1;
	}
	
	if(cq13==1)
	{
		SetTarget(0, "waypoint", 50);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq13=2;
			ct=now+2;
		}
	}
	if(cq13==2&&now>ct)
	{
		v=1;
	}
	
	if(cq14==1)
	{
		SetTarget(0, "waypoint", 53);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq14=2;
			ct=now+2;
		}
	}
	if(cq14==2&&now>ct)
	{
		v=1;
	}
	
	if(cq15==1)
	{
		SetTarget(0, "waypoint", 57);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq15=2;
			ct=now+2;
		}
	}
	if(cq15==2&&now>ct)
	{
		v=1;
	}
	
	if(cq16==1)
	{
		SetTarget(0, "waypoint", 62);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq16=2;
			ct=now+2;
		}
	}
	if(cq16==2&&now>ct)
	{
		v=1;
	}
	
	if(cq17==1)
	{
		SetTarget(0, "waypoint", 66);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq17=2;
			ct=now+2;
		}
	}
	if(cq17==2&&now>ct)
	{
		v=1;
	}
	
	if(cq18==1)
	{
		SetTarget(0, "waypoint", 70);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq18=2;
			ct=now+2;
		}
	}
	if(cq18==2&&now>ct)
	{
		v=1;
	}
	
	if(cq19==1)
	{
		SetTarget(0, "waypoint", 72);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq19=2;
			ct=now+2;
		}
	}
	if(cq19==2&&now>ct)
	{
		v=1;
	}
	
	if(cq20==1)
	{
		SetTarget(0, "waypoint", 74);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq20=2;
			ct=now+2;
		}
	}
	if(cq20==2&&now>ct)
	{
		v=1;
	}
	
	if(cq21==1)
	{
		SetTarget(0, "waypoint", 78);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq21=2;
			ct=now+2;
		}
	}
	if(cq21==2&&now>ct)
	{
		v=1;
	}
	
	if(cq22==1)
	{
		SetTarget(0, "waypoint", 81);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq22=2;
			ct=now+2;
		}
	}
	if(cq22==2&&now>ct)
	{
		v=1;
	}
	
	if(cq23==1)
	{
		SetTarget(0, "waypoint", 83);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq23=2;
			ct=now+2;
		}
	}
	if(cq23==2&&now>ct)
	{
		v=1;
	}
	
	if(cq24==1)
	{
		SetTarget(0, "waypoint", 86);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq24=2;
			ct=now+2;
		}
	}
	if(cq24==2&&now>ct)
	{
		v=1;
	}
	
	if(cq25==1)
	{
		SetTarget(0, "waypoint", 90);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq25=2;
			ct=now+2;
		}
	}
	if(cq25==2&&now>ct)
	{
		v=1;
	}
	
	if(cq26==1)
	{
		SetTarget(0, "waypoint", 94);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq26=2;
			ct=now+2;
		}
	}
	if(cq26==2&&now>ct)
	{
		v=1;
	}
	
	if(cq27==1)
	{
		SetTarget(0, "waypoint", 98);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq27=2;
			ct=now+2;
		}
	}
	if(cq27==2&&now>ct)
	{
		v=1;
	}
	
	if(cq28==1)
	{
		SetTarget(0, "waypoint", 102);
		SetTarget(1, "char", player);
		if (Distance(0, 1) <=100)
		{
			PlayerPerform("say", "想走城墙？我岳飞岂会如此懦弱！");
			PlayerPerform("block", 1);
			cq28=2;
			ct=now+2;
		}
	}
	if(cq28==2&&now>ct)
	{
		v=1;
	}
	
	if(v==0&&GetHP(player)==0)
	{
		PlayerPerform("say", "师父……徒儿学艺不精……甘领责罚！");
		v=1;t5=now+6;
		
	}
	if(v==0&&GetHP(c40)==0)
	{
		Say(c40, "啊~!岳公子……来生……");
		v=1;t5=now+4;
		
	}
    if(v==2&&now>=t5)
	{
		gameover = 1;
		
	}
	if(v==1&&now>=t5)
	{
		gameover = -1;
		
	}
	if ((gameover==1 || gameover==-1))
	{
		GameOver(gameover);
		gameover = 2;
	}
}