### 1.0.4 (2.14.2004) ###
### Thanks to Maebius & Mantagnana. :)
- Fixed babblebox bug.
- More checks to ensure experience/gold doesn't go over the database
field limit.
- Fixed bug with dropcode and levelups.
- Added visual warning if your exp/gold are maxed out.
- Fixed minor experience bug in Extended Character Stats.
- Fixed minor display bug in admin template.
This commit is contained in:
Jamin Blount 2017-02-05 10:57:01 -06:00
parent 1d735ed237
commit 0c62ab23f2
4 changed files with 12 additions and 10 deletions

View File

@ -10,7 +10,7 @@ $dbsettings = Array(
// These are used for display purposes only. Technically you could change them, but it's not going to // These are used for display purposes only. Technically you could change them, but it's not going to
// do anything special. And I'd prefer if you didn't, just to keep things all nice and standardized. // do anything special. And I'd prefer if you didn't, just to keep things all nice and standardized.
$version = "1.0.3"; $version = "1.0.4";
$build = ""; $build = "";
?> ?>

View File

@ -361,8 +361,8 @@ function victory() {
if ($userrow["difficulty"] == 2) { $gold = ceil($gold * $controlrow["diff2mod"]); } if ($userrow["difficulty"] == 2) { $gold = ceil($gold * $controlrow["diff2mod"]); }
if ($userrow["difficulty"] == 3) { $gold = ceil($gold * $controlrow["diff3mod"]); } if ($userrow["difficulty"] == 3) { $gold = ceil($gold * $controlrow["diff3mod"]); }
if ($userrow["goldbonus"] != 0) { $gold += ceil(($userrow["goldbonus"]/100)*$exp); } if ($userrow["goldbonus"] != 0) { $gold += ceil(($userrow["goldbonus"]/100)*$exp); }
$newexp = $userrow["experience"] + $exp; if ($userrow["experience"] + $exp < 16777215) { $newexp = $userrow["experience"] + $exp; $warnexp = ""; } else { $newexp = $userrow["experience"]; $exp = 0; $warnexp = "You have maxed out your experience points."; }
$newgold = $userrow["gold"] + $gold; if ($userrow["gold"] + $gold < 16777215) { $newgold = $userrow["gold"] + $gold; $warngold = ""; } else { $newgold = $userrow["gold"]; $gold = 0; $warngold = "You have maxed out your experience points."; }
$levelquery = doquery("SELECT * FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); $levelquery = doquery("SELECT * FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels");
if (mysql_num_rows($levelquery) == 1) { $levelrow = mysql_fetch_array($levelquery); } if (mysql_num_rows($levelquery) == 1) { $levelrow = mysql_fetch_array($levelquery); }
@ -386,8 +386,9 @@ function victory() {
$spelltext = "You have learned a new spell.<br />"; $spelltext = "You have learned a new spell.<br />";
} else { $spelltext = ""; $newspell=""; } } else { $spelltext = ""; $newspell=""; }
$page = "Congratulations. You have defeated the ".$monsterrow["name"].".<br />You gain $exp experience.<br />You gain $gold gold.<br /><br /><b>You have gained a level!</b><br /><br />You gain ".$levelrow[$userrow["charclass"]."_hp"]." hit points.<br />You gain ".$levelrow[$userrow["charclass"]."_mp"]." magic points.<br />You gain ".$levelrow[$userrow["charclass"]."_tp"]." travel points.<br />You gain ".$levelrow[$userrow["charclass"]."_strength"]." strength.<br />You gain ".$levelrow[$userrow["charclass"]."_dexterity"]." dexterity.<br />$spelltext<br />You can now continue <a href=\"index.php\">exploring</a>."; $page = "Congratulations. You have defeated the ".$monsterrow["name"].".<br />You gain $exp experience. $warnexp <br />You gain $gold gold. $warngold <br /><br /><b>You have gained a level!</b><br /><br />You gain ".$levelrow[$userrow["charclass"]."_hp"]." hit points.<br />You gain ".$levelrow[$userrow["charclass"]."_mp"]." magic points.<br />You gain ".$levelrow[$userrow["charclass"]."_tp"]." travel points.<br />You gain ".$levelrow[$userrow["charclass"]."_strength"]." strength.<br />You gain ".$levelrow[$userrow["charclass"]."_dexterity"]." dexterity.<br />$spelltext<br />You can now continue <a href=\"index.php\">exploring</a>.";
$title = "Courage and Wit have served thee well!"; $title = "Courage and Wit have served thee well!";
$dropcode = "";
} else { } else {
$newhp = $userrow["maxhp"]; $newhp = $userrow["maxhp"];
$newmp = $userrow["maxmp"]; $newmp = $userrow["maxmp"];
@ -398,7 +399,7 @@ function victory() {
$newdefense = $userrow["defensepower"]; $newdefense = $userrow["defensepower"];
$newlevel = $userrow["level"]; $newlevel = $userrow["level"];
$newspell = ""; $newspell = "";
$page = "Congratulations. You have defeated the ".$monsterrow["name"].".<br />You gain $exp experience.<br />You gain $gold gold.<br /><br />"; $page = "Congratulations. You have defeated the ".$monsterrow["name"].".<br />You gain $exp experience. $warnexp <br />You gain $gold gold. $warngold <br /><br />";
if (rand(1,30) == 1) { if (rand(1,30) == 1) {
$dropquery = doquery("SELECT * FROM {{table}} WHERE mlevel <= '".$monsterrow["level"]."' ORDER BY RAND() LIMIT 1", "drops"); $dropquery = doquery("SELECT * FROM {{table}} WHERE mlevel <= '".$monsterrow["level"]."' ORDER BY RAND() LIMIT 1", "drops");

View File

@ -132,7 +132,7 @@ function showchar() {
$levelquery = doquery("SELECT ". $userrow["charclass"]."_exp FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); $levelquery = doquery("SELECT ". $userrow["charclass"]."_exp FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels");
$levelrow = mysql_fetch_array($levelquery); $levelrow = mysql_fetch_array($levelquery);
$userrow["nextlevel"] = number_format($levelrow[$userrow["charclass"]."_exp"]); if ($userrow["level"] < 99) { $userrow["nextlevel"] = number_format($levelrow[$userrow["charclass"]."_exp"]); } else { $userrow["nextlevel"] = "<span class=\"light\">None</span>"; }
if ($userrow["charclass"] == 1) { $userrow["charclass"] = $controlrow["class1name"]; } if ($userrow["charclass"] == 1) { $userrow["charclass"] = $controlrow["class1name"]; }
elseif ($userrow["charclass"] == 2) { $userrow["charclass"] = $controlrow["class2name"]; } elseif ($userrow["charclass"] == 2) { $userrow["charclass"] = $controlrow["class2name"]; }
@ -248,10 +248,11 @@ function babblebox() {
$babblebox = array("content"=>""); $babblebox = array("content"=>"");
$bg = 1; $bg = 1;
$babblequery = doquery("SELECT * FROM {{table}} ORDER BY id LIMIT 20", "babble"); $babblequery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 20", "babble");
while ($babblerow = mysql_fetch_array($babblequery)) { while ($babblerow = mysql_fetch_array($babblequery)) {
if ($bg == 1) { $babblebox["content"] .= "<div style=\"width:98%; background-color:#eeeeee;\">[<b>".$babblerow["author"]."</b>] ".$babblerow["babble"]."</div>\n"; $bg = 2; } if ($bg == 1) { $new = "<div style=\"width:98%; background-color:#eeeeee;\">[<b>".$babblerow["author"]."</b>] ".$babblerow["babble"]."</div>\n"; $bg = 2; }
else { $babblebox["content"] .= "<div style=\"width:98%; background-color:#ffffff;\">[<b>".$babblerow["author"]."</b>] ".stripslashes($babblerow["babble"])."</div>\n"; $bg = 1; } else { $new = "<div style=\"width:98%; background-color:#ffffff;\">[<b>".$babblerow["author"]."</b>] ".stripslashes($babblerow["babble"])."</div>\n"; $bg = 1; }
$babblebox["content"] = $new . $babblebox["content"];
} }
$babblebox["content"] .= "<center><form action=\"index.php?do=babblebox\" method=\"post\"><input type=\"text\" name=\"babble\" size=\"15\" maxlength=\"120\" /><br /><input type=\"submit\" name=\"submit\" value=\"Babble\" /> <input type=\"reset\" name=\"reset\" value=\"Clear\" /></form></center>"; $babblebox["content"] .= "<center><form action=\"index.php?do=babblebox\" method=\"post\"><input type=\"text\" name=\"babble\" size=\"15\" maxlength=\"120\" /><br /><input type=\"submit\" name=\"submit\" value=\"Babble\" /> <input type=\"reset\" name=\"reset\" value=\"Clear\" /></form></center>";

View File

@ -71,7 +71,7 @@ a:hover {
</td></tr></table> </td></tr></table>
<br /> <br />
<table class="copyright" width="90%"><tr> <table class="copyright" width="90%"><tr>
<td width="25%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="25%" align="center">&copy; 2003 by renderse7en</td><td width="25%" align="center">{{totaltime}} Seconds, {{numqueries}} Queries</td><td width="25%" align="center">Version {{version}}, {{build}}</td> <td width="25%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="25%" align="center">&copy; 2003 by renderse7en</td><td width="25%" align="center">{{totaltime}} Seconds, {{numqueries}} Queries</td><td width="25%" align="center">Version {{version}} {{build}}</td>
</center></body> </center></body>
</html> </html>
THEVERYENDOFYOU; THEVERYENDOFYOU;