<% if session("username")="" then Response.Redirect("login.asp") end if %> Arena
 
<% chkmenu=10 %>
  Choose an opponent to fight with
<%if request("a")=1 then%> You are allowed only one pet at one time. <%end if%> <%if request("w")=1 then%> You are already been waiting for an opponent. <%end if%> <%if request("e")=1 then%> You don't have enough strength to fight. <%end if%> <%if request("d")=1 then conn.execute "DELETE opponenttable.*, * FROM UserPetTable INNER JOIN opponenttable ON UserPetTable.userPetId = opponenttable.userpetid WHERE (((UserPetTable.userid)="&session("userid")&"));" end if conn.execute "DELETE opponenttable.*, UserPetTable.userid FROM opponenttable INNER JOIN UserPetTable ON opponenttable.userpetid = UserPetTable.userPetId WHERE (((UserPetTable.userid)="&session("userid")&"));" conn.execute "delete * from livefight where player1="&session("petselected") conn.execute "delete * from livefight where player2="&session("petselected") conn.execute "DELETE livefight.* FROM livefight INNER JOIN UserPetTable ON livefight.player1 = UserPetTable.userPetId WHERE (((livefight.player1)="&session("petselected")&") AND ((UserPetTable.userid)="&session("userid")&"));" conn.execute "DELETE livefight.* FROM livefight INNER JOIN UserPetTable ON livefight.player2 = UserPetTable.userPetId WHERE (((livefight.player2)="&session("petselected")&") AND ((UserPetTable.userid)="&session("userid")&"));" conn.execute "delete * from ad where aid="&session("petselected") conn.execute "delete * from ad where did="&session("petselected") conn.execute "Delete ad.* FROM ad INNER JOIN UserPetTable ON ad.aid = UserPetTable.userPetId WHERE (((UserPetTable.userPetId)="&session("petselected")&") AND ((UserPetTable.userid)="&session("userid")&"));" conn.execute "Delete ad.* FROM ad INNER JOIN UserPetTable ON ad.did = UserPetTable.userPetId WHERE (((UserPetTable.userPetId)="&session("petselected")&") AND ((UserPetTable.userid)="&session("userid")&"));" session("first")="" %>
<% Function RandomNumber(intHighestNumber) Randomize RandomNumber = Int(Rnd * intHighestNumber) + 1 End Function Application.Lock() Application("value") = (RandomNumber(2)) Application.UnLock() %>
<%if request("recent") = "" then recent = 0 else recent = clng(request("recent")) if recent < 0 then recent = 0 end if end if if request("alltime") = "" then alltime = 0 else alltime = clng(request("alltime")) if alltime < 0 then alltime = 0 end if end if %>
  Recent Battles
<%set rswin = Server.CreateObject("ADODB.RECORDSET") rswin.open "SELECT UserPetTable.userpetName, PetTable.petName, FightHistoryTable.strength, FightHistoryTable.Bet FROM PetTable INNER JOIN (UserPetTable INNER JOIN FightHistoryTable ON UserPetTable.userPetId = FightHistoryTable.userpetid) ON PetTable.petId = UserPetTable.petId WHERE (((FightHistoryTable.Result) = 'WIN')) order by fightid;",conn,3,2 if not rswin.eof then rswin.move clng(recent)+0,1 end if %> <%if not rswin.eof then%> <%else Response.Write("") end if%> <%for i=1 to 5 if not rswin.eof then %> <% rswin.movenext end if Next%>
Winners
Name Type Strength Bet
Sorry there are no battle to show
<%=rswin("userpetname")%> <%=rswin("petname")%> <%=rswin("strength")%> <%=rswin("bet")%>
<%rswin.close rswin.open "SELECT UserPetTable.userpetName, PetTable.petName, FightHistoryTable.strength, FightHistoryTable.Bet FROM PetTable INNER JOIN (UserPetTable INNER JOIN FightHistoryTable ON UserPetTable.userPetId = FightHistoryTable.userpetid) ON PetTable.petId = UserPetTable.petId WHERE (((FightHistoryTable.Result) = 'LOSE')) order by fightid;",conn,3,2 if not rswin.eof then rswin.move clng(recent)+0,1 end if %> <% if not rswin.eof then%> <%else Response.Write("") end if%> <%for i=1 to 5 if not rswin.eof then recent = recent + 1 %> <% rswin.movenext end if Next%>
Losers
Name Type Strength Bet
Sorry there are no battle to show
<%=rswin("userpetname")%> <%=rswin("petname")%> <%=rswin("strength")%> <%=rswin("bet")%>
<%if recent > 5 then%> <   <%else%> < <%end if%> <%if not rswin.eof then%> > <%else%> > <%end if%>
 
  All Time Win Leaders
