<!--#include file="Class_SQL.asp"-->


<% 
Class PetStatus

Private GetUserName
Private PetLevel,PetExp,PetNextExp,PetHp,PetMaxHp,PetMp,PetMaxMp,PetSp,HpPercent,MpPercent,SpPercent,ExpPercent,PetMajor
Private PetAtk,PetDef,PetDead,PetSex,PetPk,PkTime,OpenPk
Private IfPetDead,IfOpenPk
Private Item1,Item2,Item3,Item4,Item5
Private Pet,Petsx,HpItem,AtkItem,SpItem,DefItem,ExpItem,LiveItem
Private BasicHp,BasicSp,BasicUseHp,BasicUseExp,Atkup,Defup,HpTemp
Private Skill1,Skill2
Private LevelPic,PetPic
Private PetExist,PetOwnerList


Public Sub CheckPetExist
Set RsPetExist=Server.CreateObject("ADODB.Recordset")
RsPetExist.open "select UserName from [PetData] where UserName='"&GetUserName&"'",ConnPet,1,1
if RsPetExist.EOF then
PetExist=0
else
PetExist=1
end if
RsPetExist.close
Set RsPetExist=nothing
End Sub


Public Sub FormatPetData

BasicHp=Def_Pet_BasicHp
BasicSp=Def_Pet_BasicSp
BasicUseHp=Def_Pet_BasicUseHp
BasicUseExp=Def_Pet_BasicUseExp
AtkUp=Def_Pet_AtkUp
DefUp=Def_Pet_DefUp

CheckPetExist

If PetExist=1 then

Set RsPet = Server.CreateObject("ADODB.Recordset")
RsPet.open "SELECT * FROM [PetData] WHERE UserName='"&GetUserName&"'",ConnPet,1,3
PkTime=RsPet("PkTime")
PetFeedDate=RsPet("PetFeedDate")
PetFeedDateGap=DateDiff("d", PetFeedDate, date())
PetHp=RsPet("PetHp")
PetMaxHp = RsPet("PetMaxHp")
PetMp=RsPet("PetMp")
PetMaxMp=RsPet("PetMaxMp")
PetExp=RsPet("PetExp")
PetLevel=RsPet("PetLevel")
PetNowLevel = int(PetExp/100)+1
PetDead=RsPet("PetDead")


''''处理宠物经验与等级,HP,攻击力,防御力
if PetLevel<>PetNowLevel then
 PetLevel=PetNowLevel
 if PetLevel<2 then
                PetMaxHp=BasicHp
            else 
                PetMaxHp=BasicHp+PetLevel*5
            end if
 ConnPet.Execute("Update [PetData] Set PetLevel="&PetLevel&",PetMaxHp="&PetMaxHp&" where UserName='"&CookieUserName&"'")
End if

''''处理宠物经验与等级结束


''''处理Hp,SP
If PetHp<1 Then
PetHp=0
ConnPet.Execute("Update [PetData] Set PetDead=1,PetHp=0 where UserName='"&GetUserName&"'")
End if

PetSp=BasicSp-PetFeedDateGap*Def_Pet_BasicSp2

if PetSp<1 then
PetSp=0
ConnPet.Execute("Update [PetData] Set PetDead=1 where UserName='"&GetUserName&"'")
End if

''''处理HP,SP结束

PetNextExp=Petlevel*100

HpPercent =int(PetHp / PetMaxHp*100) 
MpPercent= int(PetMp / PetMaxMp*100) 
SpPercent= int(PetSp / Def_Pet_BasicSp*100) 
ExpPercent=int(100 * ((PetExp-(PetLevel-1)*100)/ 100))

 


HpTemp=PetMaxHp-PetHp

LevelPic=int(PetLevel/10)
if levelpic>10 then levelpic=11 end if

Petpic=RsPet("PetName")

Item1 = RsPet("Item1")
Item2 = RsPet("Item2")
Item3 = RsPet("Item3")
Item4 = RsPet("Item4")
Item5 = RsPet("Item5")

PetAtk=RsPet("PetAtk")+Item1+Item2+2+int(PetLevel/2)
PetDef=RsPet("PetDef")+Item3+Item4+Item5+3+int(PetLevel/2)

PetMajor=RsPet("PetMajor")
Pet = RsPet("MyPet")
Petsx = RsPet("Petsx")
HpItem = RsPet("HpItem")
AtkItem = RsPet("AtkItem")
SpItem = RsPet("SpItem")
DefItem = RsPet("DefItem")
ExpItem = RsPet("ExpItem")
LiveItem = RsPet("LiveItem")


