<!--#include file="Inc.asp"-->
<!-- #include file=pet_conn.asp -->
<%
If Not BBS94KK.Founduser Then BBS94KK.GoToErr(10)
BBS94KK.Head("宠物宝贝 → 宠物大冒险")
    
    dim allpetpeople,mypetname,mypet,levelpic,mypetlevel,username
    Dim Rs,SQL
    SQL = "SELECT * FROM mypetdata WHERE username='"&bbs94kk.MyName&"'"
    set rs = connpet.execute(SQL)
                if rs.eof then
           call showmessage("你还没有宠物啊，快攒钱去买吧~","petshop.asp")
       		else
       		
'用很无聊的循环使用变量得到每种道具的名字……
dim rs3,swordname,necklacename,headname,bodyname,footname
set rs3 = connpet.execute("select * from petitemshop where itemclass='sword' and itemnum="&rs("item1"))
swordname = rs3("itemname")
rs3.close
set rs3 = connpet.execute("select * from petitemshop where itemclass='necklace' and itemnum="&rs("item2"))
necklacename = rs3("itemname")
rs3.close
set rs3 = connpet.execute("select * from petitemshop where itemclass='head' and itemnum="&rs("item3"))
headname = rs3("itemname")
rs3.close
set rs3 = connpet.execute("select * from petitemshop where itemclass='body' and itemnum="&rs("item4"))
bodyname = rs3("itemname")
rs3.close
set rs3 = connpet.execute("select * from petitemshop where itemclass='foot' and itemnum="&rs("item5"))
footname = rs3("itemname")
rs3.close



'注册宠物物品箱中物品
dim t,today,petdiff,pett,petlevel,petep,petshowlevel,intval,level1,level2,petpic,pethp,petmaxhp,hpmaxskill,maxhp
dim petatk,petdef,updat,newpettoday,petsp,petsex,petpk
dim hpf,spf,mypetdead,petdead,mypetsex
dim item1,item2,item3,item4,item5,mypetsx,imgset,szd,skill,speed
Dim Rs2,SQL2,hpitem,spitem,expitem,atkitem,defitem,liveitem,weopitem,amoritem,jewel,ring,it1,it1n,it2,it2n,it3,it3n,it4,it4n,it5,it5n,it6,it6n,it7,it7n,it8,it8n
dim tempname,tempclass,tempNum,tempN,it,temp,temp3
dim str,ski,def,vit

sql2 = "SELECT * FROM useritem WHERE username='"&bbs94kk.MyName&"' "
set rs2=connpet.ExeCute(sql2)
hpitem=rs2("hpitem")
spitem=rs2("spitem")
expitem=rs2("expitem")
liveitem=rs2("liveitem")	
weopitem=rs2("weopitem")
amoritem=rs2("amoritem")
jewel=rs2("jewel")
ring=rs2("ring")
it1=rs2("it1")
it1n=rs2("it1n")
it2=rs2("it2")
it2n=rs2("it2n")
it3=rs2("it3")
it3n=rs2("it3n")
it4=rs2("it4")
it4n=rs2("it4n")
it5=rs2("it5")
it5n=rs2("it5n")
it6=rs2("it6")
it6n=rs2("it6n")
it7=rs2("it7")
it7n=rs2("it7n")
it8=rs2("it8")
it8n=rs2("it8n")
rs2.close



t=now()
today = date()
petdiff = DateDiff("d", rs("petregdate"), t)
pett= DateDiff("d", rs("petregdate"), today)
petlevel = sqr((Log(rs("mypetexp")) / Log(10)) * (Log(rs("mypetexp")) / Log(10)) * (Log(rs("mypetexp")) / Log(10)) * (Log(rs("mypetexp")) / Log(10)) * (Log(rs("mypetexp")) / Log(10)))
petep = int (100 * (petlevel - int (petlevel)))
petshowlevel = int (petlevel + 1)
levelpic=int(petshowlevel/10)
if levelpic>10 then levelpic=11 end if
level1=int(petshowlevel)
level2=int(petshowlevel)
petpic=rs("mypetname")
pethp=rs("mypethp")
str=rs("str")
ski=rs("ski")
def=rs("def")
vit=rs("vit")
szd=rs("szd")+petshowlevel*5-str-ski-def-vit
skill=rs("skill")+petshowlevel-rs("atkskill")-rs("defskill")-rs("lifeskill")-rs("luckskill")-rs("learnskill")-rs("hpmaxskill")
petatk=rs("mypetatk")+rs("item1Num")+rs("item2Num")+int(str/2)
petdef=rs("mypetdef")+rs("item3Num")+rs("item4Num")+rs("item5Num")+int(ski/2)
 '获取生命上限
   	      hpmaxskill=1
          if rs("hpmaxskill")>0 then
          hpmaxskill=1+rs("hpmaxskill")/100
          end if 
          if rs("hpmaxskill")>30 then
          hpmaxskill=1.2+rs("hpmaxskill")/100
          end if 
          if rs("hpmaxskill")>100 then
          hpmaxskill=1.5+rs("hpmaxskill")/100
          end if  
		  petmaxhp = int((rs("mypetmaxhp")+vit)*hpmaxskill)
		  maxhp=petmaxhp
