<!-- #include file=../include/skin.asp -->
<!-- #include file=include/con_pet.asp -->
<!-- #include file=pet_conn.asp -->
<%
tit="宠物转生所"
call web_head(2,0,0,0,0)

    dim money,smoney,saveday,allmoney,time1,time2,daikuang,dkdu,daiday,sucmsg
    dim Form_userphoto,Form_FaceUrl,Form_FaceWidth,Form_FaceHeight
    
 set rs=joekoe_cms.exec("select * from user_data where username='"&login_username&"'",1)
    money=rs("emoney")
    rs.close
    

    sql = "SELECT * FROM mypetdata WHERE username='"&login_username&"' "
    rs.open sql,connpet,1,3
    if rs.eof then
        call showmessage("你还没有宠物啊，快攒钱去买吧~","petshop.asp")
        else
dim petlevel,relive,atkskill,defskill,luckskill,learnskill,lifeskill,hpmaxskill,temp
    if request("action") = "change" then
		   if rs("mypetdead") <> 0 then 
			   call showmessage("先把宝宝救活再说吧:(","petmypet.asp")
		   end if
		   relive=int(rs("relive"))
		   petlevel=int(rs("mypetlevel"))
		   atkskill=rs("atkskill")
           defskill=rs("defskill")
           luckskill=rs("luckskill")
           learnskill=rs("learnskill")
           lifeskill=rs("lifeskill")
           hpmaxskill=rs("hpmaxskill")

           
           
			temp = int(6*rnd)+1
            select case temp
			case 1
            atkskill=atkskill+1
			case 2
			defskill=defskill+1
			case 3
			luckskill=luckskill+1		
			case 4
			learnskill=learnskill+1
			case 5
			hpmaxskill=hpmaxskill+1
			case 6
			lifeskill=lifeskill+1
			end select   

		   
           if petlevel<100 then
			call showmessage("你的级别不够，还是先练练吧~","petrisk.asp")
            elseif request("petname") = "" then
                call showmessage("你还没有选定你要转生的宝宝啊，请重新选择","petrelive.asp")
                elseif money < DEF_PET_relmoney then
                    call showmessage("你没有足够的钱转生","petrelive.asp")
                    else
                    dim pettoday,pets,relmoney,pethp,petsp,petatk,petdef,szd,skill
                    
                    Randomize '初始化随机数生成器。

                    pettoday = date()
                    pets = rs("mypetsex")
                    relmoney = DEF_PET_relmoney 
                    pethp = DEF_PET_basichp
                    petsp = DEF_PET_basicsp
                    petatk = Int(rs("mypetatk")+10)
                    petdef = Int(rs("mypetdef")+10)
                    szd=rs("szd")+30
                    skill=rs("skill")+5
                    relive = relive + 1

                    if request("petname") = 1 then
                    call joekoe_cms.exec("UPDATE user_data SET emoney=emoney-"&relmoney&" WHERE username='"&login_username&"'",0)
                        SQL = "UPDATE mypetdata SET mypetname='dragon',mypetlevel='1',mypetexp='1',mypethp='"&pethp&"',mypetmaxhp='"&pethp&"',mypetsp='"&petsp&"',mypetatk='"&petatk&"',mypetdef='"&petdef&"',mypetsx='火',petregdate='"&pettoday&"',atkskill='0',defskill='0',luckskill='0',hpmaxskill='0',learnskill='0',lifeskill='0',str='0',ski='0',def='0',vit='0',szd='"&szd&"',skill='"&skill&"',relive='"&relive&"' WHERE username='"& login_username &"' "
                        'response.write sql : response.end
                        connpet.ExeCute(SQL)
                        call showmessage("转生成功！你的宠物转生为<font color=blue>泡泡龙</font>宝宝，防御和技能均有提升，继续努力吧~","petmypet.asp")
                    elseif request("petname") = 2 then
                        call joekoe_cms.exec("UPDATE user_data SET emoney=emoney-"&relmoney&" WHERE username='"&login_username&"'",0)
                        SQL = "UPDATE mypetdata SET mypetname='bst',mypetlevel='1',mypetexp='1',mypethp='"&pethp&"',mypetmaxhp='"&pethp&"',mypetsp='"&petsp&"',mypetatk='"&petatk&"',mypetdef='"&petdef&"',mypetsx='土',petregdate='"&pettoday&"',atkskill='0',defskill='0',luckskill='0',hpmaxskill='0',learnskill='0',lifeskill='0',str='0',ski='0',def='0',vit='0',szd='"&szd&"',skill='"&skill&"',relive='"&relive&"' WHERE username='"& login_username &"' "
                        connpet.ExeCute(SQL)
                        call showmessage("转生成功！你的宠物转生为<font color=blue>猫尾球</font>宝宝，防御和技能均有提升，继续努力吧~","petmypet.asp")
                    elseif request("petname") = 3 then
           call joekoe_cms.exec("UPDATE user_data SET emoney=emoney-"&relmoney&" WHERE username='"&login_username&"'",0)
                        SQL = "UPDATE mypetdata SET mypetname='bird',mypetlevel='1',mypetexp='1',mypethp='"&pethp&"',mypetmaxhp='"&pethp&"',mypetsp='"&petsp&"',mypetatk='"&petatk&"',mypetdef='"&petdef&"',mypetsx='水',petregdate='"&pettoday&"',atkskill='0',defskill='0',luckskill='0',hpmaxskill='0',learnskill='0',lifeskill='0',str='0',ski='0',def='0',vit='0',szd='"&szd&"',skill='"&skill&"',relive='"&relive&"' WHERE username='"& login_username &"' "
                        connpet.ExeCute(SQL)
                        call showmessage("转生成功！你的宠物转生为<font color=blue>天使球</font>宝宝，防御和技能均有提升，继续努力吧~","petmypet.asp")
                    elseif request("petname") = 4 then
              call joekoe_cms.exec("UPDATE user_data SET emoney=emoney-"&relmoney&" WHERE username='"&login_username&"'",0)
                        SQL = "UPDATE mypetdata SET mypetname='green',mypetlevel='1',mypetexp='1',mypethp='"&pethp&"',mypetmaxhp='"&pethp&"',mypetsp='"&petsp&"',mypetatk='"&petatk&"',mypetdef='"&petdef&"',mypetsx='木',petregdate='"&pettoday&"',atkskill='0',defskill='0',luckskill='0',hpmaxskill='0',learnskill='0',lifeskill='0',str='0',ski='0',def='0',vit='0',szd='"&szd&"',skill='"&skill&"',relive='"&relive&"' WHERE username='"& login_username &"' "
                        connpet.ExeCute(SQL)
                        call showmessage("转生成功！你的宠物转生为<font color=blue>苹果派</font>宝宝，防御和技能均有提升，继续努力吧~","petmypet.asp")
                    elseif request("petname") = 5 then
                    call joekoe_cms.exec("UPDATE user_data SET emoney=emoney-"&relmoney&" WHERE username='"&login_username&"'",0)
                        SQL = "UPDATE mypetdata SET mypetname='devil',mypetlevel='1',mypetexp='1',mypethp='"&pethp&"',mypetmaxhp='"&pethp&"',mypetsp='"&petsp&"',mypetatk='"&petatk&"',mypetdef='"&petdef&"',mypetsx='金',petregdate='"&pettoday&"',atkskill='0',defskill='0',luckskill='0',hpmaxskill='0',learnskill='0',lifeskill='0',str='0',ski='0',def='0',vit='0',szd='"&szd&"',skill='"&skill&"',relive='"&relive&"' WHERE username='"& login_username &"' "
                        connpet.ExeCute(SQL)
                        call showmessage("转生成功！你的宠物转生为<font color=blue>幽灵球</font>宝宝，防御和技能均有提升，继续努力吧~","petmypet.asp")
                    elseif request("petname") = 6 then
                 call joekoe_cms.exec("UPDATE user_data SET emoney=emoney-"&relmoney&" WHERE username='"&login_username&"'",0)
                        SQL = "UPDATE mypetdata SET mypetname='bleb',mypetlevel='1',mypetexp='1',mypethp='"&pethp&"',mypetmaxhp='"&pethp&"',mypetsp='"&petsp&"',mypetatk='"&petatk&"',mypetdef='"&petdef&"',mypetsx='水',petregdate='"&pettoday&"',atkskill='0',defskill='0',luckskill='0',hpmaxskill='0',learnskill='0',lifeskill='0',str='0',ski='0',def='0',vit='0',szd='"&szd&"',skill='"&skill&"',relive='"&relive&"' WHERE username='"& login_username &"' "
                        connpet.ExeCute(SQL)
                        call showmessage("转生成功！你的宠物转生为<font color=blue>史莱姆</font>宝宝，防御和技能均有提升，继续努力吧~","petmypet.asp")
                    elseif request("petname") = 7 then
                   call joekoe_cms.exec("UPDATE user_data SET emoney=emoney-"&relmoney&" WHERE username='"&login_username&"'",0)
						
                        SQL = "UPDATE mypetdata SET mypetname='flower',mypetlevel='1',mypetexp='1',mypethp='"&pethp&"',mypetmaxhp='"&pethp&"',mypetsp='"&petsp&"',mypetatk='"&petatk&"',mypetdef='"&petdef&"',mypetsx='无',petregdate='"&pettoday&"',atkskill='0',defskill='0',luckskill='0',hpmaxskill='0',learnskill='0',lifeskill='0',str='0',ski='0',def='0',vit='0',szd='"&szd&"',skill='"&skill&"',relive='"&relive&"' WHERE username='"& login_username &"' "
                        connpet.ExeCute(SQL)
                        call showmessage("转生成功！你的宠物转生为<font color=blue>星星花</font>宝宝，攻击、防御和技能均有提升，继续努力吧~","petmypet.asp")
					elseif request("petname") = 8 then
						if relive<3 then 
							call showmessage("3转才可以选择该宠物","petrelive.asp")
						else
