<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="sjfunc.asp"-->
<!--#include file="func.asp"-->
<!--#include file="../../mywp.asp"-->
<!--#include file="../../const3.asp"-->
<%
cwjh_roominfo=split(Application("cwjh_room"),";")
nowinroom=session("nowinroom")
chatroomnum=ubound(cwjh_roominfo)-1
onlinenow=0
for i=0 to chatroomnum	
	online=split(trim(Application("cwjh_useronlinename"&i)),"  ")
	onlinenum=ubound(online)+1
	onlinenow=onlinenow+onlinenum
chatinfo=split(cwjh_roominfo(nowinroom),"|")
useronlinename=Application("cwjh_useronlinename"&nowinroom)
onlinekill=cwjh_onlinekill
if onlinenow<onlinekill and chatinfo(0)<>cwjh_chat1 and chatinfo(0)<>cwjh_chat2 then
	Response.Write "<script language=JavaScript>{alert('提示:非恩怨房在线低于"&onlinekill&"人不得动武！');}</script>"
	Response.End
end if
next
%>
<%'发招(比拼内力)
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")
%>
<!--#include file="pkif.asp"-->
<%
if cwjh_jhdj<jhdj_fz then
	Response.Write "<script language=JavaScript>{alert('提示：发招需要["&jhdj_fz&"]级以上才可以操作！');}</script>"
	Response.End
end if
if Instr(LCase(Application("cwjh_useronlinename"&nowinroom)),LCase(" "&cwjh_name&" "))=0 then 
	Session("cwjh_inthechat")="0" 
	Response.Redirect "chaterr.asp?id=001" 
end if 
towho=Trim(Request.Form("towho"))
towhoway=Request.Form("towhoway")
saycolor=Request.Form("saycolor")
addwordcolor=Request.Form("addwordcolor")
addsays=Request.Form("addsays")
says=Trim(Request.Form("sy"))
'对暂离开、点哑穴判断
call dianzan(towho)
if len(says)>150 then says=Left(says,150)
says=lcase(says)
says=Replace(says,"&amp;","&")
'对系统禁止字符处理
if cwjh_grade<9 then
says=bdsays(says)
end if
act=1
towhoway=0
i=instr(says,"$")
fnn1=mid(says,i+1)
'判断对npc操作
if IsNumeric(left(towho,1))=true and right(towho,3)="级怪物" then
	isgw=true
else 
	isgw=false
end if
if InStr(";" & Application("cwjh_npc"), ";" & towho & "|")<>0 then
   pk="【NPC攻击】"
elseif isgw=true then
   pk="【["&cwjh_name&"]杀怪】"
else
   pk="【动武】"
end if
'判断对npc操作
says="<font color=red>"&pk&"<font color=" & saycolor & ">"+attack(mid(says,i+1),towho)+"</font>"
call chatsay("发招",towhoway,towho,saycolor,addwordcolor,addsays,says)
function attack(fn1,to1)
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_usermdb")
rs.open "select * from 用户 where 姓名='" & to1 &"'",conn,2,2
if rs.eof then
   rs.close
   rs.open "select * from [npc] where n姓名='" & to1 &"'",conn,2,2
   if rs.eof then
      rs.close
      rs.open "select * from [怪物区] where 怪物='" & to1 &"'",conn,2,2
      if rs.eof then
         wt=""
      else
         wt="guaiwu"
      end if
   else
      wt="npc"
   end if
else
   wt="ren"
end if
rs.close
select case wt
case "npc"
'开始判断npc
rs.open "select * from npc where n姓名='" & to1 &"'",conn,2,2
if rs.eof or rs.bof then
        rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('提示：NPC["&to1&"]并不存在或者它不是NPC你搞错了吧！');}</script>"
	Response.End	
end if
if rs("n体力")<0 then
        rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
'删除在线NPC名单
nowinroom=session("nowinroom")
Application.Lock
onlinelist=Application("cwjh_onlinelist"&session("nowinroom"))
onno=ubound(onlinelist)
for i=1 to onno
if InStr(onlinelist(i),to1 & "|")=1 then
  for j=i to onno-1
   onlinelist(j)=onlinelist(j+1)
  next
  ReDim Preserve onlinelist(onno-1)
  exit for
 end if
next
Application("cwjh_onlinelist"&nowinroom)=onlinelist
Application("cwjh_useronlinename"&nowinroom)=Replace(Application("cwjh_useronlinename"&nowinroom)," " & to1 & " ","")
Application("cwjh_npc")=Replace(Application("cwjh_npc"),";"&to1&"|","")
Application.UnLock
response.write "<script Language=Javascript>parent.m.location.reload();</script>"
attack="##:NPC已经无力反抗了，官府已经收回！"
exit function
end if
rs.close
rs.open "select * from 用户 where 姓名='" & cwjh_name &"'",conn,2,2
if rs("保护")=True and cwjh_grade<10 then
    attack="##:你正在保护中，请不要对NPC进行攻击！"
    exit function
end if
if rs("门派")="出家" then
    attack="##:你是出家人，不能参与NPC打架！"
    exit function
end if
yxjfyfrom=rs("防御")
yxjgjfrom=rs("攻击")
yxjwgfrom=rs("武功")
yxjdjfrom=rs("等级")
nlfrom=rs("内力")
menpai=rs("门派")
rs.close
'开始武功
rs.open "select id,c,d,e,f,g FROM y WHERE a='" & trim(fn1) & "' and b='" & menpai & "'",conn
if rs.eof or rs.bof then
    attack="##:你的门派:"&menpai&"并没有这样的武功["&fn1&"]呀！"
    exit function