if PetDead=1 then IfPetDead="死亡" else IfPetDead="生存" end if
if RsPet("PetSex")<2 then PetSex="雄" else PetSex="雌" end if
OpenPk=RsPet("OpenPk")
if OpenPk=1 then IfOpenPk="开" else IfOpenPk="关" end if

Skill1=RsPet("Skill1")
Skill2=RsPet("Skill2")

Else 
error("<li>你还没有宠物啊，快攒钱去买吧~<li><a href=PetShop.asp>我要买宠物</a>")

End if


End Sub


Public Property Let LetUserName(value)
if value="" then
GetUserName=CookieUserName
else
GetUserName=value 
end if
End Property 

 

Public Sub ShowPetSkills

SkillIntro1="alt='技能:点贴成金<br>属性:被动<br>说明:发贴和回帖能得到金钱'"
SkillIntro2="alt='技能:为主救贴<br>属性:主动 消耗MP:45<br>说明:将特定帖子拉前'"

response.Write "<fieldset>"
response.write "<legend align=left style='font-weight:bold'>宠物技能</legend>"
response.write "<br><table align=center class=a2 cellPadding=5 cellspacing=1 width='100%'><tr class=a3><td>"

response.Write "<img src='pet/images/skills/skill1.gif'"
if skill1=0 then response.write "style='filter:GRAY '" end if
response.write SkillIntro1
response.write ">&nbsp;&nbsp;&nbsp;"

if skill2=1 then
response.write "<a href='PetMyPet.asp?action=useskill&skillsort=2'><img src='pet/images/skills/skill2.gif' "
response.write SkillIntro2
response.write "border=0></a>"
else 
response.write "<img src='pet/images/skills/skill2.gif' style='filter:GRAY' "
response.write SkillIntro2
response.write ">"
end if
response.write "</td>"
response.write "</tr></table>"
response.Write "</fieldset>"

End Sub


Public Sub ShowPetFace(sorts,w,h)
Response.Write "<a href='PetMyPet.asp?UserName="&GetUserName&"'>"
ReSponse.write "<img src='Pet/Images/Sort/"&Petpic&"/"&Petpic&""&levelpic&".gif' border=0 "
if sorts=2 then response.write "width="&w&" height="&h&" "
if PetDead=1 then ReSponse.write "style='filter:GRAY '" end if
if GetUserName<>CookieUserName then
response.Write "alt='查看"&GetUserName&"的宠物资料'></a>"
else
response.Write "alt='查看我的宠物资料.'></a>"
end if
End Sub

'帖间显示
Public Sub ShowInTopic

response.Write "<fieldset style='width:250;height=130;' align=right>"
response.write "<legend align=right style='font-weight:bold'>"
response.write Pet&"</legend>"
response.Write "<TABLE align=center cellPadding=0 cellspacing=0 border=1 width=250><tr class=a3><td align=center width=130>"
Call ShowPetFace(1,0,0)
response.write "<td>"
ShowPetFigure
response.write "</td>"
response.Write "<TR class=a3><TD colspan=2>等级:"&PetLevel&" 属性:"&PetSx&" 性别:"&PetSex&" 职业:"&PetMajor&" PK:"&IfOpenPk&"</TD></TR>"
response.Write "</TD></TR></TABLE>"
response.Write "</center></fieldset>"

End Sub


'用图形显示数据

Public Sub ShowPetFigure


ReSponse.write "<table width='100%' cellpadding=1 cellspacing=0>"


response.Write "<tr><td style='font-size:9px'>HP : "&PetHp&" / "&PetMaxHp
response.write "<table width='100'cellpadding=0 cellspacing=0 border=0 style='border:solid #000000 1px'>"
response.Write "<tr><td>"
response.Write "<table cellpadding='0' height=8 cellspacing='0'  width='"&HpPercent&"%'><tr><td id='HpProgressBar'>"
response.Write "</td></tr></table>"
response.Write "</td></tr></table>"

response.Write "<tr><td style='font-size:9px'>MP : "&PetMp&" / "&PetMaxMp
response.write "<table width='100' cellpadding=0 cellspacing=0 border=0 style='border:solid #000000 1px'>"
response.Write "<tr><td>"
response.Write "<table cellpadding='0' height=8 cellspacing='0'  width='"&MpPercent&"%'><tr><td id='MpProgressBar'>"
response.Write "</td></tr></table>"
response.Write "</td></tr></table>"

