<% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
<!--#include file="../inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#INCLUDE file="conn1.asp"-->
<%call head()
call cardz10("使用回城卷","/BBS/yxxe/index.asp?sid="&request("sid")&"&amp;saytk="&request("saytk")&"")
wpid=request("wpid")

if wpid="hcj" then
yname="回城卷"
end if

Server.ScriptTimeout=999
set rs=Server.CreateObject("ADODB.Recordset")
strSQL="select * from sx where cstr(ids)="&myid
rs.open strSQL,liao,1,1
if rs.recordcount<=1 then
if rs("tl")<1 then
sql="delete from pk Where CStr(ids)='" & myid & "'"
  liao.Execute(sql)
sql="delete from kywap Where CStr(ids)='" & myid & "'"
  liao.Execute(sql)
sql="delete from luo Where CStr(ids)='" & myid & "'"
  liao.Execute(sql)
sql="delete from wupin Where CStr(ids)='" & myid & "'"
  liao.Execute(sql)
msg="GAME-OVER!<br/>您被怪物杀害了<br/>包袱物品全部消失！<br/><a href='index.asp?sid="&sid&"&amp;saytk="&saytk&"'>继续江湖</a><br/>"
else
set rs=Server.CreateObject("ADODB.Recordset")
strsQL="select "&wpid&" from wupin where cstr(ids)='"&myid& "'"
rs.open strsQL,liao,1,1
if rs(""&wpid&"")<1 then
msg="您的包袱里没有回城卷<br/>"
else
sql="delete from luo Where CStr(ids)='" & myid & "'"
  liao.Execute(sql)
sql="delete from kywap Where CStr(ids)='" & myid & "'"
  liao.Execute(sql)
sql="delete from pk Where CStr(ids)='" & myid & "'"
  liao.Execute(sql)
sql="update wupin set "&wpid&"="&wpid&"-1 where cstr(ids)="&myid
  liao.Execute(sql)
msg="成功使用"&yname&"<br/>"
end if
end if
end if
Response.Write ""&msg&"=========<br/>"
 rs.Close
	Set rs=Nothing
     liao.Close
      Set liao=Nothing
%>
<a href="index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">江湖首页</a><br/>
<a href="/bbs/index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">社区首页</a><br/>
<%call head1()%>