Jump to content

burnside

Members
  • Posts

    541
  • Joined

  • Last visited

Everything posted by burnside

  1. there is a link to the saveusername, and passing the variables in the input field.
  2. Im trying to make a form where if you click edit it lets you change a username, it kinda works it lets you pick a name but when it sends the name to the data base it just leaves it blank :-\ code is below echo " <Tr><Td>Username <td>:<td>$info[username] <a href=cont.php?edit=username>Edit</a></td> "; if($_GET[edit] == "username") { echo " <tr><Td> <input type =text name=name value='$info[username]'> <td> : <td> <a href=cont.php?edit=saveusername>Save</a> </td> "; } if($_GET[edit] == "saveusername" ) { $username = str_replace(">", ">", $username); $username = str_replace("<", "<", $username); $check1 = mysql_query("SELECT username FROM users WHERE username='$_GET[name]'"); if ((mysql_num_rows($check1) != 0)) { echo 'Sorry, name already in use<br>'; } else { $updateuserdb = mysql_query("update users set username='$_GET[name]' where id=$info[id]"); echo "You have changed your username.<br>"; } }
  3. WOW that code didnt realise was so hard ??? how you do it with two diffrent tables ??
  4. Hello, i really dont know how to explane this but ill try best i can, I am making a script where if you have say 100 points but only 10 left it will show you in a images like a bar line etc ... i have tried but it doesnt seem to do what i want sorry if its not much help. $percent = $info[points] / $info[points_left]; $percent = $percent * 100; $percent = round($percent); $leftpercent = 100 - $percent; $imagesss = "<tr><Td width=35 bgcolor=gray><img src=img\left.gif width=$percent height=10></td>"; echo $imagesss ; its showing the image but only at the current points left where i want it to show points and current points if you get me :\
  5. Hey, have you any reason why this doesnt work ? all fields are in the databse $update_ip = mysql_query("UPDATE `users` SET ip ='$REMOTE_ADDR' WHERE username='$username'");
  6. So how would i fix it just add ' ' to the arrays sorry im new to this might just as well give up
  7. what do they mean : Notice: Use of undefined constant lost - assumed 'lost' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 27 Notice: Undefined index: lost in /home/b/l/blades_of_darkness_co_uk/cont.php on line 27 Notice: Use of undefined constant won - assumed 'won' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 27 Notice: Use of undefined constant draw - assumed 'draw' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 27 Notice: Use of undefined constant won - assumed 'won' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 32 Notice: Undefined variable: zero in /home/b/l/blades_of_darkness_co_uk/cont.php on line 33 Notice: Use of undefined constant lost - assumed 'lost' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 36 Notice: Undefined index: lost in /home/b/l/blades_of_darkness_co_uk/cont.php on line 36 Notice: Use of undefined constant won - assumed 'won' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 36 Notice: Use of undefined constant draw - assumed 'draw' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 36 Notice: Use of undefined constant lost - assumed 'lost' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 41 Notice: Undefined index: lost in /home/b/l/blades_of_darkness_co_uk/cont.php on line 41 Notice: Undefined variable: zero in /home/b/l/blades_of_darkness_co_uk/cont.php on line 42 Notice: Use of undefined constant lost - assumed 'lost' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 45 Notice: Undefined index: lost in /home/b/l/blades_of_darkness_co_uk/cont.php on line 45 Notice: Use of undefined constant won - assumed 'won' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 45 Notice: Use of undefined constant draw - assumed 'draw' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 45 Notice: Use of undefined constant draw - assumed 'draw' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 50 Notice: Undefined variable: zero in /home/b/l/blades_of_darkness_co_uk/cont.php on line 51 Notice: Use of undefined constant lost - assumed 'lost' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 56 Notice: Undefined index: lost in /home/b/l/blades_of_darkness_co_uk/cont.php on line 56 Notice: Use of undefined constant won - assumed 'won' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 56 Notice: Use of undefined constant draw - assumed 'draw' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 56 Notice: Use of undefined constant won - assumed 'won' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 61 Notice: Undefined variable: zero in /home/b/l/blades_of_darkness_co_uk/cont.php on line 62 Notice: Use of undefined constant lost - assumed 'lost' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 65 Notice: Undefined index: lost in /home/b/l/blades_of_darkness_co_uk/cont.php on line 65 Notice: Use of undefined constant won - assumed 'won' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 65 Notice: Use of undefined constant draw - assumed 'draw' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 65 Notice: Use of undefined constant lost - assumed 'lost' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 70 Notice: Undefined index: lost in /home/b/l/blades_of_darkness_co_uk/cont.php on line 70 Notice: Undefined variable: zero in /home/b/l/blades_of_darkness_co_uk/cont.php on line 71 Notice: Use of undefined constant lost - assumed 'lost' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 74 Notice: Undefined index: lost in /home/b/l/blades_of_darkness_co_uk/cont.php on line 74 Notice: Use of undefined constant won - assumed 'won' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 74 Notice: Use of undefined constant draw - assumed 'draw' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 74 Notice: Use of undefined constant draw - assumed 'draw' in /home/b/l/blades_of_darkness_co_uk/cont.php on line 79 Notice: Undefined variable: zero in /home/b/l/blades_of_darkness_co_uk/cont.php on line 80
  8. i have added error_reporting(E_ALL); ini_set('display_errors','1'); now i have about 100 errors :-\
  9. No still doesnt work. Its not showing any error it just doesnt delete the post.
  10. my code might be a bit pants as i am a n00b at it only been at it past 2 -3 days code is as followed : <?php mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("database") or die(mysql_error()); //checks cookies to make sure they are logged in if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { //if the cookie has the wrong password, they are taken to the login page if ($pass != $info['password']) { header("Location: index.php"); } else { $battlesfought = $info[lost] + $info[won] + $info[draw]; if($battlesfought == 0) { $battlesfought += 1; $zero = "yes"; } $percentwon = ($info[won] / $battlesfought) * 100; if($zero == "yes") { $battlesfought -= 1; } $percentwon = sprintf ("%01.2f", $percentwon); $battlesfought1 = $info[lost] + $info[won] + $info[draw]; if($battlesfought1 == 0) { $battlesfought1 += 1; $zero = "yes"; } $percentlost = ($info[lost] / $battlesfought) * 100; if($zero == "yes") { $battlesfought1 -= 1; } $percentlost = sprintf ("%01.2f", $percentlost); $battlesfought2 = $info[lost] + $info[won] + $info[draw]; if($battlesfought2 == 0) { $battlesfought += 1; $zero = "yes"; } $percentdraw = ($info[draw] / $battlesfought) * 100; if($zero == "yes") { $battlesfought2 -= 1; } $percentdraw = sprintf ("%01.2f", $percentdraw); // Hard shit this is like $battlesfought = $info[lost] + $info[won] + $info[draw]; if($battlesfought == 0) { $battlesfought += 1; $zero = "yes"; } $percentwon = ($info[won] / $battlesfought) * 100; if($zero == "yes") { $battlesfought -= 1; } $percentwon = sprintf ("%01.2f", $percentwon); //lost $battlesfought1 = $info[lost] + $info[won] + $info[draw]; if($battlesfought1 == 0) { $battlesfought1 += 1; $zero = "yes"; } $percentlost = ($info[lost] / $battlesfought) * 100; if($zero == "yes") { $battlesfought1 -= 1; } $percentlost = sprintf ("%01.2f", $percentlost); //stalemate $battlesfought2 = $info[lost] + $info[won] + $info[draw]; if($battlesfought2 == 0) { $battlesfought += 1; $zero = "yes"; } $percentdraw = ($info[draw] / $battlesfought) * 100; if($zero == "yes") { $battlesfought2 -= 1; } $percentdraw = sprintf ("%01.2f", $percentdraw); include('top.php'); include('error.php'); echo ' Here at the brother hood, We keep track of every thing you do. '; echo ' <BR> <br> '; // START OF IMAGE SHIT AND PHRASE echo " <img src =\"$info[image]\" alt ='This is curently you game logo'> <br> <a title ='$info[main_phase]' > Phrase One </a> | <a title ='$info[main_sub]'> Phrase Two </a><br>"; $now_then = array("$info[main_phase]","$info[main_sub]",);$hello_mate = $now_then[array_rand($now_then)]; echo " <font size ='5' color =gray><b><u><a title ='Your Current Phrase'> $hello_mate </font></u></b>"; echo "<Br>"; echo " <table align ='left' width =25%> <td> <font size =4><u>Player Stats</u></font> </table> "; if($info[hp] <= 0) { echo " <img src=img\dead.gif alt='Unable to battle, You are Dead' > "; } elseif($info[hp] > 0) { echo " <img src=img\alive.gif alt='Able to battle you have $info[hp]hit points left out of $info[maxhp]'>"; } //WON if($info[won] > 0 || $info[draw] > 0 || $info[draw] > 0) { echo "";} else { } $suckmycock = $info[won] + $info[lost] + $info[draw] ; if ($action == "delete"){$request2 = "DELETE FROM usernews WHERE ID = $id";$result2 = mysql_query($request2,$db);} if ($_GET['justnews'] == "deletenews"){ mysql_query("DELETE FROM usernews WHERE id = '$id'"); }elseif($justnews == "deleteall"){ mysql_query("DELETE FROM usernews WHERE user = '$info[id]'"); } if (!$_GET[action]) { $resul = mysql_query("SELECT * FROM usernews WHERE user='$info[id]' order by id DESC LIMIT 0,15"); } if (mysql_num_rows($resul)>0) { echo "News: "; } while ($news = mysql_fetch_array($resul)){ echo "[<a href=cont.php?justnews=deletenews&id=$news[id]>D[/url]] $news[text] "; } if(mysql_num_rows($resul) > 1){ echo "[<a href=cont.php?justnews=deleteall>Clear News[/url]] "; } include("bottom.php"); }}}?> it all word apart from the if ($_GET['justnews'] == "deletenews"){ mysql_query("DELETE FROM usernews WHERE id = '$id'"); }elseif($justnews == "deleteall"){ mysql_query("DELETE FROM usernews WHERE user = '$info[id]'"); } if (!$_GET[action]) { $resul = mysql_query("SELECT * FROM usernews WHERE user='$info[id]' order by id DESC LIMIT 0,15"); } if (mysql_num_rows($resul)>0) { echo "News: "; } while ($news = mysql_fetch_array($resul)){ echo "[<a href=cont.php?justnews=deletenews&id=$news[id]>D[/url]] $news[text] "; } if(mysql_num_rows($resul) > 1){ echo "[<a href=cont.php?justnews=deleteall>Clear News[/url]] "; }
  11. sorry didnt realise had to post in in [ code ], i added the mysql_query($query) or die(mysql_error(); and it didnt give any errors
  12. Can you please have a look at this.......... if ($_GET['justnews'] == "deletenews"){ mysql_query("DELETE FROM usernews WHERE id = '$id'"); }elseif($justnews == "deleteall"){ mysql_query("DELETE FROM usernews WHERE user = '$info[id]'"); } if (!$_GET[action]) { $resul = mysql_query("SELECT * FROM usernews WHERE user='$info[id]' order by id DESC LIMIT 0,15"); } if (mysql_num_rows($resul)>0) { echo "<b>News:<br></b>"; } while ($news = mysql_fetch_array($resul)){ echo "[<a href=cont.php?justnews=deletenews&id=$news[id]>D</a>] $news[text]<br>"; } if(mysql_num_rows($resul) > 1){ echo "[<a href=cont.php?justnews=deleteall>Clear News</a>]<br>"; } i have glodal functions on but yet the script doesnt delete the post any ideas ..............?
  13. Kind off got it to work but now its not showing any variable or doing any thing just a blank screen iv took the script apart and re wrote it any ideas.?
  14. took the connection out at the top. Ill try what you suggested by tried all sorts rest of my codes work and there all like this.
  15. I was just wounderig if any one would look at this and see if you can find any errors, the script does not run, Contact me on burnside360@hotmail.co.uk if you can find any thing wrong with it please. I think has some thing to do with this bit here cos im getting the stop messing arround error its been doing my head in for 2 weeks now : if($_GET['action'] == attack) { if($info < 2) { echo "You do not have enough energy to battle."; echo " <center>[<a href=fight.php>Back[/url]]</center>"; }elseif ($info[hp]<1){ echo "You must be alive to battle"; echo " <center>[<a href=fight.php>Back[/url]]</center>"; }else { $resul = mysql_query("SELECT * FROM enemies WHERE id='$id'"); if(!@mysql_num_rows($resul)){ echo "Stop messing around !"; echo " <center>[<a href=fight.php?action=fight>Back[/url]]</center>"; }else{ $enemyinfo = mysql_fetch_array($resul); mysql_free_result($resul); <?php include("top.php"); mysql_connect("", "", "") or die(mysql_error()); mysql_select_db("") or die(mysql_error()); //checks cookies to make sure they are logged in if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { //if the cookie has the wrong password, they are taken to the login page if ($pass != $info['password']) { header("Location: index.php"); } else { if($_GET['action'] == "") { echo "Welcome to the Battle Arena, where you can test your strength against NPC's.<p>"; $select_mon = mysql_query("SELECT * from enemies where enemytype='normal' order by id"); echo "<b>Normal Monsters</b><br>"; while($nmon = mysql_fetch_array($select_mon)) { echo "<table width=100%><tr><td width=15%><img src=\"image/ene/$nmon[image].jpg\" border=0></td><td width=30%><a href=fight1.php?action=attack&id=$nmon[id]>$nmon[name]</a></td><td width=15%>Level $nmon[level]</td><td width=15%>$nmon[hp] HP</td><td width=40%>($nmon[enemiesleft] left)</td></tr></table>"; } $select_mon2 = mysql_query("select * from enemies where enemytype='special' order by id"); echo "<p><b>Special Monsters</b>"; while($nmon2 = mysql_fetch_array($select_mon2)) { echo "<table width=100%><tr><td width=30%><a href=fight1.php?action=attack&id=$nmon2[id]>$nmon2[name]</a></td><td width=15%>Level $nmon2[level]</td><td width=15%>$nmon2[hp] HP</td><td width=55%>($nmon2[enemiesleft] left)</td></tr></table>"; } $select_mon3 = mysql_query("select * from enemies where enemytype='Boss' order by id"); echo "<p><b>Boss</b>"; while($nmon3 = mysql_fetch_array($select_mon3)) { echo "<table width=100%><tr><td width=30%><a href=fight1.php?action=attack&id=$nmon3[id]>$nmon3[name]</a></td><td width=15%>Level $nmon3[level]</td><td width=15%>$nmon3[hp] HP</td><td width=55%>($nmon3[enemiesleft] left)</td></tr></table>"; } } if($_GET['action'] == attack) { if($info < 2) { echo "You do not have enough energy to battle."; echo "<br><br><center>[<a href=fight.php>Back</a>]</center>"; }elseif ($info[hp]<1){ echo "You must be alive to battle"; echo "<br><br><center>[<a href=fight.php>Back</a>]</center>"; }else { $resul = mysql_query("SELECT * FROM enemies WHERE id='$id'"); if(!@mysql_num_rows($resul)){ echo "Stop messing around !"; echo "<br><br><center>[<a href=fight.php?action=fight>Back</a>]</center>"; }else{ $enemyinfo = mysql_fetch_array($resul); mysql_free_result($resul); $resul = mysql_query("SELECT * FROM pequipment WHERE equipped='Y' AND userid='$info[id]' AND type='weapon'"); $wep = mysql_fetch_array($resul); $sel_barmor = mysql_query("select * from pequipment where userid='$info[id]' AND equipped='Y' AND type='barmor'"); $bar = mysql_fetch_array($sel_barmor); $sel_helm = mysql_query("select * from pequipment where userid='$info[id]' AND equipped='Y' AND type='helm'"); $hel = mysql_fetch_array($sel_helm); $sel_gloves = mysql_query("select * from pequipment where userid='$info[id]' AND equipped='Y' AND type='gloves'"); $glo = mysql_fetch_array($sel_gloves); $sel_boots = mysql_query("select * from pequipment where userid='$info[id]' AND equipped='Y' AND type='boots'"); $boo = mysql_fetch_array($sel_boots); $armor = $bar[effect] + $bar[effect] + $hel[effect] + $glo[effect] + $boo[effect]; $p1hp = $info[hp_left]; $p2hp = $enemyinfo[hp]; // this adds some random values to stats, making battles not the same EVERYTIME! - srand((double)microtime()*1000000); $valueofchang2 = (rand(25,35)/10); $valueofchang1 = (rand(25,35)/10); $moreorless = rand(1,2); if($boo[type_id] == "25"){$a1glmod = 10;} $pagl=$info[agility] + $a1glmod; // Sandals code $eagl=$enemyinfo[agility] + 0; // Sandals code $pturn=$pagl; $pturnmod=$pagl/$valueofchang2; $oturn=$eagl; $oturnmod=$eagl/$valueofchang1; $clock=0; /* if($info[id] == 101){ $criticalhit = rand(0,200); $armor = $armor / 2; }*/ //// do { if ($pturn>$oturn){$oturn=$oturn+$oturnmod;$clock++; srand((double)microtime()*1000000); $criticalhit = rand(0,100); if($info[lucky] == 1){ $criticalhit = rand(0,95); } if($info[lucky] == 2){ $criticalhit = rand(0,90); } if($info[lucky] == 3){ $criticalhit = rand(0,85); } if($info[lucky] == 4){ $criticalhit = rand(0,80); } if($info[lucky] == 5){ $criticalhit = rand(0,75); } if($info[lucky] > 5){ $criticalhit = rand(0,70); } $armoreff = rand(1,$enemyinfo[armoreff]); if($criticalhit == "33") { $dmg = round(rand($wep[effect],$wep[effect2]) * 3 + $info[strength] - $armoreff); } else { $dmg = round(rand($wep[effect],$wep[effect2]) + $info[strength] - $armoreff); } // Removes "the" in a weapon name. $wepyname = $wep[name]; $wepyname = eregi_replace("the ","",$wepyname); $wepyname = eregi_replace("THE ","",$wepyname); if($dmg <= "0") { // different missing messages srand((double)microtime()*1000000); $missingmess = rand(1,3); if($missingmess==1){ $missmess1 = "You swung at the"; $missmess2 = "but you missed!"; } elseif($missingmess==2){ $missmess1 = "You charged at the"; $missmess2 = "but you tripped!"; } elseif($missingmess==3){ $missmess1 = "You hit the"; $missmess2 = "but the <font color=lightblue>$enemyinfo[name]</font> deflects the attack!"; }; echo "<b>$clock:</b> $missmess1 <font color=lightblue>$enemyinfo[name]</font> with your <font color=lightgreen>$wepyname</font>, $missmess2 ($p2hp left)<br>";} else { $p2hp -= $dmg; if($p2hp < "0") { $p2hp = 0; } //Various weapon types say different things - $showcrit = "<font color=crimson> CRITICAL HIT!</font>"; if($wep[type_id] > 0 && $wep[type_id] < 11){ // First 10 weps echo "<b>$clock:</b> You attacked the <font color=lightblue>$enemyinfo[name]</font> with your <font color=lightgreen>$wepyname</font> for <font color=lightblue>$dmg</font> damage! ($p2hp left) "; if($criticalhit == "33") { echo "$showcrit"; } echo "<br>"; }elseif($wep[type_id] > 19 && $wep[type_id] < 25) { // Small bow to Streamline Bow echo "<b>$clock:</b> You shoot arrows at the <font color=lightblue>$enemyinfo[name]</font> with your <font color=lightgreen>$wepyname</font> doing <font color=lightblue>$dmg</font> damage! ($p2hp left) "; if($criticalhit == "33") { echo "$showcrit"; } echo "<br>"; } elseif($wep[type_id] > 11 && $wep[type_id] < 19){ // Next 10 etc weapons echo "<b>$clock:</b> You Attack with might at the <font color=lightblue>$enemyinfo[name]</font> with your <font color=lightgreen>$wepyname</font> for <font color=lightblue>$dmg</font> damage! ($p2hp left) "; if($criticalhit == "33") { echo "$showcrit"; } echo "<br>"; } elseif($wep[type_id] > 49 && $wep[type_id] < 54){ //Myth weps echo "<b>$clock:</b> Your soul releases anger upon the <font color=lightblue>$enemyinfo[name]</font>, your <font color=lightgreen>$wepyname</font> harnesses it and deals <font color=lightblue>$dmg</font> damage! ($p2hp left) "; if($criticalhit == "33") { echo "$showcrit"; } echo "<br>"; } elseif($wep[type_id] == 0){ //No weapon echo "<b>$clock:</b> You attacked the <font color=lightblue>$enemyinfo[name]</font> with your <font color=lightgreen>Fists</font> for <font color=lightblue>$dmg</font> damage! ($p2hp left) "; if($criticalhit == "33") { echo "$showcrit"; } echo "<br>"; } if($p2hp <= 0) { $exp = rand($enemyinfo[exp],$enemyinfo[exp2]); if($info[level] > 0 && $info[level] < 100){ $exp = $exp * 0.99; } if($info[level] > 99 && $info[level] < 200){ $exp = $exp * 0.8; } if($info[level] > 199){ $exp = $exp * 0.7; } $exp = ceil($exp); $gold = rand($enemyinfo[gold],$enemyinfo[gold2]); if(!$wep){}else{ if( $wep[exp] > -100){$wepexpmod = $wep[exp];}else{$wepexpmod = -100;} if( $wep[gold] > -100){$wepgoldmod = $wep[gold];}else{$wepgoldmod = -100;} } $exp5 = ($exp / 100) * $wepexpmod; $exp2 = ceil($exp5); $gold5 = ($gold / 100) * $wepgoldmod; $gold2 = ceil($gold5); $gold4 = $gold2 + $gold + $info[gold]; $exp4 = $exp2 + $exp + $info[exp]; $clanexp = $exp + $exp2; if($info[clan] !== "0") { $clanres3 = mysql_query("SELECT * FROM clans WHERE id='$info[clan]'"); $clanss = mysql_fetch_array($clanres3); $newclanexp = $clanss[exp] + $clanexp; $clanexpupdate5 = mysql_query("update clans set exp='$newclanexp' where id='$info[clan]'"); $clandonupd = mysql_query("update users set clan_exp=clan_exp+$clanexp where id='$info[id]'"); if($newclanexp >= "$clanss[exp_lvl]") { $newlvl2 = $clanss[level] + 1; $newexp2 = $newlvl2 * $newlvl2 * 1000; $updateclannews = mysql_query("Insert into usernews (id,user,text,time) values ('','C$info[clan]','<b>$time</b> Clan leveled up! Now level $newlvl2. (<a href=view.php?id=$info[id]>$info[username]</a>)','$realtime')"); if($clanss[levelreward] <= "$clanss[gold]") { $richmore = $info[gold]+$clanss[levelreward]; mysql_query("update users set gold='$richmore' where id='$info[id]'"); $reget = mysql_query("Select * from users where id='$info[id]'"); $info = mysql_fetch_array($reget); $updateclan55 = mysql_query("update clans set level='$newlvl2', exp='0', exp_lvl='$newexp2', gold=gold-$clanss[levelreward] where id=$info[clan]"); $clanchanger1 = mysql_query("update clans set power=power+1000 where id='$info[clan]'"); $guychanger1 = mysql_query("update users set clan_infl=clan_infl+1000 where id='$info[id]'"); echo "<br><font color=orange>You gained your clan a level! (+1000 influence) You have been rewarded $clanss[levelreward] gold!</font>"; }else{ $reget = mysql_query("Select * from users where id='$info[id]'"); $info = mysql_fetch_array($reget); $clanchanger1 = mysql_query("update clans set power=power+1000 where id='$info[clan]'"); $guychanger1 = mysql_query("update users set clan_infl=clan_infl+1000 where id='$info[id]'"); $updateclan55 = mysql_query("update clans set level='$newlvl2', exp='0', exp_lvl='$newexp2' where id=$info[clan]"); echo "<br><font color=orange>You gained your clan a level! (+1000 influence) You should have been rewarded $clanss[levelreward] gold but they dont have enough clan funds!</font>"; } } } $newgold = $info[gold] + $gold; $newexp = $info[exp] + $exp; $batwon = $info[battleswon] + 1; $eleft = $enemyinfo[enemiesleft] - 1; $fights = $info[energy] - 2; $updatedm = mysql_query("update enemies set enemiesleft='$eleft' where id='$id'"); $updatedbstats = mysql_query("update users set energy='$fights', exp='$exp4', gold='$gold4', battleswon='$batwon' where id='$info[id]'"); echo "<br>You have killed the <font color=lightblue>$enemyinfo[name]</font>!<br>You gained <font color=silver>$exp</font> experience and <font color=gold>$gold</font> gold!<br>"; echo "The magic from your weapon earned you an extra <font color=silver>$exp2</font> experience and <font color=gold>$gold2</font> gold!<br>"; $randex= rand(1,50); $randex2 = rand(1,30); if($enemyinfo[name] == "Shaman") { $emblem = rand(1,5000); if($emblem == 5000) { echo "You found a <font color=red>Shamans Emblem</font> on the Shaman's corpse!!!<br>"; $insert_emblem = mysql_query("update users set emblems=emblems+1 where id='$info[id]'"); } } if($randex2 == "23") { echo "You managed to find a <font color=yellow>key</font> on your enemies corpse!<br>"; $insert_key = mysql_query("update users set pkeys=pkeys+1 where id='$info[id]'"); } $chckdraw = mysql_query("select * from gemdb where id = '$info[id]'"); $drawstring = mysql_fetch_array($chckdraw); if($drawstring){ $getgem = 1;} else { $getgem = 0; } if($randex2 == "20") { echo "You managed to find an <font color=green>Emerald</font> on your enemies corpse!<br>"; if($getgem = 1){ $insert_key = mysql_query("update gemdb set emeralds=emeralds+1 where id='$info[id]'"); }else{echo "but you have nothing to hold it with! So you leave it there...<br>";} } if($randex == "1") { if($enemyinfo[enemytype] == "special") { echo "You managed to find 3 <font color=aqua>crystals</font> on the enemies corpse!"; $crys = $drawstring[crystals] + 3; if($getgem = 1){ $insert_crystal = mysql_query("update gemdb set crystals='$crys' where id='$info[id]'"); }else{echo "but you have nothing to hold it with! So you leave it there...<br>";} } } elseif($randex > "35") { echo "You managed to find a <font color=aqua>crystal</font> on your enemies corpse!"; $crys = $drawstring[crystals] + 1; if($getgem = 1){ $insert_crystal = mysql_query("update gemdb set crystals='$crys' where id='$info[id]'"); }else{echo "but you have nothing to hold it with! So you leave it there...<br>";} } elseif($randex == "3") { echo "You managed to find a <font color=pink>diamond</font> on your enemies corpse!"; if($getgem = 1){ $crys = $drawstring[diamonds] + 1; $insert_crystal = mysql_query("update gemdb set diamonds='$crys' where id='$info[id]'"); }else{echo "but you have nothing to hold it with! So you leave it there...<br>";} } else { echo "After searching the corpse, you found nothing to pick up!"; } break; } } } if ($oturn>$pturn){$pturn=$pturn+$pturnmod;$clock++; $criticalhit2 = rand(0,100); $armoreff2 = rand(0,$armor); if($criticalhit2 == "66") { $dmg2 = round(rand($enemyinfo[weaponeff],$enemyinfo[weaponeff2]) * 3 + $enemyinfo[strength] - $armoreff2); } else { $dmg2 = round(rand($enemyinfo[weaponeff],$enemyinfo[weaponeff2]) + $enemyinfo[strength] - $armoreff2); } if($dmg2 <= "0") { echo "<b>$clock:</b> The <font color=lightblue>$enemyinfo[name]</font> swung at you, but missed! ($p1hp left)<br>"; } else { $p1hp -= $dmg2; if($p1hp < "0") { $p1hp = 0; } echo "<b>$clock:</b> The <font color=lightblue>$enemyinfo[name]</font> attacked you with its $enemyinfo[weaponname] for <font color=lightblue>$dmg2</font> damage! ($p1hp left)<br>"; if($p1hp <= 0) { echo "<font color=Red>You have been killed by the </font><font color=lightblue>$enemyinfo[name]</font><font color=red>!</font>"; $batlost = $info[battleslost] + 1; $fights = $info[energy] - 2; $updatedbstats2 = mysql_query("update users set energy='$fights', battleslost='$batlost' where id='$info[id]'"); break; } } } if ($oturn==$pturn) {$clock++; echo "<b>$clock:</b> Both characters rest<br>"; $pturn=$pturn+$pturnmod; $oturn=$oturn+$oturnmod; } if ($clock>99) { echo "Battle timed out."; $update = mysql_query("update users set energy=energy-2 where id='$info[id]'"); exit; } } while($p1hp or $p2hp > 0 && $clock<100); echo "<p>[<a href=fight.php?action=attack&id=$id>Fight Again</a>]"; if($exp4 >= "$info[exp_lvl]") { $newlvl = $info[level] + 1; if ($newlevel > 100 && $newlevel < 200){ // EXPERIANCES GETS HARDER AS YOU LEVEL $newexp = $newlvl * $newlvl * 200;} // If under 100, then x 150 elseif($newlevel > 199 && $newlevel < 300){ // If over 100 then x 200 $newexp = $newlvl * $newlvl * 300;} // If over 200 then x 300 else{$newexp = $newlvl * $newlvl * 150;} // over 300 not added as yet. $newhp1 = $newlvl * 2; $newhp = $newhp = $info[hp] + $newhp1; $newstr = $info[strength] + 1; $newdef = $info[agility] + 1; $updatedbstats3 = mysql_query("update users set hp='$newhp', hp_left='$newhp', strength='$newstr', agility='$newdef', level='$newlvl', exp='0', exp_lvl='$newexp' where id='$info[id]'"); echo "<br><font color=lightgreen>You gained a level!</font>"; } } } } } } include("bottom.php"); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.