Browser MMO Video #20

Location of the Videos
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #20

Post by hallsofvallhalla »

next video is a admin backend to add things but for now just manually add things, also which store? each location has a store.
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

Re: Video #20

Post by neronix17 »

Scratch my last post, I can confirm tehbeasthax was right. My site didnt update quick enough lol
This isnt just a gimp mask...This is an S&M gimp mask...
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #20

Post by hallsofvallhalla »

so what is the problem. I am still not understanding.
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

Re: Video #20

Post by neronix17 »

hallsofvallhalla wrote:so what is the problem. I am still not understanding.
In battle.php something was stopping the creature from being re-selected after being killed. The fix the other guy posted works :)
This isnt just a gimp mask...This is an S&M gimp mask...
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

Re: Video #20

Post by neronix17 »

Oh and theres a problem when leveling up, the first level up page doesnt link right, all 4 of the options have an upper case L in Levelup2.php, the files named with a lower case l so just renaming the page works. Or if you want you can rename the links.
This isnt just a gimp mask...This is an S&M gimp mask...
tehbeasthax
Posts: 15
Joined: Thu Feb 25, 2010 6:22 pm

Re: Video #20

Post by tehbeasthax »

yeah neronix thanks for explaining that re-selecting monster thing i made it like a huge explanation and you made it like 3 words
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #20

Post by hallsofvallhalla »

um as far as i can tell he just reverted back to the old way. That completely throws out what i was trying accomplish. You need to make some creatures that are your level so there is a creature to select.
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

Re: Video #20

Post by neronix17 »

hallsofvallhalla wrote:um as far as i can tell he just reverted back to the old way. That completely throws out what i was trying accomplish. You need to make some creatures that are your level so there is a creature to select.
Ive got 3 creatures for each lvl from 1 to 5 and my character is lvl 3 lol, I dont know what I did but mine seems to be working, and giving me creatures at my lvl every time, the odds that I just so happen to get a creature for my lvl 20 times in a row out of 15 creatures is pretty low lol
This isnt just a gimp mask...This is an S&M gimp mask...
tehbeasthax
Posts: 15
Joined: Thu Feb 25, 2010 6:22 pm

Re: Video #20

Post by tehbeasthax »

same with me could be that it isn't but the monsters are my level so I think the old-way works
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #20

Post by hallsofvallhalla »

did anyone even bother to troubleshoot the current script?

here is the fix it was missing one line...My bad.

battle.php

Code: Select all

<?php
include_once 'connect.php';
session_start();

include_once 'logo.php';
?>
 <link href="style.css" rel="stylesheet" type="text/css" />
<div id="login2" div align="center">


<?php

 


if (isset($_SESSION['player']))
{
  $player=$_SESSION['player'];
}
else
{
  echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
  exit;
}
?>
</div>
<?php
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$pllocation = $playerinfo3['location']; /// added line here.....


include_once 'statpanel.php';

$pid = $playerinfo3['id'];
$name = $playerinfo3['name'];
$playerhp = $playerinfo3['hpoints'];
$playerattack = $playerinfo3['attack'];
$playerdefense = $playerinfo3['defense'];

?>
<div id="table">
<?php

 if (isset($_GET['randid']))
{
   $randid=$_GET['randid'];
   $iteminfo="SELECT * from inventory where randid='$randid' AND id ='$pid'";
$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2);

if (!$iteminfo3['name'])
{
}
else
{

$iname = $iteminfo3['name'];
$stats = $iteminfo3['stats'];
$statadd = $iteminfo3['statadd'];
$type = $iteminfo3['type'];
 
 if ($type == "healing")
 {
   $newhp = $statadd + $playerhp;
   if ($newhp > $playerinfo3['maxhp'])
   {
    $newhp = $playerinfo3['maxhp'];
   }
    $updateplayer="update players set hpoints='$newhp' where id='$pid'";
  mysql_query($updateplayer) or die("Could not update player");

    $updateitem="DELETE from inventory where id='$pid' AND randid='$randid' limit 1";
  mysql_query($updateitem) or die("Could not delete item");
   
   $playerhp = $newhp;
  
  echo "Used " . $iname . " and recovered " . $statadd . ".<br>";
 }

}}

 
 


$creature = $playerinfo3['creature'];
 if ($creature != 0)
{
 $creatureinfo="SELECT * from creatures where id='$creature'";
$creatureinfo2=mysql_query($creatureinfo) or die("could not get the creature you were fighting!");
$creatureinfo3=mysql_fetch_array($creatureinfo2);

}
else
{
////////////////////new for video 20
$areaninfo="SELECT * from locations where location='$pllocation' AND type='arena'";
$areaninfo2=mysql_query($areaninfo) or die("could not get arena");
$areaninfo3=mysql_fetch_array($areaninfo2);
$arenalevel = $areaninfo3['level'];


  $creatureinfo="SELECT * from creatures where level <= '$arenalevel' order by rand() limit 1";
$creatureinfo2=mysql_query($creatureinfo) or die("could get a creature!");
$creatureinfo3=mysql_fetch_array($creatureinfo2);
$cid = $creatureinfo3['id'];
$updateplayer="update players set creature='$cid' where name='$name'";
  mysql_query($updateplayer) or die("Could not update player");
}

$creature = $creatureinfo3['name'];
$creaturehp = $creatureinfo3['hpoints'];
$creatureattack = $creatureinfo3['attack'];
$creaturedefense = $creatureinfo3['defense'];



?>
</div>
<div id="player">
<?php
/////player info
echo "<u> " . $playerinfo3['name'] . "</u><br>";
echo "Hit points = " . $playerhp . "<br>";
echo "Attack = " . $playerattack . "<br>";
echo "Defense = " . $playerdefense . "<br><br><br>";
?>
</div>
<div id="creature">
<?php
///////creature info
echo "<u> " . $creatureinfo3['name'] . "</u><br>";
echo "Hit points = " . $creaturehp . "<br>";
echo "Attack = " . $creatureattack . "<br>";
echo "Defense = " . $creaturedefense . "<br><br><br>";

echo "<a href='attack.php'>Attack</a>";
echo "<br><a href='usemagic.php'>Use Magic</a>";
echo "<br><a href='useitem.php'>Use Item</a>";
echo "<br><a href='index.php'>Exit Arena</a>";


?>
</div>

<div id="logout">
<?php
echo "<br><a href='logout.php'><img src='images/logout.gif'>";
?>
</div>
Post Reply

Return to “Older Browser MMO Videos”