<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="../paodian.asp"-->
<!--#include file="../const3.asp"-->
<!--#include file="../chk.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"
ChkPost()
allhttp=LCase(Request.ServerVariables("ALL_HTTP"))
if cwjh_disproxy=1 then Chkproxy()
%>
<script language="JavaScript"> 
if(window.top==window.self){var i=1;while (i<=50){window.alert("你想作什么呀，黑我？这里是不行的，去别处玩去吧！哈！慢慢点50次！！");i=i+1;}top.location.href="../exit.asp"}
</script>
<%
cwjh_name=Session("cwjh_name")
cwjh_grade=Session("cwjh_grade")
if cwjh_yjdh=1 then Chkyjdh()
inroom=session("nowinroom")
chatbgcolor=Application("cwjh_chatbgcolor")
chatimage=Application("cwjh_chatimage")
if chatbgcolor="" then chatbgcolor="008888"
if Instr(LCase(Application("cwjh_useronlinename"&session("nowinroom")))," "&LCase(cwjh_name)&" ")=0 then
	Response.Write "<script language=JavaScript>{alert('提示：必须进入聊天室才可以操作！');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End
end if
%>
<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">
<%
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
Set rs1=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_usermdb")
rs.open "select * FROM 组队 WHERE 组长='"&cwjh_name&"'",conn
if not(rs.eof or rs.bof) then
 jianzu="yes"
else
 jianzu="no"
end if
rs.close
useronlinename=Application("cwjh_useronlinename"&inroom)
if cwjh_name="" or Session("cwjh_inthechat")<>"1" or Instr(useronlinename," "&cwjh_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 & " " & t
rs.open "SELECT * FROM 用户 WHERE  姓名='" & cwjh_name &"'",conn,1,3
if rs("组名")<>"" and rs("组名")<>"无" then
 zudui="yes"
 zuname=rs("组名")
else
 zudui="no"
 zuname="无"
end if
rs1.open "select * from 组队 where 组名='"&zuname&"'",conn,1,3
if not (rs1.eof and rs1.bof) then
 znumber=rs1("组员数")
else
 znumber=0
end if
rs1.close
mysl=clng(DateDiff("n",now(),rs("slsj")))
mysls="["&rs("sl")&"]"
mycd = DateDiff("n", rs("lasttime"), Now())
addvalue=mycd
addvalue1=mycd*cwjh_paofen
'对暂离的泡点的减半判断
zanli=application("cwjh_zanli")
if Instr(LCase(application("cwjh_zanli")),LCase("!"&cwjh_name&"!"))>0 or request("pd")="a" then 
addvalue1=int(addvalue1/2)
addvalue=int(addvalue/2)
pdzt="暂离泡点减半"
else
pdzt="状态正常泡分"
end if
'对暂离的泡点的减半判断结束
if mycd<5 then
	Response.Write "<script Language=Javascript>alert('提示：每次存点请间隔5分钟,请在["& (5-mycd )&"]分后再保存!');location.href = 'javascript:history.go(-1)';</script>"
	Response.End
end if
Session("cwjh_savetime")=now()
if mysl>0 then
	Select Case rs("sl")
	case "福神"
		cwjh_paofencd=cwjh_paofencd*1.5
	case "财神"
		cwjh_paofenyin=cwjh_paofenyin*5	
	case "衰神"
		cwjh_paofencd=int(cwjh_paofencd/2)
	case "死神"
		cwjh_paofen=-(cwjh_paofen*10)
	case "穷神"
		cwjh_paofenyin=-(cwjh_paofenyin*5)
	end select
else
	rs("sl")="无"
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("等级")
zdzt=rs("组队")
sfwg=1
if sf<>"" and sf<>"无" then
	if Instr(LCase(Application("cwjh_useronlinename"&inroom))," "&LCase(sf)&" ")=0 then
		sfwg=1
	else
		sfwg=2
	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 else
	jhhy=1
end select
rs("内力")=rs("内力")+int(addvalue1*sfwg*jhhy)
rs("银两")=rs("银两")+int(addvalue1*jhhy*cwjh_paofenyin)
rs("武功")=rs("武功")+int(addvalue1/2*sfwg*jhhy)
rs("攻击")=rs("攻击")+int(addvalue1/2*jhhy)
rs("防御")=rs("防御")+int(addvalue1/2*jhhy)
rs("法力")=rs("法力")+int(addvalue1/2*jhhy)
rs("轻功")=rs("轻功")+int(addvalue1/2*jhhy)
rs("粪库")=rs("粪库")+int(addvalue1/16*jhhy)
bl=rs("配偶")
rs("allvalue")=rs("allvalue")+int(addvalue*jhhy*cwjh_paofencd)*pd
rs("泡豆点数")=rs("泡豆点数")+addvalue
prevtime=CDate(rs("lasttime"))
if DateDiff("m",prevtime,now())=0 then
	rs("mvalue")=rs("mvalue")+int(addvalue*jhhy*cwjh_paofencd)*pd
else
	rs("mvalue")=addvalue*pd
end if
rs("lasttime")=sj
rs("lastip")=ip
rs.Update
cwjh_value=rs("allvalue")
cwjh_mvalue=rs("mvalue")
dengji=int(sqr(cwjh_value/50))
rs("等级")=dengji
rs.Update
Session("cwjh_grade")=rs("grade")
Session("cwjh_jhdj")=rs("等级")
zddj=rs("等级")
zdzt=rs("组队")
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_usermdb")
rs.open "select 粪库,状态 FROM 用户 WHERE 姓名='" & cwjh_name &"'",conn
if rs("状态")="死" then
call boot(cwjh_name,"无") 
Response.Write "<script language=JavaScript>{alert('你可能在舞剑或孤岛中被打死!');}</script>"
rs.close
set rs=nothing	
conn.close
set conn=nothing
Response.End
end if
if rs("粪库")>=50000 then
conn.execute "update 用户 set 状态='死',事件原因='被自己粪淹死|"&fn1&"' where 姓名='" & cwjh_name & "'"
call boot(cwjh_name,cwjh_name&"被"&cwjh_name&"的粪淹死了") 
Response.Write "<script language=JavaScript>{alert('你粪已达50000点被自己粪淹死了!');}</script>"
rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
Response.End
end if

'判断升级
zuyj=100
if znumber<>0 then
zuzj=100*znumber
else
zuzj=0
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>["& cwjh_name &"]</font><font color=green>经过坚持不懈的努力,又升级了！<font color=red><b><img src=img/sjl.gif>"&dj1&"→→<img src=img/sjl.gif>"&zddj&"</b></font>羡慕吧......</font>"
if zudui="yes" and jianzu="yes" then
	conn.execute("update 用户 set allvalue=allvalue+"&zuyj&"  where 组名='" & zuname & "' and 姓名<>'"&cwjh_name&"'")
	conn.execute("update 用户 set allvalue=allvalue+"&zuzj&"  where 组名='" & zuname & "' and 姓名='"&cwjh_name&"'")
elseif zudui="yes" and jianzu="no" then
	conn.execute("update 用户 set allvallue=allvalue+"&zuyj&"  where 姓名='"&cwjh_name&"'")
end if
'聊天数据
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) & cwjh_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="1" align="center" height="267" bordercolor="#F7DEAC">
 <tr valign="top">
