<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="npc_chat.asp"-->
<!--#include file="../const2.asp"-->
<!--#include file="../const3.asp"-->
<!--#include file="../chk.asp"-->
<%Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
cwjh_name=Session("cwjh_name")
cwjh_grade=Session("cwjh_grade")
cwjh_jhdj=Session("cwjh_jhdj")
nowinroom=session("nowinroom")
cwjh_roominfo=split(Application("cwjh_room"),";")
chatinfo=split(cwjh_roominfo(nowinroom),"|")
if cwjh_name="" then Response.Redirect "../error.asp?id=440"
http = Request.ServerVariables("HTTP_REFERER") 
if InStr(http,"chat")=0 then 
	Response.Write "<script language=javascript>{alert('对不起，程序拒绝您的操作！！！\n     按确定返回！');}</script>" 
	Response.End 
end if
if cwjh_yjdh=1 then Chkyjdh()
allhttp=LCase(Request.ServerVariables("ALL_HTTP"))
if cwjh_disproxy=1 then Chkproxy()
'#####房间处理#####
cwjh_roominfo=split(Application("cwjh_room"),";")
chatinfo=split(cwjh_roominfo(nowinroom),"|")
useronlinename=Application("cwjh_useronlinename"&nowinroom)
if Instr(LCase(useronlinename),LCase(" "&cwjh_name&" "))=0 then 
	Session("cwjh_inthechat")="0" 
	Response.Redirect "chaterr.asp?id=001" 
end if 
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
sj=s & ":" & f & ":" & m
if DateDiff("n",Session("cwjh_savetime"),now())>=10 then
	Response.Write "<script Language=Javascript>parent.f3.location.href='savevalue.asp';</script>"
end if
sj2=n & "-" & y & "-" & r & " " & sj
if DateDiff("s",Session("cwjh_lasttime"),sj2)<2 then
Response.Write "<script language=JavaScript>{alert('有话慢慢说，别噎着哦！');}</script>"
Response.End
end if
t="<font class=t>(" & sj & ")</font>"
'是否被点穴
Application.Lock
if Instr(LCase(application("cwjh_dianxuename")),LCase(cwjh_name))>0 then
dianxue=split(application("cwjh_dianxuename"),";")
dxdx=0
for x=0 to UBound(dianxue)-1
dxname=split(dianxue(x),"|")
if dxname(0)=cwjh_name then
	if DateDiff("s",dxname(1),sj2)<60 then
		Response.Write "<script Language=Javascript>alert('你已被哑穴，不能做任何事啊！还剩" & 60-DateDiff("s",dxname(1),sj2) & "秒自动解开!');</script>"
		erase dianxue
		erase dxname
		response.end
	else
		application("cwjh_dianxuename")=replace(application("cwjh_dianxuename"),dianxue(x)&";","")
		Response.Write "<script Language=Javascript>alert('时间到了，你的哑穴自动解开了!');</script>"
		erase dianxue
		erase dxname
		response.end
	end if
end if
erase dxname
next
erase dianxue
end if
Application.UnLock
towho=Trim(Request.Form("towho"))
says=Trim(Request.Form("sy"))
if Instr("/屏蔽$/发招$/投掷$/下毒$/用卡$",left(says,4))=0 and cwjh_grade<6 then
 if Instr(LCase(application("qzld_pingbi")),LCase(";"&cwjh_name&"|"&towho&";"))>0 then
   Response.Write "<script Language=javascript>alert('您已经把人家屏蔽了，要对人家说话请先把人家从屏蔽名单中删除！');</script>"
  response.end
 elseif Instr(LCase(application("qzld_pingbi")),LCase(";"&towho&"|"&cwjh_name&";"))>0 then
   Response.Write "<script Language=javascript>alert('你的说话对象已经把你屏蔽了，你不能再对人家说话了！');</script>"
  response.end
 end if
end if
'是否暂离
'判断自己说话
if Instr(LCase(application("cwjh_zanli")),LCase("!"&cwjh_name&"!"))>0 and cwjh_grade<9 then
	Response.Write "<script Language=Javascript>alert('您正在“暂离”状态中，请使用“我回来啦”功能解除！');</script>"
	response.end
