From 0c62ab23f2656ffecbfed3fde859f4efa3ccd237 Mon Sep 17 00:00:00 2001 From: Jamin Blount Date: Sun, 5 Feb 2017 10:57:01 -0600 Subject: [PATCH] v1.0.4 ### 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. --- config.php | 2 +- fight.php | 9 +++++---- index.php | 9 +++++---- templates/admin.php | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/config.php b/config.php index ac1aefa..5900948 100644 --- a/config.php +++ b/config.php @@ -10,7 +10,7 @@ $dbsettings = Array( // 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. -$version = "1.0.3"; +$version = "1.0.4"; $build = ""; ?> \ No newline at end of file diff --git a/fight.php b/fight.php index 6ea3915..3b5d780 100644 --- a/fight.php +++ b/fight.php @@ -361,8 +361,8 @@ function victory() { if ($userrow["difficulty"] == 2) { $gold = ceil($gold * $controlrow["diff2mod"]); } if ($userrow["difficulty"] == 3) { $gold = ceil($gold * $controlrow["diff3mod"]); } if ($userrow["goldbonus"] != 0) { $gold += ceil(($userrow["goldbonus"]/100)*$exp); } - $newexp = $userrow["experience"] + $exp; - $newgold = $userrow["gold"] + $gold; + if ($userrow["experience"] + $exp < 16777215) { $newexp = $userrow["experience"] + $exp; $warnexp = ""; } else { $newexp = $userrow["experience"]; $exp = 0; $warnexp = "You have maxed out your experience points."; } + 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"); if (mysql_num_rows($levelquery) == 1) { $levelrow = mysql_fetch_array($levelquery); } @@ -386,8 +386,9 @@ function victory() { $spelltext = "You have learned a new spell.
"; } else { $spelltext = ""; $newspell=""; } - $page = "Congratulations. You have defeated the ".$monsterrow["name"].".
You gain $exp experience.
You gain $gold gold.

You have gained a level!

You gain ".$levelrow[$userrow["charclass"]."_hp"]." hit points.
You gain ".$levelrow[$userrow["charclass"]."_mp"]." magic points.
You gain ".$levelrow[$userrow["charclass"]."_tp"]." travel points.
You gain ".$levelrow[$userrow["charclass"]."_strength"]." strength.
You gain ".$levelrow[$userrow["charclass"]."_dexterity"]." dexterity.
$spelltext
You can now continue exploring."; + $page = "Congratulations. You have defeated the ".$monsterrow["name"].".
You gain $exp experience. $warnexp
You gain $gold gold. $warngold

You have gained a level!

You gain ".$levelrow[$userrow["charclass"]."_hp"]." hit points.
You gain ".$levelrow[$userrow["charclass"]."_mp"]." magic points.
You gain ".$levelrow[$userrow["charclass"]."_tp"]." travel points.
You gain ".$levelrow[$userrow["charclass"]."_strength"]." strength.
You gain ".$levelrow[$userrow["charclass"]."_dexterity"]." dexterity.
$spelltext
You can now continue exploring."; $title = "Courage and Wit have served thee well!"; + $dropcode = ""; } else { $newhp = $userrow["maxhp"]; $newmp = $userrow["maxmp"]; @@ -398,7 +399,7 @@ function victory() { $newdefense = $userrow["defensepower"]; $newlevel = $userrow["level"]; $newspell = ""; - $page = "Congratulations. You have defeated the ".$monsterrow["name"].".
You gain $exp experience.
You gain $gold gold.

"; + $page = "Congratulations. You have defeated the ".$monsterrow["name"].".
You gain $exp experience. $warnexp
You gain $gold gold. $warngold

"; if (rand(1,30) == 1) { $dropquery = doquery("SELECT * FROM {{table}} WHERE mlevel <= '".$monsterrow["level"]."' ORDER BY RAND() LIMIT 1", "drops"); diff --git a/index.php b/index.php index 2ba4283..473e833 100644 --- a/index.php +++ b/index.php @@ -132,7 +132,7 @@ function showchar() { $levelquery = doquery("SELECT ". $userrow["charclass"]."_exp FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); $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"] = "None"; } if ($userrow["charclass"] == 1) { $userrow["charclass"] = $controlrow["class1name"]; } elseif ($userrow["charclass"] == 2) { $userrow["charclass"] = $controlrow["class2name"]; } @@ -248,10 +248,11 @@ function babblebox() { $babblebox = array("content"=>""); $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)) { - if ($bg == 1) { $babblebox["content"] .= "
[".$babblerow["author"]."] ".$babblerow["babble"]."
\n"; $bg = 2; } - else { $babblebox["content"] .= "
[".$babblerow["author"]."] ".stripslashes($babblerow["babble"])."
\n"; $bg = 1; } + if ($bg == 1) { $new = "
[".$babblerow["author"]."] ".$babblerow["babble"]."
\n"; $bg = 2; } + else { $new = "
[".$babblerow["author"]."] ".stripslashes($babblerow["babble"])."
\n"; $bg = 1; } + $babblebox["content"] = $new . $babblebox["content"]; } $babblebox["content"] .= "

"; diff --git a/templates/admin.php b/templates/admin.php index bec5ff9..fd96404 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -71,7 +71,7 @@ a:hover {
- + THEVERYENDOFYOU;