From 2b6ec4d4abc9542751439fc9067745d57cbc8e17 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Thu, 12 Dec 2024 11:28:19 -0600 Subject: [PATCH] Completely rework help page --- public/admin.php | 512 +++++++++++----------- public/forum.php | 10 +- public/help.php | 809 +++++++++++++++++++++++------------ public/help_items.php | 155 ------- public/help_levels.php | 141 ------ public/help_monsters.php | 96 ----- public/help_spells.php | 106 ----- public/index.php | 6 +- public/install.php | 76 ++-- public/users.php | 38 +- src/fight.php | 96 ++--- src/lib.php | 31 +- src/towns.php | 50 +-- templates/admin.php | 34 +- templates/changepassword.php | 4 +- templates/fight.php | 4 +- templates/leftnav.php | 26 +- templates/login.php | 4 +- templates/onlinechar.php | 36 +- templates/primary.php | 4 +- templates/register.php | 8 +- templates/rightnav.php | 26 +- templates/showchar.php | 36 +- templates/towns.php | 6 +- templates/verify.php | 4 +- 25 files changed, 1050 insertions(+), 1268 deletions(-) delete mode 100644 public/help_items.php delete mode 100644 public/help_levels.php delete mode 100644 public/help_monsters.php delete mode 100644 public/help_spells.php diff --git a/public/admin.php b/public/admin.php index 3f25424..a5a2f77 100644 --- a/public/admin.php +++ b/public/admin.php @@ -33,7 +33,7 @@ if (isset($_GET["do"])) { function donothing() { - $page = "Welcome to the Dragon Knight Administration section. Use the links on the left bar to control and edit various elements of the game.

Please note that the control panel has been created mostly as a shortcut for certain individual settings. It is meant for use primarily with editing one thing at a time. If you need to completely replace an entire table (say, to replace all stock monsters with your own new ones), it is suggested that you use a more in-depth database tool such as phpMyAdmin. Also, you may want to have a copy of the Dragon Knight development kit, available from the Dragon Knight homepage.

Also, you should be aware that certain portions of the DK code are dependent on the formatting of certain database results (for example, the special attributes on item drops). While I have attempted to point these out throughout the admin script, you should definitely pay attention and be careful when editing some fields, because mistakes in the database content may result in script errors or your game breaking completely."; + $page = "Welcome to the Dragon Knight Administration section. Use the links on the left bar to control and edit various elements of the game.

Please note that the control panel has been created mostly as a shortcut for certain individual settings. It is meant for use primarily with editing one thing at a time. If you need to completely replace an entire table (say, to replace all stock monsters with your own new ones), it is suggested that you use a more in-depth database tool such as phpMyAdmin. Also, you may want to have a copy of the Dragon Knight development kit, available from the Dragon Knight homepage.

Also, you should be aware that certain portions of the DK code are dependent on the formatting of certain database results (for example, the special attributes on item drops). While I have attempted to point these out throughout the admin script, you should definitely pay attention and be careful when editing some fields, because mistakes in the database content may result in script errors or your game breaking completely."; admindisplay($page, "Admin Home"); } @@ -44,44 +44,44 @@ function main() { extract($_POST); $errors = 0; $errorlist = ""; - if ($gamename == "") { $errors++; $errorlist .= "Game name is required.
"; } - if (($gamesize % 5) != 0) { $errors++; $errorlist .= "Map size must be divisible by five.
"; } - if (!is_numeric($gamesize)) { $errors++; $errorlist .= "Map size must be a number.
"; } - if ($forumtype == 2 && $forumaddress == "") { $errors++; $errorlist .= "You must specify a forum address when using the External setting.
"; } - if ($class1name == "") { $errors++; $errorlist .= "Class 1 name is required.
"; } - if ($class2name == "") { $errors++; $errorlist .= "Class 2 name is required.
"; } - if ($class3name == "") { $errors++; $errorlist .= "Class 3 name is required.
"; } + if ($gamename == "") { $errors++; $errorlist .= "Game name is required.
"; } + if (($gamesize % 5) != 0) { $errors++; $errorlist .= "Map size must be divisible by five.
"; } + if (!is_numeric($gamesize)) { $errors++; $errorlist .= "Map size must be a number.
"; } + if ($forumtype == 2 && $forumaddress == "") { $errors++; $errorlist .= "You must specify a forum address when using the External setting.
"; } + if ($class1name == "") { $errors++; $errorlist .= "Class 1 name is required.
"; } + if ($class2name == "") { $errors++; $errorlist .= "Class 2 name is required.
"; } + if ($class3name == "") { $errors++; $errorlist .= "Class 3 name is required.
"; } if ($errors == 0) { $query = doquery("UPDATE {{table}} SET gamename='$gamename',gamesize='$gamesize',forumtype='$forumtype',forumaddress='$forumaddress',compression='$compression',class1name='$class1name',class2name='$class2name',class3name='$class3name',diff1name='$diff1name',diff2name='$diff2name',diff3name='$diff3name',diff2mod='$diff2mod',diff3mod='$diff3mod',gameopen='$gameopen',verifyemail='$verifyemail',gameurl='$gameurl',adminemail='$adminemail',shownews='$shownews',showonline='$showonline',showbabble='$showbabble' WHERE id='1' LIMIT 1", "control"); admindisplay("Settings updated.","Main Settings"); } else { - admindisplay("Errors:
$errorlist

Please go back and try again.", "Main Settings"); + admindisplay("Errors:
$errorlist

Please go back and try again.", "Main Settings"); } } global $controlrow; $page = <<Main Settings
-These options control several major settings for the overall game engine.

+Main Settings
+These options control several major settings for the overall game engine.

- - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
Game Open:
Close the game if you are upgrading or working on settings and don't want to cause odd errors for end-users. Closing the game will completely halt all activity.
Game Name:
Default is "Dragon Knight". Change this if you want to change to call your game something different.
Game URL:
Please specify the full URL to your game installation ("http://www.server.com/dkpath/index.php"). This gets used in the registration email sent to users. If you leave this field blank or incorrect, users may not be able to register correctly.
Admin Email:
Please specify your email address. This gets used when the game has to send an email to users.
Map Size:
Default is 250. This is the size of each map quadrant. Note that monster levels increase every 5 spaces, so you should ensure that you have at least (map size / 5) monster levels total, otherwise there will be parts of the map without any monsters, or some monsters won't ever get used. Ex: with a map size of 250, you should have 50 monster levels total.
Forum Type:
'Disabled' removes the forum link. 'Internal' uses the built-in (and very stripped-down) forum program included with Dragon Knight, if you don't have your own forums software already installed. 'External' uses the address provided below and links to your own forums software.
External Forum:
If the above value is set to 'External,' please specify the complete URL to your forums here.
Page Compression:
Enable page compression if it is supported by your server, and this will greatly reduce the amount of bandwidth required by the game.
Email Verification:
Make users verify their email address for added security.
Show News:
Toggle display of the Latest News box in towns.
Show Who's Online:
Toggle display of the Who's Online box in towns.
Show Babblebox:
Toggle display of the Babble Box in towns.
Class 1 Name:
Class 2 Name:
Class 3 Name:
Game Open:
Close the game if you are upgrading or working on settings and don't want to cause odd errors for end-users. Closing the game will completely halt all activity.
Game Name:
Default is "Dragon Knight". Change this if you want to change to call your game something different.
Game URL:
Please specify the full URL to your game installation ("http://www.server.com/dkpath/index.php"). This gets used in the registration email sent to users. If you leave this field blank or incorrect, users may not be able to register correctly.
Admin Email:
Please specify your email address. This gets used when the game has to send an email to users.
Map Size:
Default is 250. This is the size of each map quadrant. Note that monster levels increase every 5 spaces, so you should ensure that you have at least (map size / 5) monster levels total, otherwise there will be parts of the map without any monsters, or some monsters won't ever get used. Ex: with a map size of 250, you should have 50 monster levels total.
Forum Type:
'Disabled' removes the forum link. 'Internal' uses the built-in (and very stripped-down) forum program included with Dragon Knight, if you don't have your own forums software already installed. 'External' uses the address provided below and links to your own forums software.
External Forum:
If the above value is set to 'External,' please specify the complete URL to your forums here.
Page Compression:
Enable page compression if it is supported by your server, and this will greatly reduce the amount of bandwidth required by the game.
Email Verification:
Make users verify their email address for added security.
Show News:
Toggle display of the Latest News box in towns.
Show Who's Online:
Toggle display of the Who's Online box in towns.
Show Babblebox:
Toggle display of the Babble Box in towns.
Class 1 Name:
Class 2 Name:
Class 3 Name:
@@ -111,7 +111,7 @@ END; function items() { $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "items"); - $page = "Edit Items
Click an item's name to edit it.

\n"; + $page = "Edit Items
Click an item's name to edit it.

\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "\n"; $count = 2; } @@ -130,18 +130,18 @@ function edititem($id) { extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } - if ($buycost == "") { $errors++; $errorlist .= "Cost is required.
"; } - if (!is_numeric($buycost)) { $errors++; $errorlist .= "Cost must be a number.
"; } - if ($attribute == "") { $errors++; $errorlist .= "Attribute is required.
"; } - if (!is_numeric($attribute)) { $errors++; $errorlist .= "Attribute must be a number.
"; } + if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } + if ($buycost == "") { $errors++; $errorlist .= "Cost is required.
"; } + if (!is_numeric($buycost)) { $errors++; $errorlist .= "Cost must be a number.
"; } + if ($attribute == "") { $errors++; $errorlist .= "Attribute is required.
"; } + if (!is_numeric($attribute)) { $errors++; $errorlist .= "Attribute must be a number.
"; } if ($special == "" || $special == " ") { $special = "X"; } if ($errors == 0) { $query = doquery("UPDATE {{table}} SET name='$name',type='$type',buycost='$buycost',attribute='$attribute',special='$special' WHERE id='$id' LIMIT 1", "items"); admindisplay("Item updated.","Edit Items"); } else { - admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Items"); + admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Items"); } } @@ -151,29 +151,29 @@ function edititem($id) { $row = mysql_fetch_array($query); $page = <<Edit Items

+Edit Items

".$row["id"]."".$row["name"]."
- - + +
ID:{{id}}
Name:
Type:
Cost: gold
Attribute:
How much the item adds to total attackpower (weapons) or defensepower (armor/shields).
Special:
Should be either a special code or X to disable. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.
Attribute:
How much the item adds to total attackpower (weapons) or defensepower (armor/shields).
Special:
Should be either a special code or X to disable. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.
-Special Codes:
-Special codes can be added in the item's Special field to give it extra user attributes. Special codes are in the format attribute,value. Attribute can be any database field from the Users table - however, it is suggested that you only use the ones from the list below, otherwise things can get freaky. Value may be any positive or negative whole number. For example, if you want a weapon to give an additional 50 max hit points, the special code would be maxhp,50.

-Suggested user fields for special codes:
-maxhp - max hit points
-maxmp - max magic points
-maxtp - max travel points
-goldbonus - gold bonus, in percent
-expbonus - experience bonus, in percent
-strength - strength (which also adds to attackpower)
-dexterity - dexterity (which also adds to defensepower)
-attackpower - total attack power
+Special Codes:
+Special codes can be added in the item's Special field to give it extra user attributes. Special codes are in the format attribute,value. Attribute can be any database field from the Users table - however, it is suggested that you only use the ones from the list below, otherwise things can get freaky. Value may be any positive or negative whole number. For example, if you want a weapon to give an additional 50 max hit points, the special code would be maxhp,50.

+Suggested user fields for special codes:
+maxhp - max hit points
+maxmp - max magic points
+maxtp - max travel points
+goldbonus - gold bonus, in percent
+expbonus - experience bonus, in percent
+strength - strength (which also adds to attackpower)
+dexterity - dexterity (which also adds to defensepower)
+attackpower - total attack power
defensepower - total defense power END; @@ -189,7 +189,7 @@ END; function drops() { $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "drops"); - $page = "Edit Drops
Click an item's name to edit it.

\n"; + $page = "Edit Drops
Click an item's name to edit it.

\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "\n"; $count = 2; } @@ -208,17 +208,17 @@ function editdrop($id) { extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } - if ($mlevel == "") { $errors++; $errorlist .= "Monster level is required.
"; } - if (!is_numeric($mlevel)) { $errors++; $errorlist .= "Monster level must be a number.
"; } - if ($attribute1 == "" || $attribute1 == " " || $attribute1 == "X") { $errors++; $errorlist .= "First attribute is required.
"; } + if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } + if ($mlevel == "") { $errors++; $errorlist .= "Monster level is required.
"; } + if (!is_numeric($mlevel)) { $errors++; $errorlist .= "Monster level must be a number.
"; } + if ($attribute1 == "" || $attribute1 == " " || $attribute1 == "X") { $errors++; $errorlist .= "First attribute is required.
"; } if ($attribute2 == "" || $attribute2 == " ") { $attribute2 = "X"; } if ($errors == 0) { $query = doquery("UPDATE {{table}} SET name='$name',mlevel='$mlevel',attribute1='$attribute1',attribute2='$attribute2' WHERE id='$id' LIMIT 1", "drops"); admindisplay("Item updated.","Edit Drops"); } else { - admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Drops"); + admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Drops"); } } @@ -228,28 +228,28 @@ function editdrop($id) { $row = mysql_fetch_array($query); $page = <<Edit Drops

+Edit Drops

".$row["id"]."".$row["name"]."
- - - + + +
ID:{{id}}
Name:
Monster Level:
Minimum monster level that will drop this item.
Attribute 1:
Must be a special code. First attribute cannot be disabled. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.
Attribute 2:
Should be either a special code or X to disable. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.
Monster Level:
Minimum monster level that will drop this item.
Attribute 1:
Must be a special code. First attribute cannot be disabled. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.
Attribute 2:
Should be either a special code or X to disable. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.
-Special Codes:
-Special codes are used in the two attribute fields to give the item properties. The first attribute field must contain a special code, but the second one may be left empty ("X") if you wish. Special codes are in the format attribute,value. Attribute can be any database field from the Users table - however, it is suggested that you only use the ones from the list below, otherwise things can get freaky. Value may be any positive or negative whole number. For example, if you want a weapon to give an additional 50 max hit points, the special code would be maxhp,50.

-Suggested user fields for special codes:
-maxhp - max hit points
-maxmp - max magic points
-maxtp - max travel points
-goldbonus - gold bonus, in percent
-expbonus - experience bonus, in percent
-strength - strength (which also adds to attackpower)
-dexterity - dexterity (which also adds to defensepower)
-attackpower - total attack power
+Special Codes:
+Special codes are used in the two attribute fields to give the item properties. The first attribute field must contain a special code, but the second one may be left empty ("X") if you wish. Special codes are in the format attribute,value. Attribute can be any database field from the Users table - however, it is suggested that you only use the ones from the list below, otherwise things can get freaky. Value may be any positive or negative whole number. For example, if you want a weapon to give an additional 50 max hit points, the special code would be maxhp,50.

+Suggested user fields for special codes:
+maxhp - max hit points
+maxmp - max magic points
+maxtp - max travel points
+goldbonus - gold bonus, in percent
+expbonus - experience bonus, in percent
+strength - strength (which also adds to attackpower)
+dexterity - dexterity (which also adds to defensepower)
+attackpower - total attack power
defensepower - total defense power END; @@ -261,7 +261,7 @@ END; function towns() { $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "towns"); - $page = "Edit Towns
Click an town's name to edit it.

\n"; + $page = "Edit Towns
Click an town's name to edit it.