<td height="260" style="filter:dropshadow(color=black, offx=1,offy=1);">
<p align="center"> <%=cwjh_name%><br>当 前 状 态</p>
<div align="center"><font color=yellow>
<%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%> 
</div></font>
<p align="left"> 
<%sjjf=(zddj+1)*(zddj+1)*50-cwjh_value%>
<font color=red><%=pdzt%></font><br>
时间:<%=mycd%>分钟<br> 
管理:<%=cwjh_grade%> 级<br> 
战斗:<%=int(sqr((cwjh_value/50)))%> 级<br> 
月积:<%=cwjh_mvalue%><br>
总积:<%=cwjh_value%><br>
升差:<font color=red><%=sjjf%></font>点<br>
泡点:<font color=red><%=int(addvalue*cwjh_paofencd*jhhy)*pd%></font>点<br>
<br>
你共增加<br>
内力:<%if sfwg=2 then%><font color=red><%=int(addvalue1*sfwg*jhhy)%></font>点<br><%else%><%=int(addvalue1*sfwg*jhhy)%>点<br><%end if%> 
银子:<%=addvalue1*cwjh_paofenyin%>两<br> 
武功:<%if sfwg=2 then%><font color=red><%=int(addvalue1/2*sfwg*jhhy)%></font>点<br><%else%><%=int(addvalue1/2*sfwg*jhhy)%>点<br><%end if%> 
攻击:<%=int(addvalue1/2*jhhy)%>点<br> 
防御:<%=int(addvalue1/2*jhhy)%>点<br> 
法力:<%=int(addvalue1/2*jhhy)%>点<br> 
轻功:<%=int(addvalue1/2*jhhy)%>点<br> 
粪库:<%=int(addvalue1/16*jhhy)%>点<br> 
<br>
<%if bl<>"无" and bl<>"" then
peioujia=int(addvalue1/4)
conn.execute "update 用户 set 内力=内力+" & addvalue1/2 & ",银两=银两+" & peioujia & ",武功=武功+" & peioujia & ",攻击=攻击+" & peioujia & ",法力=法力+"  & peioujia & ",轻功=轻功+"  & peioujia & ",防御=防御+" & peioujia & " where 姓名='" & bl & "'"%>
伴侣<font color=red> <%=bl%></font><br> 
内力:<%=int(addvalue1/4)%>点<br> 
银两:<%=int(addvalue1/4)%>两<br> 
武功:<%=int(addvalue1/4)%>点<br> 
攻击:<%=int(addvalue1/4)%>点<br> 
防御:<%=int(addvalue1/4)%>点<br> 
法力:<%=int(addvalue1/4)%>点<br> 
轻功:<%=int(addvalue1/4)%>点<br> 
<%end if
rs.close
set rs=nothing
conn.close
set conn=nothing%>
</td></tr></table><BR>
<table width="100%" border="1" cellspacing="0" cellpadding="1" align="center" bordercolor="#F7DEAC">
  <tr valign="top">
    <td align="center"> 
 <%if zudui="yes" then%>
 <%if jianzu="no" then%>
   组队泡点属性 <br>
        组长:<%=zuzj%>点<br>
        组员:<%=zuyj%>点<br><%else%>你是组长泡点不<BR>增加主要靠组员<%end if%><%else%>无组队<%end if%>
</td></tr>
</table>
</html>