call joekoe_cms.exec("UPDATE user_data SET emoney=emoney-"&relmoney&" WHERE username='"&login_username&"'",0)
						
							SQL = "UPDATE mypetdata SET mypetname='Gol',mypetlevel='1',mypetexp='1',mypethp='"&pethp&"',mypetmaxhp='"&pethp&"',mypetsp='"&petsp&"',mypetatk='"&petatk&"',mypetdef='"&petdef&"',mypetsx='龙',petregdate='"&pettoday&"',atkskill='0',defskill='0',luckskill='0',hpmaxskill='0',learnskill='0',lifeskill='0',str='0',ski='0',def='0',vit='0',szd='"&szd&"',skill='"&skill&"',relive='"&relive&"' WHERE username='"& login_username &"' "
							connpet.ExeCute(SQL)
							call showmessage("转生成功！你的宠物转生为<font color=blue>百变兽</font>宝宝，攻击、防御和技能均有提升，继续努力吧~","petmypet.asp")
						end if
                    end if
                end if

        end if
end if                    
rs.close
set rs=nothing
'Endcon()
%>
<table width="760" border="0" cellspacing="1" cellpadding="5" align="center" class=TBone>
 
  <tr>
    <td class=tbbg1>
    
<form action=petrelive.asp name="petname" mtehod=post>

          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              
            <td width="28%" valign="top">
