<%@ LANGUAGE=VBScript codepage ="936" %>
<SCRIPT LANGUAGE=JavaScript>if(window.name!='cwjh_win'){var i=1;while(i<=50){window.alert('刷钱是吗？喜欢是吗？点啊，刷啊！！');i=i+1;}top.location.href='../../exit.asp'}</script>
<!--#include file="../../showchat.asp"-->
<%
Response.Buffer=true
Response.Buffer=true
Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
name=Session("cwjh_name")
jinhua_name=request("name")
jinhua_name=replace(jinhua_name,"'","''")
select case jinhua_name
case "天狼星"
 jinhua_to="臣门星"
case "破军星"
 jinhua_to="天狼星"
case "右弼星"
 jinhua_to="破军星"
case "左辅星"
 jinhua_to="右弼星"
case "武曲星"
 jinhua_to="左辅星"
case "文曲星"
 jinhua_to="武曲星"
case "天罡星"
 jinhua_to="文曲星"
case "普化神"
 jinhua_to="天罡星"
case "玄圣神"
 jinhua_to="普化神"
case "丙灵神"
 jinhua_to="玄圣神"
case "清福神"
 jinhua_to="丙灵神"
case "紫微帝"
 jinhua_to="清福神"
case else
 jinhua_to="无"
end select
nowinroom=session("nowinroom")
if name="" then Response.Redirect "../../error.asp?id=440"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_usermdb")
rs.open "select * from 用户 where 姓名='"&name&"'",conn,2,2
myfs=rs("封神榜")
if myfs="紫微帝" then
	Response.Write "<script language=JavaScript>{alert('提示：你已经是紫微帝了，统领三界，还需要再升吗？');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End
end if
if jinhua_to<>"无" then
	if myfs<>jinhua_to then
	Response.Write "<script language=JavaScript>{alert('提示：你不是"&jinhua_to&",不能封神成"&jinhua_name&"了！');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End
	end if
else

	if jinhua_to<>"臣门星" then
	Response.Write "<script language=JavaScript>{alert('提示：搞错了吧？哪有向原始的方向封神的？');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End
	end if
end if
myjb=rs("金币")
mydj=rs("等级")
myzs=rs("转生")
rs.close
rs.open "select * from 封神榜 where 名号='"&jinhua_name&"'",conn,1,1
if rs.eof then
	Response.Write "<script language=JavaScript>{alert('提示：江湖中不存在这种封神榜，就算你是姜太公也不行！');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End 
end if
ssj=rs("上限加")
if myjb<rs("金币") then 
	Response.Write "<script language=JavaScript>{alert('提示：你的金币不够,封神榜到"&jinhua_name&"需要"&rs("金币")&"金币！');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End 
end if
if mydj<rs("等级") or myzs<rs("转生") then 
	Response.Write "<script language=JavaScript>{alert('提示：你的等级或转生条件达不到，不能进论成"&jinhua_name&"的！');location.href = 'javascript:history.go(-1)';}</script>"
	Response.End 
end if
conn.execute "update 用户 set 封神榜='"&jinhua_name&"',金币=金币-"&rs("金币")&",内力加=内力加+"&ssj&",体力加=体力加+"&ssj&",武功加=武功加+"&ssj&" where 姓名='"&name&"'"
attack="<img src=../twt/fengshen/pic/fs.jpg><font color=red><b>【江湖封神榜】</b></font><font color=ff00ff>姜尚姜子牙封<font color=red>〖" & name & "〗</font>为["&jinhua_name&"],内力、体力、武功上限各上升"&ssj&"点,攻击和防御指数保持不变,<font color=red>希望继续努力,早日封神到更高层,大家祝贺！</font></font>"
rs.close
set rs=nothing
conn.close
set conn=nothing
call showchat(attack)
Response.Write "<script Language=Javascript>alert('恭喜您封神成为"&jinhua_name&"成功，上限大大提升,希望继续努力！');location.href = 'index.asp';</script>"
Response.End 
%>