end if
wgid=int(rs("id"))
wgwg=int(rs("c"))
wgnl=int(rs("d"))
wgdj=int(sqr(rs("e")/100))+1
wgsm=rs("f")
if rs("g")="随机" then
	randomize timer
	gif="<img src=../jhmp/gif/wg"& int(rnd*130)+1 &".gif height=70>"
else
	gif="<img src=../jhmp/gif/"& rs("g")&" height=70>"
end if
if rs("c")>nlfrom or rs("d")>yxjwgfrom then
    attack="##:您的内力或武功不足，不能对npc进行攻击！先补一补吧！"
    exit function
end if
rs.close
'对NPC的判断
rs.open "select * from npc where n姓名='" & to1 &"'",conn
to1=rs("n姓名")
yxjgjto=rs("n攻击")
yxjfyto=rs("n防御")
yxjwgto=rs("n武功")
yxjdjto=int(sqr(int(rs("n经验")/50)))
nlto=rs("n内力")
nzhuren=rs("n主人")
ndiren=rs("n敌人")
sj=DateDiff("n",rs("n复活时间"),now())
rs.close
'判断主人
if nzhuren=cwjh_name then
    attack="##:NPC%%是你的部下，你不能对它攻击，不怕它背叛你吗？"
    exit function
end if
'判断敌人
if sj>5 then
if ndiren<>cwjh_name and ndiren<>"无" and Instr(LCase(useronlinename),LCase(" "&ndiren&" "))<>0 then
    attack="##:NPC%%正和"&ndiren&"打架中，请不要插手，不然%%咬死你！"
    exit function
end if
end if
randomize timer
ki=int(rnd*6)+4
killer=int(((yxjgjfrom+yxjwgfrom+yxjfyfrom)-(yxjfyto+yxjgjto+yxjwgto)*(yxjdjfrom/yxjdjto))/ki)+wgwg+wgnl+wgdj*100
if killer>0 then
	conn.execute "update 用户 set 道德=道德-20,内力=内力-" & abs(wgnl) & ",武功=武功-"& abs(wgwg) &",体力=体力-"& int(killer/30) & " where 姓名='" & cwjh_name &"'"
	conn.execute "update npc set n体力=n体力-"&int(killer/15)&",n敌人='"&cwjh_name&"',n复活时间=now(),n攻击时间=now() where n姓名='" & to1 &"'"
	djinfo="##武功高强"
        mekill=abs(int(killer/30))
        killer=int(killer/15)
else
	if abs(killer)>5000 then killer=5000
        killer=int(abs(killer)/10)
	mekill=killer*10
        conn.execute "update 用户 set 道德=道德-20,内力=内力-" & abs(wgnl) & ",武功=武功-"& abs(wgwg) &",体力=体力-"&mekill&" where 姓名='" & cwjh_name &"'"
	conn.execute "update npc set n体力=n体力-"&killer&",n敌人='"&cwjh_name&"',n复活时间=now(),n攻击时间=now() where n姓名='" & to1 &"'"
	djinfo="##武功技不如人"
end if
rs.open "select 体力 from 用户 where 姓名='" & cwjh_name &"'",conn,2,2
randomize timer
wav=int(rnd*23)+1
mywav="wav"&wav&".wav"
randomize timer
dz=int(rnd*9)+1
select case dz
case 1
 dz_ok="天下无狗"
case 2
 dz_ok="拨狗朝天"
case 3
 dz_ok="棒打双犬"
case 4
 dz_ok="乾坤借法"
case 5
 dz_ok="昆山叠掌"
case 6
 dz_ok="金蛇吐雾"
case 7
 dz_ok="天外飞龙"
case 8
 dz_ok="破玉拳"
case 9
 dz_ok="神剑伏魔"
end select
if rs("体力")<-100 then
	attack="##<bgsound src=wav/gj/"&mywav&" loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"%%,[<font color=red><b>"&djinfo&"</b></font>]使得NPC[%%]体力下降:<font color=red>-"& killer &"</font>点,自己被怪兽[%%]有了一招<fonr color=red>["&dz_ok&"]</font>,使得体力下降:<font color=red>-"& mekill &"</font>点,##武技不如人，被%%活活咬死……"
        conn.execute "update npc set n敌人='无' where n姓名='" & to1 &"'"
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
        call boot(cwjh_name,"被NPC咬死，操作者："&cwjh_name&",["&menpai&"]唉，技不如人"&fn1)
	exit function
end if
rs.close
rs.open "select * from npc where n姓名='" & to1 &"'",conn,2,2
zlwp=rs("n物品")
zlyl=rs("n银两")
n_jy=rs("n经验")
n_dj=int(sqr(int(rs("n经验")/50)))
n_baochu=(n_dj/cwjh_jhdj)*1000
n_jjy=int((n_dj/cwjh_jhdj)*500)
add_type=rs("n物品类型")
nzhuren=rs("n主人")
if zlyl>0 then
   njy="<font color=red>【NPC加血】<font color=" & saycolor & ">NPC[%%]花了"&zlyl&"银白银，补足了体力<font color=red>"&zlyl*0.01&"</font>点。<br>"
   conn.execute "update npc set n银两=0,n体力=n体力+"&zlyl*0.01&" where n姓名='" & to1 &"'"