<table width="79%"  border="0" align="center" cellpadding="3" cellspacing="3">
                  <tr> 
                    <td width="100%"> <div align="center">我的资料</div></td>
                  </tr>
         <%call pet_left("")%>
                  <tr> 
                    <td> <div align="center">
                        <nobr>用户<%=DEF_PointsName%>: <%=money%>金币 </nobr>    
                        </div></td>
                  </tr>
                </table> 
                <br>
                <br>
                <table width="79%"  border="0" align="center" cellpadding="3" cellspacing="3">
                  <tr> 
                    <td width="100%"> <div align="center"><!-- #include file=petnav.asp --></div>
                      </td>
                  </tr>
                </table> 
                <div align="right"></div></td>
              <td width="72%"><table width="100%"  border="0" align="center" cellpadding="3" cellspacing="3">
			  					<tr><font color=blue><%=login_username%></font>，欢迎你来到宠物转生所！如果你的宠物等级到达125以上，就可以来这选定你要转生的属系；转生后宠物将重新开始升级，每转1次基本攻击和防御都上升10，增加30点素质点，增加5点技能值。<b><a href=petrelive2.asp>如果想换换点口味点这里</a></b><p></tr>
                  <tr> 
                    <td width="24%"><div align="center">宠物名称</div></td>
                    <td width="58%"><div align="center">宠物介绍</div></td>
                    <td width="18%"><div align="center">选择转生</div></td>
                  </tr>
                  <tr> 
                    <td><div align="center"><img src="images/pet/dragon.gif" width="45" height="46"><br>
                        泡泡龙（龙族系）</div></td>
                    <td>来自东方的一条龙，随着你升级而升级，最终形态将是十分帅气人龙。<br>
                      宠物属性：火 <font color="#FF0000">转生费用： <%=DEF_PET_relmoney%> 
                      <%=DEF_PointsName%> </font><br> </td>
                    <td><div align="center"> 
                        <input class='94kk' type="radio" name="petname" value="1">
                        选择</div></td>
                  </tr>
                  <tr> 
                    <td><div align="center"><img src="images/pet/bst.gif" width="45" height="42"><br>
                        猫尾球（兽族系） </div></td>
                    <td>可爱的兽系宠物，也是人类最好的朋友，最终形态是黑暗守护犬。<br>
                      宠物属性：土 <font color="#FF0000">转生费用： <%=DEF_PET_relmoney%> 
                      <%=DEF_PointsName%> </font></td>
                    <td><div align="center"> 
                        <input class='94kk' type="radio" name="petname" value="2">
                        选择</div></td>
                  </tr>
                  <tr> 
                    <td><div align="center"><img src="images/pet/bird.gif" width="45" height="44"><br>
                        天使球（飞鸟系） </div></td>
                    <td>小鸟每个人都喜欢，但是你知道他们还有强大的能力，最终形态是大红鹰<br>
                      宠物属性：水 <font color="#FF0000">转生费用： <%=DEF_PET_relmoney%> 
                      <%=DEF_PointsName%> </font></td>
                    <td><div align="center"> 
                        <input class='94kk' type="radio" name="petname" value="3">
                        选择</div></td>
                  </tr>
                  <tr> 
                    <td><div align="center"><img src="images/pet/green.gif" width="45" height="46"><br>
                        苹果派（植物系） </div></td>
                    <td>谁也没有想到植物有如此强大的能力，最终形态是节节高<br>
                      宠物属性：木 <font color="#FF0000">转生费用： <%=DEF_PET_relmoney%> 
                      <%=DEF_PointsName%> </font></td>
                    <td><div align="center"> 
                        <input class='94kk' type="radio" name="petname" value="4">
                        选择</div></td>
                  </tr>
                  <tr> 
                    <td><div align="center"><img src="images/pet/devil.gif" width="45" height="46"><br>
                        幽灵球（恶魔系） </div></td>
                    <td>一生下来就有神秘色彩的幽灵球，同时也拥有神秘的功能，最终形态是巨灵恶魔<br>
                      宠物属性：金 <font color="#FF0000">转生费用： <%=DEF_PET_relmoney%> 
                      <%=DEF_PointsName%> </font></td>
                    <td><div align="center"> 
                        <input class='94kk' type="radio" name="petname" value="5">
                        选择</div></td>
                  </tr>
                  <tr> 
                    <td><div align="center"><img src="images/pet/bleb.gif" width="45" height="46"><br>
                        史莱姆（布丁系） </div></td>
                    <td>来自其他世界的软体动物，最终进化形态是黄金熊布丁<br>
                      宠物属性：水 <font color="#FF0000">转生费用： <%=DEF_PET_relmoney%> 
                      <%=DEF_PointsName%> </font></td>
                    <td><div align="center"> 
                        <input class='94kk' type="radio" name="petname" value="6">
                        选择</div></td>
                  </tr>
                  <tr> 
                    <td><div align="center"><img src="images/pet/flower.gif" width="45" height="46"><br>
                        星星花（水晶系） </div></td>
                    <td>又一个来自异世界的小可爱，最终形态为水晶花（特别开放的无属性宠物哦！）<br>
                      宠物属性：无 <font color="#FF0000">转生费用： <%=DEF_PET_relmoney%> 
                      <%=DEF_PointsName%> </font></td>
                    <td><div align="center"> 
                        <input class='94kk' type="radio" name="petname" value="7">
                        选择</div></td>
                  </tr>
				  
                    <td><div align="center"><img src="images/pet/Gol.gif" width="88" height="77"><br>
                        百变兽（神兽系） </div></td>
                    <td>神圣的百变兽，由于强大的能力，让他居于乱世中的中立，最终形态是兽王<br>
                      宠物属性：龙 <font color="#FF0000">转生费用： <%=DEF_PET_relmoney%> 
                      <%=DEF_PointsName%> </font></td>
                    <td><div align="center"> 
                        
                      <input class='94kk' type="radio" name="petname" value="8">
                        选择</div></td>
                  </tr>
                  <tr> 
                    <td colspan="3"><div align="center"> 
                        <input class='94kk' type="hidden" name="action" value="change">
                        <input class='94kk' name="submit" type="submit" value="选择">
                      </div></td>
                  </tr>

                </table></td>
            </tr>
          </table> 
          </form>


	</td></tr></table>
<%call web_end(0,0)
%>