\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "\n"; $count = 2; } @@ -280,25 +280,25 @@ function edittown($id) { extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } - if ($latitude == "") { $errors++; $errorlist .= "Latitude is required.
"; } - if (!is_numeric($latitude)) { $errors++; $errorlist .= "Latitude must be a number.
"; } - if ($longitude == "") { $errors++; $errorlist .= "Longitude is required.
"; } - if (!is_numeric($longitude)) { $errors++; $errorlist .= "Longitude must be a number.
"; } - if ($innprice == "") { $errors++; $errorlist .= "Inn Price is required.
"; } - if (!is_numeric($innprice)) { $errors++; $errorlist .= "Inn Price must be a number.
"; } - if ($mapprice == "") { $errors++; $errorlist .= "Map Price is required.
"; } - if (!is_numeric($mapprice)) { $errors++; $errorlist .= "Map Price must be a number.
"; } + if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } + if ($latitude == "") { $errors++; $errorlist .= "Latitude is required.
"; } + if (!is_numeric($latitude)) { $errors++; $errorlist .= "Latitude must be a number.
"; } + if ($longitude == "") { $errors++; $errorlist .= "Longitude is required.
"; } + if (!is_numeric($longitude)) { $errors++; $errorlist .= "Longitude must be a number.
"; } + if ($innprice == "") { $errors++; $errorlist .= "Inn Price is required.
"; } + if (!is_numeric($innprice)) { $errors++; $errorlist .= "Inn Price must be a number.
"; } + if ($mapprice == "") { $errors++; $errorlist .= "Map Price is required.
"; } + if (!is_numeric($mapprice)) { $errors++; $errorlist .= "Map Price must be a number.
"; } - if ($travelpoints == "") { $errors++; $errorlist .= "Travel Points is required.
"; } - if (!is_numeric($travelpoints)) { $errors++; $errorlist .= "Travel Points must be a number.
"; } - if ($itemslist == "") { $errors++; $errorlist .= "Items List is required.
"; } + if ($travelpoints == "") { $errors++; $errorlist .= "Travel Points is required.
"; } + if (!is_numeric($travelpoints)) { $errors++; $errorlist .= "Travel Points must be a number.
"; } + if ($itemslist == "") { $errors++; $errorlist .= "Items List is required.
"; } if ($errors == 0) { $query = doquery("UPDATE {{table}} SET name='$name',latitude='$latitude',longitude='$longitude',innprice='$innprice',mapprice='$mapprice',travelpoints='$travelpoints',itemslist='$itemslist' WHERE id='$id' LIMIT 1", "towns"); admindisplay("Town updated.","Edit Towns"); } else { - admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Towns"); + admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Towns"); } } @@ -308,17 +308,17 @@ function edittown($id) { $row = mysql_fetch_array($query); $page = <<Edit Towns

+Edit Towns

".$row["id"]."".$row["name"]."
- - + + - - - + + +
ID:{{id}}
Name:
Latitude:
Positive or negative integer.
Longitude:
Positive or negative integer.
Latitude:
Positive or negative integer.
Longitude:
Positive or negative integer.
Inn Price: gold
Map Price: gold
How much it costs to buy the map to this town.
Travel Points:
How many TP are consumed when travelling to this town.
Items List:
Comma-separated list of item ID numbers available for purchase at this town. (Example: 1,2,3,6,9,10,13,20)
Map Price: gold
How much it costs to buy the map to this town.
Travel Points:
How many TP are consumed when travelling to this town.
Items List:
Comma-separated list of item ID numbers available for purchase at this town. (Example: 1,2,3,6,9,10,13,20)
@@ -337,13 +337,13 @@ function monsters() { $statrow = mysql_fetch_array($statquery); $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "monsters"); - $page = "Edit Monsters
"; + $page = "Edit Monsters
"; if (($controlrow["gamesize"]/5) != $statrow["level"]) { - $page .= "Note: Your highest monster level does not match with your entered map size. Highest monster level should be ".($controlrow["gamesize"]/5).", yours is ".$statrow["level"].". Please fix this before opening the game to the public.

"; - } else { $page .= "Monster level and map size match. No further actions are required for map compatibility.

"; } + $page .= "Note: Your highest monster level does not match with your entered map size. Highest monster level should be ".($controlrow["gamesize"]/5).", yours is ".$statrow["level"].". Please fix this before opening the game to the public.

"; + } else { $page .= "Monster level and map size match. No further actions are required for map compatibility.

"; } - $page .= "Click an monster's name to edit it.

\n"; + $page .= "Click an monster's name to edit it.

\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "\n"; $count = 2; } @@ -362,25 +362,25 @@ function editmonster($id) { extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } - if ($maxhp == "") { $errors++; $errorlist .= "Max HP is required.
"; } - if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Max HP must be a number.
"; } - if ($maxdam == "") { $errors++; $errorlist .= "Max Damage is required.
"; } - if (!is_numeric($maxdam)) { $errors++; $errorlist .= "Max Damage must be a number.
"; } - if ($armor == "") { $errors++; $errorlist .= "Armor is required.
"; } - if (!is_numeric($armor)) { $errors++; $errorlist .= "Armor must be a number.
"; } - if ($level == "") { $errors++; $errorlist .= "Monster Level is required.
"; } - if (!is_numeric($level)) { $errors++; $errorlist .= "Monster Level must be a number.
"; } - if ($maxexp == "") { $errors++; $errorlist .= "Max Exp is required.
"; } - if (!is_numeric($maxexp)) { $errors++; $errorlist .= "Max Exp must be a number.
"; } - if ($maxgold == "") { $errors++; $errorlist .= "Max Gold is required.
"; } - if (!is_numeric($maxgold)) { $errors++; $errorlist .= "Max Gold must be a number.
"; } + if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } + if ($maxhp == "") { $errors++; $errorlist .= "Max HP is required.
"; } + if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Max HP must be a number.
"; } + if ($maxdam == "") { $errors++; $errorlist .= "Max Damage is required.
"; } + if (!is_numeric($maxdam)) { $errors++; $errorlist .= "Max Damage must be a number.
"; } + if ($armor == "") { $errors++; $errorlist .= "Armor is required.
"; } + if (!is_numeric($armor)) { $errors++; $errorlist .= "Armor must be a number.
"; } + if ($level == "") { $errors++; $errorlist .= "Monster Level is required.
"; } + if (!is_numeric($level)) { $errors++; $errorlist .= "Monster Level must be a number.
"; } + if ($maxexp == "") { $errors++; $errorlist .= "Max Exp is required.
"; } + if (!is_numeric($maxexp)) { $errors++; $errorlist .= "Max Exp must be a number.
"; } + if ($maxgold == "") { $errors++; $errorlist .= "Max Gold is required.
"; } + if (!is_numeric($maxgold)) { $errors++; $errorlist .= "Max Gold must be a number.
"; } if ($errors == 0) { $query = doquery("UPDATE {{table}} SET name='$name',maxhp='$maxhp',maxdam='$maxdam',armor='$armor',level='$level',maxexp='$maxexp',maxgold='$maxgold',immune='$immune' WHERE id='$id' LIMIT 1", "monsters"); admindisplay("Monster updated.","Edit monsters"); } else { - admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit monsters"); + admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit monsters"); } } @@ -390,18 +390,18 @@ function editmonster($id) { $row = mysql_fetch_array($query); $page = <<Edit Monsters

+Edit Monsters

".$row["id"]."".$row["name"]."
- - - - - - + + + + + +
ID:{{id}}
Name:
Max Hit Points:
Max Damage:
Compares to player's attackpower.
Armor:
Compares to player's defensepower.
Monster Level:
Determines spawn location and item drops.
Max Experience:
Max experience gained from defeating monster.
Max Gold:
Max gold gained from defeating monster.
Immunity:
Some monsters may not be hurt by certain spells.
Max Damage:
Compares to player's attackpower.
Armor:
Compares to player's defensepower.
Monster Level:
Determines spawn location and item drops.
Max Experience:
Max experience gained from defeating monster.
Max Gold:
Max gold gained from defeating monster.
Immunity:
Some monsters may not be hurt by certain spells.
@@ -419,7 +419,7 @@ END; function spells() { $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "spells"); - $page = "Edit Spells
Click an spell's name to edit it.

\n"; + $page = "Edit Spells
Click an spell's name to edit it.

\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "\n"; $count = 2; } @@ -438,17 +438,17 @@ function editspell($id) { extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } - if ($mp == "") { $errors++; $errorlist .= "MP is required.
"; } - if (!is_numeric($mp)) { $errors++; $errorlist .= "MP must be a number.
"; } - if ($attribute == "") { $errors++; $errorlist .= "Attribute is required.
"; } - if (!is_numeric($attribute)) { $errors++; $errorlist .= "Attribute must be a number.
"; } + if ($name == "") { $errors++; $errorlist .= "Name is required.
"; } + if ($mp == "") { $errors++; $errorlist .= "MP is required.
"; } + if (!is_numeric($mp)) { $errors++; $errorlist .= "MP must be a number.
"; } + if ($attribute == "") { $errors++; $errorlist .= "Attribute is required.
"; } + if (!is_numeric($attribute)) { $errors++; $errorlist .= "Attribute must be a number.
"; } if ($errors == 0) { $query = doquery("UPDATE {{table}} SET name='$name',mp='$mp',attribute='$attribute',type='$type' WHERE id='$id' LIMIT 1", "spells"); admindisplay("Spell updated.","Edit Spells"); } else { - admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Spells"); + admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Spells"); } } @@ -458,14 +458,14 @@ function editspell($id) { $row = mysql_fetch_array($query); $page = <<Edit Spells

+Edit Spells