end if
if rs("n体力")>-100 then
	attack="##<bgsound src=wav/gj/"&mywav&" loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"%%,[<font color=red><b>"&djinfo&"</b></font>]使得NPC[%%]体力下降:<font color=red>-"& killer &"</font>点。<br>"
        attack=attack&njy&"<font color=red>【NPC反击】<font color=" & saycolor & ">由于##惹到了NPC[%%]，NPC[%%]奋一切力量，使出了一招<font color=red>["&dz_ok&"]</font>，使得##体力下降:<font color=red>-"& mekill &"</font>点."
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	exit function
end if
'是否有暴出物品
if n_baochu>=Application("cwjh_npcwp") then
'暴出物品
data1=split(zlwp,";")
data2=ubound(data1)
for kk=0 to data2-1
    data3=split(data1(kk),"|")
    wp_sl=data3(1)
    wp_name=trim(data3(0))
    Application.Lock
    Application("npc_wp"&kk)=1
    Application.UnLock
    randomize()
    regjm=int(rnd*3348998)
    wp_list=wp_list&"<input type=button value='"&wp_name&"|"&wp_sl&"个' name=npc"&regjm&" style='background-color:#86A231;color:FFFFFF;border: 1 double' onClick=javascript:npc"&regjm&".disabled=1;window.open('npc_wp.asp?dj="&cwjh_jhdj&"&wp_name="&wp_name&"&wp_sl="&wp_sl&"&kk="&kk&"&wp_type="&add_type&"','d','scrollbars=0,resizable=0,width=450,height=500')> "
next
    '是否有特殊装备
     if cwjh_jhdj<n_dj then
       rs.close
       rs.open "SELECT * FROM x where f='锻造' order by g",conn,1,2
       wp_count=rs.recordcount+2
       randomize timer
       wp_rnd=int(rnd*wp_count)+1
       if wp_rnd<rs.recordcount then
          rs.moveFirst
          rs.move wp_rnd
          wp_jian=rs("a")
       else
          wp_jian="无"
       end if
       if wp_jian<>"无" then
        rs.close
        rs.open "select * from 用户 where 姓名='" & cwjh_name &"'",conn,2,2
        zstemp=add(rs("w3"),wp_jian,1)
        conn.execute "update 用户 set w3='"&zstemp&"' where  姓名='"&cwjh_name&"'"
        jian="<font color=red><b>##得到一把"&wp_jian&"！</b></font>"
       else
        jian="<font color=red><b>##只见到一把不寻常的宝剑瞬间消失了，唉，只怪自己运气不好！</b></font>"
       end if
     end if 
conn.execute "update npc set n敌人='"&cwjh_name&"',n死次数=n死次数+1,n死亡时间='"&now()&"' where n姓名='" & to1 &"'"
attack="##<bgsound src=wav/daipu.wav loop=1>用["& menpai&"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"NPC[%%],%%哪是##的对手，已经奄奄一息.."&jian&"[%%]身上所有物品四分五裂，撒落了一地，大家快抢呀！"&wp_list
'战利品
else
  attack="##<bgsound src=wav/daipu.wav loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"NPC[%%],%%哪是##的对手，已经奄奄一息...但是，没得到任何东西！"
end if
conn.execute "update 用户 set allvalue=allvalue+"&n_jjy&" where 姓名='" &cwjh_name&"'"
attack=attack&"<br><font color=ff0099>【恭喜】</font>##打死了NPC人物%%，经验值上升<font color=red>"&n_jjy&"</font>点。"
'删除在线NPC名单
nowinroom=session("nowinroom")
Application.Lock
onlinelist=Application("cwjh_onlinelist"&session("nowinroom"))
onno=ubound(onlinelist)
for i=1 to onno
if InStr(onlinelist(i),to1 & "|")=1 then
  for j=i to onno-1
   onlinelist(j)=onlinelist(j+1)
  next
  ReDim Preserve onlinelist(onno-1)
  exit for
 end if
next
Application("cwjh_onlinelist"&nowinroom)=onlinelist
Application("cwjh_useronlinename"&nowinroom)=Replace(Application("cwjh_useronlinename"&nowinroom)," " & to1 & " ","")
Application("cwjh_npc")=Replace(Application("cwjh_npc"),";"&to1&"|","")
Application.UnLock
response.write "<script Language=Javascript>parent.m.location.reload();</script>"
case "ren"
rs.open "select 转生 from 用户 where 姓名='" & cwjh_name &"'",conn
zstt=rs("转生")
rs.close
rs.open "select 门派,等级,保护,grade,宝物,死亡时间,登录 from 用户 where 姓名='" & to1 &"'",conn,2,2
dlsj=DateDiff("n",rs("登录"),now())
if dlsj<2 and cwjh_grade<10 then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，%%上线还没到2分钟啊！"
        exit function
end if
if rs("门派")="出家" and cwjh_grade<10 then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，他是出家人！"
        exit function
end if
if rs("门派")="官府" and cwjh_grade<6 then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
        attack="##，你不能对官府的[%%]进行攻击！"
        exit function
end if
sj=DateDiff("n",rs("死亡时间"),now())
if sj<15 and rs("宝物")="无" and cwjh_grade<10 then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，他刚刚被别人杀死，还是先放过他吧！"
        exit function
end if
if rs("等级")<=18 and rs("宝物")="无" and cwjh_grade<10 then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，不要对初入江湖新手操作！"
        exit function
end if
if rs("保护")=True and cwjh_grade<10 and zstt<3 then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，对方正在练功保护请不要偷袭!"
        exit function
end if
rs.close
rs.open "select 门派,保护,防御,攻击,武功,内力,门派,杀人数,暴豆时间,grade,死亡时间,登录,z1,z2,z3,z4,z5,z6 from 用户 where 姓名='" & cwjh_name &"'",conn
if rs("门派")="出家" and cwjh_grade<10 then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，你是出家人不可以操作!"
        exit function