end if
'判断对方操作
if Instr(LCase(application("cwjh_zanli")),LCase("!"&towho&"!"))>0 and left(says,4)<>"/用卡$" and cwjh_grade<9 then
	cwjh_zanli=split(application("cwjh_zanli"),";")
	for x=0 to UBound(cwjh_zanli)
		dxname=split(cwjh_zanli(x),"|")
	if dxname(0)="!"&towho&"!" then
		Response.Write "<script Language=Javascript>alert('"&towho&"说："&dxname(1)&"');</script>"
		erase dxname
		erase cwjh_zanli
		response.end
	end if
	erase dxname
	next
	erase cwjh_zanli
end if
if towho="" then towho="大家"
if len(towho)>10 then towho=Left(towho,10)
if IsNumeric(left(towho,1))=true and right(towho,3)="级怪物" then
	isgw=true
else 
	isgw=false
end if
if Not(towho=Application("cwjh_automanname") or towho=Application("figo") or isgw=true or towho="大家" or Instr(useronlinename," "&towho&" ")<>0) then
Response.Write "<script Language=Javascript>alert('“" & towho & "”不在聊天室中，不能对其发言。');parent.f2.document.af.towho.value='大家';parent.f2.document.af.towho.text='大家';parent.m.location.reload();</script>"
Response.end
end if
act=0
towhoway=Request.Form("towhoway")
if towhoway<>1 then towhoway=0
addwordcolor=Request.Form("addwordcolor")
saycolor=Request.Form("saycolor")
addsays=Request.Form("addsays")
if towho="大家" or towho=cwjh_name then towhoway=0
if instr("," & Application("cwjh_admin") & ",","," & towho & ",")<>0 or towho=Application("cwjh_automanname") or towho=Application("figo") then towhoway=1
if len(says)>150 then says=Left(says,150)
if (says="" or says="//") then Response.End
if InStr(says,"□")<>0 or InStr(says,"&#63736")<>0 then Response.End
says=Replace(says,"&amp;","&")
says=lcase(says)
says=Replace(says,"&amp;","&")
says=lcase(says)
says=replace(says,"\","")
'屏蔽9级以下玩家的非法字眼
if cwjh_grade<9 then
says=replace(says,"&#","")
says=replace(says,"..","")
says=replace(says,"'","\'")
says=replace(says,chr(34),"\"&chr(34))
says=replace(says,chr(32),"")
says=replace(says,"　","")
says=Replace(says,"<"," ")
says=Replace(says,">"," ")
says=Replace(says,"\x3c"," ")
says=Replace(says,"\x3e"," ")
says=Replace(says,"\074"," ")
says=Replace(says,"\74"," ")
says=Replace(says,"\75"," ")
says=Replace(says,"\76"," ")
says=Replace(says,"&lt"," ")
says=Replace(says,"&gt"," ")
says=Replace(says,"\076"," ")
says=Replace(LCase(says),LCase("con"),"f2uck")
says=Replace(LCase(says),LCase("or"),"ｏｒ")
says=Replace(LCase(says),LCase("java"),"f2uck")
says=Replace(LCase(says),LCase("www"),"f2uck")
says=Replace(LCase(says),LCase("org"),"f2uck")
says=Replace(LCase(says),LCase("com"),"f2uck")
says=Replace(LCase(says),LCase("net"),"f2uck")
says=Replace(says,"qq","f2uck")
says=Replace(says,"pp","f2uck")
says=Replace(says,"200.","f2uck")
says=Replace(says,"ＷＷＷ","f2uck")
says=Replace(says,"ｗｗｗ","f2uck")
says=Replace(says,"asp","f2uck")
says=Replace(says,"jh","f2uck")
says=Replace(says,"去了可以当","f2uck")
says=Replace(says,"去了可以作","f2uck")
says=Replace(says,"有一个好江湖","f2uck")
says=Replace(says,"加入腾讯","f2uck")
says=Replace(says,"加我qq给你好处","f2uck")
says=Replace(says,"家我qq给你好处","f2uck")
says=Replace(says,"加我q给你好处","f2uck")
says=Replace(says,"家我q给你好处","f2uck")
says=Replace(says,"江湖","f2uck")
says=Replace(says,"江胡","f2uck")
says=Replace(says,"我是站长","f2uck")
says=Replace(LCase(says),LCase("http"),"f2uck")
maren=instr(says,"f2uck")
if maren<>0 then
Response.Write "<script Language=Javascript>location.href='autokick.asp';</script>"
Response.end
end if
end if
if cwjh_jhdj<10 then
if InStr(says,"q")<>0 then Response.End
if InStr(says,"Q")<>0 then Response.End
if InStr(says,"ｑ")<>0 then Response.End
if InStr(says,"加我")<>0 then Response.End
end if
'文字秀
Zshow=request("Zshow")
if Zshow="1" then
show=cwjh_Zshow
says=Plus_ChkPicWords(says)
Function Plus_ChkPicWords(strText)
	If IsNull(StrText) Then Exit Function
        StrText=Ucase(StrText)
        StrText=replace(StrText,chr(32),"")
        if left(StrText,5)="[IMG]" then
           Response.Write "<script Language=Javascript>alert('使用贴图请先关闭文字秀功能！');parent.f2.document.af.sytemp.value='';</script>"
           Response.end
        end if
        if len(StrText)>35 then
           Response.Write "<script Language=Javascript>alert('为了江湖运行速度，文字秀不得超出50个！');parent.f2.document.af.sytemp.value='';</script>"
           Response.end
        end if
	Dim PicWords,i
	PicWords = Split(show,"|")
	For i = 0 To Ubound(PicWords)
	   StrText = Replace(trim(StrText),PicWords(i),"[img]../picwords/"&picwords(i)&".gif[/img]")
	Next
	Plus_ChkPicWords = StrText
End Function
end if
'文字秀
'是否战斗等级大于18才可以贴图
if cwjh_jhdj>=18 and Instr(says," ")=0 and Instr(says,"[img]")<>0 then
if Instr(says,"[img]")<>0 then
if instr(says,"width")<>0 or instr(says,"height")<>0 then Response.End	
gsz=0
Do While Instr(says,"[img]")<>0
says=Replace(says,"[img]","<img src=pic/",1,1)
gsz=gsz+1
Loop
gsy=0
Do While Instr(says,"[/img]")<>0
says=Replace(says,"[/img]",">",1,1)
gsy=gsy+1
Loop
if gsz>gsy then says=says&">"
end if
end if
zj="<a href=javascript:parent.sw('[" & cwjh_name & "]'); target=f2><font color="&addwordcolor&">"& cwjh_name & "</font></a>"
br="<a href=javascript:parent.sw('[" & towho & "]'); target=f2><font color="&addwordcolor&">"& towho & "</font></a>"
if Left(says,2)="//" then
	says=Replace(says,"##",zj,1,3,1)
	says=Replace(says,"%%",br,1,3,1)
	says="<font color=" & sayscolor & ">" & zj & Trim(mid(says,3,len(says)-2)) & "</font>"
	act="命令"
end if
'删除了原来的表情
addsays=addsays
Session("cwjh_lasttime")=sj2
says=Replace(says,"\","\\")
says=Replace(says,"/","\/")
says=Replace(says,chr(34),"\"&chr(34))
if chatinfo(6)=0 then
'开始随机事件
randomize()
rnd1=int(rnd*400)+1
sayyq=""
'每小时15分可以发金币
if Minute(time())=15 then
if Application("cwjh_zzfafang")<>""  then
      zzfff=Application("cwjh_zzfafang")
       fffdata=split(zzfff,"|")
        ffsl=abs(int(clng(fffdata(0))))
        ffsj=fffdata(1)
       erase fffdata
    end if 
 if DateDiff("s",ffsj,now())>20 then
      sayyq="<bgsound src=wav/ling.wma loop=1><br><font color=red>【自动发放】每小时发放两个金币，请需要的人来拿，时效10秒。</font><input  type=button value='我要！' onClick=javascript:zsdzff"&rnd1&".disabled=1;window.open('sjfunc/zz_fafang.asp','d') name=zsdzff"&rnd1&">"
      Application.Lock
      Application("cwjh_zzfafang")="2|"&now()
      application("cwjh_zzffjl")=""
      Application.UnLock
 end if
end if
'以下是设置运气
if rnd1<=16 then
	chance=array("体力","内力","攻击","防御","武功","银两","魅力","道德","体力","内力","攻击","防御","武功","银两","魅力","道德")
	chancetxtgood=array("遇少林达摩禅师开坛讲法，##体力增加","武当百岁真人张三丰提拨后进，##内力增加","见血河卫悲回重回人间，突有领悟，##攻击增加","在梦里见到嫦娥舞袖，领悟到神妙步法，##防御增加","##喝醉了酒，却意外见到侠客岛赏善罚恶二使见赐腊八粥，武功增加","##正在街上行走，观赏MM，却不料有人硬塞给银两","##正在华山后挖蚯蚓，做梦也想不到会见到传说中的剑侠风清扬，魅力因此而增加","在风波亭北拜谒岳王墓，##道德增加","遇少林达摩禅师开坛讲法，##体力增加","武当百岁真人张三丰提拨后进，##内力增加","见血河卫悲回重回人间，突有领悟，##攻击增加","在梦里见到嫦娥舞袖，领悟到神妙步法，##防御增加","##喝醉了酒，却意外见到侠客岛赏善罚恶二使见赐腊八粥，武功增加","##正在街上行走，观赏MM，却不料有人硬塞给银两","##正在华山后挖蚯蚓，做梦也想不到会见到传说中的剑侠风清扬，魅力因此而增加","在风波亭北拜谒岳王墓，##道德增加")
	chancetxtbad=array("##长时间熬战江湖,以致精力不济，走路也摔跤,体力因此而下降了","##在路上见到了一个美丽的小姑娘，顿起不良之心，不料却被阿紫偷偷地化去了内力","##闭关苦练躺尸剑法，却不得要领，攻击只此而减少","可笑##没事想学学荆无命的自残剑法，最后只落得满身伤疤，防御因此而减少","##闲来无事逛了逛翠花楼，结果可想而知，武功下降了","##交友不慎,银两被骗去了","##在练武场认识了薛蟠，大谈武道，魅力因此而减少了","##途见空空儿，苦心拜师学艺，不料功夫没有学到，道德却下降了","##长时间熬战江湖,以致精力不济，走路也摔跤,体力因此而下降了","##在路上见到了一个美丽的小姑娘，顿起不良之心，不料却被阿紫偷偷地化去了内力","##闭关苦练躺尸剑法，却不得要领，攻击只此而减少","可笑##没事想学学荆无命的自残剑法，最后只落得满身伤疤，防御因此而减少","##闲来无事逛了逛翠花楼，结果可想而知，武功下降了","##交友不慎,银两被骗去了","##在练武场认识了薛蟠，大谈武道，魅力因此而减少了","##途见空空儿，苦心拜师学艺，不料功夫没有学到，道德却下降了")
	rnd2=int(rnd*400)-100
	if rnd2>0 then
		rndtxt=chancetxtgood(rnd1)&"<font color=#FF8800><b>+"& abs(rnd2) & "</b></font>"
	else
		rnd2=rnd2-1
		rndtxt=chancetxtbad(rnd1)&"<font color=#FF8800><b>-"&abs(rnd2)&"</b></font>"
	end if	
	Set conn=Server.CreateObject("ADODB.CONNECTION")
	conn.open Application("cwjh_usermdb")
	conn.execute "update 用户 set "&chance(rnd1)&"="&chance(rnd1)&"+"&rnd2&" where 姓名='" & cwjh_name &"'"
	conn.close
	set conn=nothing
	zj="<font color="&addwordcolor&">"& cwjh_name & "</font>"
	sayyq="<font color=FF0000>【传闻】"&Replace(rndtxt,"##",zj,1,3,1)&"</font><font class=t>("&time&")</font>"
else
select case rnd1
case 18
banner="本站江湖采用酷屋江湖V9.2版本,想体验一下站长的生活，请去官方站购买最新江湖程序!; 一个最公平的江湖,在我们的江湖绝对不会乱调状态,为大家创造一个良好的休闲环境; 本站官府尽职尽责，如果有不满意的地方，请去论坛站务管理处投拆或发表意见！"
banners=Split(Trim(banner),";",-1)
total=UBound(banners)
randomize timer
x=int(rnd*(total+1))
sayyq="<bgsound src=wav/luo.wav loop=3><table align=center><td><table border=0 cellpadding=0 cellspacing=0 ><tr><td><img src=../chat/f2/img/rightct3.gif></td><td background=../chat/f2/img/rightct4.gif></td><td><img  src=../chat/f2/img/rightct1.gif></td></tr><tr><td background=../chat/f2/img/rightct8.gif ></td><td valign=center align=center><table align=center border=0 cellpadding=1 cellspacing=0 ><tr><td valign=center align=center><font style='font-size:9pt;color:red'>========官府公告========</font></td></tr><tr><td valign=center align=center><font style='font-size:9pt;color:green'>"&banners(x)&"</td></tr></table></td><td background=../chat/f2/img/rightct08.gif></td></tr><tr><td><img src=../chat/f2/img/rightct9.gif></td><td background=../chat/f2/img/rightct10.gif></td><td><img src=../chat/f2/img/rightct11.gif></td></tr></table></td></table>"
case 20,25
	useronlinename=Application("cwjh_useronlinename"&nowinroom)
	online=Split(Trim(useronlinename)," ",-1)
	x=UBound(online)
	Set conn=Server.CreateObject("ADODB.CONNECTION")
	conn.open Application("cwjh_usermdb")
        randomize timer
        rnd22=int(rnd*4)+1
        select case rnd22
        case 1
			randomize timer
			s=int(rnd*10000)
			for i=0 to x
				conn.Execute "update 用户 set 银两=银两+" & s & " where 姓名='" & online(i) & "'"
			next
			sayyq="<bgsound src=wav/zt.mid loop=1><font color=green>【系统发钱】</font><font color=#ff0000>考虑到灾民过多,官府决定开仓放粮,向聊天室的每个人发了"& s &"两解决灾情！</font>"
        case 2
			for i=0 to x
				conn.Execute "update 用户 set 金币=金币+1 where 姓名='" & online(i) & "'"
			next
			sayyq="<bgsound src=wav/zt.mid loop=1><font color=green>【系统金币】</font><font color=#ff0000>站长今天中了大奖,心中高兴，特为聊天室的每个人发了金币1个！</font>"
        case 3
			mm=50
			for i=0 to x
				conn.Execute "update 用户 set allvalue=allvalue+" & mm & " where 姓名='" & online(i) & "'"
			next
			sayyq="<bgsound src=wav/zt.mid loop=1><font color=green>【系统经验】</font><font color=#ff0000>站长路过此地，不忍看到各位大小虾如此苦练，特为聊天室的每个人发放经验" & mm & "点！</font>"
        case 4
			randomize timer
			s=int(rnd*150)
			for i=0 to x
				conn.Execute "update 用户 set 泡豆点数=泡豆点数+" & s & " where 姓名='" & online(i) & "'"
			next
			sayyq="<bgsound src=wav/zt.mid loop=1><font color=green>【捡豆子】</font><font color=#ff0000>不知谁的袋子漏了，豆子撒了一地，在坐的各位每人捡到了" & s & "点！</font>"
        end select
case 27,30
	s=int(rnd*20000)
	Application.Lock
	Application("cwjh_blh")=s+10000
	Application.UnLock
	abc="<a href='fafang/blh.asp?tl="&Application("cwjh_blh")&"' target='d'><img src='img/blh.gif' border='0'></a>"
	sayyq="【消息】平地里突然刮起一阵腥风，一只<font color=red>白老虎</font>冲进了聊天室四处伤人。官府发出悬赏令，打死白老虎者有重奖。白老虎体力：<font color=red>"&s+10000&"</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 35,39
	s=int(rnd*20000)
	Application.Lock
	Application("cwjh_jx")=s+17000
	Application.UnLock
	abc="<a href='fafang/jx.asp?tl="&Application("cwjh_jx")&"' target='d'><img src='img/jx.gif' border='0'></a>"
	sayyq="【消息】一只百年巨蝎修练成精，跑下山来伤人。大家快打呀......巨蝎体力："&s+17000&"</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 41,43
	s=int(rnd*20000)
	Application.Lock
	Application("cwjh_hx")=s+10000
	Application.UnLock
	abc="<a href='fafang/hx.asp?tl="&Application("cwjh_hx")&"' target='d'><img src='img/hx.gif' border='0'></a>"
	sayyq="【消息】动物园饲养员玩忽职守，忘了关熊圈，一只<font color=red>黑熊</font>跑出了熊圈，大家快抓呀。黑熊生命力：</font>"&s+10000&"</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 48,55
		jstl=int(rnd*50000)+10000
		Application.Lock
		Application("cwjh_kl")=jstl
		Application.UnLock
		abc="<a href='fafang/kl.asp?tl="&Application("cwjh_kl")&"' target='d'><img src='img/gui.GIF' border='0'></a>"
		sayyq="<font color=red>【消息】突然间阴风陈陈……“僵尸呀！”一女子尖叫，一头僵尸闯进聊天室，僵尸体力：+"&jstl&"</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 60,66,70
		Application.Lock
		Application("cwjh_dalie")="老虎"
		Application.UnLock
		sayyq="<font color=red>【消息】</font><font color=red>突然一只野兽<img src=img/laohu.gif>窜入江湖中伤人，请高手们快去打猎啊。</font>"
case 90,91,98,120
		jstl=int(rnd*50000)+100
		Application.Lock
		Application("cwjh_yb")=jstl
		Application.UnLock
		abc="<a href='fafang/yb.asp?tl="&Application("cwjh_yb")&"' target='d'><img src='img/251.GIF' border='0'></a>"
		sayyq="<font color=red>【消息】今天是什么日子，突然间从天上掉下来一个大元宝，价值：+"&jstl&"两!</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 130,135
		jstl=int(rnd*50000)+10000
		Application.Lock
		Application("cwjh_yb")=jstl
		Application.UnLock
		abc="<a href='fafang/yb.asp?tl="&Application("cwjh_yb")&"' target='d'><img src='img/251.GIF' border='0'></a>"
		sayyq="<font color=red>【消息】今天真是好日子，"&Application("cwjh_user")&"中了江湖风采头等奖，500万呀！给聊天室兄弟们一个大红包，价值：+"&jstl&"两!</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 160,170
		jstl=int(rnd*50000)+10000
		Application.Lock
		Application("cwjh_kl")=jstl
		Application.UnLock
		abc="<a href='fafang/boy.asp?tl="&Application("cwjh_kl")&"' target='d'><img src='img/p42.gif' border='0'></a>"
		sayyq="<font color=red>【消息】一个衰哥听说这个江湖的美女特别多，跑到江湖想泡美女，大家准备好棒子打呀。打跑了官府有奖。。衰哥体力：+"&jstl&"</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 180,182
		jstl=int(rnd*50000)+100000
		Application.Lock
		Application("cwjh_qi")=jstl
		Application.UnLock
		abc="<a href='fafang/qi.asp?tl="&Application("cwjh_qi")&"' target='d'><img src='img/tank.gif' border='0'></a>"
		sayyq="<font color=red>【消息】一把精制手枪闯进江湖，江湖人士看了目瞪口呆，也不知道这是什么东西。都先打了在说。。精制手枪体力：+"&jstl&"</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 190
		rftl=int(rnd*50000)+10000
		Application.Lock
		Application("cwjh_kl")=rftl
		Application.UnLock
		abc="<a href='fafang/rf.asp?tl="&Application("cwjh_kl")&"' target='d'><img src='img/rf.GIF' border='0'></a>"
		sayyq="<font color=#FF6600>【江湖任务】捉拿人贩子:叶三娘(ye sanniang)：“可恶的人贩子，把我那可怜的孩儿拐到哪里去啦？要是再找不到的话，我就见一个孩子杀一个。”人贩子体力：+"&rftl&"</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 200
		piaoke=int(rnd*50000)+10000
		Application.Lock
		Application("cwjh_kl")=piaoke
		Application.UnLock
		abc="<a href='fafang/piaoke.asp?tl="&Application("cwjh_kl")&"' target='d'><img src='img/piaoke.GIF' border='0'></a>"
		sayyq="<bgsound src=wav/FAQIAN.wav loop=1><font color=#FF6600>【江湖任务】抓小偷任务开始：这年头江湖也不平静啊！居然有位贼头贼脑的小偷闯入江湖，谁把他逮住必有重谢！”</font><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 230
if Application("cwjh_baowu")>0 and cwjh_grade<6 then 
   Set conn=Server.CreateObject("ADODB.CONNECTION") 
   Set rs=Server.CreateObject("ADODB.RecordSet") 
   conn.open Application("cwjh_usermdb") 
   rs.open "select id,姓名,宝物,等级,门派,身份 from 用户 where 宝物='" & Application("cwjh_baowuname") & "'",conn 
   if rs.eof or rs.bof  then 
    rs.close 
    rs.open "select 门派 from 用户 where 姓名='"&cwjh_name&"'" 
    if rs("门派")="出家" then 
     sayyq1="[江湖消息]：##在江湖道上偶然见到了江湖至宝<img src=img/z1.gif><font color=red>"& Application("cwjh_baowuname")&"</font>，但由于自己是个出家人，出家人戒贪，只好看了一眼宝物，悻悻然而去~~~！" 
     sayyq=Replace(sayyq1,"##",zj,1,3,1)  
    else 
     conn.execute  "update 用户 set 保护=false,宝物修练=0,宝物='"& Application("cwjh_baowuname") &"' where 姓名='" & cwjh_name &"'" 
     sayyq1="[江湖消息]：##现在拥有江湖至宝<img src=img/z1.gif><font color=red>"& Application("cwjh_baowuname")&"</font>" & Application("cwjh_baowusm") &"各位侠士互相争夺！" 
     sayyq=Replace(sayyq1,"##",zj,1,3,1)  
    end if 
   else 
    baouser=rs("姓名") 
    baowuid=rs("id") 
    if Instr(LCase(Application("cwjh_useronlinename"&nowinroom))," "&LCase(baouser)&" ")=0 then 
     conn.execute  "update 用户 set 宝物='无',宝物修练=0 where 姓名='"& baouser &"'" 
    else 
     sayyq1="[江湖消息]：江湖宝物<img src=img/z1.gif><font color=red>"& Application("cwjh_baowuname")&"</font>已被["&rs("门派")&"]"&rs("身份")&baouser&"夺走，各位大侠还不去抢..." 
     sayyq=Replace(sayyq1,"##",zj)  
    end if 
   end if 
   rs.close 
   set rs=nothing 
   conn.close 
   set conn=nothing 
  end if
case 233,235,238,250
'取江湖笑话
Set Conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_submdb")
'取笑话的记录条数
sql="select count(id) from 笑话"
set rs=Conn.execute(sql)
jokecount=rs(0)
randomize
rand=Int(jokecount * Rnd +1 )
sql="select * from 笑话 where id=" & rand & ""
set rs=Conn.execute(sql)
joke=rs("类型")&":"&rs("题目")&":"&rs("文章")
rs.close
set rs=nothing
conn.close
set conn=nothing
joke=replace(joke,chr(13),"")
joke=replace(joke,chr(10),"")
                Application.Lock
                Application("cwjh_joke")=joke
                Application.UnLock
                sayyq="<bgsound src=wav/haha.wav loop=1><img src=img/joke.GIF><font color=009933>〖开心一笑〗</font><img src=img/jokepic.GIF><font color=666666>" & Application("cwjh_joke") & "</font>"			'聊天数据
case 265,270
		jstl=int(rnd*2)+1
		Application.Lock
		Application("cwjh_jinbi")=jstl
		Application.UnLock
		abc="<a href='fafang/bxinshou.asp?tl="&Application("cwjh_jinbi")&"' target='d'><img src='img/xinshou.GIF' border='0'></a>"
		sayyq="<bgsound src=wav/xinshou.wav loop=1><font color=#000000>【照顾新手】</font><b><font color=red>有新朋友来江湖了，站长说：介绍朋友来、照顾新人者奖:+"&jstl&"个金币!</font></b><br><marquee width=100% behavior=alternate scrollamount=15>"&abc&"</marquee>"
case 280,289,295,305
'自动出题开始
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_submdb")
'取题库记录数
sql="select count(id) from 题库 "
set rs=Conn.execute(sql)
askcount=rs(0)
randomize
rand=Int(askcount * Rnd +1 )
sql="select * from 题库 where id=" & rand & ""
set rs=Conn.execute(sql)
ask=rs("类型")&":"&rs("问题")
reply=rs("回答")
rs.close
set rs=nothing
conn.close
set conn=nothing
ask=replace(ask,chr(13),"")
ask=replace(ask,chr(10),"")
                Application.Lock
                Application("cwjh_ask")=ask
                Application("cwjh_reply")=reply
                Application("cwjh_askuser")="机器人"
                Application("cwjh_asksilver")=int(rnd*9999)+100000
                Application.UnLock
                sayyq="<bgsound src=wav/zhanfa.wav loop=1>【系统出题】<font color=balck>" & Application("cwjh_ask") & "？ </font>正确答案是什么？[提问人]:<font color=red>["&Application("cwjh_askuser")&"]</font><font color=green>奖励："&Application("cwjh_asksilver")&"两!</font>"
end select			
end if
end if
if sayyq<>"" then
	sayyq=replace(sayyq,"'","\'")
	sayyq=replace(sayyq,chr(34),"\"&chr(34))
	act="运气"
	saystr="<"&"script>parent.sh("& chr(39) & addwordcolor & chr(39) &","& chr(39) & saycolor & chr(39) &","& chr(39) & act & chr(39) &","& chr(39) & cwjh_name & chr(39) &","& chr(39) & addsays & chr(39) &","& chr(39) & towho & chr(39) &"," & chr(39) & sayyq & chr(39) &",0," & nowinroom & ");<"&"/script>"
	AddMsg SayStr
end if
if act<>"命令" then act="正常"
says=replace(says,chr(39),"\'")
says=replace(says,chr(34),"\"&chr(34))
says=says&t
saystr="<"&"script>parent.sh("& chr(39) & addwordcolor & chr(39) &","& chr(39) & saycolor & chr(39) &","& chr(39) & act & chr(39) &","& chr(39) & cwjh_name & chr(39) &","& chr(39) & addsays & chr(39) &","& chr(39) & towho & chr(39) &"," & chr(39) & says & chr(39) &"," & towhoway & "," & nowinroom & ");<"&"/script>"
AddMsg SayStr
For i = 1 to Application("SayCount")-Session("SayCount")
	Response.Write Application("SayStr"&YuShu((Session("SayCount")+i)))
Next
session("SayCount")=Application("SayCount")
Response.Write "<script Language=JavaScript>"
Response.Write "parent.f1.scrollWindow();"
Response.Write "</script>"
Function Yushu(a)
	Yushu=(a and 31)
End Function
Sub AddMsg(Str)
	Application.Lock()
	Application("SayCount")=Application("SayCount")+1
	i="SayStr"&YuShu(Application("SayCount"))
	Application(i)=Str
	Application.UnLock()
End Sub
%>