Browser MMO Video #34

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

Browser MMO Video #34

Post by hallsofvallhalla »

dust1031
Posts: 92
Joined: Fri Jul 22, 2011 3:38 am

Re: video 34

Post by dust1031 »

halls, your next video ideas sound awesome. cant wait for them. btw wheres the source.
ConceptDestiny
Posts: 261
Joined: Wed Apr 28, 2010 8:35 am

Re: video 34

Post by ConceptDestiny »

Nice video, good job halls! :)
Justeenoster
Posts: 9
Joined: Mon Sep 05, 2011 4:05 pm

Re: video 34

Post by Justeenoster »

Another game update!This video's work is in it.

[youtubehd]http://www.youtube.com/watch?v=r5KCW0DwgP0[/youtubehd]
darspire
Posts: 194
Joined: Sat Jul 25, 2009 9:21 pm

Re: video 34

Post by darspire »

this is the most recent video right? are you going to post the source with your next set of videos halls? i like to use the script you have made and twist it to fit my game. that and i dont have any codes any more cuz i rebooted my PC :(
if you love something, let it go.
if it doesnt return.....hunt it down and kill it.
countvoldermort
Posts: 165
Joined: Tue Oct 13, 2009 4:22 pm

Re: video 34

Post by countvoldermort »

EDIT: Fixed

Hey guys, can someone please post the FULL equipment.php, ASAP if Possible

EDIT: You said you'd fix the Quest Log location going to 0.... I cant make Head nor Tail of the Quests Script, its say location = "$location" and in another place it says location = "$qid" i just cant work it out.... heres my script:

Code: Select all

<?php


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

 if (isset($_SESSION['player'])) 
  {
    $player=$_SESSION['player'];
    $playerinfo="SELECT * from players where name='$player'";
    $playerinfo2=mysql_query($playerinfo) or die("Could not get user stats");
    $playerinfo3=mysql_fetch_array($playerinfo2);
    
	 }
	else
	{
	print "Sorry, not logged in  please <A href='login.php'>Login</a><br>";
 exit;}


include_once 'statpanel.php';
 ?>
 <div id ="locations">
 <?php
$playerhp = $playerinfo3['hpoints'];
if ($playerhp < 1)
{
  echo "You are dead!" ;
  echo "<br><a href='useitem.php>Use an Item";
  exit;
}
$location = $playerinfo3['location'];

$bypass = 0;
$newquest = 0;

		  
if(isset($_POST['giver']))
{
$qid = $_POST['id'];
$qname = $_POST['name'];
$bypass = 1;
$house="SELECT * from playerquests where pid='$playerinfo3[name]' AND location='$qid' AND name='$qname' order by level DESC Limit 1";
$house2=mysql_query($house) or die("Could get housing");
 $house3=mysql_fetch_array($house2);
 
 if (!isset($house3['name']))
 {
 $house3['level'] = 1;
 $newquest = 1;
 }
 
 $selectquest="SELECT * from questgivers where location='$location' AND name='$qname' AND level='$house3[level]'";
 $selectquest2=mysql_query($selectquest) or die("could not select quest");
  $selectquest3=mysql_fetch_array($selectquest2);
  if (!isset($selectquest3['name']))
  {echo "I have no more quests for you at this time.<br><br>";}
  else
  {
  echo "<b><u>" . $selectquest3['name'] . "</b></u><br><br>";
  echo $selectquest3['givequest'] . "<br><br>";
 
   echo "
	  <form method='POST' action='quests.php'>
	     <input type='submit' value='Accept' name='addw' />
      	     <input type='hidden' name='id' value='$location'>
		   <input type='hidden' name='name' value='$selectquest3[name]'>
		   <input type='hidden' name='description' value='$selectquest3[description]'>
		    <input type='hidden' name='preitem' value='$selectquest3[preitem]'>
			 <input type='hidden' name='preitemtype' value='$selectquest3[preitemtype]'>
		   <input type='hidden' name='accept' value='1'>
		       </form><br><br>";
  
  if ($newquest == 1)
  {
  echo "	  <form method='POST' action='quests.php'>
	     <input type='submit' value='Complete Quest' name='addw' />
      	     <input type='hidden' name='id' value='$qid'>
		   <input type='hidden' name='name' value='$selectquest3[name]'>
		   <input type='hidden' name='qcompleted' value='1'>
		    <input type='hidden' name='level' value='1'>
		    <input type='hidden' name='newquest' value='1'>
		    </form><br><br>";
}
else
{
 echo "
	  <form method='POST' action='quests.php'>
	     <input type='submit' value='Complete Quest' name='addw' />
      	     <input type='hidden' name='id' value='$qid'>
		   <input type='hidden' name='name' value='$selectquest3[name]'>
		    <input type='hidden' name='level' value='$house3[level]'>
		   <input type='hidden' name='qcompleted' value='1'>
		   
		    </form><br><br>";


}}

 echo "
	  <form method='POST' action='quests.php'>
	     <input type='submit' value='Leave' name='addw' />
      	     <input type='hidden' name='id' value='$qid'>
		      </form><br><br>";
}


if(isset($_POST['qcompleted']))
{
$qid = $_POST['id'];
$qname = $_POST['name'];
$qlevel = $_POST['level'];
$bypass = 1;

$selectquest="SELECT * from questgivers where location='$qid' AND name='$qname' AND level='$qlevel'";
 $selectquest2=mysql_query($selectquest) or die("could not select quest");
  $selectquest3=mysql_fetch_array($selectquest2);
  
  ///////////////////item requirement is material////////////
  if($selectquest3['reqitemtype'] == 'wood' || $selectquest3['reqitemtype'] == 'stone' || $selectquest3['reqitemtype'] == 'metal' || $selectquest3['reqitemtype'] == 'gold')
  {
  $type = $selectquest3['reqitemtype'] ;
  if($playerinfo3[$type] < $selectquest3['reqamount'])
  {echo "You do not have enough " . $type . " to complete this quest. ";}
  else
  {
  $updatecre="Update players SET `$type`=`$type`-'$selectquest3[reqamount]' WHERE name='$playerinfo3[name]'";
	    mysql_query($updatecre) or die("Could not update player");
		echo $selectquest3['reqamount'] . " " . $type . " removed from inventory<br><br>";
		echo $selectquest3['finishquest'];
		
		$updatearmor="DELETE FROM currentquests where pid='$playerinfo3[name]' AND location = '$qid'  AND name = '$qname' limit 1";	   
	  mysql_query( $updatearmor) or die("Could not delete quest");
  if(isset($_POST['newquest']))
{$SQL = "INSERT into playerquests(pid,location,name,level) VALUES ('$playerinfo3[name]','$qid','$qname','2')"; mysql_query($SQL) or die("could not add to quests");}
else
{ $updatecre="Update playerquests SET level=level+1 WHERE pid='$playerinfo3[name]' AND location='$qid'  AND name='$qname'";
	    mysql_query($updatecre) or die("Could not update old quests");
		}
	$updatecre="Update players SET gold=gold+'$selectquest3[copper]',exper=exper+'$selectquest3[exper]' WHERE name='$playerinfo3[name]'";
	    mysql_query($updatecre) or die("Could not update quests");
		echo "<br><br>Recieved " . $selectquest3['exper'] . " experience and " . $selectquest3['copper'] . " gold.";
	//////////////////if given item is a item/////////////////	
		if($selectquest3['item'] != 'none')
{
$iteminfo="SELECT * from items where name='$selectquest3[item]'";
$iteminfo2=mysql_query($iteminfo) or die("Could not get user items");
$iteminfo3=mysql_fetch_array($iteminfo2);
$SQL = "INSERT into inventory(id,name,type,stats,statadd,price) VALUES ('$playerinfo3[id]','$iteminfo3[name]','$iteminfo3[type]','$iteminfo3[stats]','$iteminfo3[statadd]','$iteminfo3[price]')"; mysql_query($SQL) or die("could not add to inventory");
echo $selectquest3['item'] . " added to your backpack.<br>";

}
  
  }}
 /////////////////////////item requirement is item/////////// 
   if($selectquest3['reqitemtype'] == 'item')
  {
    $itemcount = 0;
  $iteminfo="SELECT * from inventory where name='$selectquest3[reqitem]' AND id='$playerinfo3[id]'";
$iteminfo2=mysql_query($iteminfo) or die("Could not get user items");
 while($iteminfo3=mysql_fetch_array($iteminfo2))
 {
 $itemcount = $itemcount + 1;
 }
    if($itemcount < $selectquest3['reqamount'])
  {echo "You do not have enough " . $selectquest3['reqitem'] . " to complete this quest. ";}
  else
  {
  $iamount = $selectquest3['reqamount'];
  
  for($i = 0; $i < $iamount; $i=$i+1)
  {
 $updatearmor="DELETE FROM inventory where id='$playerinfo3[id]' AND name='$selectquest3[reqitem]' limit 1";	   
	  mysql_query( $updatearmor) or die("Could not delete item from player inventory");
	
	}
		echo $selectquest3['reqamount'] . " " . $selectquest3['reqitem']  . " removed from inventory<br><br>";
		echo $selectquest3['finishquest'];
		
		$updatearmor="DELETE FROM currentquests where pid='$playerinfo3[name]' AND location = '$qid'  AND name = '$qname' limit 1";	   
	  mysql_query( $updatearmor) or die("Could not delete quest");
  if(isset($_POST['newquest']))
{$SQL = "INSERT into playerquests(pid,location,name,level) VALUES ('$playerinfo3[name]','$qid','$qname','2')"; mysql_query($SQL) or die("could not add to quests");}
else
{ $updatecre="Update playerquests SET level=level+1 WHERE pid='$playerinfo3[name]' AND location='$qid'  AND name='$qname'";
	    mysql_query($updatecre) or die("Could not update old quests");
		}
	$updatecre="Update players SET gold=gold+'$selectquest3[copper]',exper=exper+'$selectquest3[exper]' WHERE name='$playerinfo3[name]'";
	    mysql_query($updatecre) or die("Could not update quests");
		echo "<br><br>Recieved " . $selectquest3['exper'] . " experience and " . $selectquest3['copper'] . " gold.<br><br>";
			//////////////////if given item is a item/////////////////	
		if($selectquest3['item'] != 'none')
{
$iteminfo="SELECT * from items where name='$selectquest3[item]'";
$iteminfo2=mysql_query($iteminfo) or die("Could not get user items");
$iteminfo3=mysql_fetch_array($iteminfo2);
$SQL = "INSERT into inventory(id,name,type,stats,statadd,price) VALUES ('$playerinfo3[id]','$iteminfo3[name]','$iteminfo3[type]','$iteminfo3[stats]','$iteminfo3[statadd]','$iteminfo3[price]')"; mysql_query($SQL) or die("could not add to inventory");
echo "<br>" . $selectquest3['item'] . " added to your backpack.<br>";


}
  
  }
  






}
 echo "<br><form method='POST' action='quests.php'>
	     <input type='submit' value='Finish' name='addw' />
      	     <input type='hidden' name='id' value='$qid'>
		      </form><br><br>";


}

if(isset($_POST['accept']))
{
$qid = $_POST['id'];
$qname = $_POST['name'];
$preitemtype = $_POST['preitemtype'];
$preitem = $_POST['preitem'];
$descript = $_POST['description'];
$bypass = 1;

$selectquest="SELECT * from currentquests where location='$qid' AND name='$qname' AND pid='$playerinfo3[name]'";
 $selectquest2=mysql_query($selectquest) or die("could not select quest");
  $selectquest3=mysql_fetch_array($selectquest2);

if(isset($selectquest3['name'])){echo "You already have accepted this quest!<br><br>";}
else
{
$SQL = "INSERT into currentquests(pid,description,location,name) VALUES ('$playerinfo3[name]','$descript','$qid','$qname')"; mysql_query($SQL) or die("could not add to quests");
echo "Quest added to your Quest Log.<br>";

 if ($preitemtype == 'item')
 {
 $iteminfo="SELECT * from items where name='$preitem'";
$iteminfo2=mysql_query($iteminfo) or die("Could not get user items");
$iteminfo3=mysql_fetch_array($iteminfo2);
$randid2 = rand(1000,999999);
$SQL = "INSERT into inventory(id,name,type,stats,statadd,price) VALUES ('$playerinfo3[id]','$iteminfo3[name]','$iteminfo3[type]','$iteminfo3[stats]','$iteminfo3[statadd]','$iteminfo3[price]')"; mysql_query($SQL) or die("could not add to inventory");
echo $iteminfo3['name'] . " added to your inventory.<br><br>";
 }

 
}
echo "
	  <form method='POST' action='index.php'>
	     <input type='submit' value='Leave' name='addw' />
      	         </form><br><br>";
}



 if($bypass != 1)
  {
 
	 $selectbackpack="SELECT * from questgivers where location='$location' AND level=1";
 $selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
  while($selectbackpack3=mysql_fetch_array($selectbackpack2))
      {
	  echo "
	  <form method='POST' action='quests.php'>
	     <input type='submit' value='$selectbackpack3[name]' name='addw' />
      	    <input type='hidden' name='id' value='$location'>
		   <input type='hidden' name='name' value='$selectbackpack3[name]'>
		   <input type='hidden' name='giver' value='1'>
		    </form><br><br>";
			
	  	  }
		  
		   echo "
	  <form method='POST' action='index.php'>
	     <input type='submit' value='Leave' name='addw' />
      	         </form><br><br>";
				 }
?>


Thats the script from the game.... please help
Im dumb;)
dragonhall
Posts: 14
Joined: Sun Sep 20, 2009 9:00 pm

Re: video 34

Post by dragonhall »

Do we have a copy of the latest source code up? Am i just dense and missing it?
Kevin1230
Posts: 62
Joined: Mon Jul 18, 2011 3:32 pm

Re: video 34

Post by Kevin1230 »

Need the sources :D
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: video 34

Post by hallsofvallhalla »

k on my laptop, will post in a few
Kevin1230
Posts: 62
Joined: Mon Jul 18, 2011 3:32 pm

Re: video 34

Post by Kevin1230 »

Thanks
Post Reply

Return to “Older Browser MMO Videos”