end if
dlsj=DateDiff("n",rs("登录"),now())
if dlsj<2 and cwjh_grade<10 then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，你上线还不到2分钟就不要再杀人了！"
        exit function
end if
if rs("保护")=True and cwjh_grade<10 then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，你正在练功保护请不要发招！"
        exit function
end if
if rs("杀人数")>=int(Application("cwjh_killman"))  and cwjh_grade<10 then
	conn.execute "update 用户 set 保护=false where 姓名='" & cwjh_name &"'"
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
        attack="##，你不能对%%进行攻击，你作恶太多，超过江湖杀人上限"& Application("cwjh_killman") &"不能再发招了！"
        exit function
end if
sj=DateDiff("n",rs("暴豆时间"),now())
xinxi=""
baodoudj=1
if sj<=60 then
	xinxi="<font color=red><b>威力爆满</b></font>"
	baodoudj=3
end if
yxjfyfrom=rs("防御")
yxjgjfrom=rs("攻击")
yxjwgfrom=rs("武功")
nlfrom=rs("内力")
menpai=rs("门派")
z1=null
z2=null
z3=null
z4=null
z5=null
z6=null
'取出自己装备武器的攻击及特性(并且所有武器耐久-1
if not(isnull(rs("z1"))) and instr(rs("z1"),"|")<>0 then
	data=split(rs("z1"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z1=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z1=null
			wpsm="##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z2"))) and instr(rs("z2"),"|")<>0 then
	data=split(rs("z2"),"|")
	if ubound(data)=5 then	
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z2=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z2=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z3"))) and instr(rs("z3"),"|")<>0 then
	data=split(rs("z3"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z3=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z3=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z4"))) and instr(rs("z4"),"|")<>0 then
	data=split(rs("z4"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z4=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z4=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z5"))) and instr(rs("z5"),"|")<>0 then
	data=split(rs("z5"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		yxjtx=data(4)
		gjtx="<font color=red><b>["&data(0)&"]</b></font>"
		if (clng(data(1))-1)>0 then
			z5=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z5=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z6"))) and instr(rs("z6"),"|")<>0 then
	data=split(rs("z6"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z6=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z6=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
conn.execute "update 用户 set z1='"&z1&"',z2='"&z2&"',z3='"&z3&"',z4='"&z4&"',z5='"&z5&"',z6='"&z6&"' where  姓名='"&cwjh_name&"'"
rs.close
'开始武功
rs.open "select id,c,d,e,f,g FROM y WHERE a='" & trim(fn1) & "' and b='" & menpai & "'",conn
if rs.eof or rs.bof then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('提示：你的门派:"& menpai &" 并没有这样的武功["& fn1 &"]呀！');}</script>"
	Response.End
end if
wgid=int(rs("id"))
wgwg=int(rs("c"))
wgnl=int(rs("d"))
wgdj=int(sqr(rs("e")/100))+1
wgsm=rs("f")
if rs("g")="随机" then
	randomize timer
	gif="<img src=../jhmp/gif/wg"& int(rnd*130)+1 &".gif height=70>"
else
	gif="<img src=../jhmp/gif/"& rs("g")&" height=70>"
end if
if rs("c")>nlfrom or rs("d")>yxjwgfrom then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('提示：您的内力或武功不足!');}</script>"
	Response.End
end if
'判断对方有没有npc
rs.close
rs.open "select top 1 * from NPC where n主人='"&to1&"'",conn
if not rs.eof then
  n_name=rs("n姓名")
  n_tl=rs("n体力")
  n_nl=rs("n内力")
  n_wg=rs("n武功")
  n_gj=rs("n攻击")
  n_fy=rs("n防御")
  n_diren=rs("n敌人")
  if InStr(";" &Application("cwjh_npc"), ";" & n_name & "|")<>0 then
  isnpc=true
  end if
end if
'判断对方有没有npc
'判断自己有没有npc
rs.close
rs.open "select top 1 * from NPC where n主人='"&cwjh_name&"'",conn
if not rs.eof then
  my_n_name=rs("n姓名")
  my_n_dj=int(sqr(int(rs("n经验")/50)))
  my_n_diren=rs("n敌人")
  if InStr(";" &Application("cwjh_npc"), ";" & my_n_name & "|")<>0 then
  ismynpc=true
  end if
end if
'判断自己有没有npc
'对方的判断
rs.close
rs.open "select 姓名,攻击,防御,武功,等级,会员等级,z1,z2,z3,z4,z5,z6 from 用户 where 姓名='" & to1 &"'",conn
to1=rs("姓名")
to1_dj=rs("等级")
yxjgjto=rs("攻击")
yxjfyto=rs("防御")
yxjwgto=rs("武功")
jhhy=rs("会员等级")
z1=null
z2=null
z3=null
z4=null
z5=null
z6=null
'取出对方装备武器的攻击及特性(并且所有武器耐久-1)
if not(isnull(rs("z1"))) and instr(rs("z1"),"|")<>0 then
	data=split(rs("z1"),"|")
	if ubound(data)=5 then
		yxjfyto=yxjfyto+clng(data(2))
		yxjgjto=yxjgjto+clng(data(3))
		if (clng(data(1))-1)>0 then
			z1=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z1=null
			wpsmto="%%[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z2"))) and instr(rs("z2"),"|")<>0 then
	data=split(rs("z2"),"|")
	if ubound(data)=5 then
		yxjfyto=yxjfyto+clng(data(2))
		yxjgjto=yxjgjto+clng(data(3))
		if (clng(data(1))-1)>0 then
			z2=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z2=null
			wpsmto=wpsmto&"%%[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z3"))) and instr(rs("z3"),"|")<>0 then
	data=split(rs("z3"),"|")
	if ubound(data)=5 then
		yxjfyto=yxjfyto+clng(data(2))
		yxjgjto=yxjgjto+clng(data(3))
		if (clng(data(1))-1)>0 then
			z3=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z3=null
			wpsmto=wpsmto&"%%[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z4"))) and instr(rs("z4"),"|")<>0 then
	data=split(rs("z4"),"|")
	if ubound(data)=5 then
		yxjfyto=yxjfyto+clng(data(2))
		yxjgjto=yxjgjto+clng(data(3))
		if (clng(data(1))-1)>0 then
			z4=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z4=null
			wpsmto=wpsmto&"%%[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z5"))) and instr(rs("z5"),"|")<>0 then
	data=split(rs("z5"),"|")
	if ubound(data)=5 then
		yxjfyto=yxjfyto+clng(data(2))
		yxjgjto=yxjgjto+clng(data(3))
		yxjtotx=data(4)
		if (clng(data(1))-1)>0 then
			z5=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z5=null
			wpsmto=wpsmto&"%%[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z6"))) and instr(rs("z6"),"|")<>0 then
	data=split(rs("z6"),"|")
	if ubound(data)=5 then
		yxjfyto=yxjfyto+clng(data(2))
		yxjgjto=yxjgjto+clng(data(3))
		if (clng(data(1))-1)>0 then
			z6=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z6=null
			wpsmto=wpsmto&"%%[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