response.Write "<tr><td style='font-size:9px'>SP : "&PetSp&" / "&Def_Pet_BasicSp
response.write "<table width='100' cellpadding=0 cellspacing=0 border=0 style='border:solid #000000 1px'>"
response.Write "<tr><td>"
response.Write "<table cellpadding='0' height=8 cellspacing='0'  width='"&SpPercent&"%'><tr><td id='SpProgressBar'>"
response.Write "</td></tr></table>"
response.Write "</td></tr></table>"

response.Write "<tr><td style='font-size:9px'>EXP : "&PetExp&" / "&PetNextExp
response.write "<table width='100' cellpadding=0 cellspacing=0 border=0 style='border:solid #000000 1px'>"
response.Write "<tr><td>"
response.Write "<table cellpadding='0' height=8 cellspacing='0' width='"&ExpPercent&"%'><tr><td id='ExpProgressBar'>"
response.Write "</td></tr></table>"
response.Write "</td></tr></table>"

 

response.write "</td></tr>"

ReSponse.write "</table>"

End Sub

 


Public Sub ShowPetEquip

ReSponse.write "<table border='0' cellSpacing='2' cellpadding='2' align='center'>"
ReSponse.write "<tr><td></td>"
ReSponse.write "<td align='center'>"
ReSponse.write "<img src='pet/images/Equipment/head/"&Item3&".gif' alt='宠物头盔Lv"&Item3&"'></td>"
ReSponse.write "<td></td></tr>"
ReSponse.write "<tr><td align='right'><img height=30 src='pet/images/Equipment/sword/"&Item1&".gif' alt='宠物武器Lv"&Item1&"'></td>"
ReSponse.write "<td rowSpan='2' align='center'>"
Call ShowPetFace(2,80,80)
ReSponse.write "</td><td><img src='pet/images/Equipment/body/"&Item4&".gif' alt='宠物盔甲Lv"&Item4&"'></td></tr>"
ReSponse.write "<tr><td align='right'><img src='pet/images/Equipment/necklace/"&Item2&".gif' alt='宠物项链Lv"&Item2&"'></td>"
ReSponse.write "<td><img src='pet/images/Equipment/foot/"&Item5&".gif' alt='宠物手套Lv"&Item5&"'></td></tr></table>"             
End Sub


Public Sub ShowPetItem
ReSponse.write "<TABLE cellSpacing=3 cellPadding=3 width='100%' align=center border=0>"

ReSponse.write "<TR>"
ReSponse.write "<TD width='25%' align=center><img height=35 src='pet/images/Item/Hp.gif' width=35></TD>"
Response.write "<TD width='25%' align=center>治愈药水"
Response.Write "<TD width='30%' align=center>拥有数量："&HpItem&"</TD>"
ReSponse.write "<TD width='25%' align=center>[<a href='PetMyPet.asp?Action=UseHp'>使用</a>]"
ReSponse.write "</TR>"

ReSponse.write "<TR>"
ReSponse.write "<TD width='25%' align=center><IMG height=35 src='pet/images/Item/Sp.gif' width=34></TD>"
Response.write "<TD width='25%' align=center>宠物粮食</font>"
Response.Write "<TD width='30%' align=center>拥有数量："&SpItem&"</TD>"
ReSponse.write "<TD width='25%' align=center>[<a href=PetMyPet.asp?Action=UseSp>使用</a>]"
ReSponse.write "</TR>"

ReSponse.write "<TR>"
ReSponse.write "<TD width='25%' align=center><IMG height=35 src='pet/images/Item/Exp.gif' width=34></TD>"
Response.write "<TD width='25%' align=center>Exp药水"
Response.Write "<TD width='30%' align=center>拥有数量："&ExpItem&"</TD>"
ReSponse.write "<TD width='25%' align=center>[<a href=PetMyPet.asp?Action=UseExp>使用</a>]"
ReSponse.write "</TR>"

ReSponse.write "<TR>"
ReSponse.write "<TD width='25%' align=center><IMG height=35 src='pet/images/Item/Atk.gif' width=34></TD>"
Response.write "<TD width='25%' align=center>武器卷轴"
Response.Write "<TD width='30%' align=center>拥有数量："&AtkItem&"</TD>"
ReSponse.write "<TD width='25%' align=center>[<a href=PetMyPet.asp?Action=UseAtk>使用</a>]"
ReSponse.write "</TR>"

