<%@ LANGUAGE=VBScript codepage ="936" %>
<%Response.charset="gb2312"%>
<!--#include file="../../showchat.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")
if cwjh_name="" then Response.Redirect "../error.asp?id=440"
bkop=Request.Form("op")
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.eof or rs.bof then
        rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('提示：禁止捣乱');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End	
end if
if rs("转生")<1 then
        rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('提示：转生之后才能转换角色');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End	
end if
if rs("角色")<>"" and rs("角色")<>"无"  then
	rs.close
	set rs=nothing	
	conn.close
	set conn=nothing
	Response.Write "<script language=JavaScript>{alert('提示：你已经有角色了，不允许转换了。慢慢体验您的角色吧!');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End
end if
select case bkop
case "道士"
  	conn.execute "update 用户 set 角色='道士' where 姓名='" & cwjh_name &"'"
  	says="<font color=red>【角色消息】</font>"&cwjh_name&"通过转生，领悟了生死之道,终于摆脱了俗世的纷争，找到了武当派祖师爷张三丰，开始了<font color=blue>道士</font>修炼之路。</font>"
	Response.Write "<script language=JavaScript>{alert('提示：角色转换成功，您已经是道士了！');location.href = 'rpg.asp';}</script>"
rs.close
case "巫师"
	conn.execute "update 用户 set 角色='巫师' where 姓名='" & cwjh_name &"'"

   	says="<font color=red>【角色消息】</font>"&cwjh_name&"通过转生，领悟了生死之道,终于摆脱了俗世的纷争，找到了明教大魔头阳顶天，开始了<font color=blue>巫师</font>修炼之路。</font>"
	Response.Write "<script language=JavaScript>{alert('提示：角色转换成功，您已经是巫师了！');location.href = 'rpg.asp';}</script>"
 rs.close
case "战士"
   	conn.execute "update 用户 set 角色='战士' where 姓名='" & cwjh_name &"'"
   	says="<font color=red>【角色消息】</font>"&cwjh_name&"通过转生，领悟了生死之道,终于摆脱了俗世的纷争，找到了正在襄阳城中的绝代高手郭靖，开始了<font color=blue>战士</font>修炼之路。</font>"
	Response.Write "<script language=JavaScript>{alert('提示：角色转换成功，您已经是战士了！');location.href = 'rpg.asp';}</script>"
 rs.close
case else
 Response.Write "<script language=JavaScript>{alert('提示：命令有错！');location.href = 'javascript:history.go(-1)';}</script>"
 Response.End
end select
set rs=nothing	
conn.close
set conn=nothing
call showchat(says)
%>