conn.execute "update 用户 set z1='"&z1&"',z2='"&z2&"',z3='"&z3&"',z4='"&z4&"',z5='"&z5&"',z6='"&z6&"' where  姓名='"&to1&"'"
rs.close
randomize timer
ki=int(rnd*6)+4
killer=int(((yxjgjfrom+yxjwgfrom+yxjfyfrom)-(yxjfyto+yxjgjto+yxjwgto))/ki)*baodoudj+wgwg+wgnl+wgdj*100
if isnpc=true then
npc_kill=int((yxjgjfrom+yxjwgfrom+yxjfyfrom)/2-(n_gj+n_fy+n_wg))
end if
randomize timer
'对武功次数计数
if menpai<>"游侠" then
	conn.execute "update y set e=e+1 where id="&wgid
end if
randomize timer
ki=int(rnd*500)
if yxjtx<>"无" and yxjtx<>"" then
	if yxjtx<>yxjtotx then
		conn.execute "update 用户 set "&yxjtx&"="&yxjtx&"+"&ki&" where 姓名='" & cwjh_name &"'"
		conn.execute "update 用户 set  "&yxjtx&"="&yxjtx&"-"&ki&" where 姓名='" & to1 &"'"
		gjtx=gjtx&"武器克制对方，吸取对方[<font color=blue><b>"&yxjtx&"</b></font>]共计:+<font color=red>"&ki&"</font>点!"
	else
		conn.execute "update 用户 set "&yxjtx&"="&yxjtx&"-"&ki&" where 姓名='" & cwjh_name &"'"
		conn.execute "update 用户 set  "&yxjtx&"="&yxjtx&"+"&ki&" where 姓名='" & to1 &"'"
		gjtx=gjtx&"武器被对方所克制，被吸取[<font color=blue><b>"&yxjtx&"</b></font>]共计:-<font color=red>"&ki&"</font>点"
	end if
end if
gjtx=gjtx&wpsm&wpsmto
if killer>0 then
	conn.execute "update 用户 set 道德=道德-20,内力=内力-" & abs(wgnl) & ",武功=武功-"& abs(wgwg) &",体力=体力-"& int(killer/10) & " where 姓名='" & cwjh_name &"'"
'判断npc
        if isnpc=true then
	conn.execute "update 用户 set 体力=体力-"  & int(killer/2) & " where 姓名='" & to1 &"'"
        conn.execute "update 用户 set 内力=int(内力-内力*0.07),武功=int(武功-武功*0.07),体力=int(体力-体力*0.1) where 姓名='" &cwjh_name &"'"
        npc_attack="<font color=red>【NPC保护主人攻击】</font>由于##对%%进行攻击,NPC人物"&n_name&":护主攻击!但由于##武功高强,只受了点轻伤！内力，武功各下降了1/14，体力下降了1/10..."
        else
	conn.execute "update 用户 set 体力=体力-"  & killer & " where 姓名='" & to1 &"'"
        end if
	djinfo="##武功高强"
	mekill=abs(int(killer/10))
else
	if abs(killer)>5000 then killer=5000
'判断npc
        if isnpc=true then
        npc_kill=abs(npc_kill)
        conn.execute "update 用户 set 内力=内力-"&int(npc_kill/20)& ",武功=武功-"&int(npc_kill/20)&",体力=体力-"&int(npc_kill/10)&" where 姓名='" & cwjh_name &"'"
        npc_attack="<font color=red>【NPC保护主人攻击】</font>由于##对%%进行攻击,NPC人物"&n_name&"护主攻击!但由于##武功技不如人,内力、武功各下降<font color=red>-"&int(npc_kill/20)&"</font>点，体力下降<font color=red>-"&int(npc_kill/10)&"</font>点。"
        end if
       	conn.execute "update 用户 set 道德=道德-20,内力=内力-" & abs(wgnl) & ",武功=武功-"& abs(wgwg) &",体力=体力-"& abs(killer) & " where 姓名='" & cwjh_name &"'"
	mekill=abs(int(killer/10))
	randomize timer
	killer=int(rnd*400)+1
	djinfo="##武功技不如人"