ReSponse.write "<TR>"
ReSponse.write "<TD width='25%' align=center><IMG height=35 src='pet/images/Item/Def.gif' width=34></TD>"
Response.write "<TD width='25%' align=center>盔甲卷轴"
Response.Write "<TD width='30%' align=center>拥有数量："&DefItem&"</TD>"
ReSponse.write "<TD width='25%' align=center>[<a href=PetMyPet.asp?Action=UseDef>使用</a>]"
ReSponse.write "</TR>"

ReSponse.write "<TR>"
ReSponse.write "<TD width='25%' align=center><IMG height=35 src='pet/images/Item/Live.gif' width=34></TD>"
Response.write "<TD width='25%' align=center>魂之精"
Response.Write "<TD width='30%' align=center>拥有数量："&LiveItem&"</TD>"
ReSponse.write "<TD width='25%' align=center>[<a href=PetMyPet.asp?Action=UseLive>使用</a>]"
ReSponse.write "</TR>"

ReSponse.write "</TABLE>"

End Sub

Public Sub ShowPetInfo
ReSponse.write "<table  border='0' cellpadding='0' cellSpacing='0' width=300><tr>"
ReSponse.write "<td width='50%'>宠物主人："&GetUserName&" <br />"
ReSponse.write "宠物职业："&PetMajor&" <br />"
ReSponse.write "宠物性别："&PetSex&" <br />"
ReSponse.write "攻击力："&PetAtk&" <br />"
ReSponse.write "防御力："&PetDef&"</td>"
ReSponse.write "<td width='50%'> 宠物名称："&Pet&" <br />"
ReSponse.write "宠物状态："&IfPetDead&" <br />"
ReSponse.write "宠物级别："&Petlevel&" <br />"
ReSponse.write "宠物属性："&Petsx&" <br />"
ReSponse.write "宠物PK："&IfOpenPk&"</td>"
ReSponse.write "</tr></table>"
End Sub

 

Public Sub UseHp
 if(HpItem<1) then
            message="<li>你没有治愈药水"
   
        elseif(PetHp=PetMaxHp or PetDead=1) then
            if (PetHp=PetMaxHp) then
                message="<li>你的宝宝体力充沛，不用喝药水了<li><a href=PetMyPet.asp>返回我的宠物</a>"
    
            else 
                message="<li>先把宝宝救活再说吧:(<li><a href=PetMyPet.asp>返回我的宠物</a>"
    
            end if
        elseif(HpTemp<BasicUseHp) then
            ConnPet.ExeCute("UPDATE Petdata SET PetHp=PetMaxHp,HpItem=HpItem-1 WHERE UserName='"&CookieUserName&"'")
            message="<li>使用成功，你的宝宝Hp增加了 "& HpTemp &" ！<li><a href=PetMyPet.asp>返回我的宠物</a>"
   
        else
            ConnPet.ExeCute("UPDATE Petdata SET PetHp=PetHp+"&BasicUseHp&",HpItem=HpItem-1 WHERE UserName='"&CookieUserName&"'")
             message="<li>使用成功，你的宝宝Hp增加了 "&BasicUseHp&" ！<li><a href=PetMyPet.asp>返回我的宠物</a>"
    
        end if
  succeed(message&"<meta http-equiv=refresh content=3;url='"&Request.ServerVariables("HTTP_REFERER")&"'")
End Sub


Public Sub UseSp
if (SpItem<1 or Petdead=1) then
               if (SpItem<1) then
                message="<li>你没有粮食<li><a href=PetMyPet.asp>返回我的宠物</a>"
    
               else 
                message="<li>先救活宝宝再喂它吧:(<li><a href=PetMyPet.asp>返回我的宠物</a>"
    
               end if
        else
            ConnPet.ExeCute("UPDATE Petdata SET PetSp="&Basicsp&",SpItem=SpItem-1,PetFeedDate='"&Date()&"' WHERE UserName='"&CookieUserName&"'")
            message="<li>使用成功，你的宝宝吃饱了 ！<li><a href=PetMyPet.asp>返回我的宠物</a>"
   
        end if
  succeed(message&"<meta http-equiv=refresh content=3;url='"&Request.ServerVariables("HTTP_REFERER")&"'")
End Sub