petsp=rs("mypetsp")-pett*DEF_PET_basicsp2
if(petsp>DEF_PET_basicsp) then petsp=DEF_PET_basicsp end if
hpf= int (100 * (pethp / petmaxhp)) - 1
spf= int (100 * (petsp / DEF_PET_basicsp)) - 1
if (pethp<0) then pethp=0 end if
if (petsp<0) then petsp=0 end if
if (pethp<1 or petsp<1) then
	petdead="死亡"
else 
	petdead="生存"
end if
if (rs("mypetsex")<2) then
	petsex="雄" 
else
	petsex="雌"
end if
if (rs("openpk") < 2) then
	petpk="等待挑战"
else 
	petpk="拒绝挑战"
end if
if hpf >= 98 then hpf = hpf - 2 end if
if spf >= 98 then spf = spf - 2 end if

item1 = rs("item1")
item2 = rs("item2")
item3 = rs("item3")
item4 = rs("item4")
item5 = rs("item5")
mypet = rs("mypet")
mypetsx = rs("mypetsx")
imgset = rs("imgset")
dim petkill
if petdead="死亡" then
petkill="style='filter: Gray;' onLoad='javascript:if(this.width>100)this;if(this.height>100)this;'"
else
	petkill=""
end if
	end if

			
%>
<table width="760" border="0" cellspacing="1" cellpadding="5" align="center" class=TBone>

  <tr>
	<td class=tbbg1 width="241">
	

					<table width="100%" border="0" cellspacing="2" cellpadding="2">
						<tr> 
							<td width="35%">　</td>
							<td width="20%"> 
            <div align="center"><img src="images/pet/head/<%=rs("item3")%>.gif" alt="<%=headname%> 防御力 <%=rs("item3Num")%>" width="23" height="30"></div>
          </td>
							<td width="35%">　</td>
						</tr>
						<tr> 
							<td>
            <div align="right"><img height=30 src="images/pet/sword/<%=rs("item1")%>.gif" alt="<%=swordname%> 攻击力 <%=rs("item1Num")%>" width="23"></div>
          </td>
							<td rowspan="2">
            <div align="center"> 
              <%if rs("imgset")=-1 then%>
              <img src='images/pet/<%=petpic%>/<%=petpic%><%=levelpic%>.gif' border="0" <%=petkill%> > 
              <%else%>
              <img src='images/pet/<%=petpic%>/<%=petpic%><%=imgset%>.gif' border="0" width="23" height="30" <%=petkill%> > 
              <%end if%>
            </div>
          </td>
							
          <td><img src="images/pet/body/<%=rs("item4")%>.gif" alt="<%=bodyname%> 防御力 <%=rs("item4Num")%>" width="23" height="30"></td>
						</tr>
						<tr> 
							<td>
            <div align="right"><img src="images/pet/necklace/<%=rs("item2")%>.gif" alt="<%=necklacename%> 攻击力 <%=rs("item2Num")%>" width="23" height="30" ></div>
          </td>
							
          <td><img src="images/pet/foot/<%=rs("item5")%>.gif" alt="<%=footname%> 防御力 <%=rs("item5Num")%>" width="23" height="30"></td>
						</tr>
						</table>
				  <table width='100%' border='0' cellpadding='1' cellspacing='1'>
					<tr> 
					  <td align="right"> <div align="right">
						  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
							<tr>
							  <td><div align="left">宠物名称：<%=mypet%>
						  <br>
						  宠物性别：<%=petsex%><br>
                      宠物状态：<%=petdead%><br>
						宠物属性：<%=mypetsx%></div><div align="left">宠物冒险：<%=petpk%></div><div align="left">宠物转生：<%=rs("relive")%></div><div align="left">宠物级别：<%=petshowlevel%></div>--------------<span lang="zh-cn"><br>
                                    力量</span>：<%=str%><br>
						  <span lang="zh-cn">皮肤</span>：<%=ski%><br>
						  <span lang="zh-cn">敏捷</span>：<%=def%><br>
						  <span lang="zh-cn">体力</span>：<%=vit%><br>
                                攻击：<%=petatk%><br>
                                防御：<%=petdef%><br>
								    --------------<br>
								HP : <%=pethp%> / <%=petmaxhp%><br>    
								SP : <%=petsp%> / <%=DEF_PET_basicsp%><br>    
								EXP : <%=petep%>%[<%=rs("mypetexp")%>]<br>    
                                <p><a href="petmypet.asp"><font color="#FF0000">我要回家装备一下</font></a></td>
							</tr>
						  </table>
						</div></td>
					</tr>
				  </table>
				  </td>
				<td width="590"> <div align="center">
				
        <map name="petrisk"> 
          <area shape="poly" coords="277,385,269,375,264,367,266,347,281,341,293,330,302,323,309,320,318,320,333,332,336,342,346,348,352,355,353,367,353,373,349,384,342,390,330,400,313,406,297,408,286,410,275,403" href="Petpknpc2.ASP?monsid=1" alt="新手村 0-10级" title="新手村 0-10级">
          <area shape="poly" coords="250,299,250,290,253,285,256,272,259,269,263,263,272,249,290,253,301,258,310,265,311,266,318,272,317,276,320,286,321,289,326,293,326,299,318,305,310,306,291,314,283,316,278,310,270,309,263,309,254,306,250,303" href="Petpknpc2.ASP?monsid=2" alt="矿山 10-20级" title="矿山 10-20级">
          <area shape="poly" coords="561,395,520,410,487,399,477,380,480,372,497,356,503,357,507,356,514,348,517,345,525,347,530,348,535,351,559,369" href="Petpknpc2.ASP?monsid=4" alt="梦幻之岛 30-40级" title="梦幻之岛 30-40级">
          <area shape="poly" coords="365,307,382,299,401,295,420,286,430,282,445,267,451,256,455,241,451,224,440,212,427,203,406,203,397,200,389,205,378,212,363,215,350,219,335,221,323,228,310,234,309,244,329,252,350,252,351,255,354,268,357,278,353,291,347,300,344,304,343,310,347,315,356,313" href="Petpknpc2.ASP?monsid=3" alt="怪兽之家 20-30级" title="怪兽之家 20-30级">
          <area shape="poly" coords="460,300,468,285,469,271,471,262,477,258,496,258,514,262,515,271,521,284,528,287,533,297,534,312,524,322,509,325,494,323,482,320,464,313,460,304" href="Petpknpc2.ASP?monsid=5" alt="海盗船 40-50级" title="海盗船 40-50级">
          <area shape="poly" coords="191,230,185,227,175,224,162,221,157,214,166,208,179,202,192,198,201,193,204,189,205,183,214,174,221,172,226,164,227,167,237,173,244,176,247,182,249,190,249,195,253,199,260,199,264,203,263,215,266,217,269,217,256,228,246,237,235,246,227,251,220,254,209,254,200,253,196,243,193,237" href="Petpknpc2.ASP?monsid=7" alt="弭患世界 60-70级" title="弭患世界 60-70级">
          <area shape="poly" coords="313,218" href="#">
          <area shape="poly" coords="217,157,230,136,233,122,224,109,216,101,227,83,239,72,239,57,249,29,267,18,288,9,312,10,325,12,331,12,341,25,355,38,360,54,361,67,364,78,373,86,386,93,396,97,400,103,390,113,374,122,376,133,376,136,338,135,316,135,293,142,281,150,268,152,243,153,219,162" href="Petpknpc2.ASP?monsid=9" alt="雪原仙宫 80-90级" title="雪原仙宫 80-90级">
          <area shape="poly" coords="397,137,406,144,425,156,433,165,450,171,472,171,506,165,535,165,549,158,558,151,549,141,537,133,552,132,566,133,576,126,581,120,563,111,546,97,539,80,534,73,523,67,510,72,502,77,491,72,487,64,476,63,465,64,460,70,456,72,442,69,433,69,421,73,417,79,409,86,408,90,410,95,401,105,392,118,392,124" href="Petpknpc2.ASP?monsid=10" alt="火焰山 90-100级" title="火焰山 90-100级">
          <area shape="poly" coords="500,243,489,244,489,232,498,230,502,227,505,216,510,205,513,193,518,185,523,182,536,183,558,191,563,198,566,204,566,221,572,224,575,233,575,246,566,253,556,255,537,255,525,252,510,251,499,248,493,246" href="Petpknpc2.ASP?monsid=6" alt="从前小屋 50-60级" title="从前小屋 50-60级">
				
          <area shape="poly" coords="331,216,357,211,378,206,389,201,407,198,420,195,413,181,405,164,387,160,375,159,371,153,369,147,352,147,331,147,320,147,318,157,314,160,302,162,297,167,297,173,294,183,291,196,295,205,302,214,314,220,320,220" href="Petpknpc2.ASP?monsid=8" alt="沙漠 70-80级" title="沙漠 70-80级">
          <area shape="poly" coords="130,195,146,189,163,189,176,186,187,177,197,169,206,160,212,154,221,144,228,132,223,131,210,129,197,127,184,121,174,112,165,105,152,97,140,92,130,86,109,84,100,82,84,82,71,82,57,82,41,89,41,99,44,114,50,125,52,144,56,154,63,170,66,181,65,191,60,195,70,197,75,202,81,205,88,208,98,210,112,212,114,212,127,202" href="Petpknpc2.ASP?monsid=11" alt="黑暗魔堡 100级以上" title="黑暗魔堡 100级以上">
        </map>
        <img border="0" src="images/pet/map2.jpg" width="585" height="450" usemap="#petrisk"> 
      </div>
    </td>
			  </tr>
			</table>

	<%
	rs.close%>
<%bbs94kk.footer()%>