end if
'npc判断
if isnpc=true then
 if Instr(LCase(useronlinename),LCase(" "&n_diren&" "))=0 or n_diren="无" then
       conn.execute "update npc set n敌人='"&cwjh_name&"',n攻击时间=now() where n姓名='"&n_name&"'"
 end if
end if
if ismynpc=true then
 if Instr(LCase(useronlinename),LCase(" "&my_n_diren&" "))=0 or my_n_diren="无" then
     conn.execute "update npc set n敌人='"&to1&"',n攻击时间=now() where n姓名='"&my_n_name&"'"
 end if
 my_abate=int(my_n_dj*500/to1_dj)
 my_npc_attack="<font color=red>【NPC参战出击】</font>NPC人物["&my_n_name&"]看到主人攻击%%,上去就咬了%%一口,%%损失<font color=red>体力-"&my_abate&"</font>"
 conn.execute "update 用户 set 体力=体力-"&my_abate&" where 姓名='"&to1&"'"
end if
rs.open "select 体力 from 用户 where 姓名='" & cwjh_name &"'",conn,2,2
randomize timer
wav=int(rnd*13)+1
mywav="wav"&wav&".wav"
if rs("体力")<-100 then
	attack=xinxi & "##<bgsound src=wav/gj/"&mywav&" loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"%%,[<font color=red><b>"&djinfo&"</b></font>]使得%%体力下降:<font color=red>-"& killer &"</font>点,自己被%%的武功震得体力:<font color=red>-"& mekill &"</font>点,由于%%的内力深厚，##只感觉眼前一些，双腿一蹬，灵魂飞往封神台报到去……"&gjtx
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	call boot(cwjh_name,"发招，操作者："&cwjh_name&",["&menpai&"]唉，技不如人"&fn1)
	exit function
end if
rs.close
rs.open "select 体力,宝物,门派,通缉 from 用户 where 姓名='" & to1 &"'",conn,2,2
if rs("体力")>-100 then
	attack=xinxi & "##<bgsound src=wav/gj/"&mywav&" loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"%%,[<font color=red><b>"&djinfo&"</b></font>]使得%%体力下降:<font color=red>-"& killer &"</font>点,自己被%%的武功震得体力:<font color=red>-"& mekill &"</font>点."&gjtx&"<br>"&my_npc_attack&"<br>"&npc_attack
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	exit function
end if
	conn.execute "update 用户 set 杀人数=杀人数+1,总杀人=总杀人+1 where 姓名='" & cwjh_name &"'"
	if rs("宝物")=Application("cwjh_baowuname") then
		conn.execute "update 用户 set 宝物修练=0,宝物='"& Application("cwjh_baowuname") &"' where 姓名='" & cwjh_name &"'"
		conn.execute "update 用户 set 宝物修练=0,宝物='无',保护=true,内力=100,体力=2000 where 姓名='" & to1 &"'"
		attack="##把%%的宝物:"& Application("cwjh_baowuname") &"抢走，因得到此宝。江湖宝物需要进行修练才可以得到更多的东西！"&gjtx
		rs.close
		set rs=nothing	
		conn.close
		set conn=nothing
		exit function
	end if
if rs("通缉")=False then
	conn.execute "update 用户 set 状态='死',事件原因='"&cwjh_name&"|发招："&fn1&"' where 姓名='" & to1 &"'"
	attack=xinxi & "##<bgsound src=wav/daipu.wav loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"%%,%%慢慢倒下..江湖从此又少了一位大虾!"&gjtx&"<br>"&npc_attack
else
	conn.execute "update 用户 set 通缉=False,状态='死',道德=0,体力=0,内力=0,武功=0,魅力=0,银两=0,存款=int(存款/2),事件原因='"&cwjh_name&"|发招："&fn1&"' where 姓名='" & to1 &"'"
	conn.execute "update 用户 set 银两=银两+5000000 where 姓名='" & cwjh_name &"'"
	attack="攻击通缉犯，"&xinxi & "##<bgsound src=wav/daipu.wav loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"%%,%%慢慢倒下..为此：##得到500万元官府奖励!"&gjtx&"<br>"&npc_attack
end if
call boot(to1,"发招，操作者："&cwjh_name&",["&menpai&"]"&fn1)
conn.execute "insert into l(b,a,c,e,d) values ('" & to1 & "',now(),'" & cwjh_name & "','"&fn1&"','人命')"
rs.close
set rs=nothing	
conn.close
set conn=nothing
case "guaiwu"
	Response.Write "<script language=JavaScript>{alert('提示：怪物区目前设置为禁打！');}</script>"
	Response.End
rs.open "select * from 怪物区 where 怪物='"&to1&"'",conn
gwgongji=rs("攻击")
gwfangyu=rs("防御")
gwshuoming=rs("说明")
gwjifenjia=int((gwgongji+gwfangyu)/2)
myjifenjia=int((gwshuoming/cwjh_jhdj)*gwjifenjia)
if myjifenjia>cwjh_jhdj*10000 then
	myjifenjia=int(myjifenjia/1000)
end if
if rs("kill")<0 then
conn.execute "update 怪物区 set kill=体力,杀人数=杀人数+1,操作时间=now() where 怪物='"&to1&"'"
end if
sj=DateDiff("n",rs("操作时间"),now())
if sj<1 then
	ss=1-sj
	Response.Write "<script language=JavaScript>{alert('此怪物已经死亡，请你等上["& ss &"]分钟,再操作！');}</script>"
	Response.End
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
end if
rs.close
rs.open "select * from 用户 where 姓名='" & cwjh_name &"'",conn,2,2
sj=DateDiff("n",rs("暴豆时间"),now())
zuname=rs("组名")
xinxi=""
baodoudj=1
if sj<=60 then
	xinxi="<font color=red><b>威力爆满</b></font>"
	baodoudj=3
