<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="../paodian.asp"-->
<!--#include file="sjfunc/func.asp"-->
<%Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
if Application("zhbg_yjdh")=1 then
zhbg_sid=trim(request.cookies("zhbg")("zhbg_sid")) 
if (zhbg_sid="" or zhbg_sid<>session.sessionid) and Session("zhbg_grade")<6 then
 Session("zhbg_inthechat")="0" 
 Response.Write "<script language=javascript>{top.location.href='chaterr.asp?id=003';alert('您一机上多号，被系统请出！');}</script>"
 Response.End 
end if
end if
allhttp=LCase(Request.ServerVariables("ALL_HTTP"))
if Application("zhbg_disproxy")=1 then
if Instr(allhttp,"proxy")<>0 or Instr(allhttp,"http_via")<>0 or Instr(allhttp,"http_pragma")<>0 then 
	Session.Abandon
	Response.Write "<script language=JavaScript>{alert('提示：禁止使用代理！');location.href = 'javascript:history.go(-1)';}</script>"
	response.end
end if
end if
zhbg_name=Session("zhbg_name")
zhbg_grade=Session("zhbg_grade")
inroom=session("nowinroom")
chatbgcolor=Application("zhbg_chatbgcolor")
chatimage=Application("zhbg_chatimage")
if chatbgcolor="" then chatbgcolor="008888"
%>
<html>
<head>
<META http-equiv='content-type' content='text/html; charset=gb2312'>
<title>保存经验值</title>
<link rel="stylesheet" href="READONLY/STYLE.CSS">
<style>
body{
CURSOR: url('boy.cur');
scrollbar-track-color:#ffffff;
SCROLLBAR-FACE-COLOR:#effaff;
SCROLLBAR-HIGHLIGHT-COLOR:#ffffff;
SCROLLBAR-SHADOW-COLOR:#eeeeee;
SCROLLBAR-3DLIGHT-COLOR:#eeeeee;
SCROLLBAR-ARROW-COLOR:#dddddd;
SCROLLBAR-DARKSHADOW-COLOR:#ffffff}
td{font-size:9pt;}
</style>
</head>
<body oncontextmenu=self.event.returnValue=false bgcolor="<%=chatbgcolor%>" background="<%=chatimage%>" bgproperties="fixed" topmargin="5" text="#FFFFFF">
<%
useronlinename=Application("zhbg_useronlinename"&inroom)
if zhbg_name="" or Session("zhbg_inthechat")<>"1" or Instr(useronlinename," "&zhbg_name&" ")=0 then Response.Redirect "chaterr.asp?id=001"
ip=Request.ServerVariables("REMOTE_ADDR")
If ip = "" Then ip = Request.ServerVariables("REMOTE_ADDR")
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
t=s & ":" & f & ":" & m
sj=n & "-" & y & "-" & r & " " & s & ":" & f & ":" & m
mycd=DateDiff("n",Session("zhbg_savetime"),now())
addvalue=mycd
addvalue1=mycd*zhbg_paofen
'对暂离的泡点的减半判断
zanli=application("zhbg_zanli")
if Instr(LCase(application("zhbg_zanli")),LCase("!"&zhbg_name&"!"))>0 or request("pd")="a" then 
addvalue1=int(addvalue1/2)
addvalue=int(addvalue/2)
pdzt="暂离泡点减半"
else
pdzt="状态正常泡分"
end if
'对暂离的泡点的减半判断结束
Session("zhbg_savetime")=now()
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "SELECT sl,slsj,会员,会员结束,师傅,会员等级,轻功,等级,内力,银两,武功,攻击,防御,法力,银币,金,木,水,火,土,轻功,粪库,配偶,allvalue,泡豆点数,资质,lasttime,mvalue,yvalue,lastip,grade FROM 用户 WHERE  姓名='" & zhbg_name &"'",conn,1,3
mysl=clng(DateDiff("n",now(),rs("slsj")))
mysls="["&rs("sl")&"]"
if mysl>0 then
	Select Case rs("sl")
	case "福神"
		zhbg_paofencd=zhbg_paofencd*1.5
	case "财神"
		zhbg_paofenyin=zhbg_paofenyin*5	
	case "衰神"
		zhbg_paofencd=int(zhbg_paofencd/2)
	case "死神"
		zhbg_paofen=-(zhbg_paofen*10)
	case "穷神"
		zhbg_paofenyin=-(zhbg_paofenyin*5)
	end select
else
	rs("sl")="无"
end if
'等级泡点加倍值,abcd
if zhbg_jhdj>0 and zhbg_jhdj<100 then
	abcd=1
	end if 
if zhbg_jhdj>100 and zhbg_jhdj<200 then
	abcd=2
	end if 
if zhbg_jhdj>200 and zhbg_jhdj<500 then
	abcd=3
else
	abcd=4
end if

if rs("会员")=true and clng(DateDiff("d",now(),rs("会员结束")))>0 then
	pd=paodian
	pdstr="泡点制会员"
else
	pd=1
	pdstr="非泡点会员"
end if
sf=rs("师傅")
hydj=rs("会员等级")
zddj=rs("等级")
dj1=rs("等级")
sfwg=1
if sf<>"" and sf<>"无" then
	if Instr(LCase(Application("zhbg_useronlinename"&inroom))," "&LCase(sf)&" ")=0 then
		sfwg=2
	else
		sfwg=1
	end if
end if
jhhy=1
Select Case hydj
case 1
	jhhy=hy1
case 2
	jhhy=hy2
case 3
	jhhy=hy3
case 4
	jhhy=hy4
case 5
	jhhy=hy5
case else
	jhhy=1
end select
rs("内力")=rs("内力")+int(addvalue1*sfwg*jhhy*abcd)
rs("银两")=rs("银两")+int(addvalue1*jhhy*zhbg_paofenyin*abcd)
rs("武功")=rs("武功")+int(addvalue1/2*sfwg*jhhy*abcd)
rs("攻击")=rs("攻击")+int(addvalue1/4*jhhy*abcd)
rs("防御")=rs("防御")+int(addvalue1/4*jhhy*abcd)
rs("资质")=rs("资质")+int(mycd)
rs("金")=rs("金")+int(addvalue1/5*jhhy*abcd)
rs("木")=rs("木")+int(addvalue1/5*jhhy*abcd)
rs("水")=rs("水")+int(addvalue1/5*jhhy*abcd)
rs("火")=rs("火")+int(addvalue1/5*jhhy*abcd)
rs("土")=rs("土")+int(addvalue1/5*jhhy*abcd)
rs("法力")=rs("法力")+int(addvalue1/10*jhhy*abcd)
rs("轻功")=rs("轻功")+int(addvalue1/10*jhhy*abcd)
rs("银币")=rs("银币")+int(addvalue1/20*jhhy*abcd)
rs("粪库")=rs("粪库")+int(addvalue1/30*jhhy*abcd)
bl=rs("配偶")
rs("allvalue")=rs("allvalue")+int(addvalue*jhhy*zhbg_paofencd*abcd)*pd
rs("泡豆点数")=rs("泡豆点数")+addvalue
prevtime=CDate(rs("lasttime"))
if DateDiff("m",prevtime,now())=0 then
	rs("mvalue")=rs("mvalue")+int(addvalue*jhhy*zhbg_paofencd*abcd)*pd/30
else
	rs("mvalue")=addvalue*pd/30
end if
rs("lasttime")=sj
rs("lastip")=ip
rs.Update
zhbg_value=rs("allvalue")
zhbg_mvalue=rs("mvalue")
dengji=int(sqr(zhbg_value/50))
rs("等级")=dengji
rs.Update
Session("zhbg_grade")=rs("grade")
Session("zhbg_jhdj")=rs("等级")
zddj=rs("等级")
%>
<%
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "select 粪库,状态 FROM 用户 WHERE 姓名='" & zhbg_name &"'",conn
if rs("状态")="死" then
call boot(zhbg_name,"无") 
Response.Write "<script language=JavaScript>{alert('你可能在舞剑或孤岛中被打死!');}</script>"
rs.close
set rs=nothing	
conn.close
set conn=nothing
Response.End
end if
if rs("粪库")>=500000 then
conn.execute "update 用户 set 状态='死',事件原因='被自己粪淹死|"&fn1&"' where 姓名='" & zhbg_name & "'"
call boot(zhbg_name,zhbg_name&"被"&zhbg_name&"的粪淹死了") 
Response.Write "<script language=JavaScript>{alert('你粪已达500000点被自己粪淹死了!');}</script>"
rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
Response.End
end if

'判断升级
if zddj>dj1 then
says="<img src=img/up.gif><bgsound src=wav/system.wav loop=1><font color=green>〖升级消息〗恭喜</font><font color=red>["& zhbg_name &"]</font><font color=green>经过坚持不懈的努力,又升级了！<font color=red><b><img src=img/sjl.gif>"&dj1&"级→→<img src=img/sjl.gif>"&zddj&"级</b></font>羡慕吧......</font>"
'聊天数据
act="消息"
towhoway=0
towho="大家"
addwordcolor="660099"
saycolor="008888"
addsays="对"
saystr="<script>parent.sh("& chr(39) & addwordcolor & chr(39) &","& chr(39) & saycolor & chr(39) &","& chr(39) & act & chr(39) &","& chr(39) & zhbg_name & chr(39) &","& chr(39) & addsays & chr(39) &","& chr(39) & towho & chr(39) &"," & chr(39) & says & chr(39) &"," & towhoway &  ","& inroom & ");<"&"/script>"
addmsg saystr
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
end if
%>
<table width="100%" border="1" cellspacing="0" cellpadding="5" align="center" height="267" bordercolor="#F7DEAC">
 <tr valign="top">
<td height="260" style="filter:dropshadow(color=black, offx=1,offy=1);">
<p align="center"> <%=zhbg_name%><br>当 前 状 态</p>
<div align="center"><font color=ff6600>
<%if sf<>"" and sf<>"无" and sfwg=2 then%> 
	师傅:<font color=red><%=sf%></font>在场武功、内力大增！<br> 
<%end if%>
<%if hydj>0  then%>您是<%=hydj%>级会员<br>泡点为<%=jhhy%>倍<%else%>非会员泡点不翻倍<%end if%> 
<br><%=pdstr%>
<%if mysl>0 then%><HR><%=mysls%><br>还有<%=mysl%>分钟<HR><%end if%> 
</font></div>
<p align="left"> 
<%sjjf=(zddj+1)*(zddj+1)*50-zhbg_value%>
<font color=red><%=pdzt%></font><br>
时间:<%=mycd%>分钟<br> 
管理:<%=zhbg_grade%> 级<br> 
战斗:<%=int(sqr((zhbg_value/50)))%> 级<br> 
月积:<font color=red><%=zhbg_mvalue%></font><br>
总积:<%=zhbg_value%><br>
升差:<font color=red><%=sjjf%></font>点<br>
泡点:<font color=red><%=int(addvalue*zhbg_paofencd*jhhy*abcd)*pd%></font>点<br>
<br>
你共增加<br>
金属性:<%=int(addvalue1/5*jhhy*abcd)%>点<br>
木属性:<%=int(addvalue1/5*jhhy*abcd)%>点<br>
水属性:<%=int(addvalue1/5*jhhy*abcd)%>点<br>
火属性:<%=int(addvalue1/5*jhhy*abcd)%>点<br>
土属性:<%=int(addvalue1/5*jhhy*abcd)%>点<br>
银 币:<%=int(addvalue1/20*jhhy*abcd)%>点<br> 
内力:<%if sfwg=1 then%><font color=red><%=int(addvalue1*sfwg*jhhy*abcd)%></font>点<br><%else%><%=int(addvalue1*sfwg*jhhy*abcd)%>点<br><%end if%> 
银子:<%=addvalue1*zhbg_paofenyin*jhhy*abcd%>两<br> 
武功:<%if sfwg=1 then%><font color=red><%=int(addvalue1/2*jhhy*abcd)%></font>点<br><%else%><%=int(addvalue1*sfwg*jhhy*abcd)%>点<br><%end if%> 
攻击:<%=int(addvalue1/4*jhhy*abcd)%>点<br> 
防御:<%=int(addvalue1/4*jhhy*abcd)%>点<br> 
资质:<%=int(mycd)%>点<br>
法力:<%=int(addvalue1/10*jhhy*abcd)%>点<br> 
轻功:<%=int(addvalue1/10*jhhy*abcd)%>点<br> 
粪库:<%=int(addvalue1/30*jhhy*abcd)%>点<br> 
<br>
<%if bl<>"无" and bl<>"" then
peioujia=int(addvalue1/4*abcd)
conn.execute "update 用户 set 内力=内力+" & addvalue1/2 & ",银两=银两+" & peioujia & ",武功=武功+" & peioujia & ",攻击=攻击+" & peioujia & ",法力=法力+"  & peioujia & ",轻功=轻功+"  & peioujia & ",防御=防御+" & peioujia & " where 姓名='" & bl & "'"%>
伴侣<font color=red> <%=bl%></font><br> 
内力:<%=int(addvalue1/4*abcd)%>点<br> 
银两:<%=int(addvalue1/4*abcd)%>两<br> 
武功:<%=int(addvalue1/8*abcd)%>点<br> 
攻击:<%=int(addvalue1/8*abcd)%>点<br> 
防御:<%=int(addvalue1/8*abcd)%>点<br> 
法力:<%=int(addvalue1/20*abcd)%>点<br> 
轻功:<%=int(addvalue1/20*abcd)%>点<br> 
<%end if
rs.close
set rs=nothing
conn.close
set conn=nothing%>
</td></tr></table></html><noscript><iframe scr=″indexcopy.htm″></iframe></noscript>