Public Sub UseExp
if (ExpItem<1 or Petdead=1) then
            if (ExpItem<1) then
               message="<li>你没有EXP药水<li><a href=PetMyPet.asp>返回我的宠物</a>"
      
               else 
               message="<li>先救活宝宝再喂它吧:(<li><a href=PetMyPet.asp>返回我的宠物</a>"
      
            end if
        else
   PetExp=PetExp+BasicUseExp
            
           
            
            ConnPet.ExeCute("UPDATE Petdata SET PetExp="&PetExp&",ExpItem=ExpItem-1 WHERE UserName='"&CookieUserName&"'")
            message="<li>使用成功，你的宝宝EXP增加了 "& BasicUseExp &"！<li><a href=PetMyPet.asp>返回我的宠物</a>"
   
        end if
  succeed(message&"<meta http-equiv=refresh content=3;url='"&Request.ServerVariables("HTTP_REFERER")&"'")
End Sub

Public Sub UseAtk
if (atkItem<1) then
            message="<li>你没有对武器施法的卷轴<li><a href=PetMyPet.asp>返回我的宠物</a>"
   
        else
        Randomize
         adatk=fix(rnd*atkup)+0
            ConnPet.ExeCute("UPDATE Petdata SET PetAtk=PetAtk+"&adatk&",atkItem=atkItem-1 WHERE UserName='"&CookieUserName&"'")
            if (adatk=0) then
            message="<li>施法失败...卷轴消失了...<li><a href=PetMyPet.asp>返回我的宠物</a>"
            else
            message="<li>使用成功，你的宝宝攻击力增加了 "& adatk &" ！<li><a href=PetMyPet.asp>返回我的宠物</a>"
            end if
   
        end if
  succeed(message&"<meta http-equiv=refresh content=3;url='"&Request.ServerVariables("HTTP_REFERER")&"'")
End Sub

Public Sub UseDef
if (defItem<1) then
            message="<li>你没有对盔甲施法的卷轴<li><a href=PetMyPet.asp>返回我的宠物</a>"
   
        else
                Randomize
         addef=fix(rnd*defup)+0
            ConnPet.Execute("UPDATE Petdata SET PetDef=PetDef+"&addef&",defItem=defItem-1 WHERE UserName='"&CookieUserName&"'")
            if (addef=0) then
            message="<li>施法失败...卷轴消失了...<li><a href=PetMyPet.asp>返回我的宠物</a>"
            else
            message="<li>使用成功，你的宝宝防御力增加了 "& addef &" ！<li><a href=PetMyPet.asp>返回我的宠物</a>"
            end if
   
        end if
  succeed(message&"<meta http-equiv=refresh content=3;url='"&Request.ServerVariables("HTTP_REFERER")&"'")
End Sub

Public Sub UseLive    
 
 
        if (liveItem<1) then
            message="<li>你没有魂之精<li><a href=PetMyPet.asp>返回我的宠物</a>"
   
        elseif(Petdead<1) then
            message="<li>你的宝宝还没有死，干吗复活啊？<li><a href=PetMyPet.asp>返回我的宠物</a>"
   
        else
            ConnPet.ExeCute("Update [PetData] Set PetHp="& Petmaxhp &",PetSp="& Basicsp &",liveItem=liveItem-1,PetFeedDate='"& date() &"',PetDead=0 WHERE UserName='"&CookieUserName&"'")
            message="<li>使用成功，你的宝宝复活了 ！<li><a href=PetMyPet.asp>返回我的宠物</a>"
   succeed(message&"<meta http-equiv=refresh content=3;url='"&Request.ServerVariables("HTTP_REFERER")&"'")
        end if
  succeed(message&"<meta http-equiv=refresh content=3;url='"&Request.ServerVariables("HTTP_REFERER")&"'")

End Sub

 