end if
yxjfyfrom=rs("防御")+rs("防御加")
yxjgjfrom=rs("攻击")+rs("攻击加")
zhuan=rs("转生")
daode=rs("道德")
if daode>50000 then 
yxjwgfrom=rs("武功")*(1+zhuan/50)
end if
if daode<=-5000 then 
yxjwgfrom=rs("武功")*(1-zhuan/50)
end if
if daode>-5000 and daode<=50000 then 
yxjwgfrom=rs("武功")
end if
bliu=rs("保留1")
nlfrom=rs("内力")
menpai=rs("门派")
mysf=rs("身份")
if bliu<>"保留" and menpai<>"出家" and menpai<>"游民" and menpai<>"天网" and menpai<>"官府" and (mysf="掌门" or mysf="护法" or mysf="长老" or mysf="堂主") then
	zbyhdata=split(bliu,"|")
	zbsj=ubound(zbyhdata)
	if zbsj=4 then
		zbsj=DateDiff("n",zbyhdata(1),now())
		if zbsj<60 then
			xinxi=xinxi&"<font color=red><b>，##振臂一呼有效，在线弟子为其提高功力。</b></font>"
			yxjfyfrom=yxjfyfrom+clng(zbyhdata(3))
			yxjgjfrom=yxjgjfrom+clng(zbyhdata(2))
			yxjwgfrom=yxjgjfrom+clng(zbyhdata(4))
		end if
	end if
	erase zbyhdata
