Compare commits
6 Commits
5ea0de2ae1
...
30588252d8
Author | SHA1 | Date | |
---|---|---|---|
30588252d8 | |||
9ce0bab606 | |||
48ae6b2a40 | |||
b5c271e77b | |||
d10d69fb1a | |||
5235239c1c |
|
@ -35,7 +35,7 @@ main > section {
|
|||
padding: 4px;
|
||||
}
|
||||
|
||||
main > section > section:not(:last-child) {
|
||||
main > section > section {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
|
|
568
public/help.php
568
public/help.php
|
@ -1,568 +0,0 @@
|
|||
<?php
|
||||
|
||||
require_once '../src/lib.php';
|
||||
|
||||
if (!file_exists('../.installed')) redirect('install.php');
|
||||
|
||||
$controlrow = get_control_row();
|
||||
|
||||
$page = $_GET['page'] ?? '';
|
||||
if (!in_array($page, ['main', 'items', 'levels', 'monsters', 'spells'])) $page = 'main';
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><?= $controlrow["gamename"] ?> Help</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-image: url('/img/background.jpg');
|
||||
color: black;
|
||||
font: 11px verdana;
|
||||
}
|
||||
table {
|
||||
border-style: none;
|
||||
padding: 0px;
|
||||
font: 11px verdana;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: white;
|
||||
}
|
||||
td {
|
||||
border-style: none;
|
||||
padding: 3px;
|
||||
vertical-align: top;
|
||||
}
|
||||
td.top {
|
||||
border-bottom: solid 2px black;
|
||||
}
|
||||
td.left {
|
||||
width: 150px;
|
||||
border-right: solid 2px black;
|
||||
}
|
||||
td.right {
|
||||
width: 150px;
|
||||
border-left: solid 2px black;
|
||||
}
|
||||
a {
|
||||
color: #663300;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
a:hover {
|
||||
color: #330000;
|
||||
}
|
||||
.small {
|
||||
font: 10px verdana;
|
||||
}
|
||||
.highlight {
|
||||
color: red;
|
||||
}
|
||||
.light {
|
||||
color: #999999;
|
||||
}
|
||||
.title {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
}
|
||||
.copyright {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font: 10px verdana;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a name="top"></a>
|
||||
<h1><?= $controlrow["gamename"] ?> Help</h1>
|
||||
[ <a href="/">Return to the game</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<?php
|
||||
// @MAIN
|
||||
if ($page === 'main'):
|
||||
?>
|
||||
<h3>Table of Contents</h3>
|
||||
<ul>
|
||||
<li /><a href="#intro">Introduction</a>
|
||||
<li /><a href="#classes">Character Classes</a>
|
||||
<li /><a href="#intown">Playing The Game: In Town</a>
|
||||
<li /><a href="#exploring">Playing The Game: Exploring & Fighting</a>
|
||||
<li /><a href="#status">Playing The Game: Status Panels</a>
|
||||
<li /><a href="#items">Spoilers: Items & Drops</a>
|
||||
<li /><a href="#monsters">Spoilers: Monsters</a>
|
||||
<li /><a href="#spells">Spoilers: Spells</a>
|
||||
<li /><a href="#levels">Spoilers: Levels</a>
|
||||
<li /><a href="#credits">Credits</a>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3><a name="intro"></a>Introduction</h3>
|
||||
Firstly, I'd like to say thank you for playing my game. The <i>Dragon Knight</i> 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, <i>Dragon
|
||||
Warrior</i>. 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 <i>Dragon Warrior</i> and other RPGs of old.<br><br>
|
||||
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.<br><br>
|
||||
If you are a site administrator, and would like to install a copy of DK on your own server, you may visit the
|
||||
<a href="http://dragon.se7enet.com/dev.php" target="_new">development site</a> for <i>Dragon Knight</i>. This page
|
||||
includes the downloadable game souce code, as well as some other resources that developers and administrators may
|
||||
find valuable.<br><br>
|
||||
Once again, thanks for playing!<br><br>
|
||||
<i>Jamin Seven</i><br>
|
||||
<i>Dragon Knight creator</i><br>
|
||||
<a href="http://www.se7enet.com" target="_new">My Homepage</a><br>
|
||||
<a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight Homepage</a><br ><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="classes"></a>Character Classes</h3>
|
||||
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.<br><br>
|
||||
<b><?= $controlrow["class1name"] ?></b>
|
||||
<ul>
|
||||
<li>Fast level-ups</li>
|
||||
<li>High hit points</li>
|
||||
<li>High magic points</li>
|
||||
<li>Low strength</li>
|
||||
<li>Low dexterity</li>
|
||||
<li>5 heal spells</li>
|
||||
<li>5 hurt spells</li>
|
||||
<li>3 sleep spells</li>
|
||||
<li>3 +defense spells</li>
|
||||
<li>0 +attack spells</li>
|
||||
</ul>
|
||||
<b><?= $controlrow["class2name"] ?></b>
|
||||
<ul>
|
||||
<li>Medium level-ups</li>
|
||||
<li>Medium hit points</li>
|
||||
<li>Low magic points</li>
|
||||
<li>High strength</li>
|
||||
<li>Low dexterity</li>
|
||||
<li>3 heal spells</li>
|
||||
<li>3 hurt spells</li>
|
||||
<li>2 sleep spells</li>
|
||||
<li>3 +defense spells</li>
|
||||
<li>3 +attack spells</li>
|
||||
</ul>
|
||||
<b><?= $controlrow["class3name"] ?></b>
|
||||
<ul>
|
||||
<li>Slow level-ups</li>
|
||||
<li>Medium hit points</li>
|
||||
<li>Medium magic points</li>
|
||||
<li>Low strength</li>
|
||||
<li>High dexterity</li>
|
||||
<li>4 heal spells</li>
|
||||
<li>4 hurt spells</li>
|
||||
<li>3 sleep spells</li>
|
||||
<li>2 +defense spells</li>
|
||||
<li>2 +attack spells</li>
|
||||
</ul>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="intown"></a>Playing The Game: In Town</h3>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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 (<span class="highlight">*</span>) 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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="exploring"></a>Playing The Game: Exploring & Fighting</h3>
|
||||
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 <?= $controlrow["gamesize"] ?> 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).<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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).<br><br>
|
||||
When the fight is over, you can continue exploring until you find another monster to beat into submission.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="status"></a>Playing The Game: Status Panels</h3>
|
||||
There are two status panels on the game screen: left and right.<br><br>
|
||||
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.<br><br>
|
||||
The right panel displays some character statistics, your inventory, and quick spells.<br><br>
|
||||
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.<br><br>
|
||||
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.
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="items"></a>Spoilers: Items & Drops</h3>
|
||||
<a href="help.php?page=items">Click here</a> for the Items & Drops spoiler page.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="monsters"></a>Spoilers: Monsters</h3>
|
||||
<a href="help.php?page=monsters">Click here</a> for the Monsters spoiler page.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="spells"></a>Spoilers: Spells</h3>
|
||||
<a href="help.php?page=spells">Click here</a> for the Spells spoiler page.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="levels"></a>Spoilers: Levels</h3>
|
||||
<a href="help.php?page=levels">Click here</a> for the Levels spoiler page.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="credits"></a>Credits</h3>
|
||||
<ul>
|
||||
<li><b>All program code and stock graphics for the game were created by Jamin Seven</b>.<br><br></li>
|
||||
<li>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.<br><br></li>
|
||||
<li>Super monkey love goes to Enix and the developers of <i>Dragon Warrior</i>. If it weren't for you guys, my game never would have been made.<br><br></li>
|
||||
<li>Mega props go to Dalez from GameFAQs for his DW3 experience chart, which was where I got my experience levels from.<br><br></li>
|
||||
<li>
|
||||
Mad crazy ninja love goes to the following people for help and support throughout the development process:<br><br>
|
||||
<b>Ideas:</b> (whether they got used or not)
|
||||
<ul>
|
||||
<li>kushet</li>
|
||||
<li>lghtning</li>
|
||||
<li>Ebolamonkey3000</li>
|
||||
<li>Crimson Scythe</li>
|
||||
<li>SilDeath</li>
|
||||
</ul>
|
||||
<b>Beta Testing:</b> (forums name if applicable, character name otherwise)
|
||||
<ul>
|
||||
<li>Ebolamonkey3000</li>
|
||||
<li>lisi</li>
|
||||
<li>Junglist</li>
|
||||
<li>Crimson Scythe</li>
|
||||
<li>Sk8erpunk69</li>
|
||||
<li>lghtning</li>
|
||||
<li>kushet</li>
|
||||
<li>SilDeath</li>
|
||||
<li>lowrider4life</li>
|
||||
<li>dubiin</li>
|
||||
<li>Sam Wise The Great</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
Apologies and lots of happy naked love to anyone I forgot. <br><br>
|
||||
And of course, thanks to <b>you</b> for playing my game! <br><br>
|
||||
<a href="/ninja">NINJA!</a> <br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr><br>
|
||||
|
||||
Please visit the following sites for more information:<br>
|
||||
<a href="http://www.se7enet.com" target="_new">Se7enet</a> (Jamin's homepage)<br>
|
||||
<a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a> (official DK homepage)<br>
|
||||
<a href="http://se7enet.com/forums" target="_new">Forums</a> (official DK forums)<br><br>
|
||||
All original coding and graphics for the <i>Dragon Knight</i> game engine are © 2003-2005 by Jamin Seven.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<?php
|
||||
endif;
|
||||
// @MAIN END
|
||||
?>
|
||||
|
||||
<?php
|
||||
// @ITEMS
|
||||
if ($page === 'items'):
|
||||
?>
|
||||
|
||||
<table width="60%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="5" bgcolor="#ffffff"><center><b>Items</b></center></td></tr>
|
||||
<tr><td><b>Type</b></td><td><b>Name</b></td><td><b>Cost</b></td><td><b>Attribute</b></td><td><b>Special</b></td></tr>
|
||||
<?php
|
||||
$items = db()->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 = '<span class="light">None</span>';
|
||||
}
|
||||
|
||||
echo "<tr><td width=\"5%\"><img src=\"/img/icon_$image.gif\" alt=\"$image\"></td><td width=\"30%\">".$item["name"]."</td><td width=\"20%\">".$item["buycost"]." Gold</td><td width=\"20%\">".$item["attribute"]." $power Power</td><td width=\"25%\">$bigspecial</td></tr>\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table width="60%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="4" bgcolor="#ffffff"><center><b>Drops</b></center></td></tr>
|
||||
<tr><td><b>Name</b></td><td><b>Monster Level</b></td><td><b>Attribute 1</b></td><td><b>Attribute 2</b></td></tr>
|
||||
<?php
|
||||
$drops = db()->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 = '<span class="light">None</span>';
|
||||
}
|
||||
|
||||
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 = '<span class="light">None</span>';
|
||||
}
|
||||
|
||||
echo "<tr><td width=\"25%\">".$drop["name"]."</td><td width=\"15%\">".$drop["mlevel"]."</td><td width=\"30%\">$bigspecial1</td><td width=\"30%\">$bigspecial2</td></tr>\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
// @ITEMS END
|
||||
?>
|
||||
|
||||
<?php
|
||||
// @SPELLS
|
||||
if ($page === 'spells'):
|
||||
?>
|
||||
|
||||
<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b>Spells</b></center></td></tr>
|
||||
<tr><td><b>Name</b></td><td><b>Cost</b></td><td><b>Type</b></td><td><b>Attribute</b></td></tr>
|
||||
<?php
|
||||
$spells = db()->query('SELECT * FROM spells ORDER BY id;');
|
||||
$spell_types = ['None', 'Heal', 'Hurt', 'Sleep', '+Damage (%)', '+Defense (%)'];
|
||||
while ($spell = $spells->fetchArray(SQLITE3_ASSOC)) {
|
||||
echo <<<HTML
|
||||
<tr><td width="25%">{$spell["name"]}</td>
|
||||
<td width="25%">{$spell["mp"]}</td>
|
||||
<td width="25%">{$spell_types[$spell['type']]}</td>
|
||||
<td width="25%">{$spell["attribute"]}</td></tr>
|
||||
HTML;
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<ul>
|
||||
<li><b>Heal</b> spells always give you the maximum amount possible, until your current HP is full.</li>
|
||||
<li><b>Hurt</b> spells deal X damage (not always the maximum) to the monster, regardless of the monster's armor.</li>
|
||||
<li><b>Sleep</b> spells put the monster to sleep. The monster has an X in 15 chance of remaining asleep each turn.</li>
|
||||
<li><b>+Damage</b> spells increase your total attack damage by X percent until the end of the fight.</li>
|
||||
<li><b>+Defense</b> spells reduce the total damage you take from the monster by X percent until the end of each fight.</li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
// @SPELLS END
|
||||
?>
|
||||
|
||||
<?php
|
||||
// @MONSTERS
|
||||
if ($page === 'monsters'):
|
||||
?>
|
||||
|
||||
<table width="75%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b>Monsters</b></center></td></tr>
|
||||
<tr><td><b>Name</b></td><td><b>Max HP</b></td><td><b>Max Damage</b></td><td><b>Armor</b></td><td><b>Level</b></td><td><b>Max Exp.</b></td><td><b>Max Gold</b></td><td><b>Immunity</b></td></tr>
|
||||
<?php
|
||||
$monsters = db()->query('SELECT * FROM monsters ORDER BY id;');
|
||||
$immunities = ['<span class="light">None</span>', 'Hurt', 'Hurt & Sleep'];
|
||||
|
||||
while ($m = $monsters->fetchArray(SQLITE3_ASSOC)) {
|
||||
$immune = $immunities[$m['immune']] ?? 'Unknown';
|
||||
echo "<tr><td width=\"30%\">".$m["name"]."</td><td width=\"10%\">".$m["maxhp"]."</td><td width=\"10%\">".$m["maxdam"]."</td><td width=\"10%\">".$m["armor"]."</td><td width=\"10%\">".$m["level"]."</td><td width=\"10%\">".$m["maxexp"]."</td><td width=\"10%\">".$m["maxgold"]."</td><td width=\"20%\">$immune</td></tr>\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
// @MONSTERS END
|
||||
?>
|
||||
|
||||
<?php
|
||||
// @LEVELS
|
||||
if ($page === 'levels'):
|
||||
|
||||
$rows = [];
|
||||
|
||||
$levels = db()->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;
|
||||
}
|
||||
?>
|
||||
|
||||
<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b><? echo $controlrow["class1name"]; ?> Levels</b></center></td></tr>
|
||||
<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr>
|
||||
<?php
|
||||
foreach ($rows as $level => $class_data) {
|
||||
$level_data = $class_data[1][$level];
|
||||
|
||||
$spell_name = '';
|
||||
if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name'];
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>' . $level . '</td>';
|
||||
echo '<td>' . ($level_data['exp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['hp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['mp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['tp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['strength'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['dexterity'] ?? '') . '</td>';
|
||||
echo '<td>' . (!empty($spell_name) ? $spell_name : '<span class="light">None</span>') . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b><? echo $controlrow["class2name"]; ?> Levels</b></center></td></tr>
|
||||
<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr>
|
||||
<?php
|
||||
foreach ($rows as $level => $class_data) {
|
||||
$level_data = $class_data[2][$level];
|
||||
|
||||
$spell_name = '';
|
||||
if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name'];
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>' . $level . '</td>';
|
||||
echo '<td>' . ($level_data['exp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['hp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['mp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['tp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['strength'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['dexterity'] ?? '') . '</td>';
|
||||
echo '<td>' . (!empty($spell_name) ? $spell_name : '<span class="light">None</span>') . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b><? echo $controlrow["class3name"]; ?> Levels</b></center></td></tr>
|
||||
<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr>
|
||||
<?php
|
||||
foreach ($rows as $level => $class_data) {
|
||||
$level_data = $class_data[3][$level];
|
||||
|
||||
$spell_name = '';
|
||||
if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name'];
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>' . $level . '</td>';
|
||||
echo '<td>' . ($level_data['exp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['hp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['mp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['tp'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['strength'] ?? '') . '</td>';
|
||||
echo '<td>' . ($level_data['dexterity'] ?? '') . '</td>';
|
||||
echo '<td>' . (!empty($spell_name) ? $spell_name : '<span class="light">None</span>') . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
Experience points listed are total values up until that point. All other values are just the new amount that you gain for each level.
|
||||
|
||||
<?php
|
||||
endif;
|
||||
// @LEVELS END
|
||||
?>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="copyright" width="100%"><tr>
|
||||
<td width="50%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="50%" align="center">© 2003-2006 by renderse7en</td>
|
||||
</tr></table>
|
||||
</body>
|
||||
</html>
|
|
@ -2,45 +2,7 @@
|
|||
|
||||
// index.php :: Primary program script, evil alien overlord, you decide.
|
||||
|
||||
require_once '../src/lib.php';
|
||||
require_once '../src/router.php';
|
||||
|
||||
if (!file_exists('../.installed')) redirect('install.php');
|
||||
|
||||
$controlrow = get_control_row();
|
||||
|
||||
// Login (or verify) if not logged in.
|
||||
if (($userrow = checkcookies()) === false) {
|
||||
if (isset($_GET['do']) && $_GET['do'] === 'verify') {
|
||||
header("Location: users.php?do=verify");
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Location: login.php?do=login");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Close game.
|
||||
if ((bool) $controlrow["gameopen"] === false) {
|
||||
display("The game is currently closed for maintanence. Please check back later.", "Game Closed");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Force verify if the user isn't verified yet.
|
||||
if ((bool) $controlrow["verifyemail"] && (bool) $userrow["verify"] === false) {
|
||||
header("Location: users.php?do=verify");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Block user if he/she has been banned.
|
||||
if ($userrow["authlevel"] === 2) {
|
||||
exit("Your account has been blocked.");
|
||||
}
|
||||
|
||||
require_once '../src/towns.php';
|
||||
require_once '../src/explore.php';
|
||||
require_once '../src/fight.php';
|
||||
require_once '../src/heal.php';
|
||||
require_once '../src/bootstrap.php';
|
||||
|
||||
$r = new Router;
|
||||
|
||||
|
@ -58,35 +20,22 @@ $r->get('/', function() {
|
|||
}
|
||||
|
||||
display($page, $title);
|
||||
});
|
||||
})->middleware('auth_only');
|
||||
|
||||
$r->get('/ninja', function() {
|
||||
exit('NINJA! 🥷');
|
||||
});
|
||||
|
||||
$r->get('/inn', 'inn');
|
||||
$r->post('/inn', 'inn');
|
||||
$r->get('/buy', 'buy');
|
||||
$r->get('/buy2/:id', 'buy2');
|
||||
$r->post('/buy3/:id', 'buy3');
|
||||
// $r->get('/sell', 'sell');
|
||||
$r->get('/maps', 'maps');
|
||||
$r->get('/maps2/:id', 'maps2');
|
||||
$r->post('/maps3/:id', 'maps3');
|
||||
$r->get('/gotown/:id', 'travelto');
|
||||
Towns\register_routes($r);
|
||||
Fights\register_routes($r);
|
||||
Users\register_routes($r);
|
||||
Help\register_routes($r);
|
||||
Forum\register_routes($r);
|
||||
Install\register_routes($r);
|
||||
Admin\register_routes($r);
|
||||
|
||||
$r->post('/move', 'move');
|
||||
|
||||
$r->get('/fight', 'fight');
|
||||
$r->post('/fight', 'fight');
|
||||
$r->get('/victory', 'victory');
|
||||
$r->get('/drop', 'drop');
|
||||
$r->post('/drop', 'drop');
|
||||
$r->get('/dead', 'dead');
|
||||
|
||||
$r->get('/verify', function() {
|
||||
redirect('users.php?do=verify');
|
||||
});
|
||||
$r->get('/spell/:id', 'healspells');
|
||||
$r->get('/showchar', 'showchar');
|
||||
$r->get('/onlinechar/:id', 'onlinechar');
|
||||
|
@ -97,7 +46,7 @@ $r->post('/babblebox', 'babblebox');
|
|||
// [code, handler, params, middleware]
|
||||
$l = $r->lookup($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);
|
||||
|
||||
if ($l['code'] !== 200) exit($l['code']);
|
||||
if ($l['code'] !== 200) exit("Error: {$l['code']}");
|
||||
if (!empty($l['middleware'])) foreach ($l['middleware'] as $middleware) $middleware();
|
||||
$l['handler'](...$l['params'] ?? []);
|
||||
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
<?php
|
||||
|
||||
// login.php :: Handles logins and cookies.
|
||||
|
||||
require_once '../src/lib.php';
|
||||
|
||||
if (!file_exists('../.installed')) redirect('install.php');
|
||||
|
||||
match ($_GET['do'] ?? 'login') {
|
||||
'login' => login(),
|
||||
'logout' => logout()
|
||||
};
|
||||
|
||||
function login()
|
||||
{
|
||||
if (checkcookies() !== false) redirect('/');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$form = validate($_POST, [
|
||||
'username' => ['length:3-18', 'alpha-spaces'],
|
||||
'password' => ['length:6-255'],
|
||||
'remember' => ['bool']
|
||||
]);
|
||||
|
||||
if (!$form['valid']) {
|
||||
exit(ul_from_validate_errors($form['errors']));
|
||||
}
|
||||
|
||||
$form = $form['data'];
|
||||
|
||||
$query = db()->query('SELECT id, username, password FROM users WHERE username = ? COLLATE NOCASE LIMIT 1;', [$form['username']]);
|
||||
$row = $query ? $query->fetchArray(SQLITE3_ASSOC) : false;
|
||||
|
||||
if ($row === false || !password_verify($_POST['password'] ?? '', $row['password']))
|
||||
die("Invalid username or password. Please go back and try again.");
|
||||
|
||||
$expiretime = $form['remember'] ? time() + 31536000 : 0;
|
||||
$rememberme = $form['remember'] ? 1 : 0;
|
||||
$cookie = implode(' ', [$row['id'], $row['username'], $row['password'], $rememberme]);
|
||||
|
||||
set_cookie("dkgame", $cookie, $expiretime);
|
||||
redirect('/');
|
||||
}
|
||||
|
||||
$page = gettemplate("login");
|
||||
$title = "Log In";
|
||||
display($page, $title, false, false, false, false);
|
||||
}
|
||||
|
||||
|
||||
function logout()
|
||||
{
|
||||
set_cookie("dkgame", "", -3600);
|
||||
redirect('login.php?do=login');
|
||||
}
|
|
@ -2,41 +2,44 @@
|
|||
|
||||
// admin.php :: primary administration script.
|
||||
|
||||
require_once '../src/lib.php';
|
||||
namespace Admin;
|
||||
|
||||
if (!file_exists('../.installed')) redirect('install.php');
|
||||
use Router;
|
||||
|
||||
$controlrow = get_control_row();
|
||||
|
||||
// Login (or verify) if not logged in.
|
||||
if (($userrow = checkcookies()) === false) {
|
||||
if (isset($_GET['do']) && $_GET['do'] === 'verify') redirect('users.php?do=verify');
|
||||
redirect('login.php?do=login');
|
||||
function register_routes(Router $r): Router
|
||||
{
|
||||
global $userrow;
|
||||
if (isset($userrow) && $userrow !== false && $userrow['authlevel'] === 1) {
|
||||
$r->get('/admin', 'Admin\donothing');
|
||||
$r->get('/admin/main', 'Admin\primary');
|
||||
$r->post('/admin/main', 'Admin\primary');
|
||||
$r->get('/admin/items', 'Admin\items');
|
||||
$r->get('/admin/items/:id', 'Admin\edititem');
|
||||
$r->post('/admin/items/:id', 'Admin\edititem');
|
||||
$r->get('/admin/drops', 'Admin\drops');
|
||||
$r->get('/admin/drops/:id', 'Admin\editdrop');
|
||||
$r->post('/admin/drops/:id', 'Admin\editdrop');
|
||||
$r->get('/admin/towns', 'Admin\towns');
|
||||
$r->get('/admin/towns/:id', 'Admin\edittown');
|
||||
$r->post('/admin/towns/:id', 'Admin\edittown');
|
||||
$r->get('/admin/monsters', 'Admin\monsters');
|
||||
$r->get('/admin/monsters/:id', 'Admin\editmonster');
|
||||
$r->post('/admin/monsters/:id', 'Admin\editmonster');
|
||||
$r->get('/admin/level', 'Admin\levels');
|
||||
$r->get('/admin/level/:id', 'Admin\editlevel');
|
||||
$r->post('/admin/level/:id', 'Admin\editlevel');
|
||||
$r->get('/admin/spells', 'Admin\spells');
|
||||
$r->get('/admin/spells/:id', 'Admin\editspell');
|
||||
$r->post('/admin/spells/:id', 'Admin\editspell');
|
||||
$r->get('/admin/users', 'Admin\users');
|
||||
$r->get('/admin/users/:id', 'Admin\edituser');
|
||||
$r->post('/admin/users/:id', 'Admin\edituser');
|
||||
$r->get('/admin/news', 'Admin\addnews');
|
||||
$r->post('/admin/news', 'Admin\addnews');
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
if ($userrow["authlevel"] !== 1) exit("You must have administrator privileges to use the control panel.");
|
||||
|
||||
$do = explode(':', $_GET['do'] ?? '');
|
||||
match ($do[0]) {
|
||||
'main' => primary(),
|
||||
'items' => items(),
|
||||
'edititem' => edititem($do[1]),
|
||||
'drops' => drops(),
|
||||
'editdrop' => editdrop($do[1]),
|
||||
'towns' => towns(),
|
||||
'edittown' => edittown($do[1]),
|
||||
'monsters' => monsters(),
|
||||
'editmonster' => editmonster($do[1]),
|
||||
'levels' => levels(),
|
||||
'editlevel' => editlevel(),
|
||||
'spells' => spells(),
|
||||
'editspell' => editspell($do[1]),
|
||||
'users' => users(),
|
||||
'edituser' => edituser($do[1]),
|
||||
'news' => addnews(),
|
||||
default => donothing()
|
||||
};
|
||||
|
||||
function donothing()
|
||||
{
|
||||
$page = <<<HTML
|
||||
|
@ -80,7 +83,7 @@ function primary()
|
|||
if (($form['gamesize'] % 5) != 0) exit('Map size must be divisible by five.');
|
||||
|
||||
db()->query('UPDATE control SET gamename=?, gamesize=?, class1name=?, class2name=?, class3name=?, gameopen=?, verifyemail=?, gameurl=?, adminemail=?, shownews=?, showonline=?, showbabble=? WHERE id=1;', [
|
||||
$form['gamename'], $form['gamesize'], $form['class1name'], $form['class1name'], $form['class1name'], $form['gameopen'], $form['verifyemail'], $form['gameurl'], $form['adminemail'], $form['shownews'], $form['showonline'], $form['showbabble']
|
||||
$form['gamename'], $form['gamesize'], $form['class1name'], $form['class2name'], $form['class3name'], $form['gameopen'], $form['verifyemail'], $form['gameurl'], $form['adminemail'], $form['shownews'], $form['showonline'], $form['showbabble']
|
||||
]);
|
||||
|
||||
admindisplay("Settings updated.", "Main Settings");
|
||||
|
@ -95,7 +98,7 @@ function primary()
|
|||
$page = <<<HTML
|
||||
<b><u>Main Settings</u></b><br>
|
||||
These options control several major settings for the overall game engine.<br><br>
|
||||
<form action="admin.php?do=main" method="post">
|
||||
<form action="/admin/main" method="post">
|
||||
<table width="90%">
|
||||
<tr><td width="20%"><span class="highlight">Game Open:</span></td><td><select name="gameopen"><option value="1" {{open1select}}>Open</option><option value="0" {{open0select}}>Closed</option></select><br><span class="small">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.</span></td></tr>
|
||||
<tr><td width="20%">Game Name:</td><td><input type="text" name="gamename" value="{{gamename}}" /><br><span class="small">Default is "Dragon Knight". Change this if you want to change to call your game something different.</span></td></tr>
|
||||
|
@ -136,7 +139,7 @@ function items()
|
|||
$hasItems = false;
|
||||
while ($row = $items->fetchArray(SQLITE3_BOTH)) {
|
||||
$hasItems = true;
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=edititem:".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"/admin/items/".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
}
|
||||
|
||||
if (!$hasItems) $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No items found.</td></tr>\n";
|
||||
|
@ -171,7 +174,7 @@ function edititem($id)
|
|||
|
||||
$page = <<<HTML
|
||||
<b><u>Edit Items</u></b><br><br>
|
||||
<form action="admin.php?do=edititem:$id" method="post">
|
||||
<form action="/admin/items/$id" method="post">
|
||||
<table width="90%">
|
||||
<tr><td width="20%">ID:</td><td>{{id}}</td></tr>
|
||||
<tr><td width="20%">Name:</td><td><input type="text" name="name" value="{{name}}" /></td></tr>
|
||||
|
@ -211,7 +214,7 @@ function drops()
|
|||
$has_drops = false;
|
||||
while ($row = $drops->fetchArray(SQLITE3_ASSOC)) {
|
||||
$has_drops = true;
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=editdrop:".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"/admin/drops/".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
}
|
||||
|
||||
if (!$has_drops) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No drops found.</td></tr>\n"; }
|
||||
|
@ -249,7 +252,7 @@ function editdrop($id)
|
|||
|
||||
$page = <<<HTML
|
||||
<b><u>Edit Drops</u></b><br><br>
|
||||
<form action="admin.php?do=editdrop:$id" method="post">
|
||||
<form action="/admin/drops/$id" method="post">
|
||||
<table width="90%">
|
||||
<tr><td width="20%">ID:</td><td>{{id}}</td></tr>
|
||||
<tr><td width="20%">Name:</td><td><input type="text" name="name" value="{{name}}" /></td></tr>
|
||||
|
@ -284,7 +287,7 @@ function towns()
|
|||
$has_towns = false;
|
||||
while ($row = $towns->fetchArray(SQLITE3_ASSOC)) {
|
||||
$has_towns = true;
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=edittown:".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"/admin/towns/".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
}
|
||||
|
||||
if (!$has_towns) $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No towns found.</td></tr>\n";
|
||||
|
@ -330,7 +333,7 @@ function edittown($id)
|
|||
|
||||
$page = <<<HTML
|
||||
<b><u>Edit Towns</u></b><br><br>
|
||||
<form action="admin.php?do=edittown:$id" method="post">
|
||||
<form action="/admin/towns/$id" method="post">
|
||||
<table width="90%">
|
||||
<tr><td width="20%">ID:</td><td>{{id}}</td></tr>
|
||||
<tr><td width="20%">Name:</td><td><input type="text" name="name" value="{{name}}" /></td></tr>
|
||||
|
@ -368,7 +371,7 @@ function monsters()
|
|||
$has_monsters = false;
|
||||
while ($row = $monsters->fetchArray(SQLITE3_ASSOC)) {
|
||||
$has_monsters = true;
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=editmonster:".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"/admin/monsters/".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
}
|
||||
|
||||
if (!$has_monsters) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No monsters found.</td></tr>\n"; }
|
||||
|
@ -411,7 +414,7 @@ function editmonster($id)
|
|||
|
||||
$page = <<<HTML
|
||||
<b><u>Edit Monsters</u></b><br><br>
|
||||
<form action="admin.php?do=editmonster:$id" method="post">
|
||||
<form action="/admin/monsters/$id" method="post">
|
||||
<table width="90%">
|
||||
<tr><td width="20%">ID:</td><td>{{id}}</td></tr>
|
||||
<tr><td width="20%">Name:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr>
|
||||
|
@ -443,7 +446,7 @@ function spells()
|
|||
|
||||
while ($row = $spells->fetchArray(SQLITE3_ASSOC)) {
|
||||
$has_spells = true;
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=editspell:".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"/admin/spells/".$row["id"]."\">".$row["name"]."</a></td></tr>\n";
|
||||
}
|
||||
|
||||
if (!$has_spells) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No spells found.</td></tr>\n"; }
|
||||
|
@ -478,7 +481,7 @@ function editspell($id)
|
|||
|
||||
$page = <<<HTML
|
||||
<b><u>Edit Spells</u></b><br><br>
|
||||
<form action="admin.php?do=editspell:$id" method="post">
|
||||
<form action="/admin/spells/$id" method="post">
|
||||
<table width="90%">
|
||||
<tr><td width="20%">ID:</td><td>{{id}}</td></tr>
|
||||
<tr><td width="20%">Name:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr>
|
||||
|
@ -511,7 +514,7 @@ function levels()
|
|||
$page = <<<HTML
|
||||
<b><u>Edit Levels</u></b><br>
|
||||
Select a level number from the dropdown box to edit it.<br><br>
|
||||
<form action="admin.php?do=editlevel" method="post">
|
||||
<form action="/admin/level" method="post">
|
||||
<select name="level">
|
||||
$options
|
||||
</select>
|
||||
|
@ -610,7 +613,7 @@ function editlevel()
|
|||
$page = <<<HTML
|
||||
<b><u>Edit Levels</u></b><br><br>
|
||||
Experience values for each level should be the cumulative total amount of experience up to this point. All other values should be only the new amount to add this level.<br><br>
|
||||
<form action="admin.php?do=editlevel" method="post">
|
||||
<form action="/admin/level" method="post">
|
||||
<input type="hidden" name="level" value="$id" />
|
||||
<table width="90%">
|
||||
<tr><td width="20%">ID:</td><td>{{id}}</td></tr>
|
||||
|
@ -661,7 +664,7 @@ function users()
|
|||
|
||||
while ($row = $users->fetchArray(SQLITE3_ASSOC)) {
|
||||
$has_users = true;
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=edituser:".$row["id"]."\">".$row["username"]."</a></td></tr>\n";
|
||||
$page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"/admin/users/".$row["id"]."\">".$row["username"]."</a></td></tr>\n";
|
||||
}
|
||||
|
||||
if (!$has_users) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No spells found.</td></tr>\n"; }
|
||||
|
@ -800,7 +803,7 @@ function edituser($id)
|
|||
|
||||
$page = <<<HTML
|
||||
<b><u>Edit Users</u></b><br><br>
|
||||
<form action="admin.php?do=edituser:$id" method="post">
|
||||
<form action="/admin/users/$id" method="post">
|
||||
<table width="90%">
|
||||
<tr><td width="20%">ID:</td><td>{{id}}</td></tr>
|
||||
<tr><td width="20%">Username:</td><td>{{username}}</td></tr>
|
||||
|
@ -904,7 +907,7 @@ function addnews()
|
|||
|
||||
$page = <<<HTML
|
||||
<b><u>Add A News Post</u></b><br><br>
|
||||
<form action="admin.php?do=news" method="post">
|
||||
<form action="/admin/news" method="post">
|
||||
Type your post below and then click Submit to add it.<br>
|
||||
<textarea name="content" rows="5" cols="50"></textarea><br>
|
||||
<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" />
|
|
@ -2,6 +2,21 @@
|
|||
|
||||
// fight.php :: Handles all fighting action.
|
||||
|
||||
namespace Fights;
|
||||
|
||||
use Router;
|
||||
|
||||
function register_routes(Router $r): Router
|
||||
{
|
||||
$r->get('/fight', 'Fights\fight');
|
||||
$r->post('/fight', 'Fights\fight');
|
||||
$r->get('/victory', 'Fights\victory');
|
||||
$r->get('/drop', 'Fights\drop');
|
||||
$r->post('/drop', 'Fights\drop');
|
||||
$r->get('/dead', 'Fights\dead');
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* One big long function that determines the outcome of the fight.
|
||||
*/
|
|
@ -2,59 +2,31 @@
|
|||
|
||||
// forum.php :: Internal forums script for the game.
|
||||
|
||||
require_once '../src/lib.php';
|
||||
namespace Forum;
|
||||
|
||||
if (!file_exists('../.installed')) redirect('install.php');
|
||||
use Router;
|
||||
|
||||
$controlrow = get_control_row();
|
||||
|
||||
// Login (or verify) if not logged in.
|
||||
if (($userrow = checkcookies()) === false) {
|
||||
if (isset($_GET['do']) && $_GET['do'] === 'verify') {
|
||||
header("Location: users.php?do=verify");
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Location: login.php?do=login");
|
||||
exit;
|
||||
function register_routes(Router $r): Router
|
||||
{
|
||||
$r->get('/forum/thread/:x/:x', 'Forum\showthread');
|
||||
$r->get('/forum/new', 'Forum\newthread');
|
||||
$r->post('/forum/new', 'Forum\newthread');
|
||||
$r->post('/forum/reply', 'Forum\reply');
|
||||
$r->get('/forum/list/:x', 'Forum\donothing');
|
||||
$r->get('/forum', 'Forum\donothing');
|
||||
return $r;
|
||||
}
|
||||
|
||||
// Close game.
|
||||
if ((bool) $controlrow["gameopen"] === false) {
|
||||
display("The game is currently closed for maintanence. Please check back later.", "Game Closed");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Force verify if the user isn't verified yet.
|
||||
if ((bool) $controlrow["verifyemail"] && (bool) $userrow["verify"] === false) {
|
||||
header("Location: users.php?do=verify");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Block user if he/she has been banned.
|
||||
if ($userrow["authlevel"] === 2) {
|
||||
exit("Your account has been blocked.");
|
||||
}
|
||||
|
||||
$do = explode(':', $_GET['do'] ?? '');
|
||||
match ($do[0]) {
|
||||
'thread' => showthread($do[1], $do[2]),
|
||||
'new' => newthread(),
|
||||
'reply' => reply(),
|
||||
'list' => donothing($do[1]),
|
||||
default => donothing()
|
||||
};
|
||||
|
||||
function donothing($start = 0)
|
||||
{
|
||||
$query = db()->query('SELECT * FROM forum WHERE parent=0 ORDER BY newpostdate DESC LIMIT 20 OFFSET ?;', [20 * $start]);
|
||||
$page = "<table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><th colspan=\"3\" style=\"background-color:#dddddd;\"><center><a href=\"forum.php?do=new\">New Thread</a></center></th></tr><tr><th width=\"50%\" style=\"background-color:#dddddd;\">Thread</th><th width=\"10%\" style=\"background-color:#dddddd;\">Replies</th><th style=\"background-color:#dddddd;\">Last Post</th></tr>\n";
|
||||
$page = "<table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><th colspan=\"3\" style=\"background-color:#dddddd;\"><center><a href=\"/forum/new\">New Thread</a></center></th></tr><tr><th width=\"50%\" style=\"background-color:#dddddd;\">Thread</th><th width=\"10%\" style=\"background-color:#dddddd;\">Replies</th><th style=\"background-color:#dddddd;\">Last Post</th></tr>\n";
|
||||
|
||||
$hasRows = false;
|
||||
|
||||
while ($row = $query->fetchArray(SQLITE3_ASSOC)) {
|
||||
$hasRows = true;
|
||||
$page .= "<tr><td style=\"background-color:#ffffff;\"><a href=\"forum.php?do=thread:".$row["id"].":0\">".$row["title"]."</a></td><td style=\"background-color:#ffffff;\">".$row["replies"]."</td><td style=\"background-color:#ffffff;\">".$row["newpostdate"]."</td></tr>\n";
|
||||
$page .= "<tr><td style=\"background-color:#ffffff;\"><a href=\"/forum/thread/".$row["id"]."/0\">".$row["title"]."</a></td><td style=\"background-color:#ffffff;\">".$row["replies"]."</td><td style=\"background-color:#ffffff;\">".$row["newpostdate"]."</td></tr>\n";
|
||||
}
|
||||
|
||||
if (!$hasRows) {
|
||||
|
@ -71,12 +43,12 @@ function showthread($id, $start)
|
|||
$posts = db()->query('SELECT * FROM forum WHERE id=? OR parent=? ORDER BY id LIMIT 15 OFFSET ?;', [$id, $id, $start * 15]);
|
||||
$title = db()->query('SELECT title FROM forum WHERE id=? LIMIT 1;', [$id])->fetchArray(SQLITE3_ASSOC);
|
||||
|
||||
$page = "<table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><td colspan=\"2\" style=\"background-color:#dddddd;\"><b><a href=\"forum.php\">Forum</a> :: ".$title['title']."</b></td></tr>\n";
|
||||
$page = "<table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><td colspan=\"2\" style=\"background-color:#dddddd;\"><b><a href=\"/forum\">Forum</a> :: ".$title['title']."</b></td></tr>\n";
|
||||
while ($row = $posts->fetchArray(SQLITE3_ASSOC)) {
|
||||
$page .= "<tr><td width=\"25%\" style=\"background-color:#ffffff; vertical-align:top;\"><span class=\"small\"><b>".$row["author"]."</b><br><br>".prettyforumdate($row["postdate"])."</td><td style=\"background-color:#ffffff; vertical-align:top;\">".nl2br($row["content"])."</td></tr>\n";
|
||||
}
|
||||
$page .= "</table></td></tr></table><br>";
|
||||
$page .= "<table width=\"100%\"><tr><td><b>Reply To This Thread:</b><br><form action=\"forum.php?do=reply\" method=\"post\"><input type=\"hidden\" name=\"parent\" value=\"$id\" /><input type=\"hidden\" name=\"title\" value=\"Re: ".$title["title"]."\" /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br><input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"reset\" name=\"reset\" value=\"Reset\" /></form></td></tr></table>";
|
||||
$page .= "<table width=\"100%\"><tr><td><b>Reply To This Thread:</b><br><form action=\"/forum/reply\" method=\"post\"><input type=\"hidden\" name=\"parent\" value=\"$id\" /><input type=\"hidden\" name=\"title\" value=\"Re: ".$title["title"]."\" /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br><input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"reset\" name=\"reset\" value=\"Reset\" /></form></td></tr></table>";
|
||||
|
||||
display($page, "Forum");
|
||||
}
|
||||
|
@ -86,7 +58,7 @@ function reply()
|
|||
global $userrow;
|
||||
|
||||
$form = validate($_POST, [
|
||||
'title' => ['length:2-30', 'alphanum-spaces'],
|
||||
'title' => [],
|
||||
'content' => []
|
||||
]);
|
||||
|
||||
|
@ -100,7 +72,7 @@ function reply()
|
|||
$userrow['username'], $form['title'], $form['content'], $form['parent']
|
||||
]);
|
||||
db()->query('UPDATE forum SET newpostdate=CURRENT_TIMESTAMP, replies=replies + 1 WHERE id=?;', [$form['parent']]);
|
||||
redirect("forum.php?do=thread:{$form['parent']}:0");
|
||||
redirect("/forum/thread/{$form['parent']}/0");
|
||||
}
|
||||
|
||||
function newthread()
|
||||
|
@ -109,7 +81,7 @@ function newthread()
|
|||
|
||||
if (isset($_POST["submit"])) {
|
||||
$form = validate($_POST, [
|
||||
'title' => ['length:2-30', 'alphanum-spaces'],
|
||||
'title' => ['length:2-30'],
|
||||
'content' => []
|
||||
]);
|
||||
|
||||
|
@ -121,9 +93,9 @@ function newthread()
|
|||
db()->query('INSERT INTO forum (author, title, content) VALUES (?, ?, ?);', [
|
||||
$userrow['username'], $form['title'], $form['content']
|
||||
]);
|
||||
redirect('forum.php');
|
||||
redirect('/forum');
|
||||
}
|
||||
|
||||
$page = "<table width=\"100%\"><tr><td><b>Make A New Post:</b><br><br/ ><form action=\"forum.php?do=new\" method=\"post\">Title:<br><input type=\"text\" name=\"title\" size=\"50\" maxlength=\"50\" /><br><br>Message:<br><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br><br><input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"reset\" name=\"reset\" value=\"Reset\" /></form></td></tr></table>";
|
||||
$page = "<table width=\"100%\"><tr><td><b>Make A New Post:</b><br><br/ ><form action=\"/forum/new\" method=\"post\">Title:<br><input type=\"text\" name=\"title\" size=\"50\" maxlength=\"50\" /><br><br>Message:<br><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br><br><input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"reset\" name=\"reset\" value=\"Reset\" /></form></td></tr></table>";
|
||||
display($page, "Forum");
|
||||
}
|
500
src/actions/help.php
Normal file
500
src/actions/help.php
Normal file
|
@ -0,0 +1,500 @@
|
|||
<?php
|
||||
|
||||
namespace Help;
|
||||
|
||||
use Router;
|
||||
|
||||
function register_routes(Router $r): Router
|
||||
{
|
||||
$r->get('/help', 'Help\main');
|
||||
$r->get('/help/items', 'Help\items');
|
||||
$r->get('/help/spells', 'Help\spells');
|
||||
$r->get('/help/monsters', 'Help\monsters');
|
||||
$r->get('/help/levels', 'Help\levels');
|
||||
return $r;
|
||||
}
|
||||
|
||||
function main()
|
||||
{
|
||||
global $controlrow;
|
||||
|
||||
$page = <<<HTML
|
||||
<h3>Table of Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#intro">Introduction</a></li>
|
||||
<li><a href="#classes">Character Classes</a></li>
|
||||
<li><a href="#intown">Playing The Game: In Town</a></li>
|
||||
<li><a href="#exploring">Playing The Game: Exploring & Fighting</a></li>
|
||||
<li><a href="#status">Playing The Game: Status Panels</a></li>
|
||||
<li><a href="#items">Spoilers: Items & Drops</a></li>
|
||||
<li><a href="#monsters">Spoilers: Monsters</a></li>
|
||||
<li><a href="#spells">Spoilers: Spells</a></li>
|
||||
<li><a href="#levels">Spoilers: Levels</a></li>
|
||||
<li><a href="#credits">Credits</a></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3><a name="intro"></a>Introduction</h3>
|
||||
Firstly, I'd like to say thank you for playing my game. The <i>Dragon Knight</i> 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, <i>Dragon
|
||||
Warrior</i>. 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 <i>Dragon Warrior</i> and other RPGs of old.<br><br>
|
||||
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.<br><br>
|
||||
If you are a site administrator, and would like to install a copy of DK on your own server, you may visit the
|
||||
<a href="http://dragon.se7enet.com/dev.php" target="_new">development site</a> for <i>Dragon Knight</i>. This page
|
||||
includes the downloadable game souce code, as well as some other resources that developers and administrators may
|
||||
find valuable.<br><br>
|
||||
Once again, thanks for playing!<br><br>
|
||||
<i>Jamin Seven</i><br>
|
||||
<i>Dragon Knight creator</i><br>
|
||||
<a href="http://www.se7enet.com" target="_new">My Homepage</a><br>
|
||||
<a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight Homepage</a><br ><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="classes"></a>Character Classes</h3>
|
||||
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.<br><br>
|
||||
<b>{{class1name}}</b>
|
||||
<ul>
|
||||
<li>Fast level-ups</li>
|
||||
<li>High hit points</li>
|
||||
<li>High magic points</li>
|
||||
<li>Low strength</li>
|
||||
<li>Low dexterity</li>
|
||||
<li>5 heal spells</li>
|
||||
<li>5 hurt spells</li>
|
||||
<li>3 sleep spells</li>
|
||||
<li>3 +defense spells</li>
|
||||
<li>0 +attack spells</li>
|
||||
</ul>
|
||||
<b>{{class2name}}</b>
|
||||
<ul>
|
||||
<li>Medium level-ups</li>
|
||||
<li>Medium hit points</li>
|
||||
<li>Low magic points</li>
|
||||
<li>High strength</li>
|
||||
<li>Low dexterity</li>
|
||||
<li>3 heal spells</li>
|
||||
<li>3 hurt spells</li>
|
||||
<li>2 sleep spells</li>
|
||||
<li>3 +defense spells</li>
|
||||
<li>3 +attack spells</li>
|
||||
</ul>
|
||||
<b>{{class3name}}</b>
|
||||
<ul>
|
||||
<li>Slow level-ups</li>
|
||||
<li>Medium hit points</li>
|
||||
<li>Medium magic points</li>
|
||||
<li>Low strength</li>
|
||||
<li>High dexterity</li>
|
||||
<li>4 heal spells</li>
|
||||
<li>4 hurt spells</li>
|
||||
<li>3 sleep spells</li>
|
||||
<li>2 +defense spells</li>
|
||||
<li>2 +attack spells</li>
|
||||
</ul>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="intown"></a>Playing The Game: In Town</h3>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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 (<span class="highlight">*</span>) 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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="exploring"></a>Playing The Game: Exploring & Fighting</h3>
|
||||
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 {{gamesize}} 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).<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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.<br><br>
|
||||
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).<br><br>
|
||||
When the fight is over, you can continue exploring until you find another monster to beat into submission.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="status"></a>Playing The Game: Status Panels</h3>
|
||||
There are two status panels on the game screen: left and right.<br><br>
|
||||
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.<br><br>
|
||||
The right panel displays some character statistics, your inventory, and quick spells.<br><br>
|
||||
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.<br><br>
|
||||
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.
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="items"></a>Spoilers: Items & Drops</h3>
|
||||
<a href="/help/items">Click here</a> for the Items & Drops spoiler page.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="monsters"></a>Spoilers: Monsters</h3>
|
||||
<a href="/help/monsters">Click here</a> for the Monsters spoiler page.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="spells"></a>Spoilers: Spells</h3>
|
||||
<a href="/help/spells">Click here</a> for the Spells spoiler page.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="levels"></a>Spoilers: Levels</h3>
|
||||
<a href="/help/levels">Click here</a> for the Levels spoiler page.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
<h3><a name="credits"></a>Credits</h3>
|
||||
<ul>
|
||||
<li><b>All program code and stock graphics for the game were created by Jamin Seven</b>.<br><br></li>
|
||||
<li>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.<br><br></li>
|
||||
<li>Super monkey love goes to Enix and the developers of <i>Dragon Warrior</i>. If it weren't for you guys, my game never would have been made.<br><br></li>
|
||||
<li>Mega props go to Dalez from GameFAQs for his DW3 experience chart, which was where I got my experience levels from.<br><br></li>
|
||||
<li>
|
||||
Mad crazy ninja love goes to the following people for help and support throughout the development process:<br><br>
|
||||
<b>Ideas:</b> (whether they got used or not)
|
||||
<ul>
|
||||
<li>kushet</li>
|
||||
<li>lghtning</li>
|
||||
<li>Ebolamonkey3000</li>
|
||||
<li>Crimson Scythe</li>
|
||||
<li>SilDeath</li>
|
||||
</ul>
|
||||
<b>Beta Testing:</b> (forums name if applicable, character name otherwise)
|
||||
<ul>
|
||||
<li>Ebolamonkey3000</li>
|
||||
<li>lisi</li>
|
||||
<li>Junglist</li>
|
||||
<li>Crimson Scythe</li>
|
||||
<li>Sk8erpunk69</li>
|
||||
<li>lghtning</li>
|
||||
<li>kushet</li>
|
||||
<li>SilDeath</li>
|
||||
<li>lowrider4life</li>
|
||||
<li>dubiin</li>
|
||||
<li>Sam Wise The Great</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
Apologies and lots of happy naked love to anyone I forgot. <br><br>
|
||||
And of course, thanks to <b>you</b> for playing my game! <br><br>
|
||||
<a href="/ninja">NINJA!</a> <br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
|
||||
<br><br><hr><br>
|
||||
|
||||
Please visit the following sites for more information:<br>
|
||||
<a href="http://www.se7enet.com" target="_new">Se7enet</a> (Jamin's homepage)<br>
|
||||
<a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a> (official DK homepage)<br>
|
||||
<a href="http://se7enet.com/forums" target="_new">Forums</a> (official DK forums)<br><br>
|
||||
All original coding and graphics for the <i>Dragon Knight</i> game engine are © 2003-2005 by Jamin Seven.<br><br>
|
||||
[ <a href="#top">Top</a> ]
|
||||
HTML;
|
||||
|
||||
display_help(parsetemplate($page, $controlrow));
|
||||
}
|
||||
|
||||
function items()
|
||||
{
|
||||
global $controlrow;
|
||||
|
||||
$page = <<<HTML
|
||||
<table width="60%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="5" bgcolor="#ffffff"><center><b>Items</b></center></td></tr>
|
||||
<tr><td><b>Type</b></td><td><b>Name</b></td><td><b>Cost</b></td><td><b>Attribute</b></td><td><b>Special</b></td></tr>
|
||||
HTML;
|
||||
|
||||
$items = db()->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 = '<span class="light">None</span>';
|
||||
}
|
||||
|
||||
$page .= "<tr><td width=\"5%\"><img src=\"/img/icon_$image.gif\" alt=\"$image\"></td><td width=\"30%\">".$item["name"]."</td><td width=\"20%\">".$item["buycost"]." Gold</td><td width=\"20%\">".$item["attribute"]." $power Power</td><td width=\"25%\">$bigspecial</td></tr>\n";
|
||||
}
|
||||
|
||||
$page .= <<<HTML
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table width="60%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="4" bgcolor="#ffffff"><center><b>Drops</b></center></td></tr>
|
||||
<tr><td><b>Name</b></td><td><b>Monster Level</b></td><td><b>Attribute 1</b></td><td><b>Attribute 2</b></td></tr>
|
||||
HTML;
|
||||
|
||||
$drops = db()->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 = '<span class="light">None</span>';
|
||||
}
|
||||
|
||||
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 = '<span class="light">None</span>';
|
||||
}
|
||||
|
||||
$page .= "<tr><td width=\"25%\">".$drop["name"]."</td><td width=\"15%\">".$drop["mlevel"]."</td><td width=\"30%\">$bigspecial1</td><td width=\"30%\">$bigspecial2</td></tr>\n";
|
||||
}
|
||||
$page .= '</table>';
|
||||
|
||||
display_help($page);
|
||||
}
|
||||
|
||||
|
||||
function spells()
|
||||
{
|
||||
global $controlrow;
|
||||
|
||||
$page = <<<HTML
|
||||
<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b>Spells</b></center></td></tr>
|
||||
<tr><td><b>Name</b></td><td><b>Cost</b></td><td><b>Type</b></td><td><b>Attribute</b></td></tr>
|
||||
HTML;
|
||||
|
||||
$spells = db()->query('SELECT * FROM spells ORDER BY id;');
|
||||
$spell_types = ['None', 'Heal', 'Hurt', 'Sleep', '+Damage (%)', '+Defense (%)'];
|
||||
while ($spell = $spells->fetchArray(SQLITE3_ASSOC)) {
|
||||
$page .= <<<HTML
|
||||
<tr><td width="25%">{$spell["name"]}</td>
|
||||
<td width="25%">{$spell["mp"]}</td>
|
||||
<td width="25%">{$spell_types[$spell['type']]}</td>
|
||||
<td width="25%">{$spell["attribute"]}</td></tr>
|
||||
HTML;
|
||||
}
|
||||
|
||||
$page .= <<<HTML
|
||||
</table>
|
||||
<ul>
|
||||
<li><b>Heal</b> spells always give you the maximum amount possible, until your current HP is full.</li>
|
||||
<li><b>Hurt</b> spells deal X damage (not always the maximum) to the monster, regardless of the monster's armor.</li>
|
||||
<li><b>Sleep</b> spells put the monster to sleep. The monster has an X in 15 chance of remaining asleep each turn.</li>
|
||||
<li><b>+Damage</b> spells increase your total attack damage by X percent until the end of the fight.</li>
|
||||
<li><b>+Defense</b> spells reduce the total damage you take from the monster by X percent until the end of each fight.</li>
|
||||
</ul>
|
||||
HTML;
|
||||
|
||||
display_help($page);
|
||||
}
|
||||
|
||||
function monsters()
|
||||
{
|
||||
$page = <<<HTML
|
||||
<table width="75%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b>Monsters</b></center></td></tr>
|
||||
<tr><td><b>Name</b></td><td><b>Max HP</b></td><td><b>Max Damage</b></td><td><b>Armor</b></td><td><b>Level</b></td><td><b>Max Exp.</b></td><td><b>Max Gold</b></td><td><b>Immunity</b></td></tr>
|
||||
HTML;
|
||||
|
||||
$monsters = db()->query('SELECT * FROM monsters ORDER BY id;');
|
||||
$immunities = ['<span class="light">None</span>', 'Hurt', 'Hurt & Sleep'];
|
||||
|
||||
while ($m = $monsters->fetchArray(SQLITE3_ASSOC)) {
|
||||
$immune = $immunities[$m['immune']] ?? 'Unknown';
|
||||
$page .= "<tr><td width=\"30%\">".$m["name"]."</td><td width=\"10%\">".$m["maxhp"]."</td><td width=\"10%\">".$m["maxdam"]."</td><td width=\"10%\">".$m["armor"]."</td><td width=\"10%\">".$m["level"]."</td><td width=\"10%\">".$m["maxexp"]."</td><td width=\"10%\">".$m["maxgold"]."</td><td width=\"20%\">$immune</td></tr>\n";
|
||||
}
|
||||
|
||||
display_help($page.'</table>');
|
||||
}
|
||||
|
||||
function levels()
|
||||
{
|
||||
global $controlrow;
|
||||
|
||||
$rows = [];
|
||||
|
||||
$levels = db()->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;
|
||||
}
|
||||
|
||||
$page = <<<HTML
|
||||
<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b>{{class1name}} Levels</b></center></td></tr>
|
||||
<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr>
|
||||
HTML;
|
||||
foreach ($rows as $level => $class_data) {
|
||||
$level_data = $class_data[1][$level];
|
||||
|
||||
$spell_name = '';
|
||||
if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name'];
|
||||
|
||||
$page .= '<tr>';
|
||||
$page .= '<td>' . $level . '</td>';
|
||||
$page .= '<td>' . ($level_data['exp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['hp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['mp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['tp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['strength'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['dexterity'] ?? '') . '</td>';
|
||||
$page .= '<td>' . (!empty($spell_name) ? $spell_name : '<span class="light">None</span>') . '</td>';
|
||||
$page .= '</tr>';
|
||||
}
|
||||
|
||||
$page .= <<<HTML
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b>{{class2name}} Levels</b></center></td></tr>
|
||||
<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr>
|
||||
HTML;
|
||||
|
||||
foreach ($rows as $level => $class_data) {
|
||||
$level_data = $class_data[2][$level];
|
||||
|
||||
$spell_name = '';
|
||||
if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name'];
|
||||
|
||||
$page .= '<tr>';
|
||||
$page .= '<td>' . $level . '</td>';
|
||||
$page .= '<td>' . ($level_data['exp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['hp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['mp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['tp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['strength'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['dexterity'] ?? '') . '</td>';
|
||||
$page .= '<td>' . (!empty($spell_name) ? $spell_name : '<span class="light">None</span>') . '</td>';
|
||||
$page .= '</tr>';
|
||||
}
|
||||
|
||||
$page .= <<<HTML
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0">
|
||||
<tr><td colspan="8" bgcolor="#ffffff"><center><b>{{class3name}} Levels</b></center></td></tr>
|
||||
<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr>
|
||||
HTML;
|
||||
|
||||
foreach ($rows as $level => $class_data) {
|
||||
$level_data = $class_data[3][$level];
|
||||
|
||||
$spell_name = '';
|
||||
if (!empty($level_data['spells'])) $spell_name = $spells[$level_data['spells']]['name'];
|
||||
|
||||
$page .= '<tr>';
|
||||
$page .= '<td>' . $level . '</td>';
|
||||
$page .= '<td>' . ($level_data['exp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['hp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['mp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['tp'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['strength'] ?? '') . '</td>';
|
||||
$page .= '<td>' . ($level_data['dexterity'] ?? '') . '</td>';
|
||||
$page .= '<td>' . (!empty($spell_name) ? $spell_name : '<span class="light">None</span>') . '</td>';
|
||||
$page .= '</tr>';
|
||||
}
|
||||
|
||||
$page .= <<<HTML
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
Experience points listed are total values up until that point. All other values are just the new amount that you gain for each level.
|
||||
HTML;
|
||||
|
||||
display_help(parsetemplate($page, $controlrow));
|
||||
}
|
||||
|
||||
function display_help(string $content)
|
||||
{
|
||||
global $controlrow;
|
||||
$template = parsetemplate(gettemplate('help'), $controlrow);
|
||||
echo parsetemplate($template, ['content' => $content]);
|
||||
}
|
|
@ -1,17 +1,20 @@
|
|||
<?php
|
||||
|
||||
require_once '../src/lib.php';
|
||||
namespace Install;
|
||||
|
||||
if (file_exists('../.installed')) redirect('/');
|
||||
use Router;
|
||||
|
||||
$page = $_GET['page'] ?? 1;
|
||||
match ((int) $page) {
|
||||
2 => second(),
|
||||
3 => third(),
|
||||
4 => fourth(),
|
||||
5 => fifth(),
|
||||
default => first(),
|
||||
};
|
||||
function register_routes(Router $r): Router
|
||||
{
|
||||
if (!file_exists('../.installed')) {
|
||||
$r->get('/install', 'Install\first');
|
||||
$r->get('/install/second', 'Install\second');
|
||||
$r->get('/install/third', 'Install\third');
|
||||
$r->post('/install/fourth', 'Install\fourth');
|
||||
$r->get('/install/fifth', 'Install\fifth');
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* First page - show warnings and gather info
|
||||
|
@ -27,7 +30,7 @@ function first()
|
|||
<body>
|
||||
<b>Dragon Knight Installation: Page One</b><br><br>
|
||||
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.<br><br>
|
||||
<a href="install.php?page=2"><button>Install</button></a>
|
||||
<a href="/install/second"><button>Install</button></a>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
|
@ -639,7 +642,7 @@ function second()
|
|||
echo $query === true ? 'Users table created.<br>' : 'Error creating Users table.';
|
||||
|
||||
$time = round((microtime(true) - START), 4);
|
||||
echo "<br>Database setup complete in $time seconds.<br><br><a href=\"install.php?page=3\">Click here to continue with installation.</a></body></html>";
|
||||
echo "<br>Database setup complete in $time seconds.<br><br><a href=\"/install/third\">Click here to continue with installation.</a></body></html>";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -655,7 +658,7 @@ function third()
|
|||
<body>
|
||||
<b>Dragon Knight Installation: Page Three</b><br><br>
|
||||
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.<br><br>
|
||||
<form action="install.php?page=4" method="post">
|
||||
<form action="/install/fourth" method="post">
|
||||
<table width="50%">
|
||||
<tr><td width="20%" style="vertical-align:top;">Username:</td><td><input type="text" name="username" /><br><br><br></td></tr>
|
||||
<tr><td style="vertical-align:top;">Password:</td><td><input type="password" name="password" /></td></tr>
|
||||
|
@ -711,7 +714,7 @@ function fourth()
|
|||
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
|
||||
how many copies of the game are being installed and used. If you choose to submit your URL to the author, please
|
||||
<a href="install.php?page=5">click here</a>.
|
||||
<a href="/install/fifth">click here</a>.
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
|
@ -2,6 +2,25 @@
|
|||
|
||||
// towns.php :: Handles all actions you can do in town.
|
||||
|
||||
namespace Towns;
|
||||
|
||||
use Router;
|
||||
|
||||
function register_routes(Router $r): Router
|
||||
{
|
||||
$r->get('/inn', 'Towns\inn');
|
||||
$r->post('/inn', 'Towns\inn');
|
||||
$r->get('/buy', 'Towns\buy');
|
||||
$r->get('/buy2/:id', 'Towns\buy2');
|
||||
$r->post('/buy3/:id', 'Towns\buy3');
|
||||
// $r->get('/sell', 'Towns\sell');
|
||||
$r->get('/maps', 'Towns\maps');
|
||||
$r->get('/maps2/:id', 'Towns\maps2');
|
||||
$r->post('/maps3/:id', 'Towns\maps3');
|
||||
$r->get('/gotown/:id', 'Towns\travelto');
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Staying at the inn resets all expendable stats to their max values.
|
||||
*/
|
|
@ -1,20 +1,72 @@
|
|||
<?php
|
||||
|
||||
// users.php :: Handles user account functions.
|
||||
namespace Users;
|
||||
|
||||
require_once '../src/lib.php';
|
||||
use Router;
|
||||
|
||||
if (!file_exists('../.installed')) redirect('install.php');
|
||||
function register_routes(Router $r): Router
|
||||
{
|
||||
$r->get('/login', 'Users\login');
|
||||
$r->post('/login', 'Users\login');
|
||||
$r->get('/logout', 'Users\logout');
|
||||
$r->get('/register', 'Users\register');
|
||||
$r->post('/register', 'Users\register');
|
||||
$r->get('/lostpassword', 'Users\lostpassword');
|
||||
$r->post('/lostpassword', 'Users\lostpassword');
|
||||
$r->get('/changepassword', 'Users\changepassword');
|
||||
$r->post('/changepassword', 'Users\changepassword');
|
||||
$r->get('/verify', 'Users\verify');
|
||||
$r->post('/verify', 'Users\verify');
|
||||
return $r;
|
||||
}
|
||||
|
||||
$controlrow = get_control_row();
|
||||
/**
|
||||
* Displays the login page, and processes login requests.
|
||||
*/
|
||||
function login()
|
||||
{
|
||||
if (checkcookies() !== false) redirect('/');
|
||||
|
||||
$do = $_GET['do'] ?? 'register';
|
||||
match ($do) {
|
||||
'verify' => verify(),
|
||||
'lostpassword' => lostpassword(),
|
||||
'changepassword' => changepassword(),
|
||||
default => register()
|
||||
};
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$form = validate($_POST, [
|
||||
'username' => ['length:3-18', 'alpha-spaces'],
|
||||
'password' => ['length:6-255'],
|
||||
'remember' => ['bool']
|
||||
]);
|
||||
|
||||
if (!$form['valid']) {
|
||||
exit(ul_from_validate_errors($form['errors']));
|
||||
}
|
||||
|
||||
$form = $form['data'];
|
||||
|
||||
$query = db()->query('SELECT id, username, password FROM users WHERE username = ? COLLATE NOCASE LIMIT 1;', [$form['username']]);
|
||||
$row = $query ? $query->fetchArray(SQLITE3_ASSOC) : false;
|
||||
|
||||
if ($row === false || !password_verify($_POST['password'] ?? '', $row['password']))
|
||||
die("Invalid username or password. Please go back and try again.");
|
||||
|
||||
$expiretime = $form['remember'] ? time() + 31536000 : 0;
|
||||
$rememberme = $form['remember'] ? 1 : 0;
|
||||
$cookie = implode(' ', [$row['id'], $row['username'], $row['password'], $rememberme]);
|
||||
|
||||
set_cookie("dkgame", $cookie, $expiretime);
|
||||
redirect('/');
|
||||
}
|
||||
|
||||
$page = gettemplate("login");
|
||||
$title = "Log In";
|
||||
display($page, $title, false, false, false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the current cookie and redirect to home.
|
||||
*/
|
||||
function logout()
|
||||
{
|
||||
set_cookie("dkgame", "", -3600);
|
||||
redirect('/login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new account.
|
||||
|
@ -51,7 +103,7 @@ function register()
|
|||
$page = "Your account was created successfully.<br><br>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.<br><br>You may now continue to the <a href=\"login.php?do=login\">Login Page</a> and continue playing ".$controlrow["gamename"]."!";
|
||||
$page = "Your account was created succesfully.<br><br>You may now continue to the <a href=\"/login\">Login Page</a> and continue playing ".$controlrow["gamename"]."!";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -79,10 +131,10 @@ function verify()
|
|||
|
||||
db()->query("UPDATE users SET verify='g2g' WHERE username=?;", [$u]);
|
||||
|
||||
display("Your account was verified successfully.<br><br>You may now continue to the <a href=\"login.php?do=login\">Login Page</a> and start playing the game.<br><br>Thanks for playing!","Verify Email",false,false,false);
|
||||
display("Your account was verified successfully.<br><br>You may now continue to the <a href=\"/login\">Login Page</a> and start playing the game.<br><br>Thanks for playing!","Verify Email",false,false,false);
|
||||
}
|
||||
|
||||
$topnav = "<a href=\"login.php?do=login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"help.php\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
$topnav = "<a href=\"/login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"/help\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
display(gettemplate("verify"), "Verify Email", false, false, false);
|
||||
}
|
||||
|
||||
|
@ -99,13 +151,13 @@ function lostpassword()
|
|||
db()->query('UPDATE users SET password=? WHERE email=?;', [$hashed, $e]);
|
||||
|
||||
if (sendpassemail($e, $newpass)) {
|
||||
display("Your new password was emailed to the address you provided.<br><br>Once you receive it, you may <a href=\"login.php?do=login\">Log In</a> and continue playing.<br><br>Thank you.","Lost Password",false,false,false);
|
||||
display("Your new password was emailed to the address you provided.<br><br>Once you receive it, you may <a href=\"/login\">Log In</a> and continue playing.<br><br>Thank you.","Lost Password",false,false,false);
|
||||
} else {
|
||||
display("There was an error sending your new password.<br><br>Please check with the game administrator for more information.<br><br>We apologize for the inconvience.","Lost Password",false,false,false);
|
||||
}
|
||||
}
|
||||
|
||||
$topnav = "<a href=\"login.php?do=login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"help.php\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
$topnav = "<a href=\"/login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"/help\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
display(gettemplate("lostpassword"), "Lost Password", false, false, false);
|
||||
|
||||
}
|
||||
|
@ -137,10 +189,10 @@ function changepassword()
|
|||
|
||||
set_cookie('dkgame', '', -3600);
|
||||
|
||||
display("Your password was changed successfully.<br><br>You have been logged out of the game to avoid errors.<br><br>Please <a href=\"login.php?do=login\">log back in</a> to continue playing.","Change Password",false,false,false);
|
||||
display("Your password was changed successfully.<br><br>You have been logged out of the game to avoid errors.<br><br>Please <a href=\"/login\">log back in</a> to continue playing.","Change Password",false,false,false);
|
||||
}
|
||||
|
||||
$topnav = "<a href=\"login.php?do=login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"help.php\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
$topnav = "<a href=\"/login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"/help\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
display(gettemplate("changepassword"), "Change Password", false, false, false);
|
||||
}
|
||||
|
51
src/bootstrap.php
Normal file
51
src/bootstrap.php
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
require_once 'lib.php';
|
||||
require_once 'router.php';
|
||||
require_once 'explore.php';
|
||||
require_once 'heal.php';
|
||||
require_once 'actions/users.php';
|
||||
require_once 'actions/help.php';
|
||||
require_once 'actions/towns.php';
|
||||
require_once 'actions/fight.php';
|
||||
require_once 'actions/forum.php';
|
||||
require_once 'actions/install.php';
|
||||
require_once 'actions/admin.php';
|
||||
|
||||
$uri = uri();
|
||||
|
||||
if (!file_exists('../.installed') && $uri[0] !== 'install') {
|
||||
redirect('/install');
|
||||
} elseif (file_exists(('../.installed')) && $uri[0] === 'install') {
|
||||
redirect('/');
|
||||
} elseif (file_exists(('../.installed')) && $uri[0] !== 'install') {
|
||||
$controlrow = get_control_row();
|
||||
|
||||
if (!$controlrow["gameopen"]) {
|
||||
display("The game is currently closed for maintanence. Please check back later.", "Game Closed");
|
||||
}
|
||||
|
||||
// Login (or verify) if not logged in.
|
||||
if (($userrow = checkcookies()) === false) {
|
||||
if (!in_array($uri[0], ['login', 'register', 'verify', 'lostpassword', 'help'])) {
|
||||
redirect('/login');
|
||||
}
|
||||
} else {
|
||||
// Block user if he/she has been banned.
|
||||
if ($userrow["authlevel"] === 2) {
|
||||
exit("Your account has been banned.");
|
||||
}
|
||||
|
||||
// Force verify if the user isn't verified yet.
|
||||
if ($controlrow["verifyemail"] && (bool) $userrow["verify"] === false) {
|
||||
redirect('/verify');
|
||||
header("Location: users.php?do=verify");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Ensure the user can't use the admin panel.
|
||||
if ($userrow['authlevel'] !== 1 && $uri[0] === 'admin') {
|
||||
redirect('/');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,6 +9,9 @@ class Database extends SQLite3
|
|||
public array $log = [];
|
||||
public float $query_time = 0;
|
||||
|
||||
/**
|
||||
* Make a big, chonky connection to our SQLite database.
|
||||
*/
|
||||
public function __construct(string $db_path)
|
||||
{
|
||||
parent::__construct($db_path);
|
||||
|
@ -18,6 +21,10 @@ class Database extends SQLite3
|
|||
parent::exec('PRAGMA temp_store = MEMORY');
|
||||
}
|
||||
|
||||
/**
|
||||
* Query the database. Uses prepared statements, and your choise of placeholder syntax. (:key or ?) Logs
|
||||
* the query in the class.
|
||||
*/
|
||||
public function query(string $query, array $params = []): SQLite3Result|false
|
||||
{
|
||||
$p = strpos($query, '?') !== false;
|
||||
|
@ -31,6 +38,9 @@ class Database extends SQLite3
|
|||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a result-less query on the database.
|
||||
*/
|
||||
public function exec(string $query): bool
|
||||
{
|
||||
$start = microtime(true);
|
||||
|
@ -39,6 +49,10 @@ class Database extends SQLite3
|
|||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a given value exists in a given column in a given table. Can optionally make it
|
||||
* case-sensitive!
|
||||
*/
|
||||
public function exists(string $table, string $column, mixed $value, bool $case_insensitive = true): bool
|
||||
{
|
||||
if ($case_insensitive) {
|
||||
|
@ -51,6 +65,9 @@ class Database extends SQLite3
|
|||
return $result->fetchArray(SQLITE3_NUM) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log the query, including the time it took. Increment the query counter.
|
||||
*/
|
||||
private function log(string $query, float $time_taken): void
|
||||
{
|
||||
$this->count++;
|
||||
|
@ -58,6 +75,9 @@ class Database extends SQLite3
|
|||
$this->log[] = [$query, $time_taken];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the correct SQLite3 type for the given value.
|
||||
*/
|
||||
private function getSQLiteType(mixed $value): int
|
||||
{
|
||||
return match (true) {
|
||||
|
|
|
@ -25,7 +25,7 @@ function move()
|
|||
$town = get_town_by_xy($longitude, $latitude);
|
||||
if ($town !== false) {
|
||||
require_once __DIR__ . '/towns.php';
|
||||
travelto($town['id'], false);
|
||||
Towns\travelto($town['id'], false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
45
src/lib.php
45
src/lib.php
|
@ -96,7 +96,7 @@ function admindisplay($content, $title)
|
|||
|
||||
function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, $badstart=false) { // Finalize page and output to browser.
|
||||
|
||||
global $numqueries, $userrow, $controlrow, $version, $build;
|
||||
global $userrow, $controlrow;
|
||||
if (!isset($controlrow)) {
|
||||
$query = db()->query('SELECT * FROM control WHERE id=1 LIMIT 1;');
|
||||
$controlrow = $query->fetchArray(SQLITE3_ASSOC);
|
||||
|
@ -106,12 +106,19 @@ function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true,
|
|||
if ($rightnav == true) { $rightnav = gettemplate("rightnav"); } else { $rightnav = ""; }
|
||||
if ($leftnav == true) { $leftnav = gettemplate("leftnav"); } else { $leftnav = ""; }
|
||||
if ($topnav == true) {
|
||||
$topnav = "<a href=\"login.php?do=logout\"><img src=\"/img/button_logout.gif\" alt=\"Log Out\" title=\"Log Out\" border=\"0\" /></a> <a href=\"help.php\"><img src=\"/img/button_help.gif\" alt=\"Help\" title=\"Help\" border=\"0\" /></a>";
|
||||
$topnav = <<<HTML
|
||||
<a href='/logout'><img src='/img/button_logout.gif' alt='Log Out' title='Log Out'></a>
|
||||
<a href='/help'><img src='/img/button_help.gif' alt='Help' title='Help'></a>
|
||||
HTML;
|
||||
} else {
|
||||
$topnav = "<a href=\"login.php?do=login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" title=\"Log In\" border=\"0\" /></a> <a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" title=\"Register\" border=\"0\" /></a> <a href=\"help.php\"><img src=\"/img/button_help.gif\" alt=\"Help\" title=\"Help\" border=\"0\" /></a>";
|
||||
$topnav = <<<HTML
|
||||
<a href='/login'><img src='/img/button_login.gif' alt='Log In' title='Log In'></a>
|
||||
<a href='users.php?do=register'><img src='/img/button_register.gif' alt='Register' title='Register'></a>
|
||||
<a href='/help'><img src='/img/button_help.gif' alt='Help' title='Help'></a>
|
||||
HTML;
|
||||
}
|
||||
|
||||
if (isset($userrow)) {
|
||||
if (isset($userrow) && $userrow !== false) {
|
||||
|
||||
// Get userrow again, in case something has been updated.
|
||||
$userquery = db()->query('SELECT * FROM users WHERE id = ? LIMIT 1;', [$userrow['id']]);
|
||||
|
@ -127,14 +134,14 @@ function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true,
|
|||
$userrow["currenttown"] = "";
|
||||
}
|
||||
|
||||
$userrow["forumslink"] = "<a href=\"forum.php\">Forum</a><br>";
|
||||
$userrow["forumslink"] = '<a href="/forum">Forum</a><br>';
|
||||
|
||||
// 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"] = "<a href=\"admin.php\">Admin</a><br>"; } else { $userrow["adminlink"] = ""; }
|
||||
if ($userrow["authlevel"] == 1) { $userrow["adminlink"] = "<a href=\"/admin\">Admin</a><br>"; } else { $userrow["adminlink"] = ""; }
|
||||
|
||||
// HP/MP/TP bars.
|
||||
$stathp = ceil($userrow["currenthp"] / $userrow["maxhp"] * 100);
|
||||
|
@ -226,7 +233,7 @@ function checkcookies()
|
|||
}
|
||||
$row = $query->fetchArray(SQLITE3_ASSOC);
|
||||
set_cookie('dkgame', implode(" ", $theuser), (int) $theuser[3] === 1 ? time() + 31536000 : 0);
|
||||
db()->exec('UPDATE users SET onlinetime = CURRENT_TIMESTAMP WHERE id = ?;', [$theuser[0]]);
|
||||
db()->query('UPDATE users SET onlinetime = CURRENT_TIMESTAMP WHERE id = ?;', [$theuser[0]]);
|
||||
}
|
||||
|
||||
return $row;
|
||||
|
@ -526,3 +533,27 @@ function ul_from_validate_errors(array $errors): string
|
|||
}
|
||||
return $string . '</ul>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URI, broken up into chunks.
|
||||
*/
|
||||
function uri(): array
|
||||
{
|
||||
return explode('/', trim($_SERVER['REQUEST_URI'], '/'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to login if not authenticated.
|
||||
*/
|
||||
function auth_only(): void
|
||||
{
|
||||
if (!checkcookies()) redirect('/login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to home if authenticated.
|
||||
*/
|
||||
function guest_only(): void
|
||||
{
|
||||
if (checkcookies()) redirect('/login');
|
||||
}
|
||||
|
|
|
@ -174,10 +174,5 @@ class Router
|
|||
if (!str_starts_with($route, '/')) {
|
||||
throw new InvalidArgumentException("Route must start with a '/'");
|
||||
}
|
||||
|
||||
// Optional: Check for consecutive dynamic segments or invalid characters
|
||||
if (preg_match('/(:x.*){2,}/', $route)) {
|
||||
throw new InvalidArgumentException("Invalid route pattern: consecutive dynamic segments");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$template = <<<THEVERYENDOFYOU
|
||||
$template = <<<HTML
|
||||
<head>
|
||||
<title>{{title}}</title>
|
||||
<style type="text/css">
|
||||
|
@ -53,19 +53,19 @@ a:hover {
|
|||
<td width="150" style="border-right: solid 1px black;">
|
||||
<b><u>DK Administration</u></b><br><br>
|
||||
<b>Links:</b><br>
|
||||
<a href="admin.php">Admin Home</a><br>
|
||||
<a href="/admina">Admin Home</a><br>
|
||||
<a href="/">Game Home</a><br><br>
|
||||
<b>Primary Data:</b><br>
|
||||
<a href="admin.php?do=main">Main Settings</a><br>
|
||||
<a href="admin.php?do=news">Add News Post</a><br>
|
||||
<a href="admin.php?do=users">Edit Users</a><br><br>
|
||||
<a href="/admin/main">Main Settings</a><br>
|
||||
<a href="/admin/news">Add News Post</a><br>
|
||||
<a href="/admin/users">Edit Users</a><br><br>
|
||||
<b>Game Data:</b><br>
|
||||
<a href="admin.php?do=items">Edit Items</a><br>
|
||||
<a href="admin.php?do=drops">Edit Drops</a><br>
|
||||
<a href="admin.php?do=towns">Edit Towns</a><br>
|
||||
<a href="admin.php?do=monsters">Edit Monsters</a><br>
|
||||
<a href="admin.php?do=levels">Edit Levels</a><br>
|
||||
<a href="admin.php?do=spells">Edit Spells</a><br>
|
||||
<a href="/admin/items">Edit Items</a><br>
|
||||
<a href="/admin/drops">Edit Drops</a><br>
|
||||
<a href="/admin/towns">Edit Towns</a><br>
|
||||
<a href="/admin/monsters">Edit Monsters</a><br>
|
||||
<a href="/admin/levels">Edit Levels</a><br>
|
||||
<a href="/admin/spells">Edit Spells</a><br>
|
||||
</td><td>
|
||||
{{content}}
|
||||
</td></tr></table>
|
||||
|
@ -74,5 +74,4 @@ a:hover {
|
|||
<td width="25%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="25%" align="center">© 2003-2006 by renderse7en</td><td width="25%" align="center">{{totaltime}} Seconds, {{numqueries}} Queries</td><td width="25%" align="center">Version {{version}} {{build}}</td>
|
||||
</center></body>
|
||||
</html>
|
||||
THEVERYENDOFYOU;
|
||||
?>
|
||||
HTML;
|
||||
|
|
85
templates/help.php
Normal file
85
templates/help.php
Normal file
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
$template = <<<HTML
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{gamename}} Help</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-image: url('/img/background.jpg');
|
||||
color: black;
|
||||
font: 11px verdana;
|
||||
}
|
||||
table {
|
||||
border-style: none;
|
||||
padding: 0px;
|
||||
font: 11px verdana;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: white;
|
||||
}
|
||||
td {
|
||||
border-style: none;
|
||||
padding: 3px;
|
||||
vertical-align: top;
|
||||
}
|
||||
td.top {
|
||||
border-bottom: solid 2px black;
|
||||
}
|
||||
td.left {
|
||||
width: 150px;
|
||||
border-right: solid 2px black;
|
||||
}
|
||||
td.right {
|
||||
width: 150px;
|
||||
border-left: solid 2px black;
|
||||
}
|
||||
a {
|
||||
color: #663300;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
a:hover {
|
||||
color: #330000;
|
||||
}
|
||||
.small {
|
||||
font: 10px verdana;
|
||||
}
|
||||
.highlight {
|
||||
color: red;
|
||||
}
|
||||
.light {
|
||||
color: #999999;
|
||||
}
|
||||
.title {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
}
|
||||
.copyright {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font: 10px verdana;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a name="top"></a>
|
||||
<h1>{{gamename}} Help</h1>
|
||||
[ <a href="/">Return to the game</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
{{content}}
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="copyright" width="100%"><tr>
|
||||
<td width="50%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="50%" align="center">© 2003-2006 by renderse7en</td>
|
||||
</tr></table>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
|
@ -28,8 +28,8 @@ $template = <<<HTML
|
|||
<a href="/">Home</a><br>
|
||||
{{forumslink}}
|
||||
{{adminlink}}
|
||||
<a href="users.php?do=changepassword">Change Password</a><br>
|
||||
<a href="login.php?do=logout">Log Out</a><br>
|
||||
<a href="help.php">Help</a>
|
||||
<a href="/changepassword">Change Password</a><br>
|
||||
<a href="/logout">Log Out</a><br>
|
||||
<a href="/help">Help</a>
|
||||
</section>
|
||||
HTML;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
$template = <<<HTML
|
||||
<form action="login.php?do=login" method="post">
|
||||
<form action="/login" method="post">
|
||||
<table width="75%">
|
||||
<tr>
|
||||
<td width="30%">Username:</td>
|
||||
|
|
|
@ -8,7 +8,7 @@ $template = <<<THEVERYENDOFYOU
|
|||
<tr><td>Email Address:</td><td><input type="text" name="email1" size="30" maxlength="100" /></td></tr>
|
||||
<tr><td>Verify Email:</td><td><input type="text" name="email2" size="30" maxlength="100" />{{verifytext}}<br><br><br></td></tr>
|
||||
<tr><td>Character Class:</td><td><select name="charclass"><option value="1">{{class1name}}</option><option value="2">{{class2name}}</option><option value="3">{{class3name}}</option></select></td></tr>
|
||||
<tr><td colspan="2">See <a href="help.php">Help</a> for more information about character classes.<br><br></td></tr>
|
||||
<tr><td colspan="2">See <a href="/help">Help</a> for more information about character classes.<br><br></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue
Block a user