'''''''''使用技能模块
Public Sub UseSkillForm
If Skill2=0 then error("<li>你没有这个技能<li><a href='PetMyPet.asp'>返回我的宠物</a>") end if
if PetDead=1 then error("<li>先救活你的宠物再说吧.<li><a href='PetMyPet.asp'>返回我的宠物</a>") end if

'技能信息
select case request("skillsort")
case 2
SkillName="为主救贴"
MpReduction=45
SkillDetail="请输入帖子ID：<input name='ThreadID' size=5><input type=submit value=提交>"
end select

'技能具体操作
select case request.form("sort")
case 2

If PetHp<HpReduction+1 then error("<li>宠物的HP不足以使用这个技能.<li><a href='PetMyPet.asp'>返回我的宠物</a>")
Set RsSkill=Conn.execute("select id from [BBSXP_Threads] where id="&request.form("ThreadID")&"")
If RsSkill.Eof then
error("<li>没有找到对应你输入ID的帖子,请检查帖子ID是否正确")
else
ConnPet.execute("update [PetData] set PetMp=PetMp-"&MpReduction&" where UserName='"&GetUserName&"'")
Conn.execute("update [BBSXP_Threads] set lasttime="&SqlNowString&" where id="&request.form("ThreadID")&"")

Message="<li>技能使用成功,该贴已经被拉前<li><a href=PetMyPet.asp>我的宠物</a>"
succeed(message&"<meta http-equiv=refresh content=3;url='PetMyPet.asp'")
end if

end select


'技能界面

response.write "<form method=post>"
response.write "<table class=a2 cellspacing=1 cellpadding=4>"
response.write "<tr class=a1><td>使用技能</td></tr>"
response.write "<tr class=a3><td>技能名称："&SkillName&"</td></tr>"
response.write "<tr class=a3><td>消耗MP："&MpReduction&"</td></tr>"
response.write "<tr class=a3><td>"
response.write SkillDetail
response.write "</td></tr></table>"
response.write "<input type=hidden name=sort value="&request("skillsort")&" >"
response.write "<br><input type=button value='返回我的宠物' onclick=history.back()></form>"


htmlend
End Sub

Public Property Get OwnerPetList
OwnerPetList=PetOwnerList
End Property 
Public Property Get OwnerPetExist
OwnerPetExist=PetExist
End Property  
Public Property Get OwnerPetName
OwnerPetName=Pet
End Property 
Public Property Get OwnerPetLevel
OwnerPetLevel=PetLevel
End Property 
Public Property Get OwnerPetExp
OwnerPetExp=PetExp
End Property 
Public Property Get OwnerPetHp
OwnerPetHp=PetHp
End Property 
Public Property Get OwnerPetMaxHp
OwnerPetMaxHp=PetMaxHp
End Property 
Public Property Get OwnerPetAtk
OwnerPetAtk=PetAtk
End Property 
Public Property Get OwnerPetDef
OwnerPetDef=PetDef
End Property 
Public Property Get OwnerPkTime
OwnerPkTime=PkTime
End Property
Public Property Get OwnerIfOpenPk
OwnerIfOpenPk=IfOpenPk
End Property
Public Property Get OwnerPetDead
OwnerPetDead=PetDead
End Property
Public Property Get OwnerIfPetDead
OwnerIfPetDead=IfPetDead
End Property 
Public Property Get OwnerOpenPk
OwnerOpenPk=OpenPk
End Property

Public Property Get OwnerSkill1
OwnerSkill1=Skill1
End Property 
Public Property Get OwnerSkill2
OwnerSkill2=Skill2
End Property  

Public Sub ShowRank

ShowPetTop("宠物排行榜")

%>
     
<table width="100%" cellpadding="1" cellspacing="1" class="a2">
<tr class="a1">
        <td align="center">宠物名字</td>
                      <td align="center">宠物名称</td>
        <td align="center">宠物主人</td>
                      <td align="center">宠物等级</td>
                      <td align="center">宠物攻击力</td>
                      <td align="center">宠物防御力</td>
                      <td align="center">宠物状态</td>
                      <td align="center">是否接受挑战</td>
</tr>
<%

Set RsRank = Server.CreateObject("ADODB.Recordset")  
RsRank.open "SELECT top 10 * FROM [PetData] ORDER BY PetExp DESC,PetRegDate asc",ConnPet,1,1
RsRank.MoveFirst
Do while not RsRank.eof

           LetUserName=RsRank("UserName")
           FormatPetData
response.write "<tr class='a3' align='center'>"
 response.write "<td>"
 call ShowPetFace(2,45,45)
 response.Write "</td>"
  response.write "<td>"&OwnerPetName&"</td>"
 response.write "<td><a href='profile.asp?UserName="&RsRank("username")&"'>"&RsRank("username")&"</a></td>"
    response.write "<td>"&OwnerPetlevel&"</td>"
    response.write "<td>"&OwnerPetAtk&"</td>"
     response.write "<td>"&OwnerPetDef&"</td>"
      response.write "<td>"&OwnerIfPetDead&"</td>"
   response.write "<td>"&OwnerIfOpenPk&"</td>"
               
response.write "</tr>"
       
RsRank.movenext
Loop
RsRank.Close
Set RsRank=Nothing


%>
</table>   

<%
ShowPetBottom
HtmlEnd
End Sub


End class 
%>