end if
z1=null
z2=null
z3=null
z4=null
z5=null
z6=null
'取出自己装备武器的攻击及特性(并且所有武器耐久-1
if not(isnull(rs("z1"))) and instr(rs("z1"),"|")<>0 then
	data=split(rs("z1"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z1=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z1=null
			wpsm="##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z2"))) and instr(rs("z2"),"|")<>0 then
	data=split(rs("z2"),"|")
	if ubound(data)=5 then	
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z2=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z2=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z3"))) and instr(rs("z3"),"|")<>0 then
	data=split(rs("z3"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z3=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z3=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z4"))) and instr(rs("z4"),"|")<>0 then
	data=split(rs("z4"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z4=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z4=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z5"))) and instr(rs("z5"),"|")<>0 then
	data=split(rs("z5"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		yxjtx=data(4)
		gjtx="<font color=red><b>["&data(0)&"]</b></font>"
		if (clng(data(1))-1)>0 then
			z5=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z5=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
if not(isnull(rs("z6"))) and instr(rs("z6"),"|")<>0 then
	data=split(rs("z6"),"|")
	if ubound(data)=5 then
		yxjfyfrom=yxjfyfrom+clng(data(2))
		yxjgjfrom=yxjgjfrom+clng(data(3))
		if (clng(data(1))-1)>0 then
			z6=data(0)&"|"&(clng(data(1))-1)&"|"&data(2)&"|"&data(3)&"|"&data(4)&"|"&data(5)
		else
			z6=null
			wpsm=wpsm&"##[<font color=red><b>"&data(0)&"</b></font>]坏掉了"
		end if
	end if
end if
conn.execute "update 用户 set z1='"&z1&"',z2='"&z2&"',z3='"&z3&"',z4='"&z4&"',z5='"&z5&"',z6='"&z6&"' where  姓名='"&cwjh_name&"'"
rs.close
'开始武功
rs.open "select id,c,d,e,f,g FROM y WHERE a='" & trim(fn1) & "' and b='" & menpai & "'",conn
if rs.eof or rs.bof then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('提示：你的门派:"& menpai &" 并没有这样的武功["& fn1 &"]呀！');}</script>"
	Response.End
end if
wgid=int(rs("id"))
wgwg=int(rs("c"))
wgnl=int(rs("d"))
wgdj=int(sqr(rs("e")/100))+1
wgsm=rs("f")
if rs("g")="随机" then
	randomize timer
	gif="<img src=../jhmp/gif/wg"& int(rnd*98)+1 &".gif>"
else
	gif="<img src=../jhmp/gif/"& rs("g")&">"
end if
if rs("c")>nlfrom or rs("d")>yxjwgfrom then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('提示：您的内力或武功不足!');}</script>"
	Response.End
end if
rs.close
rs.open "select 体力 from 用户 where 姓名='" & cwjh_name &"'",conn,2,2
randomize timer
wav=int(rnd*13)+1
mywav="wav"&wav&".wav"
randomize timer
dz=int(rnd*9)+1
select case dz
case 1
 dz_ok="一掌四式"
case 2
 dz_ok="葵花宝典"
case 3
 dz_ok="亢龙有悔"
case 4
 dz_ok="乾坤大挪移"
case 5
 dz_ok="回马枪"
case 6
 dz_ok="金蛇吐雾"
case 7
 dz_ok="守护兽狂咬"
case 8
 dz_ok="隔山打牛"
case 9
 dz_ok="如来神掌"
end select
if rs("体力")<-100 then
	attack="##<bgsound src=wav/gj/"&mywav&" loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"%%,[<font color=red><b>"&djinfo&"</b></font>]使得[%%]体力下降:<font color=red>-"& killer &"</font>点,自己被[%%]用了一招<fonr color=red>["&dz_ok&"]</font>,使得体力下降:<font color=red>-"& mekill &"</font>点,##武技不如人，被%%活活咬死……"
        conn.execute "update 怪物区 set 杀人数=杀人数+1 where 怪物='" & to1 &"'"
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
        call boot(cwjh_name,"被怪物咬死，操作者："&cwjh_name&",["&menpai&"]唉，技不如人"&fn1)
	exit function
end if
rs.close
rs.open "select * from 怪物区 where 怪物='"&to1&"'",conn
if not rs.bof and not rs.eof then
gwgj=rs("攻击")
gwfy=rs("防御")
gwtl=rs("体力")
killer=int((yxjgjfrom+wgnl+egj1+yxjwgfrom-gwfy*2+wgkill)*baodoudj)
killergw=int(gwgj*2-(yxjwgfrom+yxjfyfrom))
killer=int(abs(killer)/10)
mekill=killer*10
if killer<=1 then
killer=int(rnd*99)+1
end if
if killergw<=1 then
killergw=int(rnd*99)+1
end if
aa="<img src='rommhigh.gif'  border='0' width='36' height='36'>"
bb="<img src='../ico/"& jhtx &"-2.gif' width='36' height='36'>"
conn.execute "update 怪物区 set kill=kill-"  & killer & " where 怪物='"&to1&"'"
	conn.execute "update 用户 set 道德=道德-20,内力=内力-" & abs(wgnl) & ",武功=武功-"& abs(wgwg) &",体力=体力-"& int(killer/30) & " where 姓名='" & cwjh_name &"'"
end if
if killer>0 then
	conn.execute "update 用户 set 道德=道德-20,内力=内力-" & abs(wgnl) & ",武功=武功-"& abs(wgwg) &",体力=体力-"& int(killer/30) & " where 姓名='" & cwjh_name &"'"
	conn.execute "update 怪物区 set kill=kill-"&int(killer/15)&" where 怪物='" & to1 &"'"
	djinfo="##武功高强"
        mekill=abs(int(killer/30))
        killer=int(killer/15)
else
	if abs(killer)>5000 then killer=5000
        killer=int(abs(killer)/10)
	mekill=killer*10
        conn.execute "update 用户 set 内力=内力-" & abs(wgnl) & ",武功=武功-"& abs(wgwg) &",体力=体力-"&mekill&" where 姓名='" & cwjh_name &"'"
	conn.execute "update 怪物区 set kill=kill-"&killer&" where 怪物='" & to1 &"'"
	djinfo="##武功技不如人"
end if
if rs("kill")>-100 then
	attack="##<bgsound src=wav/gj/"&mywav&" loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"%%,[<font color=red><b>"&djinfo&"</b></font>]使得守护兽[%%]体力下降:<font color=red>-"& killer &"</font>点。<br>"&my_ss_attack1
        attack=attack&njy&"<font color=red>【["&to1&"]反击】<font color=" & saycolor & ">由于##惹到了[%%]，[%%]奋一切力量，使出了一招<font color=red>["&dz_ok&"]</font>，使得##体力下降:<font color=red>-"& mekill &"</font>点."
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	exit function
else
 if zudui="no" then
  if cwjh_jhdj>rs("说明")  then
  conn.execute "update 用户 set allvalue=allvalue+"& myjifenjia & " where 姓名='" & cwjh_name &"'"
  attack="##<bgsound src=wav/daipu.wav loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"[%%],%%哪是##的对手，已经奄奄一息...但是，##除了得到积分（"& myjifenjia & "）点外没得到任何东西！"
  else
  conn.execute "update 用户 set allvalue=allvalue+"& myjifenjia & " where 姓名='" & cwjh_name &"'"
  attack="##<bgsound src=wav/daipu.wav loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"[%%],%%哪是##的对手，被活活打死!~##得到积分（"& myjifenjia & "）点"&dlzs
  end if
 else
   if cwjh_jhdj>rs("说明")  then
       conn.execute "update 用户 set allvalue=allvalue+"& myjifenjia & " where 姓名='" & cwjh_name &"'"
       conn.execute "update 用户 set allvalue=allvalue+"& int(myjifenjia/2) & " where 组名='" & zuname &"' and 姓名<>'" & cwjh_name &"'"
       attack="##<bgsound src=wav/daipu.wav loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"[%%],%%哪是##的对手，已经奄奄一息...但是，##除了得到积分（"& myjifenjia & "）点外没得到任何东西,{["&cwjh_name&"]已经加入组队["& zuname &"]，该组内所有成员得到积分（"& int(myjifenjia/2) & "）}！"
   else
       conn.execute "update 用户 set allvalue=allvalue+"& myjifenjia & " where 姓名='" & cwjh_name &"'"
       conn.execute "update 用户 set allvalue=allvalue+"& int(myjifenjia/2) & " where 组名='" & zuname &"' and 姓名<>'" & cwjh_name &"'"
       attack="##<bgsound src=wav/daipu.wav loop=1>用["& menpai &"]招式("& fn1 &")修练["&wgdj&"重]{"&wgsm&"}攻击"&gif&"[%%],%%哪是##的对手，被活活打死!~##得到积分（"& myjifenjia & "）点,{["&cwjh_name&"]已经加入组队["& zuname &"]，该组内所有成员得到积分（"& int(myjifenjia/2) & "）}！"&dlzs
   end if
 end if
end if
rs.close
set rs=nothing	
conn.close
set conn=nothing
case else
 Response.Write "<script language=JavaScript>{alert('提示：找不到攻击对象！');}</script>"
 Response.End
end select
end function
%>