".$row["id"]."".$row["name"]."
- - - + + +
ID:{{id}}
Name:
Magic Points:
MP required to cast spell.
Attribute:
Numeric value of the spell's effect. Ties with type, below.
Type:
- Heal gives player back [attribute] hit points.
- Hurt deals [attribute] damage to monster.
- Sleep keeps monster from attacking ([attribute] is monster's chance out of 15 to stay asleep each turn).
- Uber Attack increases total attack damage by [attribute] percent.
- Uber Defense increases total defense from attack by [attribute] percent.
Magic Points:
MP required to cast spell.
Attribute:
Numeric value of the spell's effect. Ties with type, below.
Type:
- Heal gives player back [attribute] hit points.
- Hurt deals [attribute] damage to monster.
- Sleep keeps monster from attacking ([attribute] is monster's chance out of 15 to stay asleep each turn).
- Uber Attack increases total attack damage by [attribute] percent.
- Uber Defense increases total defense from attack by [attribute] percent.
@@ -493,7 +493,7 @@ function levels() { } $page = <<Edit Levels
Select a level number from the dropdown box to edit it.

+Edit Levels
Select a level number from the dropdown box to edit it.

@@ -635,7 +635,7 @@ END; function users() { $query = doquery("SELECT id,username FROM {{table}} ORDER BY id", "users"); - $page = "Edit Users
Click a username to edit the account.

\n"; + $page = "Edit Users
Click a username to edit the account.

\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "\n"; $count = 2; } @@ -654,91 +654,91 @@ function edituser($id) { extract($_POST); $errors = 0; $errorlist = ""; - if ($email == "") { $errors++; $errorlist .= "Email is required.
"; } - if ($verify == "") { $errors++; $errorlist .= "Verify is required.
"; } - if ($authlevel == "") { $errors++; $errorlist .= "Auth Level is required.
"; } - if ($latitude == "") { $errors++; $errorlist .= "Latitude is required.
"; } - if ($longitude == "") { $errors++; $errorlist .= "Longitude is required.
"; } - if ($charclass == "") { $errors++; $errorlist .= "Character Class is required.
"; } - if ($currentaction == "") { $errors++; $errorlist .= "Current Action is required.
"; } - if ($currentfight == "") { $errors++; $errorlist .= "Current Fight is required.
"; } + if ($email == "") { $errors++; $errorlist .= "Email is required.
"; } + if ($verify == "") { $errors++; $errorlist .= "Verify is required.
"; } + if ($authlevel == "") { $errors++; $errorlist .= "Auth Level is required.
"; } + if ($latitude == "") { $errors++; $errorlist .= "Latitude is required.
"; } + if ($longitude == "") { $errors++; $errorlist .= "Longitude is required.
"; } + if ($charclass == "") { $errors++; $errorlist .= "Character Class is required.
"; } + if ($currentaction == "") { $errors++; $errorlist .= "Current Action is required.
"; } + if ($currentfight == "") { $errors++; $errorlist .= "Current Fight is required.
"; } - if ($currentmonster == "") { $errors++; $errorlist .= "Current Monster is required.
"; } - if ($currentmonsterhp == "") { $errors++; $errorlist .= "Current Monster HP is required.
"; } - if ($currentmonstersleep == "") { $errors++; $errorlist .= "Current Monster Sleep is required.
"; } - if ($currentmonsterimmune == "") { $errors++; $errorlist .= "Current Monster Immune is required.
"; } - if ($currentuberdamage == "") { $errors++; $errorlist .= "Current Uber Damage is required.
"; } - if ($currentuberdefense == "") { $errors++; $errorlist .= "Current Uber Defense is required.
"; } - if ($currenthp == "") { $errors++; $errorlist .= "Current HP is required.
"; } - if ($currentmp == "") { $errors++; $errorlist .= "Current MP is required.
"; } - if ($currenttp == "") { $errors++; $errorlist .= "Current TP is required.
"; } - if ($maxhp == "") { $errors++; $errorlist .= "Max HP is required.
"; } + if ($currentmonster == "") { $errors++; $errorlist .= "Current Monster is required.
"; } + if ($currentmonsterhp == "") { $errors++; $errorlist .= "Current Monster HP is required.
"; } + if ($currentmonstersleep == "") { $errors++; $errorlist .= "Current Monster Sleep is required.
"; } + if ($currentmonsterimmune == "") { $errors++; $errorlist .= "Current Monster Immune is required.
"; } + if ($currentuberdamage == "") { $errors++; $errorlist .= "Current Uber Damage is required.
"; } + if ($currentuberdefense == "") { $errors++; $errorlist .= "Current Uber Defense is required.
"; } + if ($currenthp == "") { $errors++; $errorlist .= "Current HP is required.
"; } + if ($currentmp == "") { $errors++; $errorlist .= "Current MP is required.
"; } + if ($currenttp == "") { $errors++; $errorlist .= "Current TP is required.
"; } + if ($maxhp == "") { $errors++; $errorlist .= "Max HP is required.
"; } - if ($maxmp == "") { $errors++; $errorlist .= "Max MP is required.
"; } - if ($maxtp == "") { $errors++; $errorlist .= "Max TP is required.
"; } - if ($level == "") { $errors++; $errorlist .= "Level is required.
"; } - if ($gold == "") { $errors++; $errorlist .= "Gold is required.
"; } - if ($experience == "") { $errors++; $errorlist .= "Experience is required.
"; } - if ($goldbonus == "") { $errors++; $errorlist .= "Gold Bonus is required.
"; } - if ($expbonus == "") { $errors++; $errorlist .= "Experience Bonus is required.
"; } - if ($strength == "") { $errors++; $errorlist .= "Strength is required.
"; } - if ($dexterity == "") { $errors++; $errorlist .= "Dexterity is required.
"; } - if ($attackpower == "") { $errors++; $errorlist .= "Attack Power is required.
"; } + if ($maxmp == "") { $errors++; $errorlist .= "Max MP is required.
"; } + if ($maxtp == "") { $errors++; $errorlist .= "Max TP is required.
"; } + if ($level == "") { $errors++; $errorlist .= "Level is required.
"; } + if ($gold == "") { $errors++; $errorlist .= "Gold is required.
"; } + if ($experience == "") { $errors++; $errorlist .= "Experience is required.
"; } + if ($goldbonus == "") { $errors++; $errorlist .= "Gold Bonus is required.
"; } + if ($expbonus == "") { $errors++; $errorlist .= "Experience Bonus is required.
"; } + if ($strength == "") { $errors++; $errorlist .= "Strength is required.
"; } + if ($dexterity == "") { $errors++; $errorlist .= "Dexterity is required.
"; } + if ($attackpower == "") { $errors++; $errorlist .= "Attack Power is required.
"; } - if ($defensepower == "") { $errors++; $errorlist .= "Defense Power is required.
"; } - if ($weaponid == "") { $errors++; $errorlist .= "Weapon ID is required.
"; } - if ($armorid == "") { $errors++; $errorlist .= "Armor ID is required.
"; } - if ($shieldid == "") { $errors++; $errorlist .= "Shield ID is required.
"; } - if ($slot1id == "") { $errors++; $errorlist .= "Slot 1 ID is required.
"; } - if ($slot2id == "") { $errors++; $errorlist .= "Slot 2 ID is required.
"; } - if ($slot3id == "") { $errors++; $errorlist .= "Slot 3 ID is required.
"; } - if ($weaponname == "") { $errors++; $errorlist .= "Weapon Name is required.
"; } - if ($armorname == "") { $errors++; $errorlist .= "Armor Name is required.
"; } - if ($shieldname == "") { $errors++; $errorlist .= "Shield Name is required.
"; } + if ($defensepower == "") { $errors++; $errorlist .= "Defense Power is required.
"; } + if ($weaponid == "") { $errors++; $errorlist .= "Weapon ID is required.
"; } + if ($armorid == "") { $errors++; $errorlist .= "Armor ID is required.
"; } + if ($shieldid == "") { $errors++; $errorlist .= "Shield ID is required.
"; } + if ($slot1id == "") { $errors++; $errorlist .= "Slot 1 ID is required.
"; } + if ($slot2id == "") { $errors++; $errorlist .= "Slot 2 ID is required.
"; } + if ($slot3id == "") { $errors++; $errorlist .= "Slot 3 ID is required.
"; } + if ($weaponname == "") { $errors++; $errorlist .= "Weapon Name is required.
"; } + if ($armorname == "") { $errors++; $errorlist .= "Armor Name is required.
"; } + if ($shieldname == "") { $errors++; $errorlist .= "Shield Name is required.
"; } - if ($slot1name == "") { $errors++; $errorlist .= "Slot 1 Name is required.
"; } - if ($slot2name == "") { $errors++; $errorlist .= "Slot 2 Name is required.
"; } - if ($slot3name == "") { $errors++; $errorlist .= "Slot 3 Name is required.
"; } - if ($dropcode == "") { $errors++; $errorlist .= "Drop Code is required.
"; } - if ($spells == "") { $errors++; $errorlist .= "Spells is required.
"; } - if ($towns == "") { $errors++; $errorlist .= "Towns is required.
"; } + if ($slot1name == "") { $errors++; $errorlist .= "Slot 1 Name is required.
"; } + if ($slot2name == "") { $errors++; $errorlist .= "Slot 2 Name is required.
"; } + if ($slot3name == "") { $errors++; $errorlist .= "Slot 3 Name is required.
"; } + if ($dropcode == "") { $errors++; $errorlist .= "Drop Code is required.
"; } + if ($spells == "") { $errors++; $errorlist .= "Spells is required.
"; } + if ($towns == "") { $errors++; $errorlist .= "Towns is required.
"; } - if (!is_numeric($authlevel)) { $errors++; $errorlist .= "Auth Level must be a number.
"; } - if (!is_numeric($latitude)) { $errors++; $errorlist .= "Latitude must be a number.
"; } - if (!is_numeric($longitude)) { $errors++; $errorlist .= "Longitude must be a number.
"; } - if (!is_numeric($charclass)) { $errors++; $errorlist .= "Character Class must be a number.
"; } - if (!is_numeric($currentfight)) { $errors++; $errorlist .= "Current Fight must be a number.
"; } - if (!is_numeric($currentmonster)) { $errors++; $errorlist .= "Current Monster must be a number.
"; } - if (!is_numeric($currentmonsterhp)) { $errors++; $errorlist .= "Current Monster HP must be a number.
"; } - if (!is_numeric($currentmonstersleep)) { $errors++; $errorlist .= "Current Monster Sleep must be a number.
"; } + if (!is_numeric($authlevel)) { $errors++; $errorlist .= "Auth Level must be a number.
"; } + if (!is_numeric($latitude)) { $errors++; $errorlist .= "Latitude must be a number.
"; } + if (!is_numeric($longitude)) { $errors++; $errorlist .= "Longitude must be a number.
"; } + if (!is_numeric($charclass)) { $errors++; $errorlist .= "Character Class must be a number.
"; } + if (!is_numeric($currentfight)) { $errors++; $errorlist .= "Current Fight must be a number.
"; } + if (!is_numeric($currentmonster)) { $errors++; $errorlist .= "Current Monster must be a number.
"; } + if (!is_numeric($currentmonsterhp)) { $errors++; $errorlist .= "Current Monster HP must be a number.
"; } + if (!is_numeric($currentmonstersleep)) { $errors++; $errorlist .= "Current Monster Sleep must be a number.
"; } - if (!is_numeric($currentmonsterimmune)) { $errors++; $errorlist .= "Current Monster Immune must be a number.
"; } - if (!is_numeric($currentuberdamage)) { $errors++; $errorlist .= "Current Uber Damage must be a number.
"; } - if (!is_numeric($currentuberdefense)) { $errors++; $errorlist .= "Current Uber Defense must be a number.
"; } - if (!is_numeric($currenthp)) { $errors++; $errorlist .= "Current HP must be a number.
"; } - if (!is_numeric($currentmp)) { $errors++; $errorlist .= "Current MP must be a number.
"; } - if (!is_numeric($currenttp)) { $errors++; $errorlist .= "Current TP must be a number.
"; } - if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Max HP must be a number.
"; } - if (!is_numeric($maxmp)) { $errors++; $errorlist .= "Max MP must be a number.
"; } - if (!is_numeric($maxtp)) { $errors++; $errorlist .= "Max TP must be a number.
"; } - if (!is_numeric($level)) { $errors++; $errorlist .= "Level must be a number.
"; } + if (!is_numeric($currentmonsterimmune)) { $errors++; $errorlist .= "Current Monster Immune must be a number.
"; } + if (!is_numeric($currentuberdamage)) { $errors++; $errorlist .= "Current Uber Damage must be a number.
"; } + if (!is_numeric($currentuberdefense)) { $errors++; $errorlist .= "Current Uber Defense must be a number.
"; } + if (!is_numeric($currenthp)) { $errors++; $errorlist .= "Current HP must be a number.
"; } + if (!is_numeric($currentmp)) { $errors++; $errorlist .= "Current MP must be a number.
"; } + if (!is_numeric($currenttp)) { $errors++; $errorlist .= "Current TP must be a number.
"; } + if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Max HP must be a number.
"; } + if (!is_numeric($maxmp)) { $errors++; $errorlist .= "Max MP must be a number.
"; } + if (!is_numeric($maxtp)) { $errors++; $errorlist .= "Max TP must be a number.
"; } + if (!is_numeric($level)) { $errors++; $errorlist .= "Level must be a number.
"; } - if (!is_numeric($gold)) { $errors++; $errorlist .= "Gold must be a number.
"; } - if (!is_numeric($experience)) { $errors++; $errorlist .= "Experience must be a number.
"; } - if (!is_numeric($goldbonus)) { $errors++; $errorlist .= "Gold Bonus must be a number.
"; } - if (!is_numeric($expbonus)) { $errors++; $errorlist .= "Experience Bonus must be a number.
"; } - if (!is_numeric($strength)) { $errors++; $errorlist .= "Strength must be a number.
"; } - if (!is_numeric($dexterity)) { $errors++; $errorlist .= "Dexterity must be a number.
"; } - if (!is_numeric($attackpower)) { $errors++; $errorlist .= "Attack Power must be a number.
"; } - if (!is_numeric($defensepower)) { $errors++; $errorlist .= "Defense Power must be a number.
"; } - if (!is_numeric($weaponid)) { $errors++; $errorlist .= "Weapon ID must be a number.
"; } - if (!is_numeric($armorid)) { $errors++; $errorlist .= "Armor ID must be a number.
"; } + if (!is_numeric($gold)) { $errors++; $errorlist .= "Gold must be a number.
"; } + if (!is_numeric($experience)) { $errors++; $errorlist .= "Experience must be a number.
"; } + if (!is_numeric($goldbonus)) { $errors++; $errorlist .= "Gold Bonus must be a number.
"; } + if (!is_numeric($expbonus)) { $errors++; $errorlist .= "Experience Bonus must be a number.
"; } + if (!is_numeric($strength)) { $errors++; $errorlist .= "Strength must be a number.
"; } + if (!is_numeric($dexterity)) { $errors++; $errorlist .= "Dexterity must be a number.
"; } + if (!is_numeric($attackpower)) { $errors++; $errorlist .= "Attack Power must be a number.
"; } + if (!is_numeric($defensepower)) { $errors++; $errorlist .= "Defense Power must be a number.
"; } + if (!is_numeric($weaponid)) { $errors++; $errorlist .= "Weapon ID must be a number.
"; } + if (!is_numeric($armorid)) { $errors++; $errorlist .= "Armor ID must be a number.
"; } - if (!is_numeric($shieldid)) { $errors++; $errorlist .= "Shield ID must be a number.
"; } - if (!is_numeric($slot1id)) { $errors++; $errorlist .= "Slot 1 ID must be a number.
"; } - if (!is_numeric($slot2id)) { $errors++; $errorlist .= "Slot 2 ID must be a number.
"; } - if (!is_numeric($slot3id)) { $errors++; $errorlist .= "Slot 3 ID must be a number.
"; } - if (!is_numeric($dropcode)) { $errors++; $errorlist .= "Drop Code must be a number.
"; } + if (!is_numeric($shieldid)) { $errors++; $errorlist .= "Shield ID must be a number.
"; } + if (!is_numeric($slot1id)) { $errors++; $errorlist .= "Slot 1 ID must be a number.
"; } + if (!is_numeric($slot2id)) { $errors++; $errorlist .= "Slot 2 ID must be a number.
"; } + if (!is_numeric($slot3id)) { $errors++; $errorlist .= "Slot 3 ID must be a number.
"; } + if (!is_numeric($dropcode)) { $errors++; $errorlist .= "Drop Code must be a number.
"; } if ($errors == 0) { $updatequery = <<Errors:
$errorlist

Please go back and try again.", "Edit Users"); + admindisplay("Errors:
$errorlist

Please go back and try again.", "Edit Users"); } } @@ -773,7 +773,7 @@ END; $class3name = $controlrow["class3name"]; $page = <<Edit Users

+Edit Users

".$row["id"]."".$row["username"]."
@@ -782,7 +782,7 @@ $page = << - + @@ -867,22 +867,22 @@ function addnews() { extract($_POST); $errors = 0; $errorlist = ""; - if ($content == "") { $errors++; $errorlist .= "Content is required.
"; } + if ($content == "") { $errors++; $errorlist .= "Content is required.
"; } if ($errors == 0) { $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),content='$content'", "news"); admindisplay("News post added.","Add News"); } else { - admindisplay("Errors:
$errorlist

Please go back and try again.", "Add News"); + admindisplay("Errors:
$errorlist

Please go back and try again.", "Add News"); } } $page = <<Add A News Post

+Add A News Post

-Type your post below and then click Submit to add it.
-
+Type your post below and then click Submit to add it.
+
END; diff --git a/public/forum.php b/public/forum.php index 54332dc..0cdf8dd 100644 --- a/public/forum.php +++ b/public/forum.php @@ -58,15 +58,15 @@ function showthread($id, $start) { $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { - $page .= "
\n"; + $page .= "\n"; $count = 2; } else { - $page .= "\n"; + $page .= "\n"; $count = 1; } } - $page .= "
ID:{{id}}
Verify:
Register Date:{{regdate}}
Last Online:{{onlinetime}}
Auth Level:
Set to "Blocked" to temporarily (or permanently) ban a user.
Auth Level:
Set to "Blocked" to temporarily (or permanently) ban a user.
 
".$row["author"]."

".prettyforumdate($row["postdate"])."
".nl2br($row["content"])."
".$row["author"]."

".prettyforumdate($row["postdate"])."
".nl2br($row["content"])."
".$row["author"]."

".prettyforumdate($row["postdate"])."
".nl2br($row["content"])."
".$row["author"]."

".prettyforumdate($row["postdate"])."
".nl2br($row["content"])."

"; - $page .= "
Reply To This Thread:

"; + $page .= "
"; + $page .= "
Reply To This Thread:

"; display($page, "Forum"); @@ -94,7 +94,7 @@ function newthread() { die(); } - $page = "
Make A New Post:

Title:


Message:


"; + $page = "
Make A New Post:

Title:


Message:


"; display($page, "Forum"); } diff --git a/public/help.php b/public/help.php index b00e8d9..1c81ab2 100644 --- a/public/help.php +++ b/public/help.php @@ -1,306 +1,567 @@ - - + + -<? echo $controlrow["gamename"]; ?> Help - + <?= $controlrow["gamename"] ?> Help + - -

Help

-[ Return to the game ] + +

Help

+ [ Return to the game ] -


+


-

Table of Contents

- + +

Table of Contents

+ -
+
-

Introduction

-Firstly, I'd like to say thank you for playing my game. The Dragon Knight game engine is the result of several months of -planning, coding and testing. The original idea was to create a web-based tribute to the NES game, Dragon -Warrior. In its current iteration, only the underlying fighting system really resembles that game, as almost -everything else in DK has been made bigger and better. But you should still recognize bits and pieces as stemming -from Dragon Warrior and other RPGs of old.

-This is the first game I've ever written, and it has definitely been a positive experience. It got difficult at -times, admittedly, but it was still a lot of fun to write, and even more fun to play. And I hope to use this -experience so that if I ever want to create another game it will be even better than this one.

-If you are a site administrator, and would like to install a copy of DK on your own server, you may visit the -development site for Dragon Knight. This page -includes the downloadable game souce code, as well as some other resources that developers and administrators may -find valuable.

-Once again, thanks for playing!

-Jamin Seven
-Dragon Knight creator
-My Homepage
-Dragon Knight Homepage

-[ Top ] +

Introduction

+ Firstly, I'd like to say thank you for playing my game. The Dragon Knight game engine is the result of several months of + planning, coding and testing. The original idea was to create a web-based tribute to the NES game, Dragon + Warrior. In its current iteration, only the underlying fighting system really resembles that game, as almost + everything else in DK has been made bigger and better. But you should still recognize bits and pieces as stemming + from Dragon Warrior and other RPGs of old.

+ This is the first game I've ever written, and it has definitely been a positive experience. It got difficult at + times, admittedly, but it was still a lot of fun to write, and even more fun to play. And I hope to use this + experience so that if I ever want to create another game it will be even better than this one.

+ If you are a site administrator, and would like to install a copy of DK on your own server, you may visit the + development site for Dragon Knight. This page + includes the downloadable game souce code, as well as some other resources that developers and administrators may + find valuable.

+ Once again, thanks for playing!

+ Jamin Seven
+ Dragon Knight creator
+ My Homepage
+ Dragon Knight Homepage

+ [ Top ] -


+


-

Character Classes

-There are three character classes in the game. The main differences between the classes are what spells you get -access to, the speed with which you level up, and the amount of HP/MP/strength/dexterity you gain per level. Below -is a basic outline of each of the character classes. For more detailed information about the characters, please -view the Levels table at the bottom of this page. Also, note that the outline below refers to the stock class setup -for the game. If your administrator has used his/her own class setup, this information may not be accurate.

- -
    -
  • Fast level-ups -
  • High hit points -
  • High magic points -
  • Low strength -
  • Low dexterity -
  • 5 heal spells -
  • 5 hurt spells -
  • 3 sleep spells -
  • 3 +defense spells -
  • 0 +attack spells -
- -
    -
  • Medium level-ups -
  • Medium hit points -
  • Low magic points -
  • High strength -
  • Low dexterity -
  • 3 heal spells -
  • 3 hurt spells -
  • 2 sleep spells -
  • 3 +defense spells -
  • 3 +attack spells -
- -
    -
  • Slow level-ups -
  • Medium hit points -
  • Medium magic points -
  • Low strength -
  • High dexterity -
  • 4 heal spells -
  • 4 hurt spells -
  • 3 sleep spells -
  • 2 +defense spells -
  • 2 +attack spells -
-[ Top ] +

Character Classes

+ There are three character classes in the game. The main differences between the classes are what spells you get + access to, the speed with which you level up, and the amount of HP/MP/strength/dexterity you gain per level. Below + is a basic outline of each of the character classes. For more detailed information about the characters, please + view the Levels table at the bottom of this page. Also, note that the outline below refers to the stock class setup + for the game. If your administrator has used his/her own class setup, this information may not be accurate.

+ +
    +
  • Fast level-ups
  • +
  • High hit points
  • +
  • High magic points
  • +
  • Low strength
  • +
  • Low dexterity
  • +
  • 5 heal spells
  • +
  • 5 hurt spells
  • +
  • 3 sleep spells
  • +
  • 3 +defense spells
  • +
  • 0 +attack spells
  • +
+ +
    +
  • Medium level-ups
  • +
  • Medium hit points
  • +
  • Low magic points
  • +
  • High strength
  • +
  • Low dexterity
  • +
  • 3 heal spells
  • +
  • 3 hurt spells
  • +
  • 2 sleep spells
  • +
  • 3 +defense spells
  • +
  • 3 +attack spells
  • +
+ +
    +
  • Slow level-ups
  • +
  • Medium hit points
  • +
  • Medium magic points
  • +
  • Low strength
  • +
  • High dexterity
  • +
  • 4 heal spells
  • +
  • 4 hurt spells
  • +
  • 3 sleep spells
  • +
  • 2 +defense spells
  • +
  • 2 +attack spells
  • +
+ [ Top ] -


+


-

Playing The Game: In Town

-When you begin a new game, the first thing you see is the Town screen. Towns serve four primary functions: healing, buying items, -buying maps, and displaying game information.

-To heal yourself, click the "Rest at the Inn" link at the top of the town screen. Each town's Inn has a different price - some towns -are cheap, others are expensive. No matter what town you're in, the Inns always serve the same function: they restore your current -hit points, magic points, and travel points to their maximum amounts. Out in the field, you are free to use healing spells to restore -your hit points, but when you run low on magic points, the only way to restore them is at an Inn.

-Buying weapons and armor is accomplished through the appropriately-named "Buy Weapons/Armor" link. Not every item is available in -every town, so in order to get the most powerful items, you'll need to explore some of the outer towns. Once you've clicked the link, -you are presented with a list of items available in this town's store. To the left of each item is an icon that represents its type: -weapon, armor or shield. The amount of attack/defense power, as well as the item's price, are displayed to the right of the item name. -You'll notice that some items have a red asterisk (*) next to their names. These are items that come -with special attributes that modify other parts of your character profile. See the Items & Drops table at the bottom of this page for -more information about special items.

-Maps are the third function in towns. Buying a map to a town places the town in your Travel To box in the left status panel. Once -you've purchased a town's map, you can click its name from your Travel To box and you will jump to that town. Travelling this way -costs travel points, though, and you'll only be able to visit towns if you have enough travel points.

-The final function in towns is displaying game information and statistics. This includes the latest news post made by the game -administrator, a list of players who have been online recently, and the Babble Box.

-[ Top ] +

Playing The Game: In Town

+ When you begin a new game, the first thing you see is the Town screen. Towns serve four primary functions: healing, buying items, + buying maps, and displaying game information.

+ To heal yourself, click the "Rest at the Inn" link at the top of the town screen. Each town's Inn has a different price - some towns + are cheap, others are expensive. No matter what town you're in, the Inns always serve the same function: they restore your current + hit points, magic points, and travel points to their maximum amounts. Out in the field, you are free to use healing spells to restore + your hit points, but when you run low on magic points, the only way to restore them is at an Inn.

+ Buying weapons and armor is accomplished through the appropriately-named "Buy Weapons/Armor" link. Not every item is available in + every town, so in order to get the most powerful items, you'll need to explore some of the outer towns. Once you've clicked the link, + you are presented with a list of items available in this town's store. To the left of each item is an icon that represents its type: + weapon, armor or shield. The amount of attack/defense power, as well as the item's price, are displayed to the right of the item name. + You'll notice that some items have a red asterisk (*) next to their names. These are items that come + with special attributes that modify other parts of your character profile. See the Items & Drops table at the bottom of this page for + more information about special items.

+ Maps are the third function in towns. Buying a map to a town places the town in your Travel To box in the left status panel. Once + you've purchased a town's map, you can click its name from your Travel To box and you will jump to that town. Travelling this way + costs travel points, though, and you'll only be able to visit towns if you have enough travel points.

+ The final function in towns is displaying game information and statistics. This includes the latest news post made by the game + administrator, a list of players who have been online recently, and the Babble Box.

+ [ Top ] -


+


-

Playing The Game: Exploring & Fighting

-Once you're done in town, you are free to start exploring the world. Use the compass buttons on the left status panel to move around. -The game world is basically a big square, divided into four quadrants. Each quadrant is spaces -square. The first town is usually located at (0N,0E). Click the North button from the first town, and now you'll be at (1N,0E). -Likewise, if you now click the West button, you'll be at (1N,1W). Monster levels increase with every 5 spaces you move outward -from (0N,0E).

-While you're exploring, you will occasionally run into monsters. As in pretty much any other RPG game, you and the monster take turns -hitting each other in an attempt to reduce each other's hit points to zero. Once you run into a monster, the Exploring screen changes -to the Fighting screen.

-When a fight begins, you'll see the monster's name and hit points, and the game will ask you for your first command. You then get to -pick whether you want to fight, use a spell, or run away. Note, though, that sometimes the monster has the chance to hit you -first.

-The Fight button is pretty straightforward: you attack the monster, and the amount of damage dealt is based on your attack power and -the monster's armor. On top of that, there are two other things that can happen: an Excellent Hit, which doubles your total attack -damage; and a monster dodge, which results in you doing no damage to the monster.

-The Spell button allows you to pick an available spell and cast it. See the Spells list at the bottom of this page for more information -about spells.

-Finally, there is the Run button, which lets you run away from a fight if the monster is too powerful. Be warned, though: it is -possible for the monster to block you from running and attack you. So if your hit points are low, you may fare better by staying -around monsters that you know can't do much damage to you.

-Once you've had your turn, the monster also gets his turn. It is also possible for you to dodge the monster's attack and take no -damage.

-The end result of a fight is either you or the monster being knocked down to zero hit points. If you win, the monster dies and will -give you a certain amount of experience and gold. There is also a chance that the monster will drop an item, which you can put into -one of the three inventory slots to give you extra points in your character profile. If you lose and die, half of your gold is taken -away - however, you are given back a few hit points to help you make it back to town (for example, if you don't have enough gold to -pay for an Inn, and need to kill a couple low-level monsters to get the money).

-When the fight is over, you can continue exploring until you find another monster to beat into submission.

-[ Top ] +

Playing The Game: Exploring & Fighting

+ Once you're done in town, you are free to start exploring the world. Use the compass buttons on the left status panel to move around. + The game world is basically a big square, divided into four quadrants. Each quadrant is spaces + square. The first town is usually located at (0N,0E). Click the North button from the first town, and now you'll be at (1N,0E). + Likewise, if you now click the West button, you'll be at (1N,1W). Monster levels increase with every 5 spaces you move outward + from (0N,0E).

+ While you're exploring, you will occasionally run into monsters. As in pretty much any other RPG game, you and the monster take turns + hitting each other in an attempt to reduce each other's hit points to zero. Once you run into a monster, the Exploring screen changes + to the Fighting screen.

+ When a fight begins, you'll see the monster's name and hit points, and the game will ask you for your first command. You then get to + pick whether you want to fight, use a spell, or run away. Note, though, that sometimes the monster has the chance to hit you + first.

+ The Fight button is pretty straightforward: you attack the monster, and the amount of damage dealt is based on your attack power and + the monster's armor. On top of that, there are two other things that can happen: an Excellent Hit, which doubles your total attack + damage; and a monster dodge, which results in you doing no damage to the monster.

+ The Spell button allows you to pick an available spell and cast it. See the Spells list at the bottom of this page for more information + about spells.

+ Finally, there is the Run button, which lets you run away from a fight if the monster is too powerful. Be warned, though: it is + possible for the monster to block you from running and attack you. So if your hit points are low, you may fare better by staying + around monsters that you know can't do much damage to you.

+ Once you've had your turn, the monster also gets his turn. It is also possible for you to dodge the monster's attack and take no + damage.

+ The end result of a fight is either you or the monster being knocked down to zero hit points. If you win, the monster dies and will + give you a certain amount of experience and gold. There is also a chance that the monster will drop an item, which you can put into + one of the three inventory slots to give you extra points in your character profile. If you lose and die, half of your gold is taken + away - however, you are given back a few hit points to help you make it back to town (for example, if you don't have enough gold to + pay for an Inn, and need to kill a couple low-level monsters to get the money).

+ When the fight is over, you can continue exploring until you find another monster to beat into submission.

+ [ Top ] -


+


-

Playing The Game: Status Panels

-There are two status panels on the game screen: left and right.

-The left panel inclues your current location and play status (In Town, Exploring, Fighting), compass buttons for movement, and the -Travel To list for jumping between towns. At the bottom of the left panel is also a list of game functions.

-The right panel displays some character statistics, your inventory, and quick spells.

-The Character section shows the most important character statistics. It also displays the status bars for your current hit points, -magic points and travel points. These status bars are colored either green, yellow or red depending on your current amount of each -stat. There is also a link to pop up your list of extended statistics, which shows more detailed character information.

-The Fast Spells section lists any Heal spells you've learned. You may use these links any time you are in town or exploring to cast -the heal spell. These may not be used during fights, however - you have to use the Spells box on the fight screen for that. -[ Top ] +

Playing The Game: Status Panels

+ There are two status panels on the game screen: left and right.

+ The left panel inclues your current location and play status (In Town, Exploring, Fighting), compass buttons for movement, and the + Travel To list for jumping between towns. At the bottom of the left panel is also a list of game functions.

+ The right panel displays some character statistics, your inventory, and quick spells.

+ The Character section shows the most important character statistics. It also displays the status bars for your current hit points, + magic points and travel points. These status bars are colored either green, yellow or red depending on your current amount of each + stat. There is also a link to pop up your list of extended statistics, which shows more detailed character information.

+ The Fast Spells section lists any Heal spells you've learned. You may use these links any time you are in town or exploring to cast + the heal spell. These may not be used during fights, however - you have to use the Spells box on the fight screen for that. + [ Top ] -


+


-

Spoilers: Items & Drops

-Click here for the Items & Drops spoiler page.

-[ Top ] +

Spoilers: Items & Drops

+ Click here for the Items & Drops spoiler page.

+ [ Top ] -


+


-

Spoilers: Monsters

-Click here for the Monsters spoiler page.

-[ Top ] +

Spoilers: Monsters

+ Click here for the Monsters spoiler page.

+ [ Top ] -


+


-

Spoilers: Spells

-Click here for the Spells spoiler page.

-[ Top ] +

Spoilers: Spells

+ Click here for the Spells spoiler page.

+ [ Top ] -


+


-

Spoilers: Levels

-Click here for the Levels spoiler page.

-[ Top ] +

Spoilers: Levels

+ Click here for the Levels spoiler page.

+ [ Top ] -


+


-

Credits

-
    -
  • All program code and stock graphics for the game were created by Jamin Seven.

    -
  • Major props go to a few people on the PHP manual site, for help with various chunks of code. The specific people are listed in the source code.

    -
  • Super monkey love goes to Enix and the developers of Dragon Warrior. If it weren't for you guys, my game never would have been made.

    -
  • Mega props go to Dalez from GameFAQs for his DW3 experience chart, which was where I got my experience levels from.

    -
  • Mad crazy ninja love goes to the following people for help and support throughout the development process:

    -Ideas: (whether they got used or not) -
      -
    • kushet -
    • lghtning -
    • Ebolamonkey3000 -
    • Crimson Scythe -
    • SilDeath -

    -Beta Testing: (forums name if applicable, character name otherwise) -
      -
    • Ebolamonkey3000 -
    • lisi -
    • Junglist -
    • Crimson Scythe -
    • Sk8erpunk69 -
    • lghtning -
    • kushet -
    • SilDeath -
    • lowrider4life -
    • dubiin -
    • Sam Wise The Great -

    -
  • Apologies and lots of happy naked love to anyone I forgot.

    -
  • And of course, thanks to you for playing my game!

    -
  • NINJA! -
-[ Top ] +

Credits

+
    +
  • All program code and stock graphics for the game were created by Jamin Seven.

  • +
  • Major props go to a few people on the PHP manual site, for help with various chunks of code. The specific people are listed in the source code.

  • +
  • Super monkey love goes to Enix and the developers of Dragon Warrior. If it weren't for you guys, my game never would have been made.

  • +
  • Mega props go to Dalez from GameFAQs for his DW3 experience chart, which was where I got my experience levels from.

  • +
  • + Mad crazy ninja love goes to the following people for help and support throughout the development process:

    + Ideas: (whether they got used or not) +
      +
    • kushet
    • +
    • lghtning
    • +
    • Ebolamonkey3000
    • +
    • Crimson Scythe
    • +
    • SilDeath
    • +
    + Beta Testing: (forums name if applicable, character name otherwise) +
      +
    • Ebolamonkey3000
    • +
    • lisi
    • +
    • Junglist
    • +
    • Crimson Scythe
    • +
    • Sk8erpunk69
    • +
    • lghtning
    • +
    • kushet
    • +
    • SilDeath
    • +
    • lowrider4life
    • +
    • dubiin
    • +
    • Sam Wise The Great
    • +
    +
  • +
+ Apologies and lots of happy naked love to anyone I forgot.

+ And of course, thanks to you for playing my game!

+ NINJA!

+ [ Top ] -



+



-Please visit the following sites for more information:
-Se7enet (Jamin's homepage)
-Dragon Knight (official DK homepage)
-Forums (official DK forums)

-All original coding and graphics for the Dragon Knight game engine are © 2003-2005 by Jamin Seven.

-[ Top ] -

- - - + Please visit the following sites for more information:
+ Se7enet (Jamin's homepage)
+ Dragon Knight (official DK homepage)
+ Forums (official DK forums)

+ All original coding and graphics for the Dragon Knight game engine are © 2003-2005 by Jamin Seven.

+ [ Top ] + + + + + + + + + query('SELECT * FROM items ORDER BY id;'); + $item_types = [1 => ['weapon', 'Attack'], 2 => ['armor', 'Defense'], 3 => ['shield', 'Defense']]; + + while ($item = $items->fetchArray(SQLITE3_ASSOC)) { + $image = $item_types[$item['type']][0]; + $power = $item_types[$item['type']][1]; + + if ($item['special'] !== 'X') { + $special = explode(',', $item['special']); + $attr = special_to_string($special[0]); + $stat = (($special[1] > 0) ? '+' : '') . $special[1]; + $bigspecial = "$attr $stat"; + } else { + $bigspecial = 'None'; + } + + echo "\n"; + } + ?> +
Items
TypeNameCostAttributeSpecial
\"$image\"".$item["name"]."".$item["buycost"]." Gold".$item["attribute"]." $power Power$bigspecial
+ +

+ + + + + query('SELECT * FROM drops ORDER BY id;'); + + while ($drop = $drops->fetchArray(SQLITE3_ASSOC)) { + if ($drop["attribute1"] !== "X") { + $special = explode(',', $drop['attribute1']); + $attr = special_to_string($special[0]); + $stat = (($special[1] > 0) ? '+' : '') . $special[1]; + $bigspecial1 = "$attr $stat"; + } else { + $bigspecial1 = 'None'; + } + + if ($drop["attribute2"] !== "X") { + $special = explode(',', $drop['attribute2']); + $attr = special_to_string($special[0]); + $stat = (($special[1] > 0) ? '+' : '') . $special[1]; + $bigspecial2 = "$attr $stat"; + } else { + $bigspecial2 = 'None'; + } + + echo "\n"; + } + ?> +
Drops
NameMonster LevelAttribute 1Attribute 2
".$drop["name"]."".$drop["mlevel"]."$bigspecial1$bigspecial2
+ + + + + + + + + query('SELECT * FROM spells ORDER BY id;'); + $spell_types = ['None', 'Heal', 'Hurt', 'Sleep', '+Damage (%)', '+Defense (%)']; + while ($spell = $spells->fetchArray(SQLITE3_ASSOC)) { + echo << + + + + HTML; + } + ?> +
Spells
NameCostTypeAttribute
{$spell["name"]}{$spell["mp"]}{$spell_types[$spell['type']]}{$spell["attribute"]}
+
    +
  • Heal spells always give you the maximum amount possible, until your current HP is full.
  • +
  • Hurt spells deal X damage (not always the maximum) to the monster, regardless of the monster's armor.
  • +
  • Sleep spells put the monster to sleep. The monster has an X in 15 chance of remaining asleep each turn.
  • +
  • +Damage spells increase your total attack damage by X percent until the end of the fight.
  • +
  • +Defense spells reduce the total damage you take from the monster by X percent until the end of each fight.
  • +
+ + + + + + + + + query('SELECT * FROM monsters ORDER BY id;'); + $immunities = ['None', 'Hurt', 'Hurt & Sleep']; + + while ($m = $monsters->fetchArray(SQLITE3_ASSOC)) { + $immune = $immunities[$m['immune']] ?? 'Unknown'; + echo "\n"; + } + ?> +
Monsters
NameMax HPMax DamageArmorLevelMax Exp.Max GoldImmunity
".$m["name"]."".$m["maxhp"]."".$m["maxdam"]."".$m["armor"]."".$m["level"]."".$m["maxexp"]."".$m["maxgold"]."$immune
+ + + + query('SELECT * FROM levels ORDER BY id;'); + while ($level = $levels->fetchArray(SQLITE3_ASSOC)) { + $class_data = [1 => [], 2 => [], 3 => []]; + + foreach ($level as $column => $value) { + if ($column === 'id') continue; + + $parts = explode('_', $column); + $class_number = (int) $parts[0]; + $attribute = $parts[1]; + + if (in_array($class_number, [1, 2, 3])) { + $class_data[$class_number][$level['id']][$attribute] = $value; + } + } + + $rows[$level['id']] = $class_data; + } + + $spells = []; + $spells_query = db()->query('SELECT * FROM spells ORDER BY id;'); + while ($spell = $spells_query->fetchArray(SQLITE3_ASSOC)) { + $spells[$spell['id']] = $spell; + } + ?> + + + + + $class_data) { + $level_data = $class_data[1][$level]; + + $spell_name = ''; + if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name']; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + ?> +
Levels
LevelExp.HPMPTPStrengthDexteritySpell
' . $level . '' . ($level_data['exp'] ?? '') . '' . ($level_data['hp'] ?? '') . '' . ($level_data['mp'] ?? '') . '' . ($level_data['tp'] ?? '') . '' . ($level_data['strength'] ?? '') . '' . ($level_data['dexterity'] ?? '') . '' . (!empty($spell_name) ? $spell_name : 'None') . '
+ +

+ + + + + $class_data) { + $level_data = $class_data[2][$level]; + + $spell_name = ''; + if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name']; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + ?> +
Levels
LevelExp.HPMPTPStrengthDexteritySpell
' . $level . '' . ($level_data['exp'] ?? '') . '' . ($level_data['hp'] ?? '') . '' . ($level_data['mp'] ?? '') . '' . ($level_data['tp'] ?? '') . '' . ($level_data['strength'] ?? '') . '' . ($level_data['dexterity'] ?? '') . '' . (!empty($spell_name) ? $spell_name : 'None') . '
+ +

+ + + + + $class_data) { + $level_data = $class_data[3][$level]; + + $spell_name = ''; + if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name']; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + ?> +
Levels
LevelExp.HPMPTPStrengthDexteritySpell
' . $level . '' . ($level_data['exp'] ?? '') . '' . ($level_data['hp'] ?? '') . '' . ($level_data['mp'] ?? '') . '' . ($level_data['tp'] ?? '') . '' . ($level_data['strength'] ?? '') . '' . ($level_data['dexterity'] ?? '') . '' . (!empty($spell_name) ? $spell_name : 'None') . '
+ +
+ + Experience points listed are total values up until that point. All other values are just the new amount that you gain for each level. + + + +

+ + + + diff --git a/public/help_items.php b/public/help_items.php deleted file mode 100644 index 1dac7eb..0000000 --- a/public/help_items.php +++ /dev/null @@ -1,155 +0,0 @@ - - - - - -<? echo $controlrow["gamename"]; ?> Help - - - - -

Help: Items & Drops

-[ Return to Help | Return to the game ] - -


- - - - - 0) { $stat = "+" . $special[1]; } else { $stat = $special[1]; } - $bigspecial = "$attr $stat"; - } else { $bigspecial = "None"; } - echo "\n"; -} -?> -
Items
TypeNameCostAttributeSpecial
\"$image\"".$itemsrow["name"]."".$itemsrow["buycost"]." Gold".$itemsrow["attribute"]." $power Power$bigspecial
-
-
- - - - 0) { $stat1 = "+" . $special1[1]; } else { $stat1 = $special1[1]; } - $bigspecial1 = "$attr1 $stat1"; - } else { $bigspecial1 = "None"; } - if ($itemsrow["attribute2"] != "X") { - $special2 = explode(",",$itemsrow["attribute2"]); - if ($special2[0] == "maxhp") { $attr2 = "Max HP"; } - elseif ($special2[0] == "maxmp") { $attr2 = "Max MP"; } - elseif ($special2[0] == "maxtp") { $attr2 = "Max TP"; } - elseif ($special2[0] == "goldbonus") { $attr2 = "Gold Bonus (%)"; } - elseif ($special2[0] == "expbonus") { $attr2 = "Experience Bonus (%)"; } - elseif ($special2[0] == "strength") { $attr2 = "Strength"; } - elseif ($special2[0] == "dexterity") { $attr2 = "Dexterity"; } - elseif ($special2[0] == "attackpower") { $attr2 = "Attack Power"; } - elseif ($special2[0] == "defensepower") { $attr2 = "Defense Power"; } - else { $attr2 = $special2[0]; } - if ($special2[1] > 0) { $stat2 = "+" . $special2[1]; } else { $stat2 = $special2[1]; } - $bigspecial2 = "$attr2 $stat2"; - } else { $bigspecial2 = "None"; } - echo "\n"; -} -?> -
Drops
NameMonster LevelAttribute 1Attribute 2
".$itemsrow["name"]."".$itemsrow["mlevel"]."$bigspecial1$bigspecial2
-
- - - - - \ No newline at end of file diff --git a/public/help_levels.php b/public/help_levels.php deleted file mode 100644 index 856ac36..0000000 --- a/public/help_levels.php +++ /dev/null @@ -1,141 +0,0 @@ - - - - - -<? echo $controlrow["gamename"]; ?> Help - - - - -

Help: Levels

-[ Return to Help | Return to the game ] - -


- - - - -None"; } - if ($itemsrow["id"] != 100) { echo "\n"; } -} -?> -
Levels
LevelExp.HPMPTPStrengthDexteritySpell
".$itemsrow["id"]."".number_format($itemsrow["1_exp"])."".$itemsrow["1_hp"]."".$itemsrow["1_mp"]."".$itemsrow["1_tp"]."".$itemsrow["1_strength"]."".$itemsrow["1_dexterity"]."$spell
-

- - - -None"; } - if ($itemsrow["id"] != 100) { echo "\n"; } -} -?> -
Levels
LevelExp.HPMPTPStrengthDexteritySpell
".$itemsrow["id"]."".number_format($itemsrow["2_exp"])."".$itemsrow["2_hp"]."".$itemsrow["2_mp"]."".$itemsrow["2_tp"]."".$itemsrow["2_strength"]."".$itemsrow["2_dexterity"]."$spell
-

- - - -None"; } - if ($itemsrow["id"] != 100) { echo "\n"; } -} -?> -
Levels
LevelExp.HPMPTPStrengthDexteritySpell
".$itemsrow["id"]."".number_format($itemsrow["3_exp"])."".$itemsrow["3_hp"]."".$itemsrow["3_mp"]."".$itemsrow["3_tp"]."".$itemsrow["3_strength"]."".$itemsrow["3_dexterity"]."$spell
-
-Experience points listed are total values up until that point. All other values are just the new amount that you gain for each level. -

- - - - - \ No newline at end of file diff --git a/public/help_monsters.php b/public/help_monsters.php deleted file mode 100644 index ac15f54..0000000 --- a/public/help_monsters.php +++ /dev/null @@ -1,96 +0,0 @@ - - - - - -<? echo $controlrow["gamename"]; ?> Help - - - - -

Help: Monsters

-[ Return to Help | Return to the game ] - -


- - - - -None"; } elseif ($itemsrow["immune"] == 1) { $immune = "Hurt"; } else { $immune = "Hurt & Sleep"; } - echo "\n"; -} -?> -
Monsters
NameMax HPMax DamageArmorLevelMax Exp.Max GoldImmunity
".$itemsrow["name"]."".$itemsrow["maxhp"]."".$itemsrow["maxdam"]."".$itemsrow["armor"]."".$itemsrow["level"]."".$itemsrow["maxexp"]."".$itemsrow["maxgold"]."$immune
-
- - - - - \ No newline at end of file diff --git a/public/help_spells.php b/public/help_spells.php deleted file mode 100644 index 42866a2..0000000 --- a/public/help_spells.php +++ /dev/null @@ -1,106 +0,0 @@ - - - - - -<? echo $controlrow["gamename"]; ?> Help - - - - -

Help: Spells

-[ Return to Help | Return to the game ] - -


- - - - -\n"; -} -?> -
Spells
NameCostTypeAttribute
".$itemsrow["name"]."".$itemsrow["mp"]."$type".$itemsrow["attribute"]."
-
    -
  • Heal spells always give you the maximum amount possible, until your current HP is full. -
  • Hurt spells deal X damage (not always the maximum) to the monster, regardless of the monster's armor. -
  • Sleep spells put the monster to sleep. The monster has an X in 15 chance of remaining asleep each turn. -
  • +Damage spells increase your total attack damage by X percent until the end of the fight. -
  • +Defense spells reduce the total damage you take from the monster by X percent until the end of each fight. -
- - - - - \ No newline at end of file diff --git a/public/index.php b/public/index.php index ad685d5..7650919 100644 --- a/public/index.php +++ b/public/index.php @@ -102,7 +102,7 @@ function dotown() if ($controlrow["shownews"] == 1) { $newsrow = db()->query('SELECT * FROM news ORDER BY id DESC LIMIT 1;')->fetchArray(SQLITE3_ASSOC); $townrow["news"] = "
Latest News
\n"; - $townrow["news"] .= "[".prettydate($newsrow["postdate"])."]
".nl2br($newsrow["content"]); + $townrow["news"] .= "[".prettydate($newsrow["postdate"])."]
".nl2br($newsrow["content"]); $townrow["news"] .= "
\n"; } @@ -186,7 +186,7 @@ function showchar() while ($spellrow = $spells->fetchArray(SQLITE3_ASSOC)) { $spell = false; foreach($userspells as $b) if ($b == $spellrow["id"]) $spell = true; - if ($spell == true) $userrow["magiclist"] .= $spellrow["name"]."
"; + if ($spell == true) $userrow["magiclist"] .= $spellrow["name"]."
"; } if ($userrow["magiclist"] == "") $userrow["magiclist"] = "None"; @@ -251,7 +251,7 @@ function babblebox() else { $new = "
[".$babblerow["author"]."] ".stripslashes($babblerow["babble"])."
\n"; $bg = 1; } $babblebox["content"] = $new . $babblebox["content"]; } - $babblebox["content"] .= "

"; + $babblebox["content"] .= "

"; echo parsetemplate("\n" . gettemplate("babblebox"), $babblebox); } diff --git a/public/install.php b/public/install.php index 41cf178..d4347dc 100644 --- a/public/install.php +++ b/public/install.php @@ -28,17 +28,17 @@ function first() - Dragon Knight Installation: Page One

- NOTE: Please ensure you have filled in the correct values in config.php before continuing. Installation will fail if these values are not correct. Also, the MySQL database needs to already exist. This installer script will take care of setting up its structure and content, but the database itself must already exist on your MySQL server before the installer will work.

- Installation for Dragon Knight is a simple two-step process: set up the database tables, then create the admin user. After that, you're done.

+ Dragon Knight Installation: Page One

+ NOTE: Please ensure you have filled in the correct values in config.php before continuing. Installation will fail if these values are not correct. Also, the MySQL database needs to already exist. This installer script will take care of setting up its structure and content, but the database itself must already exist on your MySQL server before the installer will work.

+ Installation for Dragon Knight is a simple two-step process: set up the database tables, then create the admin user. After that, you're done.

You have two options for database setup: complete or partial.
  • Complete Setup includes table structure and all default data (items, drops, monsters, levels, spells, towns) - after complete setup, the game is totally ready to run.
  • Partial Setup only creates the table structure, it does not populate the tables - use this if you are going to be creating and importing your own customized game data later.
- Click the appropriate button below for your preferred installation method.

+ Click the appropriate button below for your preferred installation method.

-
- OR -
+
- OR -
@@ -50,7 +50,7 @@ function first() */ function second() { - echo "Dragon Knight InstallationDragon Knight Installation: Page Two

"; + echo "Dragon Knight InstallationDragon Knight Installation: Page Two

"; $full = isset($_POST["complete"]); @@ -63,7 +63,7 @@ function second() ); SQL); - echo $query === true ? 'Babble Box table created.
' : 'Error creating Babble Box table.'; + echo $query === true ? 'Babble Box table created.
' : 'Error creating Babble Box table.'; $query = db()->exec(<<' : 'Error creating Control table.'; + echo $query === true ? 'Control table created.
' : 'Error creating Control table.'; $query = db()->exec("INSERT INTO control VALUES (1, 'Dragon Knight', 250, 1, '', '', 1, '', 'Mage', 'Warrior', 'Paladin', 'Easy', 1, 'Medium', 1.2, 'Hard', 1.5, 1, 1, 1, 1);"); - echo $query === true ? 'Control table populated.
' : 'Error populating Control table.'; + echo $query === true ? 'Control table populated.
' : 'Error populating Control table.'; $query = db()->exec(<<' : 'Error creating Drops table.'; + echo $query == true ? 'Drops table created.
' : 'Error creating Drops table.'; if ($full) { $query = db()->exec(<<' : 'Error populating Drops table.'; + echo $query === true ? 'Drops table populated.
' : 'Error populating Drops table.'; } $query = db()->exec(<<' : 'Error creating Forum table.'; + echo $query === true ? 'Forum table created.
' : 'Error creating Forum table.'; $query = db()->exec(<<' : 'Error creating Items table.'; + echo $query === true ? 'Items table created.
' : 'Error creating Items table.'; if ($full) { $query = db()->exec(<<' : 'Error populating Items table.'; + echo $query === true ? 'Items table populated.
' : 'Error populating Items table.'; } $query = db()->exec(<<' : 'Error creating Levels table.'; + echo $query === true ? 'Levels table created.
' : 'Error creating Levels table.'; if ($full) { $query = db()->exec(<<' : 'Error populating Levels table.'; + echo $query === true ? 'Levels table populated.
' : 'Error populating Levels table.'; } $query = db()->exec(<<' : 'Error creating Monsters table.'; + echo $query === true ? 'Monsters table created.
' : 'Error creating Monsters table.'; if ($full) { $query = db()->exec(<<' : 'Error populating Monsters table.'; + echo $query === true ? 'Monsters table populated.
' : 'Error populating Monsters table.'; } $query = db()->exec(<<' : 'Error creating News table.'; + echo $query === true ? 'News table created.
' : 'Error creating News table.'; $query = db()->exec("INSERT INTO news VALUES (1, '2004-01-01 12:00:00', 'This is the first news post. Please use the admin control panel to add another one and make this one go away.');"); - echo $query === true ? 'News table populated.
' : 'Error populating News table.'; + echo $query === true ? 'News table populated.
' : 'Error populating News table.'; $query = db()->exec(<<' : 'Error creating Spells table.'; + echo $query === true ? 'Spells table created.
' : 'Error creating Spells table.'; if ($full) { $query = db()->exec(<<' : 'Error populating Spells table.'; + echo $query === true ? 'Spells table populated.
' : 'Error populating Spells table.'; } $query = db()->exec(<<' : 'Error creating Towns table.'; + echo $query === true ? 'Towns table created.
' : 'Error creating Towns table.'; if ($full) { $query = db()->exec(<<' : 'Error populating Towns table.'; + echo $query === true ? 'Towns table populated.
' : 'Error populating Towns table.'; } $query = db()->exec(<<' : 'Error creating Users table.'; + echo $query === true ? 'Users table created.
' : 'Error creating Users table.'; $time = round((microtime(true) - START), 4); - echo "
Database setup complete in $time seconds.

Click here to continue with installation."; + echo "
Database setup complete in $time seconds.

Click here to continue with installation."; } /** @@ -686,15 +686,15 @@ function third() Dragon Knight Installation - Dragon Knight Installation: Page Three

- Now you must create an administrator account so you can use the control panel. Fill out the form below to create your account. You will be able to customize the class names through the control panel once your admin account is created.

+ Dragon Knight Installation: Page Three

+ Now you must create an administrator account so you can use the control panel. Fill out the form below to create your account. You will be able to customize the class names through the control panel once your admin account is created.

- + - + - +
Username:


Username:


Password:
Verify Password:


Verify Password:


Email Address:
Verify Email:


Verify Email:


Character Class:
@@ -761,11 +761,11 @@ function fourth() Dragon Knight Installation - Dragon Knight Installation: Page Four

- Your admin account was created successfully. Installation is complete.

- Be sure to delete install.php from your Dragon Knight directory for security purposes.

- You are now ready to play the game. Note that you must log in through the public section before being allowed into the control panel. Once logged in, an "Admin" link will appear in the Functions box of the left sidebar panel.

- Thank you for using Dragon Knight!

-----

+ Dragon Knight Installation: Page Four

+ Your admin account was created successfully. Installation is complete.

+ Be sure to delete install.php from your Dragon Knight directory for security purposes.

+ You are now ready to play the game. Note that you must log in through the public section before being allowed into the control panel. Once logged in, an "Admin" link will appear in the Functions box of the left sidebar panel.

+ Thank you for using Dragon Knight!

-----

Optional: Dragon Knight is a free product, and does not require registration of any sort. However, there is an optional "call home" function in the installer, which notifies the author of your game installation. The ONLY information transmitted with this function is the URL to your game. This is included mainly to satisfy the author's curiosity about @@ -791,8 +791,8 @@ function fifth() Dragon Knight Installation - Dragon Knight Installation: Page Five

- Thank you for submitting your URL!

+ Dragon Knight Installation: Page Five

+ Thank you for submitting your URL!

You are now ready to play the game. Note that you must log in through the public section before being allowed into the control panel. Once logged in, an "Admin" link will appear in the Functions box of the left sidebar panel. diff --git a/public/users.php b/public/users.php index 34439eb..07d9f28 100644 --- a/public/users.php +++ b/public/users.php @@ -25,22 +25,22 @@ function register() { // Register a new account. $errors = 0; $errorlist = ""; // Process username. - if ($username == "") { $errors++; $errorlist .= "Username field is required.
"; } - if (preg_match("/[^A-z0-9_\-]/", $username)==1) { $errors++; $errorlist .= "Username must be alphanumeric.
"; } // Thanks to "Carlos Pires" from php.net! + if ($username == "") { $errors++; $errorlist .= "Username field is required.
"; } + if (preg_match("/[^A-z0-9_\-]/", $username)==1) { $errors++; $errorlist .= "Username must be alphanumeric.
"; } // Thanks to "Carlos Pires" from php.net! $usernamequery = doquery("SELECT username FROM {{table}} WHERE username='$username' LIMIT 1","users"); - if (mysql_num_rows($usernamequery) > 0) { $errors++; $errorlist .= "Username already taken - unique username required.
"; } + if (mysql_num_rows($usernamequery) > 0) { $errors++; $errorlist .= "Username already taken - unique username required.
"; } // Process email address. - if ($email1 == "" || $email2 == "") { $errors++; $errorlist .= "Email fields are required.
"; } - if ($email1 != $email2) { $errors++; $errorlist .= "Emails don't match.
"; } - if (! is_email($email1)) { $errors++; $errorlist .= "Email isn't valid.
"; } + if ($email1 == "" || $email2 == "") { $errors++; $errorlist .= "Email fields are required.
"; } + if ($email1 != $email2) { $errors++; $errorlist .= "Emails don't match.
"; } + if (! is_email($email1)) { $errors++; $errorlist .= "Email isn't valid.
"; } $emailquery = doquery("SELECT email FROM {{table}} WHERE email='$email1' LIMIT 1","users"); - if (mysql_num_rows($emailquery) > 0) { $errors++; $errorlist .= "Email already taken - unique email address required.
"; } + if (mysql_num_rows($emailquery) > 0) { $errors++; $errorlist .= "Email already taken - unique email address required.
"; } // Process password. - if (trim($password1) == "") { $errors++; $errorlist .= "Password field is required.
"; } - if (preg_match("/[^A-z0-9_\-]/", $password1)==1) { $errors++; $errorlist .= "Password must be alphanumeric.
"; } // Thanks to "Carlos Pires" from php.net! - if ($password1 != $password2) { $errors++; $errorlist .= "Passwords don't match.
"; } + if (trim($password1) == "") { $errors++; $errorlist .= "Password field is required.
"; } + if (preg_match("/[^A-z0-9_\-]/", $password1)==1) { $errors++; $errorlist .= "Password must be alphanumeric.
"; } // Thanks to "Carlos Pires" from php.net! + if ($password1 != $password2) { $errors++; $errorlist .= "Passwords don't match.
"; } $password = md5($password1); if ($errors == 0) { @@ -58,17 +58,17 @@ function register() { // Register a new account. if ($controlrow["verifyemail"] == 1) { if (sendregmail($email1, $verifycode) == true) { - $page = "Your account was created successfully.

You should receive an Account Verification email shortly. You will need the verification code contained in that email before you are allowed to log in. Once you have received the email, please visit the Verification Page to enter your code and start playing."; + $page = "Your account was created successfully.

You should receive an Account Verification email shortly. You will need the verification code contained in that email before you are allowed to log in. Once you have received the email, please visit the Verification Page to enter your code and start playing."; } else { - $page = "Your account was created successfully.

However, there was a problem sending your verification email. Please check with the game administrator to help resolve this problem."; + $page = "Your account was created successfully.

However, there was a problem sending your verification email. Please check with the game administrator to help resolve this problem."; } } else { - $page = "Your account was created succesfully.

You may now continue to the Login Page and continue playing ".$controlrow["gamename"]."!"; + $page = "Your account was created succesfully.

You may now continue to the Login Page and continue playing ".$controlrow["gamename"]."!"; } } else { - $page = "The following error(s) occurred when your account was being made:
$errorlist
Please go back and try again."; + $page = "The following error(s) occurred when your account was being made:
$errorlist
Please go back and try again."; } @@ -76,7 +76,7 @@ function register() { // Register a new account. $page = gettemplate("register"); if ($controlrow["verifyemail"] == 1) { - $controlrow["verifytext"] = "
A verification code will be sent to the address above, and you will not be able to log in without first entering the code. Please be sure to enter your correct email address."; + $controlrow["verifytext"] = "
A verification code will be sent to the address above, and you will not be able to log in without first entering the code. Please be sure to enter your correct email address."; } else { $controlrow["verifytext"] = ""; } @@ -101,7 +101,7 @@ function verify() { if ($userrow["verify"] != $verify) { die("Incorrect verification code."); } // If we've made it this far, should be safe to update their account. $updatequery = doquery("UPDATE {{table}} SET verify='1' WHERE username='$username' LIMIT 1","users"); - display("Your account was verified successfully.

You may now continue to the Login Page and start playing the game.

Thanks for playing!","Verify Email",false,false,false); + display("Your account was verified successfully.

You may now continue to the Login Page and start playing the game.

Thanks for playing!","Verify Email",false,false,false); } $page = gettemplate("verify"); $topnav = "\"Log\"Register\"\"Help\""; @@ -122,9 +122,9 @@ function lostpassword() { $md5newpass = md5($newpass); $updatequery = doquery("UPDATE {{table}} SET password='$md5newpass' WHERE email='$email' LIMIT 1","users"); if (sendpassemail($email,$newpass) == true) { - display("Your new password was emailed to the address you provided.

Once you receive it, you may Log In and continue playing.

Thank you.","Lost Password",false,false,false); + display("Your new password was emailed to the address you provided.

Once you receive it, you may Log In and continue playing.

Thank you.","Lost Password",false,false,false); } else { - display("There was an error sending your new password.

Please check with the game administrator for more information.

We apologize for the inconvience.","Lost Password",false,false,false); + display("There was an error sending your new password.

Please check with the game administrator for more information.

We apologize for the inconvience.","Lost Password",false,false,false); } die(); } @@ -147,7 +147,7 @@ function changepassword() { $realnewpass = md5($newpass1); $updatequery = doquery("UPDATE {{table}} SET password='$realnewpass' WHERE username='$username' LIMIT 1","users"); if (isset($_COOKIE["dkgame"])) { setcookie("dkgame", "", time()-100000, "/", "", 0); } - display("Your password was changed successfully.

You have been logged out of the game to avoid cookie errors.

Please log back in to continue playing.","Change Password",false,false,false); + display("Your password was changed successfully.

You have been logged out of the game to avoid cookie errors.

Please log back in to continue playing.","Change Password",false,false,false); die(); } $page = gettemplate("changepassword"); diff --git a/src/fight.php b/src/fight.php index d18bd4b..b2a4ad2 100644 --- a/src/fight.php +++ b/src/fight.php @@ -3,7 +3,7 @@ function fight() { // One big long function that determines the outcome of the fight. global $userrow, $controlrow; - if ($userrow["currentaction"] != "Fighting") { display("Cheat attempt detected.

Get a life, loser.", "Error"); } + if ($userrow["currentaction"] != "Fighting") { display("Cheat attempt detected.

Get a life, loser.", "Error"); } $pagearray = array(); $playerisdead = 0; @@ -64,16 +64,16 @@ function fight() { // One big long function that determines the outcome of the f if ($chancetorun > (rand(1,5) + ceil(sqrt($monsterrow["maxdam"])))) { $chancetorun = 1; } else { $chancetorun = 0; } if ($chancetorun == 0) { - $pagearray["yourturn"] = "You tried to run away, but were blocked in front!

"; - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; + $pagearray["yourturn"] = "You tried to run away, but were blocked in front!

"; + $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; $pagearray["monsterturn"] = ""; if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. $chancetowake = rand(1,15); if ($chancetowake > $userrow["currentmonstersleep"]) { $userrow["currentmonstersleep"] = 0; - $pagearray["monsterturn"] .= "The monster has woken up.
"; + $pagearray["monsterturn"] .= "The monster has woken up.
"; } else { - $pagearray["monsterturn"] .= "The monster is still asleep.
"; + $pagearray["monsterturn"] .= "The monster is still asleep.
"; } } if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. @@ -81,7 +81,7 @@ function fight() { // One big long function that determines the outcome of the f $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); $tododge = rand(1,150); if ($tododge <= sqrt($userrow["dexterity"])) { - $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.
"; + $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.
"; $persondamage = 0; } else { $persondamage = $tohit - $toblock; @@ -91,7 +91,7 @@ function fight() { // One big long function that determines the outcome of the f } if ($persondamage < 1) { $persondamage = 1; } } - $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.

"; + $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.

"; $userrow["currenthp"] -= $persondamage; if ($userrow["currenthp"] <= 0) { $newgold = ceil($userrow["gold"]/2); @@ -113,11 +113,11 @@ function fight() { // One big long function that determines the outcome of the f $pagearray["yourturn"] = ""; $tohit = ceil(rand($userrow["attackpower"]*.75,$userrow["attackpower"])/3); $toexcellent = rand(1,150); - if ($toexcellent <= sqrt($userrow["strength"])) { $tohit *= 2; $pagearray["yourturn"] .= "Excellent hit!
"; } + if ($toexcellent <= sqrt($userrow["strength"])) { $tohit *= 2; $pagearray["yourturn"] .= "Excellent hit!
"; } $toblock = ceil(rand($monsterrow["armor"]*.75,$monsterrow["armor"])/3); $tododge = rand(1,200); if ($tododge <= sqrt($monsterrow["armor"])) { - $tohit = 0; $pagearray["yourturn"] .= "The monster is dodging. No damage has been scored.
"; + $tohit = 0; $pagearray["yourturn"] .= "The monster is dodging. No damage has been scored.
"; $monsterdamage = 0; } else { $monsterdamage = $tohit - $toblock; @@ -126,9 +126,9 @@ function fight() { // One big long function that determines the outcome of the f $monsterdamage += ceil($monsterdamage * ($userrow["currentuberdamage"]/100)); } } - $pagearray["yourturn"] .= "You attack the monster for $monsterdamage damage.

"; + $pagearray["yourturn"] .= "You attack the monster for $monsterdamage damage.

"; $userrow["currentmonsterhp"] -= $monsterdamage; - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; + $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; if ($userrow["currentmonsterhp"] <= 0) { $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); header("Location: index.php?do=victory"); @@ -141,9 +141,9 @@ function fight() { // One big long function that determines the outcome of the f $chancetowake = rand(1,15); if ($chancetowake > $userrow["currentmonstersleep"]) { $userrow["currentmonstersleep"] = 0; - $pagearray["monsterturn"] .= "The monster has woken up.
"; + $pagearray["monsterturn"] .= "The monster has woken up.
"; } else { - $pagearray["monsterturn"] .= "The monster is still asleep.
"; + $pagearray["monsterturn"] .= "The monster is still asleep.
"; } } if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. @@ -151,7 +151,7 @@ function fight() { // One big long function that determines the outcome of the f $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); $tododge = rand(1,150); if ($tododge <= sqrt($userrow["dexterity"])) { - $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.
"; + $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.
"; $persondamage = 0; } else { $persondamage = $tohit - $toblock; @@ -161,7 +161,7 @@ function fight() { // One big long function that determines the outcome of the f } if ($persondamage < 1) { $persondamage = 1; } } - $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.

"; + $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.

"; $userrow["currenthp"] -= $persondamage; if ($userrow["currenthp"] <= 0) { $newgold = ceil($userrow["gold"]/2); @@ -192,35 +192,35 @@ function fight() { // One big long function that determines the outcome of the f if ($userrow["maxhp"] < $newhp) { $newspellrow["attribute"] = $userrow["maxhp"] - $userrow["currenthp"]; $newhp = $userrow["currenthp"] + $newspellrow["attribute"]; } $userrow["currenthp"] = $newhp; $userrow["currentmp"] -= $newspellrow["mp"]; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and gained ".$newspellrow["attribute"]." Hit Points.

"; + $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and gained ".$newspellrow["attribute"]." Hit Points.

"; } elseif ($newspellrow["type"] == 2) { // Hurt spell. if ($userrow["currentmonsterimmune"] == 0) { $monsterdamage = rand((($newspellrow["attribute"]/6)*5), $newspellrow["attribute"]); $userrow["currentmonsterhp"] -= $monsterdamage; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell for $monsterdamage damage.

"; + $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell for $monsterdamage damage.

"; } else { - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, but the monster is immune to it.

"; + $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, but the monster is immune to it.

"; } $userrow["currentmp"] -= $newspellrow["mp"]; } elseif ($newspellrow["type"] == 3) { // Sleep spell. if ($userrow["currentmonsterimmune"] != 2) { $userrow["currentmonstersleep"] = $newspellrow["attribute"]; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell. The monster is asleep.

"; + $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell. The monster is asleep.

"; } else { - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, but the monster is immune to it.

"; + $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, but the monster is immune to it.

"; } $userrow["currentmp"] -= $newspellrow["mp"]; } elseif ($newspellrow["type"] == 4) { // +Damage spell. $userrow["currentuberdamage"] = $newspellrow["attribute"]; $userrow["currentmp"] -= $newspellrow["mp"]; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and will gain ".$newspellrow["attribute"]."% damage until the end of this fight.

"; + $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and will gain ".$newspellrow["attribute"]."% damage until the end of this fight.

"; } elseif ($newspellrow["type"] == 5) { // +Defense spell. $userrow["currentuberdefense"] = $newspellrow["attribute"]; $userrow["currentmp"] -= $newspellrow["mp"]; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and will gain ".$newspellrow["attribute"]."% defense until the end of this fight.

"; + $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and will gain ".$newspellrow["attribute"]."% defense until the end of this fight.

"; } - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; + $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; if ($userrow["currentmonsterhp"] <= 0) { $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0',currenthp='".$userrow["currenthp"]."',currentmp='".$userrow["currentmp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); header("Location: index.php?do=victory"); @@ -233,9 +233,9 @@ function fight() { // One big long function that determines the outcome of the f $chancetowake = rand(1,15); if ($chancetowake > $userrow["currentmonstersleep"]) { $userrow["currentmonstersleep"] = 0; - $pagearray["monsterturn"] .= "The monster has woken up.
"; + $pagearray["monsterturn"] .= "The monster has woken up.
"; } else { - $pagearray["monsterturn"] .= "The monster is still asleep.
"; + $pagearray["monsterturn"] .= "The monster is still asleep.
"; } } if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. @@ -243,7 +243,7 @@ function fight() { // One big long function that determines the outcome of the f $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); $tododge = rand(1,150); if ($tododge <= sqrt($userrow["dexterity"])) { - $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.
"; + $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.
"; $persondamage = 0; } else { if ($tohit <= $toblock) { $tohit = $toblock + 1; } @@ -253,7 +253,7 @@ function fight() { // One big long function that determines the outcome of the f } if ($persondamage < 1) { $persondamage = 1; } } - $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.

"; + $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.

"; $userrow["currenthp"] -= $persondamage; if ($userrow["currenthp"] <= 0) { $newgold = ceil($userrow["gold"]/2); @@ -265,16 +265,16 @@ function fight() { // One big long function that determines the outcome of the f // Do a monster's turn if person lost the chance to swing first. Serves him right! } elseif ( $chancetoswingfirst == 0 ) { - $pagearray["yourturn"] = "The monster attacks before you are ready!

"; - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; + $pagearray["yourturn"] = "The monster attacks before you are ready!

"; + $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; $pagearray["monsterturn"] = ""; if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. $chancetowake = rand(1,15); if ($chancetowake > $userrow["currentmonstersleep"]) { $userrow["currentmonstersleep"] = 0; - $pagearray["monsterturn"] .= "The monster has woken up.
"; + $pagearray["monsterturn"] .= "The monster has woken up.
"; } else { - $pagearray["monsterturn"] .= "The monster is still asleep.
"; + $pagearray["monsterturn"] .= "The monster is still asleep.
"; } } if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. @@ -282,7 +282,7 @@ function fight() { // One big long function that determines the outcome of the f $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); $tododge = rand(1,150); if ($tododge <= sqrt($userrow["dexterity"])) { - $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.
"; + $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.
"; $persondamage = 0; } else { $persondamage = $tohit - $toblock; @@ -292,7 +292,7 @@ function fight() { // One big long function that determines the outcome of the f } if ($persondamage < 1) { $persondamage = 1; } } - $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.

"; + $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.

"; $userrow["currenthp"] -= $persondamage; if ($userrow["currenthp"] <= 0) { $newgold = ceil($userrow["gold"]/2); @@ -304,7 +304,7 @@ function fight() { // One big long function that determines the outcome of the f } else { $pagearray["yourturn"] = ""; - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; + $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "

"; $pagearray["monsterturn"] = ""; } @@ -321,16 +321,16 @@ function fight() { // One big long function that determines the outcome of the f if ($playerisdead != 1) { $pagearray["command"] = <<
+Command?

-

-

-

+

+

+

END; $updatequery = doquery("UPDATE {{table}} SET currentaction='Fighting',currenthp='$newhp',currentmp='$newmp',currentfight='$newfight',currentmonster='$newmonster',currentmonsterhp='$newmonsterhp',currentmonstersleep='$newmonstersleep',currentmonsterimmune='$newmonsterimmune',currentuberdamage='$newuberdamage',currentuberdefense='$newuberdefense' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); } else { - $pagearray["command"] = "You have died.

As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.

You may now continue back to town, and we hope you fair better next time."; + $pagearray["command"] = "You have died.

As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.

You may now continue back to town, and we hope you fair better next time."; } // Finalize page and display it. @@ -377,10 +377,10 @@ function victory() { if ($levelrow[$userrow["charclass"]."_spells"] != 0) { $userspells = $userrow["spells"] . ",".$levelrow[$userrow["charclass"]."_spells"]; $newspell = "spells='$userspells',"; - $spelltext = "You have learned a new spell.
"; + $spelltext = "You have learned a new spell.
"; } else { $spelltext = ""; $newspell=""; } - $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."; + $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 { @@ -393,7 +393,7 @@ function victory() { $newdefense = $userrow["defensepower"]; $newlevel = $userrow["level"]; $newspell = ""; - $page = "Congratulations. You have defeated the ".$monsterrow["name"].".
You gain $exp experience. $warnexp
You gain $gold gold. $warngold

"; + $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"); @@ -493,20 +493,20 @@ function drop() { "expbonus"=>"Experience Bonus", "goldbonus"=>"Gold Bonus"); - $page = "The monster dropped the following item: ".$droprow["name"]."

"; - $page .= "This item has the following attribute(s):
"; + $page = "The monster dropped the following item: ".$droprow["name"]."

"; + $page .= "This item has the following attribute(s):
"; $attribute1 = explode(",",$droprow["attribute1"]); $page .= $attributearray[$attribute1[0]]; - if ($attribute1[1] > 0) { $page .= " +" . $attribute1[1] . "
"; } else { $page .= $attribute1[1] . "
"; } + if ($attribute1[1] > 0) { $page .= " +" . $attribute1[1] . "
"; } else { $page .= $attribute1[1] . "
"; } if ($droprow["attribute2"] != "X") { $attribute2 = explode(",",$droprow["attribute2"]); $page .= $attributearray[$attribute2[0]]; - if ($attribute2[1] > 0) { $page .= " +" . $attribute2[1] . "
"; } else { $page .= $attribute2[1] . "
"; } + if ($attribute2[1] > 0) { $page .= " +" . $attribute2[1] . "
"; } else { $page .= $attribute2[1] . "
"; } } - $page .= "
Select an inventory slot from the list below to equip this item. If the inventory slot is already full, the old item will be discarded."; + $page .= "
Select an inventory slot from the list below to equip this item. If the inventory slot is already full, the old item will be discarded."; $page .= "
"; $page .= "You may also choose to just continue exploring and give up this item."; @@ -517,7 +517,7 @@ function drop() { function dead() { - $page = "You have died.

As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.

You may now continue back to town, and we hope you fair better next time."; + $page = "You have died.

As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.

You may now continue back to town, and we hope you fair better next time."; } diff --git a/src/lib.php b/src/lib.php index 4e13a93..2b40071 100644 --- a/src/lib.php +++ b/src/lib.php @@ -127,21 +127,21 @@ function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, if ($userrow["currentaction"] == "In Town") { $townquery = db()->query('SELECT * FROM towns WHERE latitude = ? AND longitude = ? LIMIT 1;', [$userrow["latitude"], $userrow["longitude"]]); $townrow = $townquery->fetchArray(SQLITE3_ASSOC); - $userrow["currenttown"] = "Welcome to ".$townrow["name"].".

"; + $userrow["currenttown"] = "Welcome to ".$townrow["name"].".

"; } else { $userrow["currenttown"] = ""; } if ($controlrow["forumtype"] == 0) { $userrow["forumslink"] = ""; } - elseif ($controlrow["forumtype"] == 1) { $userrow["forumslink"] = "Forum
"; } - elseif ($controlrow["forumtype"] == 2) { $userrow["forumslink"] = "Forum
"; } + elseif ($controlrow["forumtype"] == 1) { $userrow["forumslink"] = "Forum
"; } + elseif ($controlrow["forumtype"] == 2) { $userrow["forumslink"] = "Forum
"; } // Format various userrow stuffs... if ($userrow["latitude"] < 0) { $userrow["latitude"] = $userrow["latitude"] * -1 . "S"; } else { $userrow["latitude"] .= "N"; } if ($userrow["longitude"] < 0) { $userrow["longitude"] = $userrow["longitude"] * -1 . "W"; } else { $userrow["longitude"] .= "E"; } $userrow["experience"] = number_format($userrow["experience"]); $userrow["gold"] = number_format($userrow["gold"]); - if ($userrow["authlevel"] == 1) { $userrow["adminlink"] = "Admin
"; } else { $userrow["adminlink"] = ""; } + if ($userrow["authlevel"] == 1) { $userrow["adminlink"] = "Admin
"; } else { $userrow["adminlink"] = ""; } // HP/MP/TP bars. $stathp = ceil($userrow["currenthp"] / $userrow["maxhp"] * 100); @@ -179,7 +179,7 @@ function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, if ($b == $spellrow["id"] && $spellrow["type"] == 1) { $spell = true; } } if ($spell == true) { - $userrow["magiclist"] .= "".$spellrow["name"]."
"; + $userrow["magiclist"] .= "".$spellrow["name"]."
"; } } if ($userrow["magiclist"] == "") { $userrow["magiclist"] = "None"; } @@ -194,7 +194,7 @@ function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, if ($b == $townrow2["id"]) { $town = true; } } if ($town == true) { - $userrow["townslist"] .= "".$townrow2["name"]."
\n"; + $userrow["townslist"] .= "".$townrow2["name"]."
\n"; } } } else { @@ -303,3 +303,22 @@ function get_spell(int $id): array|false if ($query === false) return false; return $query->fetchArray(SQLITE3_ASSOC); } + +/** + * Translate a Specials keyword to it's string. + */ +function special_to_string(string $special): string +{ + return match ($special) { + 'maxhp' => 'Max HP', + 'maxmp' => 'Max MP', + 'maxtp' => 'Max TP', + 'goldbonus' => 'Gold Bonus (%)', + 'expbonus' => 'Experience Bonus (%)', + 'strength' => 'Strength', + 'dexterity' => 'Dexterity', + 'attackpower' => 'Attack Power', + 'defensepower' => 'Defense Power', + default => $special + }; +} diff --git a/src/towns.php b/src/towns.php index ae18f33..6bb10a3 100644 --- a/src/towns.php +++ b/src/towns.php @@ -10,10 +10,10 @@ function inn() global $userrow; $townrow = get_town_by_xy($userrow["longitude"], $userrow["latitude"]); - if ($townrow === false) { display("Cheat attempt detected.

Get a life, loser.", "Error"); } + if ($townrow === false) { display("Cheat attempt detected.

Get a life, loser.", "Error"); } if ($userrow["gold"] < $townrow["innprice"]) { - display("You do not have enough gold to stay at this Inn tonight.

You may return to town, or use the direction buttons on the left to start exploring.", "Inn"); + display("You do not have enough gold to stay at this Inn tonight.

You may return to town, or use the direction buttons on the left to start exploring.", "Inn"); } if (isset($_POST["submit"])) { @@ -23,14 +23,14 @@ function inn() [$newgold, $userrow['maxhp'], $userrow['maxmp'], $userrow['maxtp'], $userrow['id'] ]); $title = "Inn"; - $page = "You wake up feeling refreshed and ready for action.

You may return to town, or use the direction buttons on the left to start exploring."; + $page = "You wake up feeling refreshed and ready for action.

You may return to town, or use the direction buttons on the left to start exploring."; } elseif (isset($_POST["cancel"])) { redirect('index.php'); } else { $title = "Inn"; $page = <<
- A night's sleep at this Inn will cost you {$townrow["innprice"]} gold. Is that ok?

+ Resting at the inn will refill your current HP, MP, and TP to their maximum levels.

+ A night's sleep at this Inn will cost you {$townrow["innprice"]} gold. Is that ok?

@@ -48,10 +48,10 @@ function buy() global $userrow; $townrow = get_town_by_xy($userrow['longitude'], $userrow['latitude']); - if ($townrow === false) display("Cheat attempt detected.

Get a life, loser.", "Error"); + if ($townrow === false) display("Cheat attempt detected.

Get a life, loser.", "Error"); $items = db()->query("SELECT * FROM items WHERE id IN ({$townrow["itemslist"]});"); - $page = "Buying weapons will increase your Attack Power. Buying armor and shields will increase your Defense Power.

Click an item name to purchase it.

The following items are available at this town:

\n"; + $page = "Buying weapons will increase your Attack Power. Buying armor and shields will increase your Defense Power.

Click an item name to purchase it.

The following items are available at this town:

\n"; $page .= "\n"; while ($itemsrow = $items->fetchArray(SQLITE3_ASSOC)) { $attrib = ($itemsrow["type"] == 1) ? "Attack Power:" : "Defense Power:"; @@ -68,7 +68,7 @@ function buy() $page .= "\n"; } } - $page .= "
".$itemsrow["name"]."$specialdot$attrib ".$itemsrow["attribute"]."Price: ".$itemsrow["buycost"]." gold

\n"; + $page .= "
\n"; $page .= "If you've changed your mind, you may also return back to town.\n"; $title = "Buy Items"; @@ -83,14 +83,14 @@ function buy2($id) global $userrow; $townrow = get_town_by_xy($userrow['longitude'], $userrow['latitude']); - if ($townrow === false) display("Cheat attempt detected.

Get a life, loser.", "Error"); + if ($townrow === false) display("Cheat attempt detected.

Get a life, loser.", "Error"); $townitems = explode(",", $townrow["itemslist"]); - if (!in_array($id, $townitems)) display("Cheat attempt detected.

Get a life, loser.", "Error"); + if (!in_array($id, $townitems)) display("Cheat attempt detected.

Get a life, loser.", "Error"); $item = get_item($id); if ($userrow["gold"] < $item["buycost"]) { - display("You do not have enough gold to buy this item.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Items"); + display("You do not have enough gold to buy this item.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Items"); } $type_to_row_mapping = [1 => 'weaponid', 2 => 'armorid', 3 => 'shieldid']; @@ -98,9 +98,9 @@ function buy2($id) if ($current_equipped_id != 0) { $item2 = get_item($current_equipped_id); - $page = "If you are buying the ".$item["name"].", then I will buy your ".$item2["name"]." for ".ceil($item2["buycost"] / 2)." gold. Is that ok?

"; + $page = "If you are buying the ".$item["name"].", then I will buy your ".$item2["name"]." for ".ceil($item2["buycost"] / 2)." gold. Is that ok?

"; } else { - $page = "You are buying the ".$item["name"].", is that ok?

"; + $page = "You are buying the ".$item["name"].", is that ok?

"; } display($page, "Buy Items"); @@ -117,14 +117,14 @@ function buy3($id) global $userrow; $townrow = get_town_by_xy($userrow['longitude'], $userrow['latitude']); - if ($townrow === false) display("Cheat attempt detected.

Get a life, loser.", "Error"); + if ($townrow === false) display("Cheat attempt detected.

Get a life, loser.", "Error"); $townitems = explode(",", $townrow["itemslist"]); - if (!in_array($id, $townitems)) display("Cheat attempt detected.

Get a life, loser.", "Error"); + if (!in_array($id, $townitems)) display("Cheat attempt detected.

Get a life, loser.", "Error"); $item = get_item($id); if ($userrow["gold"] < $item["buycost"]) { - display("You do not have enough gold to buy this item.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Items"); + display("You do not have enough gold to buy this item.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Items"); } $type_mapping = [ @@ -212,7 +212,7 @@ function buy3($id) $stmt = db()->query("UPDATE users SET " . implode(", ", $updateFields) . " WHERE id = ?;", $updateValues); if ($stmt === false) exit("Failed to purchase and equip $id. Go back and try again."); - display("Thank you for purchasing this item.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Items"); + display("Thank you for purchasing this item.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Items"); } /** @@ -224,8 +224,8 @@ function maps() $mappedtowns = explode(",", $userrow["towns"]); - $page = "Buying maps will put the town in your Travel To box, and it won't cost you as many TP to get there.

\n"; - $page .= "Click a town name to purchase its map.

\n"; + $page = "Buying maps will put the town in your Travel To box, and it won't cost you as many TP to get there.

\n"; + $page .= "Click a town name to purchase its map.

\n"; $page .= "\n"; $towns = db()->query('SELECT * FROM towns ORDER BY id;'); @@ -243,7 +243,7 @@ function maps() } } - $page .= "

\n"; + $page .= "
\n"; $page .= "If you've changed your mind, you may also return back to town.\n"; display($page, "Buy Maps"); @@ -259,10 +259,10 @@ function maps2($id) $townrow = get_town_by_id($id); if ($userrow["gold"] < $townrow["mapprice"]) { - display("You do not have enough gold to buy this map.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Maps"); + display("You do not have enough gold to buy this map.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Maps"); } - $page = "You are buying the ".$townrow["name"]." map. Is that ok?

"; + $page = "You are buying the ".$townrow["name"]." map. Is that ok?

"; display($page, "Buy Maps"); } @@ -279,7 +279,7 @@ function maps3($id) $townrow = get_town_by_id($id); if ($userrow["gold"] < $townrow["mapprice"]) { - display("You do not have enough gold to buy this map.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Maps"); + display("You do not have enough gold to buy this map.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Maps"); } $mappedtowns = $userrow["towns"].",$id"; @@ -287,7 +287,7 @@ function maps3($id) db()->query('UPDATE users SET towns=?, gold=? WHERE id=?;', [$mappedtowns, $newgold, $userrow['id']]); - display("Thank you for purchasing this map.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Maps"); + display("Thank you for purchasing this map.

You may return to town, store, or use the direction buttons on the left to start exploring.", "Buy Maps"); } /** @@ -306,7 +306,7 @@ function travelto($id, bool $usepoints = true) display("You do not have enough TP to travel here. Please go back and try again when you get more TP.", "Travel To"); } $mapped = explode(",",$userrow["towns"]); - if (!in_array($id, $mapped)) { display("Cheat attempt detected.

Get a life, loser.", "Error"); } + if (!in_array($id, $mapped)) { display("Cheat attempt detected.

Get a life, loser.", "Error"); } } if (($userrow["latitude"] == $townrow["latitude"]) && ($userrow["longitude"] == $townrow["longitude"])) { diff --git a/templates/admin.php b/templates/admin.php index d10fbb2..00d9de0 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -51,28 +51,28 @@ a:hover {
-DK Administration

-Links:
-Admin Home
-Game Home

-Primary Data:
-Main Settings
-Add News Post
-Edit Users

-Game Data:
-Edit Items
-Edit Drops
-Edit Towns
-Edit Monsters
-Edit Levels
-Edit Spells
+DK Administration

+Links:
+Admin Home
+Game Home

+Primary Data:
+Main Settings
+Add News Post
+Edit Users

+Game Data:
+Edit Items
+Edit Drops
+Edit Towns
+Edit Monsters
+Edit Levels
+Edit Spells
{{content}}
-
+
THEVERYENDOFYOU; -?> \ No newline at end of file +?> diff --git a/templates/changepassword.php b/templates/changepassword.php index 0ef6baf..b23cba8 100644 --- a/templates/changepassword.php +++ b/templates/changepassword.php @@ -6,9 +6,9 @@ $template = << - + THEVERYENDOFYOU; -?> \ No newline at end of file +?> diff --git a/templates/fight.php b/templates/fight.php index ac049be..a574072 100644 --- a/templates/fight.php +++ b/templates/fight.php @@ -3,7 +3,7 @@ $template = << Fighting -You are fighting a {{monstername}}

+You are fighting a {{monstername}}

{{monsterhp}} {{yourturn}} {{monsterturn}} @@ -11,4 +11,4 @@ You are fighting a {{monstername}}

THEVERYENDOFYOU; -?> \ No newline at end of file +?> diff --git a/templates/leftnav.php b/templates/leftnav.php index 8bd3d6b..0650209 100644 --- a/templates/leftnav.php +++ b/templates/leftnav.php @@ -3,38 +3,38 @@ $template = << Location -Currently: {{currentaction}}
-Latitude: {{latitude}}
-Longitude: {{longitude}}
-View Map

+Currently: {{currentaction}}
+Latitude: {{latitude}}
+Longitude: {{longitude}}
+View Map

-
-
+
+
-
+
-
Towns
{{currenttown}} -Travel To:
+Travel To:
{{townslist}}

+
-
Functions
{{forumslink}} {{adminlink}} -Change Password
-Log Out
+Change Password
+Log Out
Help

+
THEVERYENDOFYOU; -?> \ No newline at end of file +?> diff --git a/templates/login.php b/templates/login.php index 66b3f49..fb5207a 100644 --- a/templates/login.php +++ b/templates/login.php @@ -6,8 +6,8 @@ $template = <<Password: Remember me? Yes -Checking the "Remember Me" option will store your login information in a cookie so you don't have to enter it next time you get online.

Want to play? You gotta register your own character.

You may also change your password, or request a new one if you've lost yours. +Checking the "Remember Me" option will store your login information in a cookie so you don't have to enter it next time you get online.

Want to play? You gotta register your own character.

You may also change your password, or request a new one if you've lost yours. THEVERYENDOFYOU; -?> \ No newline at end of file +?> diff --git a/templates/onlinechar.php b/templates/onlinechar.php index 023ff23..d8f341e 100644 --- a/templates/onlinechar.php +++ b/templates/onlinechar.php @@ -1,27 +1,27 @@ {{username}}.

- When you're finished, you may return to town.

+ Here is the character profile for {{username}}.

+ When you're finished, you may return to town.

-
Character
- {{username}}

+ {{username}}

- Class: {{charclass}}

+ Class: {{charclass}}

- Level: {{level}}
- Experience: {{experience}}
- Gold: {{gold}}
- Hit Points: {{currenthp}} / {{maxhp}}
- Magic Points: {{currentmp}} / {{maxmp}}
- Travel Points: {{currenttp}} / {{maxtp}}

+ Level: {{level}}
+ Experience: {{experience}}
+ Gold: {{gold}}
+ Hit Points: {{currenthp}} / {{maxhp}}
+ Magic Points: {{currentmp}} / {{maxmp}}
+ Travel Points: {{currenttp}} / {{maxtp}}

- Strength: {{strength}}
- Dexterity: {{dexterity}}
- Attack Power: {{attackpower}}
- Defense Power: {{defensepower}}
+ Strength: {{strength}}
+ Dexterity: {{dexterity}}
+ Attack Power: {{attackpower}}
+ Defense Power: {{defensepower}}

+
@@ -31,9 +31,9 @@ $template = <<
Inventory
ArmorArmor: {{armorname}}
ShieldShield: {{shieldname}}
- Slot 1: {{slot1name}}
- Slot 2: {{slot2name}}
+ Slot 1: {{slot1name}}
+ Slot 2: {{slot2name}}
Slot 3: {{slot3name}} -
+
HTML; diff --git a/templates/primary.php b/templates/primary.php index 025c14c..00e7ffa 100644 --- a/templates/primary.php +++ b/templates/primary.php @@ -80,11 +80,11 @@ winpops=window.open(popurl,"","width=520,height=520,scrollbars") {{content}} {{rightnav}} -
+
THEVERYENDOFYOU; -?> \ No newline at end of file +?> diff --git a/templates/register.php b/templates/register.php index 039e4fc..bdf2b02 100644 --- a/templates/register.php +++ b/templates/register.php @@ -2,13 +2,13 @@ $template = << - + - + - + - +
Username:
Usernames must be 30 alphanumeric characters or less.


Username:
Usernames must be 30 alphanumeric characters or less.


Password:
Verify Password:
Passwords must be 10 alphanumeric characters or less.


Verify Password:
Passwords must be 10 alphanumeric characters or less.


Email Address:
Verify Email:{{verifytext}}


Verify Email:{{verifytext}}


Character Class:
See Help for more information about character classes.

See Help for more information about character classes.

diff --git a/templates/rightnav.php b/templates/rightnav.php index 17d8e24..d3c9ecc 100644 --- a/templates/rightnav.php +++ b/templates/rightnav.php @@ -3,17 +3,17 @@ $template = << Character -{{username}}
-Level: {{level}}
-Exp: {{experience}}
-Gold: {{gold}}
-HP: {{currenthp}}
-MP: {{currentmp}}
-TP: {{currenttp}}
-{{statbars}}
+{{username}}
+Level: {{level}}
+Exp: {{experience}}
+Gold: {{gold}}
+HP: {{currenthp}}
+MP: {{currentmp}}
+TP: {{currenttp}}
+{{statbars}}
Extended Stats -
+
@@ -23,17 +23,17 @@ TP: {{currenttp}}
Inventory
ArmorArmor: {{armorname}}
ShieldShield: {{shieldname}}
-Slot 1: {{slot1name}}
-Slot 2: {{slot2name}}
+Slot 1: {{slot1name}}
+Slot 2: {{slot2name}}
Slot 3: {{slot3name}} -
+
-
Fast Spells
{{magiclist}}

+
THEVERYENDOFYOU; ?> diff --git a/templates/showchar.php b/templates/showchar.php index d80ae89..882e2cc 100644 --- a/templates/showchar.php +++ b/templates/showchar.php @@ -3,24 +3,24 @@ $template = << Character -{{username}}

+{{username}}

-Class: {{charclass}}

+Class: {{charclass}}

-Level: {{level}}
-Experience: {{experience}} {{plusexp}}
-Next Level: {{nextlevel}}
-Gold: {{gold}} {{plusgold}}
-Hit Points: {{currenthp}} / {{maxhp}}
-Magic Points: {{currentmp}} / {{maxmp}}
-Travel Points: {{currenttp}} / {{maxtp}}

+Level: {{level}}
+Experience: {{experience}} {{plusexp}}
+Next Level: {{nextlevel}}
+Gold: {{gold}} {{plusgold}}
+Hit Points: {{currenthp}} / {{maxhp}}
+Magic Points: {{currentmp}} / {{maxmp}}
+Travel Points: {{currenttp}} / {{maxtp}}

-Strength: {{strength}}
-Dexterity: {{dexterity}}
-Attack Power: {{attackpower}}
-Defense Power: {{defensepower}}
+Strength: {{strength}}
+Dexterity: {{dexterity}}
+Attack Power: {{attackpower}}
+Defense Power: {{defensepower}}
-
+
@@ -30,17 +30,17 @@ Defense Power: {{defensepower}}
Inventory
ArmorArmor: {{armorname}}
ShieldShield: {{shieldname}}
-Slot 1: {{slot1name}}
-Slot 2: {{slot2name}}
+Slot 1: {{slot1name}}
+Slot 2: {{slot2name}}
Slot 3: {{slot3name}} -
+
-
Spells
{{magiclist}}

+
THEVERYENDOFYOU; ?> diff --git a/templates/towns.php b/templates/towns.php index 5d14934..0df9cdb 100644 --- a/templates/towns.php +++ b/templates/towns.php @@ -3,7 +3,7 @@ $template = << Welcome to {{name}} -Town Options:
+Town Options:
  • Rest at the Inn
  • Buy Weapons/Armor @@ -12,7 +12,7 @@ $template = <<
    {{news}} -
    +
    {{whosonline}} @@ -23,4 +23,4 @@ $template = <<
    THEVERYENDOFYOU; -?> \ No newline at end of file +?> diff --git a/templates/verify.php b/templates/verify.php index 3c5d3a7..ee3d3bb 100644 --- a/templates/verify.php +++ b/templates/verify.php @@ -6,9 +6,9 @@ $template = << Username: Email Address: -Verification Code:


    +Verification Code:


    THEVERYENDOFYOU; -?> \ No newline at end of file +?>