<% rswin.close rswin.open "SELECT UserPetTable.userpetName, PetTable.petName, UserTable.familyName, Sum(weaponPetTable.cost) AS SumOfcost, Count(weaponPetTable.weaponId) AS CountOfweaponId, UserPetTable.userPetId FROM UserTable INNER JOIN ((PetTable INNER JOIN UserPetTable ON PetTable.petId = UserPetTable.petId) INNER JOIN weaponPetTable ON UserPetTable.userPetId = weaponPetTable.userpetId) ON UserTable.userid = UserPetTable.userid GROUP BY UserPetTable.userpetName, PetTable.petName, UserTable.familyName, UserPetTable.userPetId, UserPetTable.totalWins ORDER BY UserPetTable.totalWins DESC;",conn,3,2 if not rswin.eof then rswin.move clng(alltime)+0,1 end if %> <% if not rswin.eof then%> <%else Response.Write("") end if%> <%for i=1 to 5 if not rswin.eof then alltime= alltime + 1 %> <% rswin.movenext End if Next %>
Family Name Pet Name Type Wins Loses Weapons Net Worth
Sorry there are no battle to show
<%=rswin("familyName")%> <%=rswin("userpetname")%> <%=rswin("PetName")%> <%set rsw = Server.CreateObject("Adodb.recordset") rsw.open "select count(userpetid) as cnt from fighthistorytable where result = 'WIN' and userpetid="& rswin("userpetid"),conn if not rsw.eof then Response.Write(rsw("cnt")) end if %> <%set rsl = Server.CreateObject("Adodb.recordset") rsl.open "select count(userpetid) as cnt from fighthistorytable where result = 'LOSE' and userpetid="& rswin("userpetid"),conn if not rsl.eof then Response.Write(rsl("cnt")) end if %> <%=rswin("CountOfweaponId")%> <%=rswin("SumOfcost")%>
<%if alltime > 5 then%> <   <%else%> < <%end if%> <%if not rswin.eof then%> > <%else%> > <%end if%>


INSTRUCTIONS

First select your pet from the pulldown menu in the middle. Once selected, the current weapons that your pet has are located in the box to the right. To browse through the weapons of a certain weapon level, simply click on the text or the graphic for that weapon level. In order to buy weapons from different weapon levels, your pet must first own every weapon in the previous weapon levels. So in order to buy level 2 weapons, your pet would need to own all level 1 weapons. Each pet can only own 1 of every weapon.

Check back often as new weapons are added regularly!!!

<%set rspett = Server.CreateObject("ADODB.RECORDSET") rspett.open "SELECT UserPetTable.userPetname,UserPetTable.energylevel, PetTable.smallimg FROM PetTable INNER JOIN UserPetTable ON PetTable.petId = UserPetTable.petId WHERE (((UserPetTable.userPetId)=" & session("petselected") & "));",conn %>
" width="34" height="34">
Pet Name <%=rspett("userpetname")%>
Energy Level <%=rspett("energylevel")%>
No. of Weapons <% rspett.close rspett.open "select count(weaponpetid) as totalc,sum(cost) as total from weaponpettable where userpetid="& session("petselected") ,conn if not rspett.eof then%> <%=rspett("totalc")%> <%end if%>
Weapons Worth $ <%if not rspett.eof then%> <%=rspett("total")%> <%end if%>