Compare commits

..

No commits in common. "98204ee9f128dccf97232e788c78787938c2e1f3" and "7e9ce285e0ba9da18adeaae91a30ddd1c81a7b9f" have entirely different histories.

10 changed files with 1212 additions and 1232 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,10 +2,10 @@
// forum.php :: Internal forums script for the game. // forum.php :: Internal forums script for the game.
require_once '../src/lib.php';
if (!file_exists('../.installed')) redirect('install.php'); if (!file_exists('../.installed')) redirect('install.php');
require_once '../src/lib.php';
$controlrow = get_control_row(); $controlrow = get_control_row();
// Login (or verify) if not logged in. // Login (or verify) if not logged in.

View File

@ -1,9 +1,8 @@
<?php <?php
if (!file_exists('../.installed')) redirect('install.php');
require_once '../src/lib.php'; require_once '../src/lib.php';
if (!file_exists('../.installed')) redirect('install.php');
$controlrow = get_control_row(); $controlrow = get_control_row();
$page = $_GET['page'] ?? ''; $page = $_GET['page'] ?? '';

View File

@ -2,10 +2,10 @@
// index.php :: Primary program script, evil alien overlord, you decide. // index.php :: Primary program script, evil alien overlord, you decide.
require_once '../src/lib.php';
if (!file_exists('../.installed')) redirect('install.php'); if (!file_exists('../.installed')) redirect('install.php');
require_once '../src/lib.php';
$controlrow = get_control_row(); $controlrow = get_control_row();
// Login (or verify) if not logged in. // Login (or verify) if not logged in.

View File

@ -1,8 +1,11 @@
<?php <?php
require_once '../src/lib.php'; if (file_exists('../.installed')) {
header('Location: index.php');
exit;
}
if (file_exists('../.installed')) redirect('index.php'); require_once '../src/lib.php';
$page = $_GET['page'] ?? 1; $page = $_GET['page'] ?? 1;
match ((int) $page) { match ((int) $page) {
@ -26,8 +29,17 @@ function first()
<body> <body>
<b>Dragon Knight Installation: Page One</b><br><br> <b>Dragon Knight Installation: Page One</b><br><br>
<b>NOTE:</b> Please ensure you have filled in the correct values in config.php before continuing. Installation will fail if these values are not correct. Also, the MySQL database needs to already exist. This installer script will take care of setting up its structure and content, but the database itself must already exist on your MySQL server before the installer will work.<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> 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> You have two options for database setup: complete or partial.
<ul>
<li><b>Complete Setup</b> includes table structure and all default data (items, drops, monsters, levels, spells, towns) - after complete setup, the game is totally ready to run.</li>
<li><b>Partial Setup</b> only creates the table structure, it does not populate the tables - use this if you are going to be creating and importing your own customized game data later.</li>
</ul>
Click the appropriate button below for your preferred installation method.<br><br>
<form action="install.php?page=2" method="post">
<input type="submit" name="complete" value="Complete Setup" /><br> - OR - <br><input type="submit" name="partial" value="Partial Setup" />
</form>
</body> </body>
</html> </html>
HTML; HTML;
@ -40,6 +52,8 @@ function second()
{ {
echo "<html><head><title>Dragon Knight Installation</title></head><body><b>Dragon Knight Installation: Page Two</b><br><br>"; echo "<html><head><title>Dragon Knight Installation</title></head><body><b>Dragon Knight Installation: Page Two</b><br><br>";
$full = isset($_POST["complete"]);
$query = db()->exec(<<<SQL $query = db()->exec(<<<SQL
CREATE TABLE babble ( CREATE TABLE babble (
`id` INTEGER PRIMARY KEY AUTOINCREMENT, `id` INTEGER PRIMARY KEY AUTOINCREMENT,
@ -54,14 +68,20 @@ function second()
$query = db()->exec(<<<SQL $query = db()->exec(<<<SQL
CREATE TABLE control ( CREATE TABLE control (
`id` INTEGER PRIMARY KEY AUTOINCREMENT, `id` INTEGER PRIMARY KEY AUTOINCREMENT,
`gamename` TEXT NOT NULL DEFAULT 'Dragon Knight', `gamename` TEXT NOT NULL DEFAULT '',
`gamesize` INTEGER NOT NULL DEFAULT 250, `gamesize` INTEGER NOT NULL DEFAULT 0,
`gameopen` INTEGER NOT NULL DEFAULT 1, `gameopen` INTEGER NOT NULL DEFAULT 0,
`gameurl` TEXT NOT NULL DEFAULT '', `gameurl` TEXT NOT NULL DEFAULT '',
`adminemail` TEXT NOT NULL DEFAULT '', `adminemail` TEXT NOT NULL DEFAULT '',
`class1name` TEXT NOT NULL DEFAULT '', `class1name` TEXT NOT NULL DEFAULT '',
`class2name` TEXT NOT NULL DEFAULT '', `class2name` TEXT NOT NULL DEFAULT '',
`class3name` TEXT NOT NULL DEFAULT '', `class3name` TEXT NOT NULL DEFAULT '',
`diff1name` TEXT NOT NULL DEFAULT '',
`diff1mod` REAL NOT NULL DEFAULT 0,
`diff2name` TEXT NOT NULL DEFAULT '',
`diff2mod` REAL NOT NULL DEFAULT 0,
`diff3name` TEXT NOT NULL DEFAULT '',
`diff3mod` REAL NOT NULL DEFAULT 0,
`verifyemail` INTEGER NOT NULL DEFAULT 0, `verifyemail` INTEGER NOT NULL DEFAULT 0,
`shownews` INTEGER NOT NULL DEFAULT 0, `shownews` INTEGER NOT NULL DEFAULT 0,
`showbabble` INTEGER NOT NULL DEFAULT 0, `showbabble` INTEGER NOT NULL DEFAULT 0,
@ -71,7 +91,7 @@ function second()
echo $query === true ? 'Control table created.<br>' : 'Error creating Control table.'; echo $query === true ? 'Control table created.<br>' : 'Error creating Control table.';
$query = db()->exec("INSERT INTO control VALUES (1, 'Dragon Knight', 250, 1, '', '', 'Mage', 'Warrior', 'Paladin', 1, 1, 1, 1);"); $query = db()->exec("INSERT INTO control VALUES (1, 'Dragon Knight', 250, 1, '', '', 1, '', 'Mage', 'Warrior', 'Paladin', 'Easy', 1, 'Medium', 1.2, 'Hard', 1.5, 1, 1, 1, 1);");
echo $query === true ? 'Control table populated.<br>' : 'Error populating Control table.'; echo $query === true ? 'Control table populated.<br>' : 'Error populating Control table.';
@ -88,43 +108,45 @@ function second()
echo $query == true ? 'Drops table created.<br>' : 'Error creating Drops table.'; echo $query == true ? 'Drops table created.<br>' : 'Error creating Drops table.';
$query = db()->exec(<<<SQL if ($full) {
INSERT INTO drops VALUES $query = db()->exec(<<<SQL
(1, 'Life Pebble', 1, 1, 'maxhp,10', 'X'), INSERT INTO drops VALUES
(2, 'Life Stone', 10, 1, 'maxhp,25', 'X'), (1, 'Life Pebble', 1, 1, 'maxhp,10', 'X'),
(3, 'Life Rock', 25, 1, 'maxhp,50', 'X'), (2, 'Life Stone', 10, 1, 'maxhp,25', 'X'),
(4, 'Magic Pebble', 1, 1, 'maxmp,10', 'X'), (3, 'Life Rock', 25, 1, 'maxhp,50', 'X'),
(5, 'Magic Stone', 10, 1, 'maxmp,25', 'X'), (4, 'Magic Pebble', 1, 1, 'maxmp,10', 'X'),
(6, 'Magic Rock', 25, 1, 'maxmp,50', 'X'), (5, 'Magic Stone', 10, 1, 'maxmp,25', 'X'),
(7, 'Dragon''s Scale', 10, 1, 'defensepower,25', 'X'), (6, 'Magic Rock', 25, 1, 'maxmp,50', 'X'),
(8, 'Dragon''s Plate', 30, 1, 'defensepower,50', 'X'), (7, 'Dragon''s Scale', 10, 1, 'defensepower,25', 'X'),
(9, 'Dragon''s Claw', 10, 1, 'attackpower,25', 'X'), (8, 'Dragon''s Plate', 30, 1, 'defensepower,50', 'X'),
(10, 'Dragon''s Tooth', 30, 1, 'attackpower,50', 'X'), (9, 'Dragon''s Claw', 10, 1, 'attackpower,25', 'X'),
(11, 'Dragon''s Tear', 35, 1, 'strength,50', 'X'), (10, 'Dragon''s Tooth', 30, 1, 'attackpower,50', 'X'),
(12, 'Dragon''s Wing', 35, 1, 'dexterity,50', 'X'), (11, 'Dragon''s Tear', 35, 1, 'strength,50', 'X'),
(13, 'Demon''s Sin', 35, 1, 'maxhp,-50', 'strength,50'), (12, 'Dragon''s Wing', 35, 1, 'dexterity,50', 'X'),
(14, 'Demon''s Fall', 35, 1, 'maxmp,-50', 'strength,50'), (13, 'Demon''s Sin', 35, 1, 'maxhp,-50', 'strength,50'),
(15, 'Demon''s Lie', 45, 1, 'maxhp,-100', 'strength,100'), (14, 'Demon''s Fall', 35, 1, 'maxmp,-50', 'strength,50'),
(16, 'Demon''s Hate', 45, 1, 'maxmp,-100', 'strength,100'), (15, 'Demon''s Lie', 45, 1, 'maxhp,-100', 'strength,100'),
(17, 'Angel''s Joy', 25, 1, 'maxhp,25', 'strength,25'), (16, 'Demon''s Hate', 45, 1, 'maxmp,-100', 'strength,100'),
(18, 'Angel''s Rise', 30, 1, 'maxhp,50', 'strength,50'), (17, 'Angel''s Joy', 25, 1, 'maxhp,25', 'strength,25'),
(19, 'Angel''s Truth', 35, 1, 'maxhp,75', 'strength,75'), (18, 'Angel''s Rise', 30, 1, 'maxhp,50', 'strength,50'),
(20, 'Angel''s Love', 40, 1, 'maxhp,100', 'strength,100'), (19, 'Angel''s Truth', 35, 1, 'maxhp,75', 'strength,75'),
(21, 'Seraph''s Joy', 25, 1, 'maxmp,25', 'dexterity,25'), (20, 'Angel''s Love', 40, 1, 'maxhp,100', 'strength,100'),
(22, 'Seraph''s Rise', 30, 1, 'maxmp,50', 'dexterity,50'), (21, 'Seraph''s Joy', 25, 1, 'maxmp,25', 'dexterity,25'),
(23, 'Seraph''s Truth', 35, 1, 'maxmp,75', 'dexterity,75'), (22, 'Seraph''s Rise', 30, 1, 'maxmp,50', 'dexterity,50'),
(24, 'Seraph''s Love', 40, 1, 'maxmp,100', 'dexterity,100'), (23, 'Seraph''s Truth', 35, 1, 'maxmp,75', 'dexterity,75'),
(25, 'Ruby', 50, 1, 'maxhp,150', 'X'), (24, 'Seraph''s Love', 40, 1, 'maxmp,100', 'dexterity,100'),
(26, 'Pearl', 50, 1, 'maxmp,150', 'X'), (25, 'Ruby', 50, 1, 'maxhp,150', 'X'),
(27, 'Emerald', 50, 1, 'strength,150', 'X'), (26, 'Pearl', 50, 1, 'maxmp,150', 'X'),
(28, 'Topaz', 50, 1, 'dexterity,150', 'X'), (27, 'Emerald', 50, 1, 'strength,150', 'X'),
(29, 'Obsidian', 50, 1, 'attackpower,150', 'X'), (28, 'Topaz', 50, 1, 'dexterity,150', 'X'),
(30, 'Diamond', 50, 1, 'defensepower,150', 'X'), (29, 'Obsidian', 50, 1, 'attackpower,150', 'X'),
(31, 'Memory Drop', 5, 1, 'expbonus,10', 'X'), (30, 'Diamond', 50, 1, 'defensepower,150', 'X'),
(32, 'Fortune Drop', 5, 1, 'goldbonus,10', 'X'); (31, 'Memory Drop', 5, 1, 'expbonus,10', 'X'),
SQL); (32, 'Fortune Drop', 5, 1, 'goldbonus,10', 'X');
SQL);
echo $query === true ? 'Drops table populated.<br>' : 'Error populating Drops table.'; echo $query === true ? 'Drops table populated.<br>' : 'Error populating Drops table.';
}
$query = db()->exec(<<<SQL $query = db()->exec(<<<SQL
CREATE TABLE forum ( CREATE TABLE forum (
@ -154,44 +176,46 @@ function second()
echo $query === true ? 'Items table created.<br>' : 'Error creating Items table.'; echo $query === true ? 'Items table created.<br>' : 'Error creating Items table.';
$query = db()->exec(<<<SQL if ($full) {
INSERT INTO items VALUES $query = db()->exec(<<<SQL
(1, 1, 'Stick', 10, 2, 'X'), INSERT INTO items VALUES
(2, 1, 'Branch', 30, 4, 'X'), (1, 1, 'Stick', 10, 2, 'X'),
(3, 1, 'Club', 40, 5, 'X'), (2, 1, 'Branch', 30, 4, 'X'),
(4, 1, 'Dagger', 90, 8, 'X'), (3, 1, 'Club', 40, 5, 'X'),
(5, 1, 'Hatchet', 150, 12, 'X'), (4, 1, 'Dagger', 90, 8, 'X'),
(6, 1, 'Axe', 200, 16, 'X'), (5, 1, 'Hatchet', 150, 12, 'X'),
(7, 1, 'Brand', 300, 25, 'X'), (6, 1, 'Axe', 200, 16, 'X'),
(8, 1, 'Poleaxe', 500, 35, 'X'), (7, 1, 'Brand', 300, 25, 'X'),
(9, 1, 'Broadsword', 800, 45, 'X'), (8, 1, 'Poleaxe', 500, 35, 'X'),
(10, 1, 'Battle Axe', 1200, 50, 'X'), (9, 1, 'Broadsword', 800, 45, 'X'),
(11, 1, 'Claymore', 2000, 60, 'X'), (10, 1, 'Battle Axe', 1200, 50, 'X'),
(12, 1, 'Dark Axe', 3000, 100, 'expbonus,-5'), (11, 1, 'Claymore', 2000, 60, 'X'),
(13, 1, 'Dark Sword', 4500, 125, 'expbonus,-10'), (12, 1, 'Dark Axe', 3000, 100, 'expbonus,-5'),
(14, 1, 'Bright Sword', 6000, 100, 'expbonus,10'), (13, 1, 'Dark Sword', 4500, 125, 'expbonus,-10'),
(15, 1, 'Magic Sword', 10000, 150, 'maxmp,50'), (14, 1, 'Bright Sword', 6000, 100, 'expbonus,10'),
(16, 1, 'Destiny Blade', 50000, 250, 'strength,50'), (15, 1, 'Magic Sword', 10000, 150, 'maxmp,50'),
(17, 2, 'Skivvies', 25, 2, 'goldbonus,10'), (16, 1, 'Destiny Blade', 50000, 250, 'strength,50'),
(18, 2, 'Clothes', 50, 5, 'X'), (17, 2, 'Skivvies', 25, 2, 'goldbonus,10'),
(19, 2, 'Leather Armor', 75, 10, 'X'), (18, 2, 'Clothes', 50, 5, 'X'),
(20, 2, 'Hard Leather Armor', 150, 25, 'X'), (19, 2, 'Leather Armor', 75, 10, 'X'),
(21, 2, 'Chain Mail', 300, 30, 'X'), (20, 2, 'Hard Leather Armor', 150, 25, 'X'),
(22, 2, 'Bronze Plate', 900, 50, 'X'), (21, 2, 'Chain Mail', 300, 30, 'X'),
(23, 2, 'Iron Plate', 2000, 100, 'X'), (22, 2, 'Bronze Plate', 900, 50, 'X'),
(24, 2, 'Magic Armor', 4000, 125, 'maxmp,50'), (23, 2, 'Iron Plate', 2000, 100, 'X'),
(25, 2, 'Dark Armor', 5000, 150, 'expbonus,-10'), (24, 2, 'Magic Armor', 4000, 125, 'maxmp,50'),
(26, 2, 'Bright Armor', 10000, 175, 'expbonus,10'), (25, 2, 'Dark Armor', 5000, 150, 'expbonus,-10'),
(27, 2, 'Destiny Raiment', 50000, 200, 'dexterity,50'), (26, 2, 'Bright Armor', 10000, 175, 'expbonus,10'),
(28, 3, 'Reed Shield', 50, 2, 'X'), (27, 2, 'Destiny Raiment', 50000, 200, 'dexterity,50'),
(29, 3, 'Buckler', 100, 4, 'X'), (28, 3, 'Reed Shield', 50, 2, 'X'),
(30, 3, 'Small Shield', 500, 10, 'X'), (29, 3, 'Buckler', 100, 4, 'X'),
(31, 3, 'Large Shield', 2500, 30, 'X'), (30, 3, 'Small Shield', 500, 10, 'X'),
(32, 3, 'Silver Shield', 10000, 60, 'X'), (31, 3, 'Large Shield', 2500, 30, 'X'),
(33, 3, 'Destiny Aegis', 25000, 100, 'maxhp,50'); (32, 3, 'Silver Shield', 10000, 60, 'X'),
SQL); (33, 3, 'Destiny Aegis', 25000, 100, 'maxhp,50');
SQL);
echo $query === true ? 'Items table populated.<br>' : 'Error populating Items table.'; echo $query === true ? 'Items table populated.<br>' : 'Error populating Items table.';
}
$query = db()->exec(<<<SQL $query = db()->exec(<<<SQL
CREATE TABLE levels ( CREATE TABLE levels (
@ -222,111 +246,113 @@ function second()
echo $query === true ? 'Levels table created.<br>' : 'Error creating Levels table.'; echo $query === true ? 'Levels table created.<br>' : 'Error creating Levels table.';
$query = db()->exec(<<<SQL if ($full) {
INSERT INTO levels VALUES $query = db()->exec(<<<SQL
(1, 0, 15, 0, 5, 5, 5, 0, 0, 15, 0, 5, 5, 5, 0, 0, 15, 0, 5, 5, 5, 0), INSERT INTO levels VALUES
(2, 15, 2, 5, 1, 0, 1, 1, 18, 2, 4, 1, 2, 1, 1, 20, 2, 5, 1, 0, 2, 1), (1, 0, 15, 0, 5, 5, 5, 0, 0, 15, 0, 5, 5, 5, 0, 0, 15, 0, 5, 5, 5, 0),
(3, 45, 3, 4, 2, 1, 2, 0, 54, 2, 3, 2, 3, 2, 0, 60, 2, 3, 2, 1, 3, 0), (2, 15, 2, 5, 1, 0, 1, 1, 18, 2, 4, 1, 2, 1, 1, 20, 2, 5, 1, 0, 2, 1),
(4, 105, 3, 3, 2, 1, 2, 6, 126, 2, 3, 2, 3, 2, 0, 140, 2, 4, 2, 1, 3, 0), (3, 45, 3, 4, 2, 1, 2, 0, 54, 2, 3, 2, 3, 2, 0, 60, 2, 3, 2, 1, 3, 0),
(5, 195, 2, 5, 2, 0, 1, 0, 234, 2, 4, 2, 2, 1, 6, 260, 2, 4, 2, 0, 2, 6), (4, 105, 3, 3, 2, 1, 2, 6, 126, 2, 3, 2, 3, 2, 0, 140, 2, 4, 2, 1, 3, 0),
(6, 330, 4, 5, 2, 2, 3, 0, 396, 3, 4, 2, 4, 3, 0, 440, 3, 5, 2, 2, 4, 0), (5, 195, 2, 5, 2, 0, 1, 0, 234, 2, 4, 2, 2, 1, 6, 260, 2, 4, 2, 0, 2, 6),
(7, 532, 3, 4, 2, 1, 2, 11, 639, 2, 3, 2, 3, 2, 0, 710, 2, 3, 2, 1, 3, 0), (6, 330, 4, 5, 2, 2, 3, 0, 396, 3, 4, 2, 4, 3, 0, 440, 3, 5, 2, 2, 4, 0),
(8, 835, 2, 4, 2, 0, 1, 0, 1003, 2, 3, 2, 2, 1, 11, 1115, 2, 4, 2, 0, 2, 11), (7, 532, 3, 4, 2, 1, 2, 11, 639, 2, 3, 2, 3, 2, 0, 710, 2, 3, 2, 1, 3, 0),
(9, 1290, 5, 3, 2, 3, 4, 2, 1549, 4, 2, 2, 5, 4, 0, 1722, 4, 2, 2, 3, 5, 0), (8, 835, 2, 4, 2, 0, 1, 0, 1003, 2, 3, 2, 2, 1, 11, 1115, 2, 4, 2, 0, 2, 11),
(10, 1973, 10, 3, 2, 4, 3, 0, 2369, 10, 2, 2, 6, 3, 0, 2633, 10, 3, 2, 4, 4, 0), (9, 1290, 5, 3, 2, 3, 4, 2, 1549, 4, 2, 2, 5, 4, 0, 1722, 4, 2, 2, 3, 5, 0),
(11, 2997, 5, 2, 2, 3, 4, 0, 3598, 4, 1, 2, 5, 4, 2, 3999, 4, 1, 2, 3, 5, 2), (10, 1973, 10, 3, 2, 4, 3, 0, 2369, 10, 2, 2, 6, 3, 0, 2633, 10, 3, 2, 4, 4, 0),
(12, 4533, 4, 2, 2, 2, 3, 7, 5441, 4, 1, 2, 4, 3, 0, 6047, 4, 2, 2, 2, 4, 0), (11, 2997, 5, 2, 2, 3, 4, 0, 3598, 4, 1, 2, 5, 4, 2, 3999, 4, 1, 2, 3, 5, 2),
(13, 6453, 4, 3, 2, 2, 3, 0, 7745, 4, 2, 2, 4, 3, 0, 8607, 4, 2, 2, 2, 4, 0), (12, 4533, 4, 2, 2, 2, 3, 7, 5441, 4, 1, 2, 4, 3, 0, 6047, 4, 2, 2, 2, 4, 0),
(14, 8853, 5, 4, 2, 3, 4, 17, 10625, 4, 3, 2, 5, 4, 7, 11807, 4, 4, 2, 3, 5, 7), (13, 6453, 4, 3, 2, 2, 3, 0, 7745, 4, 2, 2, 4, 3, 0, 8607, 4, 2, 2, 2, 4, 0),
(15, 11853, 5, 5, 2, 3, 4, 0, 14225, 4, 4, 2, 5, 4, 0, 15808, 4, 4, 2, 3, 5, 0), (14, 8853, 5, 4, 2, 3, 4, 17, 10625, 4, 3, 2, 5, 4, 7, 11807, 4, 4, 2, 3, 5, 7),
(16, 15603, 5, 3, 2, 3, 4, 0, 18725, 5, 2, 2, 5, 4, 0, 20807, 5, 3, 2, 3, 5, 0), (15, 11853, 5, 5, 2, 3, 4, 0, 14225, 4, 4, 2, 5, 4, 0, 15808, 4, 4, 2, 3, 5, 0),
(17, 20290, 4, 2, 2, 2, 3, 12, 24350, 4, 1, 2, 4, 3, 0, 27057, 4, 1, 2, 2, 4, 0), (16, 15603, 5, 3, 2, 3, 4, 0, 18725, 5, 2, 2, 5, 4, 0, 20807, 5, 3, 2, 3, 5, 0),
(18, 25563, 4, 2, 2, 2, 3, 0, 30678, 3, 1, 2, 4, 3, 14, 34869, 3, 2, 2, 2, 4, 17), (17, 20290, 4, 2, 2, 2, 3, 12, 24350, 4, 1, 2, 4, 3, 0, 27057, 4, 1, 2, 2, 4, 0),
(19, 31495, 4, 5, 2, 2, 3, 0, 37797, 3, 4, 2, 4, 3, 0, 43657, 3, 4, 2, 2, 4, 0), (18, 25563, 4, 2, 2, 2, 3, 0, 30678, 3, 1, 2, 4, 3, 14, 34869, 3, 2, 2, 2, 4, 17),
(20, 38169, 10, 6, 2, 3, 3, 0, 45805, 10, 5, 2, 5, 3, 0, 53543, 10, 6, 2, 3, 4, 0), (19, 31495, 4, 5, 2, 2, 3, 0, 37797, 3, 4, 2, 4, 3, 0, 43657, 3, 4, 2, 2, 4, 0),
(21, 45676, 4, 4, 2, 2, 3, 0, 54814, 4, 3, 2, 4, 3, 0, 64664, 4, 3, 2, 2, 4, 0), (20, 38169, 10, 6, 2, 3, 3, 0, 45805, 10, 5, 2, 5, 3, 0, 53543, 10, 6, 2, 3, 4, 0),
(22, 54121, 5, 5, 2, 3, 4, 0, 64949, 4, 4, 2, 5, 4, 12, 77175, 4, 5, 2, 3, 5, 12), (21, 45676, 4, 4, 2, 2, 3, 0, 54814, 4, 3, 2, 4, 3, 0, 64664, 4, 3, 2, 2, 4, 0),
(23, 63622, 5, 3, 2, 3, 4, 0, 76350, 4, 2, 2, 5, 4, 0, 91250, 4, 2, 2, 3, 5, 0), (22, 54121, 5, 5, 2, 3, 4, 0, 64949, 4, 4, 2, 5, 4, 12, 77175, 4, 5, 2, 3, 5, 12),
(24, 74310, 5, 5, 2, 3, 4, 0, 89176, 4, 4, 2, 5, 4, 0, 107083, 4, 5, 2, 3, 5, 0), (23, 63622, 5, 3, 2, 3, 4, 0, 76350, 4, 2, 2, 5, 4, 0, 91250, 4, 2, 2, 3, 5, 0),
(25, 86334, 4, 4, 2, 2, 3, 3, 103605, 3, 3, 2, 4, 3, 17, 124895, 3, 3, 2, 2, 4, 14), (24, 74310, 5, 5, 2, 3, 4, 0, 89176, 4, 4, 2, 5, 4, 0, 107083, 4, 5, 2, 3, 5, 0),
(26, 99861, 6, 3, 2, 4, 5, 0, 119837, 5, 2, 2, 6, 5, 0, 144933, 5, 3, 2, 4, 6, 0), (25, 86334, 4, 4, 2, 2, 3, 3, 103605, 3, 3, 2, 4, 3, 17, 124895, 3, 3, 2, 2, 4, 14),
(27, 115078, 6, 2, 2, 4, 5, 0, 138098, 5, 1, 2, 6, 5, 0, 167475, 5, 1, 2, 4, 6, 0), (26, 99861, 6, 3, 2, 4, 5, 0, 119837, 5, 2, 2, 6, 5, 0, 144933, 5, 3, 2, 4, 6, 0),
(28, 132197, 4, 2, 2, 2, 3, 0, 158641, 4, 1, 2, 4, 3, 0, 192835, 4, 2, 2, 2, 4, 0), (27, 115078, 6, 2, 2, 4, 5, 0, 138098, 5, 1, 2, 6, 5, 0, 167475, 5, 1, 2, 4, 6, 0),
(29, 151456, 6, 3, 2, 4, 5, 0, 181751, 5, 2, 2, 6, 5, 3, 221365, 5, 2, 2, 4, 6, 3), (28, 132197, 4, 2, 2, 2, 3, 0, 158641, 4, 1, 2, 4, 3, 0, 192835, 4, 2, 2, 2, 4, 0),
(30, 173121, 10, 4, 3, 4, 4, 0, 207749, 10, 3, 3, 6, 4, 0, 253461, 10, 4, 3, 4, 5, 0), (29, 151456, 6, 3, 2, 4, 5, 0, 181751, 5, 2, 2, 6, 5, 3, 221365, 5, 2, 2, 4, 6, 3),
(31, 197494, 5, 5, 3, 3, 4, 8, 236996, 4, 3, 3, 5, 4, 0, 289568, 4, 3, 3, 3, 5, 0), (30, 173121, 10, 4, 3, 4, 4, 0, 207749, 10, 3, 3, 6, 4, 0, 253461, 10, 4, 3, 4, 5, 0),
(32, 224913, 6, 4, 3, 4, 5, 0, 269898, 5, 3, 3, 6, 5, 0, 330188, 5, 4, 3, 4, 6, 0), (31, 197494, 5, 5, 3, 3, 4, 8, 236996, 4, 3, 3, 5, 4, 0, 289568, 4, 3, 3, 3, 5, 0),
(33, 255758, 5, 4, 3, 3, 4, 0, 306912, 5, 3, 3, 5, 4, 0, 375885, 5, 3, 3, 3, 5, 0), (32, 224913, 6, 4, 3, 4, 5, 0, 269898, 5, 3, 3, 6, 5, 0, 330188, 5, 4, 3, 4, 6, 0),
(34, 290458, 6, 4, 3, 4, 5, 0, 348552, 5, 3, 3, 6, 5, 8, 427294, 5, 4, 3, 4, 6, 8), (33, 255758, 5, 4, 3, 3, 4, 0, 306912, 5, 3, 3, 5, 4, 0, 375885, 5, 3, 3, 3, 5, 0),
(35, 329495, 5, 3, 3, 3, 4, 0, 395397, 4, 2, 3, 5, 4, 0, 485126, 4, 2, 3, 3, 5, 0), (34, 290458, 6, 4, 3, 4, 5, 0, 348552, 5, 3, 3, 6, 5, 8, 427294, 5, 4, 3, 4, 6, 8),
(36, 373412, 4, 3, 3, 2, 3, 18, 448097, 5, 2, 3, 4, 3, 0, 550188, 5, 3, 3, 2, 4, 0), (35, 329495, 5, 3, 3, 3, 4, 0, 395397, 4, 2, 3, 5, 4, 0, 485126, 4, 2, 3, 3, 5, 0),
(37, 422818, 5, 4, 3, 3, 4, 0, 507384, 5, 3, 3, 5, 4, 0, 623383, 5, 3, 3, 3, 5, 0), (36, 373412, 4, 3, 3, 2, 3, 18, 448097, 5, 2, 3, 4, 3, 0, 550188, 5, 3, 3, 2, 4, 0),
(38, 478399, 6, 5, 3, 4, 5, 0, 574081, 5, 4, 3, 6, 5, 15, 705726, 5, 5, 3, 4, 6, 18), (37, 422818, 5, 4, 3, 3, 4, 0, 507384, 5, 3, 3, 5, 4, 0, 623383, 5, 3, 3, 3, 5, 0),
(39, 540927, 6, 4, 3, 4, 5, 0, 649115, 5, 3, 3, 6, 5, 0, 798362, 5, 3, 3, 4, 6, 0), (38, 478399, 6, 5, 3, 4, 5, 0, 574081, 5, 4, 3, 6, 5, 15, 705726, 5, 5, 3, 4, 6, 18),
(40, 611271, 15, 3, 3, 5, 5, 13, 733528, 15, 2, 3, 7, 5, 0, 902577, 15, 3, 3, 5, 6, 0), (39, 540927, 6, 4, 3, 4, 5, 0, 649115, 5, 3, 3, 6, 5, 0, 798362, 5, 3, 3, 4, 6, 0),
(41, 690408, 7, 3, 3, 5, 2, 0, 828492, 6, 2, 3, 7, 2, 0, 1019818, 6, 2, 3, 5, 3, 0), (40, 611271, 15, 3, 3, 5, 5, 13, 733528, 15, 2, 3, 7, 5, 0, 902577, 15, 3, 3, 5, 6, 0),
(42, 779437, 7, 4, 3, 5, 6, 0, 935326, 6, 3, 3, 7, 6, 0, 1151714, 6, 4, 3, 5, 7, 0), (41, 690408, 7, 3, 3, 5, 2, 0, 828492, 6, 2, 3, 7, 2, 0, 1019818, 6, 2, 3, 5, 3, 0),
(43, 879592, 8, 5, 3, 6, 7, 0, 1055514, 7, 4, 3, 8, 7, 0, 1300096, 7, 4, 3, 6, 8, 0), (42, 779437, 7, 4, 3, 5, 6, 0, 935326, 6, 3, 3, 7, 6, 0, 1151714, 6, 4, 3, 5, 7, 0),
(44, 992268, 6, 3, 3, 4, 5, 0, 1190725, 5, 2, 3, 6, 5, 0, 1448478, 5, 3, 3, 4, 6, 0), (43, 879592, 8, 5, 3, 6, 7, 0, 1055514, 7, 4, 3, 8, 7, 0, 1300096, 7, 4, 3, 6, 8, 0),
(45, 1119028, 5, 8, 3, 3, 4, 4, 1325936, 5, 8, 3, 5, 4, 18, 1596860, 5, 8, 3, 3, 5, 4), (44, 992268, 6, 3, 3, 4, 5, 0, 1190725, 5, 2, 3, 6, 5, 0, 1448478, 5, 3, 3, 4, 6, 0),
(46, 1245788, 6, 5, 3, 4, 5, 0, 1461147, 5, 4, 3, 6, 5, 0, 1745242, 5, 5, 3, 4, 6, 0), (45, 1119028, 5, 8, 3, 3, 4, 4, 1325936, 5, 8, 3, 5, 4, 18, 1596860, 5, 8, 3, 3, 5, 4),
(47, 1372548, 7, 4, 3, 5, 6, 0, 1596358, 6, 3, 3, 7, 6, 0, 1893624, 6, 3, 3, 5, 7, 0), (46, 1245788, 6, 5, 3, 4, 5, 0, 1461147, 5, 4, 3, 6, 5, 0, 1745242, 5, 5, 3, 4, 6, 0),
(48, 1499308, 6, 4, 3, 4, 5, 0, 1731569, 5, 3, 3, 6, 5, 0, 2042006, 5, 4, 3, 4, 6, 0), (47, 1372548, 7, 4, 3, 5, 6, 0, 1596358, 6, 3, 3, 7, 6, 0, 1893624, 6, 3, 3, 5, 7, 0),
(49, 1626068, 5, 3, 3, 3, 4, 0, 1866780, 4, 2, 3, 5, 4, 0, 2190388, 4, 2, 3, 3, 5, 0), (48, 1499308, 6, 4, 3, 4, 5, 0, 1731569, 5, 3, 3, 6, 5, 0, 2042006, 5, 4, 3, 4, 6, 0),
(50, 1752828, 15, 3, 3, 5, 5, 0, 2001991, 15, 2, 3, 7, 5, 0, 2338770, 15, 3, 3, 5, 6, 0), (49, 1626068, 5, 3, 3, 3, 4, 0, 1866780, 4, 2, 3, 5, 4, 0, 2190388, 4, 2, 3, 3, 5, 0),
(51, 1879588, 6, 2, 3, 4, 5, 9, 2137202, 5, 1, 3, 6, 5, 13, 2487152, 5, 1, 3, 4, 6, 13), (50, 1752828, 15, 3, 3, 5, 5, 0, 2001991, 15, 2, 3, 7, 5, 0, 2338770, 15, 3, 3, 5, 6, 0),
(52, 2006348, 7, 2, 3, 5, 6, 0, 2272413, 6, 1, 3, 7, 6, 0, 2635534, 6, 2, 3, 5, 7, 0), (51, 1879588, 6, 2, 3, 4, 5, 9, 2137202, 5, 1, 3, 6, 5, 13, 2487152, 5, 1, 3, 4, 6, 13),
(53, 2133108, 8, 2, 3, 6, 7, 0, 2407624, 7, 1, 3, 8, 7, 0, 2783916, 7, 1, 3, 6, 8, 0), (52, 2006348, 7, 2, 3, 5, 6, 0, 2272413, 6, 1, 3, 7, 6, 0, 2635534, 6, 2, 3, 5, 7, 0),
(54, 2259868, 8, 4, 3, 6, 7, 0, 2542835, 7, 3, 3, 8, 7, 0, 2932298, 7, 4, 3, 6, 8, 0), (53, 2133108, 8, 2, 3, 6, 7, 0, 2407624, 7, 1, 3, 8, 7, 0, 2783916, 7, 1, 3, 6, 8, 0),
(55, 2386628, 7, 4, 3, 5, 6, 0, 2678046, 6, 3, 3, 7, 6, 0, 3080680, 6, 3, 3, 5, 7, 0), (54, 2259868, 8, 4, 3, 6, 7, 0, 2542835, 7, 3, 3, 8, 7, 0, 2932298, 7, 4, 3, 6, 8, 0),
(56, 2513388, 7, 4, 3, 5, 6, 0, 2813257, 6, 3, 3, 7, 6, 0, 3229062, 6, 4, 3, 5, 7, 9), (55, 2386628, 7, 4, 3, 5, 6, 0, 2678046, 6, 3, 3, 7, 6, 0, 3080680, 6, 3, 3, 5, 7, 0),
(57, 2640148, 6, 5, 3, 4, 5, 0, 2948468, 6, 4, 3, 6, 5, 0, 3377444, 6, 4, 3, 4, 6, 0), (56, 2513388, 7, 4, 3, 5, 6, 0, 2813257, 6, 3, 3, 7, 6, 0, 3229062, 6, 4, 3, 5, 7, 9),
(58, 2766908, 5, 5, 3, 3, 4, 0, 3083679, 5, 4, 3, 5, 4, 19, 3525826, 5, 5, 3, 3, 5, 0), (57, 2640148, 6, 5, 3, 4, 5, 0, 2948468, 6, 4, 3, 6, 5, 0, 3377444, 6, 4, 3, 4, 6, 0),
(59, 2893668, 8, 3, 3, 6, 7, 0, 3218890, 7, 2, 3, 8, 7, 0, 3674208, 7, 2, 3, 6, 8, 0), (58, 2766908, 5, 5, 3, 3, 4, 0, 3083679, 5, 4, 3, 5, 4, 19, 3525826, 5, 5, 3, 3, 5, 0),
(60, 3020428, 15, 4, 4, 6, 6, 19, 3354101, 15, 3, 4, 8, 6, 0, 3822590, 15, 4, 4, 6, 7, 15), (59, 2893668, 8, 3, 3, 6, 7, 0, 3218890, 7, 2, 3, 8, 7, 0, 3674208, 7, 2, 3, 6, 8, 0),
(61, 3147188, 8, 5, 4, 6, 7, 0, 3489312, 7, 4, 4, 8, 7, 0, 3970972, 7, 4, 4, 6, 8, 0), (60, 3020428, 15, 4, 4, 6, 6, 19, 3354101, 15, 3, 4, 8, 6, 0, 3822590, 15, 4, 4, 6, 7, 15),
(62, 3273948, 8, 4, 4, 6, 7, 0, 3624523, 7, 3, 4, 8, 7, 0, 4119354, 7, 4, 4, 6, 8, 0), (61, 3147188, 8, 5, 4, 6, 7, 0, 3489312, 7, 4, 4, 8, 7, 0, 3970972, 7, 4, 4, 6, 8, 0),
(63, 3400708, 9, 5, 4, 7, 8, 0, 3759734, 8, 4, 4, 9, 8, 0, 4267736, 8, 4, 4, 7, 9, 0), (62, 3273948, 8, 4, 4, 6, 7, 0, 3624523, 7, 3, 4, 8, 7, 0, 4119354, 7, 4, 4, 6, 8, 0),
(64, 3527468, 5, 5, 4, 3, 4, 0, 3894945, 5, 4, 4, 5, 4, 0, 4416118, 5, 5, 4, 3, 5, 0), (63, 3400708, 9, 5, 4, 7, 8, 0, 3759734, 8, 4, 4, 9, 8, 0, 4267736, 8, 4, 4, 7, 9, 0),
(65, 3654228, 6, 4, 4, 4, 5, 0, 4030156, 6, 3, 4, 6, 5, 0, 4564500, 6, 3, 4, 4, 6, 0), (64, 3527468, 5, 5, 4, 3, 4, 0, 3894945, 5, 4, 4, 5, 4, 0, 4416118, 5, 5, 4, 3, 5, 0),
(66, 3780988, 8, 4, 4, 6, 7, 0, 4165367, 8, 3, 4, 8, 7, 0, 4712882, 8, 4, 4, 6, 8, 0), (65, 3654228, 6, 4, 4, 4, 5, 0, 4030156, 6, 3, 4, 6, 5, 0, 4564500, 6, 3, 4, 4, 6, 0),
(67, 3907748, 7, 3, 4, 5, 6, 0, 4300578, 7, 2, 4, 7, 6, 0, 4861264, 7, 2, 4, 5, 7, 0), (66, 3780988, 8, 4, 4, 6, 7, 0, 4165367, 8, 3, 4, 8, 7, 0, 4712882, 8, 4, 4, 6, 8, 0),
(68, 4034508, 9, 3, 4, 7, 8, 0, 4435789, 8, 2, 4, 9, 8, 0, 5009646, 8, 3, 4, 7, 9, 0), (67, 3907748, 7, 3, 4, 5, 6, 0, 4300578, 7, 2, 4, 7, 6, 0, 4861264, 7, 2, 4, 5, 7, 0),
(69, 4161268, 5, 4, 4, 3, 4, 0, 4571000, 5, 3, 4, 5, 4, 0, 5158028, 5, 3, 4, 3, 5, 0), (68, 4034508, 9, 3, 4, 7, 8, 0, 4435789, 8, 2, 4, 9, 8, 0, 5009646, 8, 3, 4, 7, 9, 0),
(70, 4288028, 20, 4, 4, 6, 6, 5, 4706211, 20, 3, 4, 8, 6, 16, 5306410, 20, 4, 4, 6, 7, 0), (69, 4161268, 5, 4, 4, 3, 4, 0, 4571000, 5, 3, 4, 5, 4, 0, 5158028, 5, 3, 4, 3, 5, 0),
(71, 4414788, 5, 5, 4, 3, 4, 0, 4841422, 5, 4, 4, 5, 4, 0, 5454792, 5, 4, 4, 3, 5, 0), (70, 4288028, 20, 4, 4, 6, 6, 5, 4706211, 20, 3, 4, 8, 6, 16, 5306410, 20, 4, 4, 6, 7, 0),
(72, 4541548, 6, 2, 4, 4, 5, 0, 4976633, 5, 1, 4, 6, 5, 0, 5603174, 5, 2, 4, 4, 6, 0), (71, 4414788, 5, 5, 4, 3, 4, 0, 4841422, 5, 4, 4, 5, 4, 0, 5454792, 5, 4, 4, 3, 5, 0),
(73, 4668308, 8, 4, 4, 6, 7, 0, 5111844, 8, 3, 4, 8, 7, 0, 5751556, 8, 3, 4, 6, 8, 0), (72, 4541548, 6, 2, 4, 4, 5, 0, 4976633, 5, 1, 4, 6, 5, 0, 5603174, 5, 2, 4, 4, 6, 0),
(74, 4795068, 7, 5, 4, 5, 6, 0, 5247055, 6, 4, 4, 7, 6, 0, 5899938, 6, 5, 4, 5, 7, 0), (73, 4668308, 8, 4, 4, 6, 7, 0, 5111844, 8, 3, 4, 8, 7, 0, 5751556, 8, 3, 4, 6, 8, 0),
(75, 4921828, 5, 3, 4, 3, 4, 0, 5382266, 5, 2, 4, 5, 4, 0, 6048320, 5, 2, 4, 3, 5, 0), (74, 4795068, 7, 5, 4, 5, 6, 0, 5247055, 6, 4, 4, 7, 6, 0, 5899938, 6, 5, 4, 5, 7, 0),
(76, 5048588, 6, 3, 4, 4, 5, 0, 5517477, 6, 2, 4, 6, 5, 0, 6196702, 6, 3, 4, 4, 6, 0), (75, 4921828, 5, 3, 4, 3, 4, 0, 5382266, 5, 2, 4, 5, 4, 0, 6048320, 5, 2, 4, 3, 5, 0),
(77, 5175348, 6, 4, 4, 4, 5, 0, 5652688, 7, 3, 4, 6, 5, 0, 6345084, 7, 3, 4, 4, 6, 0), (76, 5048588, 6, 3, 4, 4, 5, 0, 5517477, 6, 2, 4, 6, 5, 0, 6196702, 6, 3, 4, 4, 6, 0),
(78, 5302108, 7, 4, 4, 5, 6, 0, 5787899, 7, 3, 4, 7, 6, 0, 6493466, 7, 4, 4, 5, 7, 0), (77, 5175348, 6, 4, 4, 4, 5, 0, 5652688, 7, 3, 4, 6, 5, 0, 6345084, 7, 3, 4, 4, 6, 0),
(79, 5428868, 8, 4, 4, 6, 7, 10, 5923110, 7, 3, 4, 8, 7, 0, 6641848, 7, 3, 4, 6, 8, 0), (78, 5302108, 7, 4, 4, 5, 6, 0, 5787899, 7, 3, 4, 7, 6, 0, 6493466, 7, 4, 4, 5, 7, 0),
(80, 5555628, 20, 5, 4, 6, 7, 0, 6058321, 20, 4, 4, 8, 7, 0, 6790230, 20, 5, 4, 6, 8, 0), (79, 5428868, 8, 4, 4, 6, 7, 10, 5923110, 7, 3, 4, 8, 7, 0, 6641848, 7, 3, 4, 6, 8, 0),
(81, 5682388, 7, 3, 4, 5, 6, 0, 6193532, 7, 2, 4, 7, 6, 0, 6938612, 7, 2, 4, 5, 7, 0), (80, 5555628, 20, 5, 4, 6, 7, 0, 6058321, 20, 4, 4, 8, 7, 0, 6790230, 20, 5, 4, 6, 8, 0),
(82, 5809148, 6, 4, 4, 4, 5, 0, 6328743, 5, 3, 4, 6, 5, 0, 7086994, 5, 4, 4, 4, 6, 0), (81, 5682388, 7, 3, 4, 5, 6, 0, 6193532, 7, 2, 4, 7, 6, 0, 6938612, 7, 2, 4, 5, 7, 0),
(83, 5935908, 6, 2, 4, 4, 5, 0, 6463954, 6, 1, 4, 6, 5, 0, 7235376, 6, 1, 4, 4, 6, 0), (82, 5809148, 6, 4, 4, 4, 5, 0, 6328743, 5, 3, 4, 6, 5, 0, 7086994, 5, 4, 4, 4, 6, 0),
(84, 6062668, 5, 4, 4, 3, 4, 0, 6599165, 5, 3, 4, 5, 4, 0, 7383758, 5, 4, 4, 3, 5, 0), (83, 5935908, 6, 2, 4, 4, 5, 0, 6463954, 6, 1, 4, 6, 5, 0, 7235376, 6, 1, 4, 4, 6, 0),
(85, 6189428, 7, 4, 4, 5, 6, 0, 6734376, 6, 3, 4, 7, 6, 0, 7532140, 6, 3, 4, 5, 7, 0), (84, 6062668, 5, 4, 4, 3, 4, 0, 6599165, 5, 3, 4, 5, 4, 0, 7383758, 5, 4, 4, 3, 5, 0),
(86, 6316188, 8, 5, 4, 6, 7, 0, 6869587, 8, 4, 4, 8, 7, 0, 7680522, 8, 5, 4, 6, 8, 0), (85, 6189428, 7, 4, 4, 5, 6, 0, 6734376, 6, 3, 4, 7, 6, 0, 7532140, 6, 3, 4, 5, 7, 0),
(87, 6442948, 8, 4, 4, 6, 7, 0, 7004798, 7, 3, 4, 8, 7, 0, 7828904, 7, 3, 4, 6, 8, 0), (86, 6316188, 8, 5, 4, 6, 7, 0, 6869587, 8, 4, 4, 8, 7, 0, 7680522, 8, 5, 4, 6, 8, 0),
(88, 6569708, 9, 5, 4, 7, 8, 0, 7140009, 8, 4, 4, 9, 8, 0, 7977286, 8, 5, 4, 7, 9, 0), (87, 6442948, 8, 4, 4, 6, 7, 0, 7004798, 7, 3, 4, 8, 7, 0, 7828904, 7, 3, 4, 6, 8, 0),
(89, 6696468, 5, 2, 4, 3, 4, 0, 7275220, 5, 1, 4, 5, 4, 0, 8125668, 5, 1, 4, 3, 5, 0), (88, 6569708, 9, 5, 4, 7, 8, 0, 7140009, 8, 4, 4, 9, 8, 0, 7977286, 8, 5, 4, 7, 9, 0),
(90, 6823228, 20, 2, 5, 7, 8, 0, 7410431, 20, 1, 5, 9, 8, 0, 8274050, 20, 2, 5, 7, 9, 0), (89, 6696468, 5, 2, 4, 3, 4, 0, 7275220, 5, 1, 4, 5, 4, 0, 8125668, 5, 1, 4, 3, 5, 0),
(91, 6949988, 5, 3, 5, 3, 4, 0, 7545642, 5, 2, 5, 5, 4, 0, 8422432, 5, 2, 5, 3, 5, 0), (90, 6823228, 20, 2, 5, 7, 8, 0, 7410431, 20, 1, 5, 9, 8, 0, 8274050, 20, 2, 5, 7, 9, 0),
(92, 7076748, 6, 3, 5, 4, 5, 0, 7680853, 4, 2, 5, 6, 5, 0, 8570814, 4, 3, 5, 4, 6, 0), (91, 6949988, 5, 3, 5, 3, 4, 0, 7545642, 5, 2, 5, 5, 4, 0, 8422432, 5, 2, 5, 3, 5, 0),
(93, 7203508, 8, 4, 5, 6, 7, 0, 7816064, 6, 2, 5, 8, 7, 0, 8719196, 6, 2, 5, 6, 8, 0), (92, 7076748, 6, 3, 5, 4, 5, 0, 7680853, 4, 2, 5, 6, 5, 0, 8570814, 4, 3, 5, 4, 6, 0),
(94, 7330268, 4, 4, 5, 3, 3, 0, 7951275, 4, 3, 5, 5, 3, 0, 8867578, 4, 4, 5, 3, 4, 0), (93, 7203508, 8, 4, 5, 6, 7, 0, 7816064, 6, 2, 5, 8, 7, 0, 8719196, 6, 2, 5, 6, 8, 0),
(95, 7457028, 3, 3, 5, 5, 2, 0, 8086486, 4, 2, 5, 7, 2, 0, 9015960, 4, 2, 5, 5, 3, 0), (94, 7330268, 4, 4, 5, 3, 3, 0, 7951275, 4, 3, 5, 5, 3, 0, 8867578, 4, 4, 5, 3, 4, 0),
(96, 7583788, 5, 3, 5, 4, 3, 0, 8221697, 5, 2, 5, 7, 3, 0, 9164342, 5, 3, 5, 4, 4, 0), (95, 7457028, 3, 3, 5, 5, 2, 0, 8086486, 4, 2, 5, 7, 2, 0, 9015960, 4, 2, 5, 5, 3, 0),
(97, 7710548, 5, 4, 5, 4, 5, 0, 8356908, 5, 3, 5, 7, 5, 0, 9312724, 5, 3, 5, 4, 6, 0), (96, 7583788, 5, 3, 5, 4, 3, 0, 8221697, 5, 2, 5, 7, 3, 0, 9164342, 5, 3, 5, 4, 4, 0),
(98, 7837308, 4, 5, 5, 4, 3, 0, 8492119, 4, 3, 5, 7, 3, 0, 9461106, 4, 4, 5, 4, 4, 0), (97, 7710548, 5, 4, 5, 4, 5, 0, 8356908, 5, 3, 5, 7, 5, 0, 9312724, 5, 3, 5, 4, 6, 0),
(99, 7964068, 50, 5, 5, 6, 5, 0, 8627330, 50, 3, 5, 9, 5, 0, 9609488, 50, 4, 5, 6, 6, 0), (98, 7837308, 4, 5, 5, 4, 3, 0, 8492119, 4, 3, 5, 7, 3, 0, 9461106, 4, 4, 5, 4, 4, 0),
(100, 16777215, 0, 0, 0, 0, 0, 0, 16777215, 0, 0, 0, 0, 0, 0, 16777215, 0, 0, 0, 0, 0, 0); (99, 7964068, 50, 5, 5, 6, 5, 0, 8627330, 50, 3, 5, 9, 5, 0, 9609488, 50, 4, 5, 6, 6, 0),
SQL); (100, 16777215, 0, 0, 0, 0, 0, 0, 16777215, 0, 0, 0, 0, 0, 0, 16777215, 0, 0, 0, 0, 0, 0);
SQL);
echo $query === true ? 'Levels table populated.<br>' : 'Error populating Levels table.'; echo $query === true ? 'Levels table populated.<br>' : 'Error populating Levels table.';
}
$query = db()->exec(<<<SQL $query = db()->exec(<<<SQL
CREATE TABLE monsters ( CREATE TABLE monsters (
@ -344,167 +370,168 @@ function second()
echo $query === true ? 'Monsters table created.<br>' : 'Error creating Monsters table.'; echo $query === true ? 'Monsters table created.<br>' : 'Error creating Monsters table.';
$query = db()->exec(<<<SQL if ($full) {
INSERT INTO monsters VALUES $query = db()->exec(<<<SQL
(1, 'Blue Slime', 4, 3, 1, 1, 1, 1, 0), INSERT INTO monsters VALUES
(2, 'Red Slime', 6, 5, 1, 1, 2, 1, 0), (1, 'Blue Slime', 4, 3, 1, 1, 1, 1, 0),
(3, 'Critter', 6, 5, 2, 1, 4, 2, 0), (2, 'Red Slime', 6, 5, 1, 1, 2, 1, 0),
(4, 'Creature', 10, 8, 2, 2, 4, 2, 0), (3, 'Critter', 6, 5, 2, 1, 4, 2, 0),
(5, 'Shadow', 10, 9, 3, 2, 6, 2, 1), (4, 'Creature', 10, 8, 2, 2, 4, 2, 0),
(6, 'Drake', 11, 10, 3, 2, 8, 3, 0), (5, 'Shadow', 10, 9, 3, 2, 6, 2, 1),
(7, 'Shade', 12, 10, 3, 3, 10, 3, 1), (6, 'Drake', 11, 10, 3, 2, 8, 3, 0),
(8, 'Drakelor', 14, 12, 4, 3, 10, 3, 0), (7, 'Shade', 12, 10, 3, 3, 10, 3, 1),
(9, 'Silver Slime', 15, 100, 200, 30, 15, 1000, 2), (8, 'Drakelor', 14, 12, 4, 3, 10, 3, 0),
(10, 'Scamp', 16, 13, 5, 4, 15, 5, 0), (9, 'Silver Slime', 15, 100, 200, 30, 15, 1000, 2),
(11, 'Raven', 16, 13, 5, 4, 18, 6, 0), (10, 'Scamp', 16, 13, 5, 4, 15, 5, 0),
(12, 'Scorpion', 18, 14, 6, 5, 20, 7, 0), (11, 'Raven', 16, 13, 5, 4, 18, 6, 0),
(13, 'Illusion', 20, 15, 6, 5, 20, 7, 1), (12, 'Scorpion', 18, 14, 6, 5, 20, 7, 0),
(14, 'Nightshade', 22, 16, 6, 6, 24, 8, 0), (13, 'Illusion', 20, 15, 6, 5, 20, 7, 1),
(15, 'Drakemal', 22, 18, 7, 6, 24, 8, 0), (14, 'Nightshade', 22, 16, 6, 6, 24, 8, 0),
(16, 'Shadow Raven', 24, 18, 7, 6, 26, 9, 1), (15, 'Drakemal', 22, 18, 7, 6, 24, 8, 0),
(17, 'Ghost', 24, 20, 8, 6, 28, 9, 0), (16, 'Shadow Raven', 24, 18, 7, 6, 26, 9, 1),
(18, 'Frost Raven', 26, 20, 8, 7, 30, 10, 0), (17, 'Ghost', 24, 20, 8, 6, 28, 9, 0),
(19, 'Rogue Scorpion', 28, 22, 9, 7, 32, 11, 0), (18, 'Frost Raven', 26, 20, 8, 7, 30, 10, 0),
(20, 'Ghoul', 29, 24, 9, 7, 34, 11, 0), (19, 'Rogue Scorpion', 28, 22, 9, 7, 32, 11, 0),
(21, 'Magician', 30, 24, 10, 8, 36, 12, 0), (20, 'Ghoul', 29, 24, 9, 7, 34, 11, 0),
(22, 'Rogue', 30, 25, 12, 8, 40, 13, 0), (21, 'Magician', 30, 24, 10, 8, 36, 12, 0),
(23, 'Drakefin', 32, 26, 12, 8, 40, 13, 0), (22, 'Rogue', 30, 25, 12, 8, 40, 13, 0),
(24, 'Shimmer', 32, 26, 14, 8, 45, 15, 1), (23, 'Drakefin', 32, 26, 12, 8, 40, 13, 0),
(25, 'Fire Raven', 34, 28, 14, 9, 45, 15, 0), (24, 'Shimmer', 32, 26, 14, 8, 45, 15, 1),
(26, 'Dybbuk', 34, 28, 14, 9, 50, 17, 0), (25, 'Fire Raven', 34, 28, 14, 9, 45, 15, 0),
(27, 'Knave', 36, 30, 15, 9, 52, 17, 0), (26, 'Dybbuk', 34, 28, 14, 9, 50, 17, 0),
(28, 'Goblin', 36, 30, 15, 10, 54, 18, 0), (27, 'Knave', 36, 30, 15, 9, 52, 17, 0),
(29, 'Skeleton', 38, 30, 18, 10, 58, 19, 0), (28, 'Goblin', 36, 30, 15, 10, 54, 18, 0),
(30, 'Dark Slime', 38, 32, 18, 10, 62, 21, 0), (29, 'Skeleton', 38, 30, 18, 10, 58, 19, 0),
(31, 'Silver Scorpion', 30, 160, 350, 40, 63, 2000, 2), (30, 'Dark Slime', 38, 32, 18, 10, 62, 21, 0),
(32, 'Mirage', 40, 32, 20, 11, 64, 21, 1), (31, 'Silver Scorpion', 30, 160, 350, 40, 63, 2000, 2),
(33, 'Sorceror', 41, 33, 22, 11, 68, 23, 0), (32, 'Mirage', 40, 32, 20, 11, 64, 21, 1),
(34, 'Imp', 42, 34, 22, 12, 70, 23, 0), (33, 'Sorceror', 41, 33, 22, 11, 68, 23, 0),
(35, 'Nymph', 43, 35, 22, 12, 70, 23, 0), (34, 'Imp', 42, 34, 22, 12, 70, 23, 0),
(36, 'Scoundrel', 43, 35, 22, 12, 75, 25, 0), (35, 'Nymph', 43, 35, 22, 12, 70, 23, 0),
(37, 'Megaskeleton', 44, 36, 24, 13, 78, 26, 0), (36, 'Scoundrel', 43, 35, 22, 12, 75, 25, 0),
(38, 'Grey Wolf', 44, 36, 24, 13, 82, 27, 0), (37, 'Megaskeleton', 44, 36, 24, 13, 78, 26, 0),
(39, 'Phantom', 46, 38, 24, 14, 85, 28, 1), (38, 'Grey Wolf', 44, 36, 24, 13, 82, 27, 0),
(40, 'Specter', 46, 38, 24, 14, 90, 30, 0), (39, 'Phantom', 46, 38, 24, 14, 85, 28, 1),
(41, 'Dark Scorpion', 48, 40, 26, 15, 95, 32, 1), (40, 'Specter', 46, 38, 24, 14, 90, 30, 0),
(42, 'Warlock', 48, 40, 26, 15, 100, 33, 1), (41, 'Dark Scorpion', 48, 40, 26, 15, 95, 32, 1),
(43, 'Orc', 49, 42, 28, 15, 104, 35, 0), (42, 'Warlock', 48, 40, 26, 15, 100, 33, 1),
(44, 'Sylph', 49, 42, 28, 15, 106, 35, 0), (43, 'Orc', 49, 42, 28, 15, 104, 35, 0),
(45, 'Wraith', 50, 45, 30, 16, 108, 36, 0), (44, 'Sylph', 49, 42, 28, 15, 106, 35, 0),
(46, 'Hellion', 50, 45, 30, 16, 110, 37, 0), (45, 'Wraith', 50, 45, 30, 16, 108, 36, 0),
(47, 'Bandit', 52, 45, 30, 16, 114, 38, 0), (46, 'Hellion', 50, 45, 30, 16, 110, 37, 0),
(48, 'Ultraskeleton', 52, 46, 32, 16, 116, 39, 0), (47, 'Bandit', 52, 45, 30, 16, 114, 38, 0),
(49, 'Dark Wolf', 54, 47, 36, 17, 120, 40, 1), (48, 'Ultraskeleton', 52, 46, 32, 16, 116, 39, 0),
(50, 'Troll', 56, 48, 36, 17, 120, 40, 0), (49, 'Dark Wolf', 54, 47, 36, 17, 120, 40, 1),
(51, 'Werewolf', 56, 48, 38, 17, 124, 41, 0), (50, 'Troll', 56, 48, 36, 17, 120, 40, 0),
(52, 'Hellcat', 58, 50, 38, 18, 128, 43, 0), (51, 'Werewolf', 56, 48, 38, 17, 124, 41, 0),
(53, 'Spirit', 58, 50, 38, 18, 132, 44, 0), (52, 'Hellcat', 58, 50, 38, 18, 128, 43, 0),
(54, 'Nisse', 60, 52, 40, 19, 132, 44, 0), (53, 'Spirit', 58, 50, 38, 18, 132, 44, 0),
(55, 'Dawk', 60, 54, 40, 19, 136, 45, 0), (54, 'Nisse', 60, 52, 40, 19, 132, 44, 0),
(56, 'Figment', 64, 55, 42, 19, 140, 47, 1), (55, 'Dawk', 60, 54, 40, 19, 136, 45, 0),
(57, 'Hellhound', 66, 56, 44, 20, 140, 47, 0), (56, 'Figment', 64, 55, 42, 19, 140, 47, 1),
(58, 'Wizard', 66, 56, 44, 20, 144, 48, 0), (57, 'Hellhound', 66, 56, 44, 20, 140, 47, 0),
(59, 'Uruk', 68, 58, 44, 20, 146, 49, 0), (58, 'Wizard', 66, 56, 44, 20, 144, 48, 0),
(60, 'Siren', 68, 400, 800, 50, 10000, 50, 2), (59, 'Uruk', 68, 58, 44, 20, 146, 49, 0),
(61, 'Megawraith', 70, 60, 46, 21, 155, 52, 0), (60, 'Siren', 68, 400, 800, 50, 10000, 50, 2),
(62, 'Dawkin', 70, 60, 46, 21, 155, 52, 0), (61, 'Megawraith', 70, 60, 46, 21, 155, 52, 0),
(63, 'Grey Bear', 70, 62, 48, 21, 160, 53, 0), (62, 'Dawkin', 70, 60, 46, 21, 155, 52, 0),
(64, 'Haunt', 72, 62, 48, 22, 160, 53, 0), (63, 'Grey Bear', 70, 62, 48, 21, 160, 53, 0),
(65, 'Hellbeast', 74, 64, 50, 22, 165, 55, 0), (64, 'Haunt', 72, 62, 48, 22, 160, 53, 0),
(66, 'Fear', 76, 66, 52, 23, 165, 55, 0), (65, 'Hellbeast', 74, 64, 50, 22, 165, 55, 0),
(67, 'Beast', 76, 66, 52, 23, 170, 57, 0), (66, 'Fear', 76, 66, 52, 23, 165, 55, 0),
(68, 'Ogre', 78, 68, 54, 23, 170, 57, 0), (67, 'Beast', 76, 66, 52, 23, 170, 57, 0),
(69, 'Dark Bear', 80, 70, 56, 24, 175, 58, 1), (68, 'Ogre', 78, 68, 54, 23, 170, 57, 0),
(70, 'Fire', 80, 72, 56, 24, 175, 58, 0), (69, 'Dark Bear', 80, 70, 56, 24, 175, 58, 1),
(71, 'Polgergeist', 84, 74, 58, 25, 180, 60, 0), (70, 'Fire', 80, 72, 56, 24, 175, 58, 0),
(72, 'Fright', 86, 76, 58, 25, 180, 60, 0), (71, 'Polgergeist', 84, 74, 58, 25, 180, 60, 0),
(73, 'Lycan', 88, 78, 60, 25, 185, 62, 0), (72, 'Fright', 86, 76, 58, 25, 180, 60, 0),
(74, 'Terra Elemental', 88, 80, 62, 25, 185, 62, 1), (73, 'Lycan', 88, 78, 60, 25, 185, 62, 0),
(75, 'Necromancer', 90, 80, 62, 26, 190, 63, 0), (74, 'Terra Elemental', 88, 80, 62, 25, 185, 62, 1),
(76, 'Ultrawraith', 90, 82, 64, 26, 190, 63, 0), (75, 'Necromancer', 90, 80, 62, 26, 190, 63, 0),
(77, 'Dawkor', 92, 82, 64, 26, 195, 65, 0), (76, 'Ultrawraith', 90, 82, 64, 26, 190, 63, 0),
(78, 'Werebear', 92, 84, 65, 26, 195, 65, 0), (77, 'Dawkor', 92, 82, 64, 26, 195, 65, 0),
(79, 'Brute', 94, 84, 65, 27, 200, 67, 0), (78, 'Werebear', 92, 84, 65, 26, 195, 65, 0),
(80, 'Large Beast', 96, 88, 66, 27, 200, 67, 0), (79, 'Brute', 94, 84, 65, 27, 200, 67, 0),
(81, 'Horror', 96, 88, 68, 27, 210, 70, 0), (80, 'Large Beast', 96, 88, 66, 27, 200, 67, 0),
(82, 'Flame', 100, 90, 70, 28, 210, 70, 0), (81, 'Horror', 96, 88, 68, 27, 210, 70, 0),
(83, 'Lycanthor', 100, 90, 70, 28, 210, 70, 0), (82, 'Flame', 100, 90, 70, 28, 210, 70, 0),
(84, 'Wyrm', 100, 92, 72, 28, 220, 73, 0), (83, 'Lycanthor', 100, 90, 70, 28, 210, 70, 0),
(85, 'Aero Elemental', 104, 94, 74, 29, 220, 73, 1), (84, 'Wyrm', 100, 92, 72, 28, 220, 73, 0),
(86, 'Dawkare', 106, 96, 76, 29, 220, 73, 0), (85, 'Aero Elemental', 104, 94, 74, 29, 220, 73, 1),
(87, 'Large Brute', 108, 98, 78, 29, 230, 77, 0), (86, 'Dawkare', 106, 96, 76, 29, 220, 73, 0),
(88, 'Frost Wyrm', 110, 100, 80, 30, 230, 77, 0), (87, 'Large Brute', 108, 98, 78, 29, 230, 77, 0),
(89, 'Knight', 110, 102, 80, 30, 240, 80, 0), (88, 'Frost Wyrm', 110, 100, 80, 30, 230, 77, 0),
(90, 'Lycanthra', 112, 104, 82, 30, 240, 80, 0), (89, 'Knight', 110, 102, 80, 30, 240, 80, 0),
(91, 'Terror', 115, 108, 84, 31, 250, 83, 0), (90, 'Lycanthra', 112, 104, 82, 30, 240, 80, 0),
(92, 'Blaze', 118, 108, 84, 31, 250, 83, 0), (91, 'Terror', 115, 108, 84, 31, 250, 83, 0),
(93, 'Aqua Elemental', 120, 110, 90, 31, 260, 87, 1), (92, 'Blaze', 118, 108, 84, 31, 250, 83, 0),
(94, 'Fire Wyrm', 120, 110, 90, 32, 260, 87, 0), (93, 'Aqua Elemental', 120, 110, 90, 31, 260, 87, 1),
(95, 'Lesser Wyvern', 122, 110, 92, 32, 270, 90, 0), (94, 'Fire Wyrm', 120, 110, 90, 32, 260, 87, 0),
(96, 'Doomer', 124, 112, 92, 32, 270, 90, 0), (95, 'Lesser Wyvern', 122, 110, 92, 32, 270, 90, 0),
(97, 'Armor Knight', 130, 115, 95, 33, 280, 93, 0), (96, 'Doomer', 124, 112, 92, 32, 270, 90, 0),
(98, 'Wyvern', 134, 120, 95, 33, 290, 97, 0), (97, 'Armor Knight', 130, 115, 95, 33, 280, 93, 0),
(99, 'Nightmare', 138, 125, 100, 33, 300, 100, 0), (98, 'Wyvern', 134, 120, 95, 33, 290, 97, 0),
(100, 'Fira Elemental', 140, 125, 100, 34, 310, 103, 1), (99, 'Nightmare', 138, 125, 100, 33, 300, 100, 0),
(101, 'Megadoomer', 140, 128, 105, 34, 320, 107, 0), (100, 'Fira Elemental', 140, 125, 100, 34, 310, 103, 1),
(102, 'Greater Wyvern', 145, 130, 105, 34, 335, 112, 0), (101, 'Megadoomer', 140, 128, 105, 34, 320, 107, 0),
(103, 'Advocate', 148, 132, 108, 35, 350, 117, 0), (102, 'Greater Wyvern', 145, 130, 105, 34, 335, 112, 0),
(104, 'Strong Knight', 150, 135, 110, 35, 365, 122, 0), (103, 'Advocate', 148, 132, 108, 35, 350, 117, 0),
(105, 'Liche', 150, 135, 110, 35, 380, 127, 0), (104, 'Strong Knight', 150, 135, 110, 35, 365, 122, 0),
(106, 'Ultradoomer', 155, 140, 115, 36, 395, 132, 0), (105, 'Liche', 150, 135, 110, 35, 380, 127, 0),
(107, 'Fanatic', 160, 140, 115, 36, 410, 137, 0), (106, 'Ultradoomer', 155, 140, 115, 36, 395, 132, 0),
(108, 'Green Dragon', 160, 140, 115, 36, 425, 142, 0), (107, 'Fanatic', 160, 140, 115, 36, 410, 137, 0),
(109, 'Fiend', 160, 145, 120, 37, 445, 148, 0), (108, 'Green Dragon', 160, 140, 115, 36, 425, 142, 0),
(110, 'Greatest Wyvern', 162, 150, 120, 37, 465, 155, 0), (109, 'Fiend', 160, 145, 120, 37, 445, 148, 0),
(111, 'Lesser Devil', 164, 150, 120, 37, 485, 162, 0), (110, 'Greatest Wyvern', 162, 150, 120, 37, 465, 155, 0),
(112, 'Liche Master', 168, 155, 125, 38, 505, 168, 0), (111, 'Lesser Devil', 164, 150, 120, 37, 485, 162, 0),
(113, 'Zealot', 168, 155, 125, 38, 530, 177, 0), (112, 'Liche Master', 168, 155, 125, 38, 505, 168, 0),
(114, 'Serafiend', 170, 155, 125, 38, 555, 185, 0), (113, 'Zealot', 168, 155, 125, 38, 530, 177, 0),
(115, 'Pale Knight', 175, 160, 130, 39, 580, 193, 0), (114, 'Serafiend', 170, 155, 125, 38, 555, 185, 0),
(116, 'Blue Dragon', 180, 160, 130, 39, 605, 202, 0), (115, 'Pale Knight', 175, 160, 130, 39, 580, 193, 0),
(117, 'Obsessive', 180, 160, 135, 40, 630, 210, 0), (116, 'Blue Dragon', 180, 160, 130, 39, 605, 202, 0),
(118, 'Devil', 184, 164, 135, 40, 666, 222, 0), (117, 'Obsessive', 180, 160, 135, 40, 630, 210, 0),
(119, 'Liche Prince', 190, 168, 138, 40, 660, 220, 0), (118, 'Devil', 184, 164, 135, 40, 666, 222, 0),
(120, 'Cherufiend', 195, 170, 140, 41, 690, 230, 0), (119, 'Liche Prince', 190, 168, 138, 40, 660, 220, 0),
(121, 'Red Dragon', 200, 180, 145, 41, 720, 240, 0), (120, 'Cherufiend', 195, 170, 140, 41, 690, 230, 0),
(122, 'Greater Devil', 200, 180, 145, 41, 750, 250, 0), (121, 'Red Dragon', 200, 180, 145, 41, 720, 240, 0),
(123, 'Renegade', 205, 185, 150, 42, 780, 260, 0), (122, 'Greater Devil', 200, 180, 145, 41, 750, 250, 0),
(124, 'Archfiend', 210, 190, 150, 42, 810, 270, 0), (123, 'Renegade', 205, 185, 150, 42, 780, 260, 0),
(125, 'Liche Lord', 210, 190, 155, 42, 850, 283, 0), (124, 'Archfiend', 210, 190, 150, 42, 810, 270, 0),
(126, 'Greatest Devil', 215, 195, 160, 43, 890, 297, 0), (125, 'Liche Lord', 210, 190, 155, 42, 850, 283, 0),
(127, 'Dark Knight', 220, 200, 160, 43, 930, 310, 0), (126, 'Greatest Devil', 215, 195, 160, 43, 890, 297, 0),
(128, 'Giant', 220, 200, 165, 43, 970, 323, 0), (127, 'Dark Knight', 220, 200, 160, 43, 930, 310, 0),
(129, 'Shadow Dragon', 225, 200, 170, 44, 1010, 337, 0), (128, 'Giant', 220, 200, 165, 43, 970, 323, 0),
(130, 'Liche King', 225, 205, 170, 44, 1050, 350, 0), (129, 'Shadow Dragon', 225, 200, 170, 44, 1010, 337, 0),
(131, 'Incubus', 230, 205, 175, 44, 1100, 367, 1), (130, 'Liche King', 225, 205, 170, 44, 1050, 350, 0),
(132, 'Traitor', 230, 205, 175, 45, 1150, 383, 0), (131, 'Incubus', 230, 205, 175, 44, 1100, 367, 1),
(133, 'Demon', 240, 210, 180, 45, 1200, 400, 0), (132, 'Traitor', 230, 205, 175, 45, 1150, 383, 0),
(134, 'Dark Dragon', 245, 215, 180, 45, 1250, 417, 1), (133, 'Demon', 240, 210, 180, 45, 1200, 400, 0),
(135, 'Insurgent', 250, 220, 190, 46, 1300, 433, 0), (134, 'Dark Dragon', 245, 215, 180, 45, 1250, 417, 1),
(136, 'Leviathan', 255, 225, 190, 46, 1350, 450, 0), (135, 'Insurgent', 250, 220, 190, 46, 1300, 433, 0),
(137, 'Grey Daemon', 260, 230, 190, 46, 1400, 467, 0), (136, 'Leviathan', 255, 225, 190, 46, 1350, 450, 0),
(138, 'Succubus', 265, 240, 200, 47, 1460, 487, 1), (137, 'Grey Daemon', 260, 230, 190, 46, 1400, 467, 0),
(139, 'Demon Prince', 270, 240, 200, 47, 1520, 507, 0), (138, 'Succubus', 265, 240, 200, 47, 1460, 487, 1),
(140, 'Black Dragon', 275, 250, 205, 47, 1580, 527, 1), (139, 'Demon Prince', 270, 240, 200, 47, 1520, 507, 0),
(141, 'Nihilist', 280, 250, 205, 47, 1640, 547, 0), (140, 'Black Dragon', 275, 250, 205, 47, 1580, 527, 1),
(142, 'Behemoth', 285, 260, 210, 48, 1700, 567, 0), (141, 'Nihilist', 280, 250, 205, 47, 1640, 547, 0),
(143, 'Demagogue', 290, 260, 210, 48, 1760, 587, 0), (142, 'Behemoth', 285, 260, 210, 48, 1700, 567, 0),
(144, 'Demon Lord', 300, 270, 220, 48, 1820, 607, 0), (143, 'Demagogue', 290, 260, 210, 48, 1760, 587, 0),
(145, 'Red Daemon', 310, 280, 230, 48, 1880, 627, 0), (144, 'Demon Lord', 300, 270, 220, 48, 1820, 607, 0),
(146, 'Colossus', 320, 300, 240, 49, 1940, 647, 0), (145, 'Red Daemon', 310, 280, 230, 48, 1880, 627, 0),
(147, 'Demon King', 330, 300, 250, 49, 2000, 667, 0), (146, 'Colossus', 320, 300, 240, 49, 1940, 647, 0),
(148, 'Dark Daemon', 340, 320, 260, 49, 2200, 733, 1), (147, 'Demon King', 330, 300, 250, 49, 2000, 667, 0),
(149, 'Titan', 360, 340, 270, 50, 2400, 800, 0), (148, 'Dark Daemon', 340, 320, 260, 49, 2200, 733, 1),
(150, 'Black Daemon', 400, 400, 280, 50, 3000, 1000, 1), (149, 'Titan', 360, 340, 270, 50, 2400, 800, 0),
(151, 'Lucifuge', 600, 600, 400, 50, 10000, 10000, 2); (150, 'Black Daemon', 400, 400, 280, 50, 3000, 1000, 1),
SQL); (151, 'Lucifuge', 600, 600, 400, 50, 10000, 10000, 2);
SQL);
echo $query === true ? 'Monsters table populated.<br>' : 'Error populating Monsters table.'; echo $query === true ? 'Monsters table populated.<br>' : 'Error populating Monsters table.';
}
$query = db()->exec(<<<SQL $query = db()->exec(<<<SQL
CREATE TABLE news ( CREATE TABLE news (
`id` INTEGER PRIMARY KEY AUTOINCREMENT, `id` INTEGER PRIMARY KEY AUTOINCREMENT,
`author` TEXT NOT NULL DEFAULT 'Guild Master',
`postdate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, `postdate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`content` TEXT NOT NULL `content` TEXT NOT NULL
); );
@ -512,7 +539,7 @@ function second()
echo $query === true ? 'News table created.<br>' : 'Error creating News table.'; echo $query === true ? 'News table created.<br>' : 'Error creating News table.';
$query = db()->exec("INSERT INTO news (content) VALUES ('This is the first news post. Please use the admin control panel to add another one and make this one go away.');"); $query = db()->exec("INSERT INTO news VALUES (1, '2004-01-01 12:00:00', 'This is the first news post. Please use the admin control panel to add another one and make this one go away.');");
echo $query === true ? 'News table populated.<br>' : 'Error populating News table.'; echo $query === true ? 'News table populated.<br>' : 'Error populating News table.';
@ -528,30 +555,32 @@ function second()
echo $query === true ? 'Spells table created.<br>' : 'Error creating Spells table.'; echo $query === true ? 'Spells table created.<br>' : 'Error creating Spells table.';
$query = db()->exec(<<<SQL if ($full) {
INSERT INTO spells VALUES $query = db()->exec(<<<SQL
(1, 'Heal', 5, 10, 1), INSERT INTO spells VALUES
(2, 'Revive', 10, 25, 1), (1, 'Heal', 5, 10, 1),
(3, 'Life', 25, 50, 1), (2, 'Revive', 10, 25, 1),
(4, 'Breath', 50, 100, 1), (3, 'Life', 25, 50, 1),
(5, 'Gaia', 75, 150, 1), (4, 'Breath', 50, 100, 1),
(6, 'Hurt', 5, 15, 2), (5, 'Gaia', 75, 150, 1),
(7, 'Pain', 12, 35, 2), (6, 'Hurt', 5, 15, 2),
(8, 'Maim', 25, 70, 2), (7, 'Pain', 12, 35, 2),
(9, 'Rend', 40, 100, 2), (8, 'Maim', 25, 70, 2),
(10, 'Chaos', 50, 130, 2), (9, 'Rend', 40, 100, 2),
(11, 'Sleep', 10, 5, 3), (10, 'Chaos', 50, 130, 2),
(12, 'Dream', 30, 9, 3), (11, 'Sleep', 10, 5, 3),
(13, 'Nightmare', 60, 13, 3), (12, 'Dream', 30, 9, 3),
(14, 'Craze', 10, 10, 4), (13, 'Nightmare', 60, 13, 3),
(15, 'Rage', 20, 25, 4), (14, 'Craze', 10, 10, 4),
(16, 'Fury', 30, 50, 4), (15, 'Rage', 20, 25, 4),
(17, 'Ward', 10, 10, 5), (16, 'Fury', 30, 50, 4),
(18, 'Fend', 20, 25, 5), (17, 'Ward', 10, 10, 5),
(19, 'Barrier', 30, 50, 5); (18, 'Fend', 20, 25, 5),
SQL); (19, 'Barrier', 30, 50, 5);
SQL);
echo $query === true ? 'Spells table populated.<br>' : 'Error populating Spells table.'; echo $query === true ? 'Spells table populated.<br>' : 'Error populating Spells table.';
}
$query = db()->exec(<<<SQL $query = db()->exec(<<<SQL
CREATE TABLE towns ( CREATE TABLE towns (
@ -568,19 +597,21 @@ function second()
echo $query === true ? 'Towns table created.<br>' : 'Error creating Towns table.'; echo $query === true ? 'Towns table created.<br>' : 'Error creating Towns table.';
$query = db()->exec(<<<SQL if ($full) {
INSERT INTO towns VALUES $query = db()->exec(<<<SQL
(1, 'Midworld', 0, 0, 5, 0, 0, '1,2,3,17,18,19,28,29'), INSERT INTO towns VALUES
(2, 'Roma', 30, 30, 10, 25, 5, '2,3,4,18,19,29'), (1, 'Midworld', 0, 0, 5, 0, 0, '1,2,3,17,18,19,28,29'),
(3, 'Bris', 70, -70, 25, 50, 15, '2,3,4,5,18,19,20,29.30'), (2, 'Roma', 30, 30, 10, 25, 5, '2,3,4,18,19,29'),
(4, 'Kalle', -100, 100, 40, 100, 30, '5,6,8,10,12,21,22,23,29,30'), (3, 'Bris', 70, -70, 25, 50, 15, '2,3,4,5,18,19,20,29.30'),
(5, 'Narcissa', -130, -130, 60, 500, 50, '4,7,9,11,13,21,22,23,29,30,31'), (4, 'Kalle', -100, 100, 40, 100, 30, '5,6,8,10,12,21,22,23,29,30'),
(6, 'Hambry', 170, 170, 90, 1000, 80, '10,11,12,13,14,23,24,30,31'), (5, 'Narcissa', -130, -130, 60, 500, 50, '4,7,9,11,13,21,22,23,29,30,31'),
(7, 'Gilead', 200, -200, 100, 3000, 110, '12,13,14,15,24,25,26,32'), (6, 'Hambry', 170, 170, 90, 1000, 80, '10,11,12,13,14,23,24,30,31'),
(8, 'Endworld', -250, -250, 125, 9000, 160, '16,27,33'); (7, 'Gilead', 200, -200, 100, 3000, 110, '12,13,14,15,24,25,26,32'),
SQL); (8, 'Endworld', -250, -250, 125, 9000, 160, '16,27,33');
SQL);
echo $query === true ? 'Towns table populated.<br>' : 'Error populating Towns table.'; echo $query === true ? 'Towns table populated.<br>' : 'Error populating Towns table.';
}
$query = db()->exec(<<<SQL $query = db()->exec(<<<SQL
CREATE TABLE users ( CREATE TABLE users (

View File

@ -2,10 +2,10 @@
// login.php :: Handles logins and cookies. // login.php :: Handles logins and cookies.
require_once '../src/lib.php';
if (!file_exists('../.installed')) redirect('install.php'); if (!file_exists('../.installed')) redirect('install.php');
require_once '../src/lib.php';
match ($_GET['do'] ?? 'login') { match ($_GET['do'] ?? 'login') {
'login' => login(), 'login' => login(),
'logout' => logout() 'logout' => logout()

View File

@ -2,10 +2,10 @@
// users.php :: Handles user account functions. // users.php :: Handles user account functions.
require_once '../src/lib.php';
if (!file_exists('../.installed')) redirect('install.php'); if (!file_exists('../.installed')) redirect('install.php');
require_once '../src/lib.php';
$controlrow = get_control_row(); $controlrow = get_control_row();
$do = $_GET['do'] ?? 'register'; $do = $_GET['do'] ?? 'register';

View File

@ -1,27 +1,26 @@
<?php <?php // fight.php :: Handles all fighting action.
// fight.php :: Handles all fighting action. function fight() { // One big long function that determines the outcome of the fight.
/** global $userrow, $controlrow;
* One big long function that determines the outcome of the fight. if ($userrow["currentaction"] != "Fighting") { display("Cheat attempt detected.<br><br>Get a life, loser.", "Error"); }
*/
function fight()
{
global $userrow;
if ($userrow["currentaction"] != "Fighting") display("Cheat attempt detected.<br><br>Get a life, loser.", "Error");
$pagearray = array(); $pagearray = array();
$playerisdead = 0; $playerisdead = 0;
$pagearray["magiclist"] = ""; $pagearray["magiclist"] = "";
$userspells = explode(",", $userrow["spells"]); $userspells = explode(",",$userrow["spells"]);
$spellquery = db()->query('SELECT id, name FROM spells ORDER BY id;'); $spellquery = doquery("SELECT id,name FROM {{table}}", "spells");
while ($spellrow = $spellquery->fetchArray(SQLITE3_ASSOC)) { while ($spellrow = mysql_fetch_array($spellquery)) {
$spell = false; $spell = false;
foreach ($userspells as $b) if ($b == $spellrow["id"]) $spell = true; foreach ($userspells as $a => $b) {
if ($spell == true) $pagearray["magiclist"] .= "<option value=\"".$spellrow["id"]."\">".$spellrow["name"]."</option>\n"; if ($b == $spellrow["id"]) { $spell = true; }
}
if ($spell == true) {
$pagearray["magiclist"] .= "<option value=\"".$spellrow["id"]."\">".$spellrow["name"]."</option>\n";
}
unset($spell); unset($spell);
} }
if ($pagearray["magiclist"] == "") $pagearray["magiclist"] = "<option value=\"0\">None</option>\n"; if ($pagearray["magiclist"] == "") { $pagearray["magiclist"] = "<option value=\"0\">None</option>\n"; }
$magiclist = $pagearray["magiclist"]; $magiclist = $pagearray["magiclist"];
$chancetoswingfirst = 1; $chancetoswingfirst = 1;
@ -38,9 +37,8 @@ function fight()
// Pick a monster. // Pick a monster.
$monsterrow = db()->query('SELECT * FROM monsters WHERE level >= ? AND level <= ? ORDER BY RANDOM() LIMIT 1;', [ $monsterquery = doquery("SELECT * FROM {{table}} WHERE level>='$minlevel' AND level<='$maxlevel' ORDER BY RAND() LIMIT 1", "monsters");
$minlevel, $maxlevel $monsterrow = mysql_fetch_array($monsterquery);
])->fetchArray(SQLITE3_ASSOC);
$userrow["currentmonster"] = $monsterrow["id"]; $userrow["currentmonster"] = $monsterrow["id"];
$userrow["currentmonsterhp"] = rand((($monsterrow["maxhp"]/5)*4),$monsterrow["maxhp"]); $userrow["currentmonsterhp"] = rand((($monsterrow["maxhp"]/5)*4),$monsterrow["maxhp"]);
$userrow["currentmonstersleep"] = 0; $userrow["currentmonstersleep"] = 0;
@ -51,10 +49,12 @@ function fight()
unset($monsterquery); unset($monsterquery);
unset($monsterrow); unset($monsterrow);
} }
// Next, get the monster statistics. // Next, get the monster statistics.
$monsterrow = get_monster($userrow['currentmonster']); $monsterquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["currentmonster"]."' LIMIT 1", "monsters");
$monsterrow = mysql_fetch_array($monsterquery);
$pagearray["monstername"] = $monsterrow["name"]; $pagearray["monstername"] = $monsterrow["name"];
// Do run stuff. // Do run stuff.
@ -96,16 +96,15 @@ function fight()
if ($userrow["currenthp"] <= 0) { if ($userrow["currenthp"] <= 0) {
$newgold = ceil($userrow["gold"]/2); $newgold = ceil($userrow["gold"]/2);
$newhp = ceil($userrow["maxhp"]/4); $newhp = ceil($userrow["maxhp"]/4);
db()->query("UPDATE users SET currenthp=?, currentaction='In Town', currentmonster=0, currentmonsterhp=0, currentmonstersleep=0, currentmonsterimmune=0, currentfight=0, latitude=0, longitude=0, gold=? WHERE id=?;", [ $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
$newhp, $newgold, $userrow['id']
]);
$playerisdead = 1; $playerisdead = 1;
} }
} }
} }
db()->query("UPDATE users SET currentaction='Exploring' WHERE id=?;", [$userrow['id']]); $updatequery = doquery("UPDATE {{table}} SET currentaction='Exploring' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
redirect('index.php'); header("Location: index.php");
die();
// Do fight stuff. // Do fight stuff.
} elseif (isset($_POST["fight"])) { } elseif (isset($_POST["fight"])) {
@ -131,8 +130,9 @@ function fight()
$userrow["currentmonsterhp"] -= $monsterdamage; $userrow["currentmonsterhp"] -= $monsterdamage;
$pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br><br>"; $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br><br>";
if ($userrow["currentmonsterhp"] <= 0) { if ($userrow["currentmonsterhp"] <= 0) {
db()->query('UPDATE users SET currentmonsterhp=0 WHERE id=?;', [$userrow['id']]); $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
redirect('index.php?do=victory'); header("Location: index.php?do=victory");
die();
} }
// Monster's turn. // Monster's turn.
@ -166,10 +166,8 @@ function fight()
if ($userrow["currenthp"] <= 0) { if ($userrow["currenthp"] <= 0) {
$newgold = ceil($userrow["gold"]/2); $newgold = ceil($userrow["gold"]/2);
$newhp = ceil($userrow["maxhp"]/4); $newhp = ceil($userrow["maxhp"]/4);
db()->query("UPDATE users SET currenthp=?, currentaction='In Town', currentmonster=0, currentmonsterhp=0, currentmonstersleep=0, currentmonsterimmune=0, currentfight=0, latitude=0, longitude=0, gold=? WHERE id=?;", [ $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
$newhp, $newgold, $userrow['id'] $playerisdead = 1;
]);
$playerisdead = 1;
} }
} }
@ -180,7 +178,8 @@ function fight()
$pickedspell = $_POST["userspell"]; $pickedspell = $_POST["userspell"];
if ($pickedspell == 0) { display("You must select a spell first. Please go back and try again.", "Error"); die(); } if ($pickedspell == 0) { display("You must select a spell first. Please go back and try again.", "Error"); die(); }
$newspellrow = get_spell($pickedspell); $newspellquery = doquery("SELECT * FROM {{table}} WHERE id='$pickedspell' LIMIT 1", "spells");
$newspellrow = mysql_fetch_array($newspellquery);
$spell = false; $spell = false;
foreach($userspells as $a => $b) { foreach($userspells as $a => $b) {
if ($b == $pickedspell) { $spell = true; } if ($b == $pickedspell) { $spell = true; }
@ -223,10 +222,9 @@ function fight()
$pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br><br>"; $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br><br>";
if ($userrow["currentmonsterhp"] <= 0) { if ($userrow["currentmonsterhp"] <= 0) {
db()->query('UPDATE users SET currentmonsterhp=0, currenthp=?, currentmp=? WHERE id=?;', [ $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0',currenthp='".$userrow["currenthp"]."',currentmp='".$userrow["currentmp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
$userrow['currenthp'], $userrow['currentmp'], $userrow['id'] header("Location: index.php?do=victory");
]); die();
redirect('index.php?do=victory');
} }
// Monster's turn. // Monster's turn.
@ -260,10 +258,8 @@ function fight()
if ($userrow["currenthp"] <= 0) { if ($userrow["currenthp"] <= 0) {
$newgold = ceil($userrow["gold"]/2); $newgold = ceil($userrow["gold"]/2);
$newhp = ceil($userrow["maxhp"]/4); $newhp = ceil($userrow["maxhp"]/4);
db()->query("UPDATE users SET currenthp=?, currentaction='In Town', currentmonster=0, currentmonsterhp=0, currentmonstersleep=0, currentmonsterimmune=0, currentfight=0, latitude=0, longitude=0, gold=? WHERE id=?;", [ $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
$newhp, $newgold, $userrow['id'] $playerisdead = 1;
]);
$playerisdead = 1;
} }
} }
@ -301,10 +297,8 @@ function fight()
if ($userrow["currenthp"] <= 0) { if ($userrow["currenthp"] <= 0) {
$newgold = ceil($userrow["gold"]/2); $newgold = ceil($userrow["gold"]/2);
$newhp = ceil($userrow["maxhp"]/4); $newhp = ceil($userrow["maxhp"]/4);
db()->query("UPDATE users SET currenthp=?, currentaction='In Town', currentmonster=0, currentmonsterhp=0, currentmonstersleep=0, currentmonsterimmune=0, currentfight=0, latitude=0, longitude=0, gold=? WHERE id=?;", [ $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
$newhp, $newgold, $userrow['id'] $playerisdead = 1;
]);
$playerisdead = 1;
} }
} }
@ -325,25 +319,26 @@ function fight()
$newhp = $userrow["currenthp"]; $newhp = $userrow["currenthp"];
$newmp = $userrow["currentmp"]; $newmp = $userrow["currentmp"];
if ($playerisdead != 1) { if ($playerisdead != 1) {
$pagearray["command"] = <<<HTML $pagearray["command"] = <<<END
Command?<br><br> Command?<br><br>
<form action="index.php?do=fight" method="post"> <form action="index.php?do=fight" method="post">
<input type="submit" name="fight" value="Fight" /><br><br> <input type="submit" name="fight" value="Fight" /><br><br>
<select name="userspell"><option value="0">Choose One</option>$magiclist</select> <input type="submit" name="spell" value="Spell" /><br><br> <select name="userspell"><option value="0">Choose One</option>$magiclist</select> <input type="submit" name="spell" value="Spell" /><br><br>
<input type="submit" name="run" value="Run" /><br><br> <input type="submit" name="run" value="Run" /><br><br>
</form> </form>
HTML; END;
$updatequery = doquery("UPDATE {{table}} SET currentaction='Fighting',currenthp='$newhp',currentmp='$newmp',currentfight='$newfight',currentmonster='$newmonster',currentmonsterhp='$newmonsterhp',currentmonstersleep='$newmonstersleep',currentmonsterimmune='$newmonsterimmune',currentuberdamage='$newuberdamage',currentuberdefense='$newuberdefense' WHERE id='".$userrow["id"]."' LIMIT 1", "users");
db()->query("UPDATE users SET currentaction='Fighting', currenthp=?, currentmp=?, currentfight=?, currentmonster=?, currentmonsterhp=?, currentmonstersleep=?, currentmonsterimmune=?, currentuberdamage=?, currentuberdefense=? WHERE id=?;", [ } else {
$newhp, $newmp, $newfight, $newmonster, $newmonsterhp, $newmonstersleep, $newmonsterimmune, $newuberdamage, $newuberdefense, $userrow['id'] $pagearray["command"] = "<b>You have died.</b><br><br>As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.<br><br>You may now continue back to <a href=\"index.php\">town</a>, and we hope you fair better next time.";
]); }
} else {
$pagearray["command"] = "<b>You have died.</b><br><br>As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.<br><br>You may now continue back to <a href=\"index.php\">town</a>, and we hope you fair better next time.";
}
// Finalize page and display it. // Finalize page and display it.
display(parsetemplate(gettemplate("fight"), $pagearray), "Fighting"); $template = gettemplate("fight");
$page = parsetemplate($template,$pagearray);
display($page, "Fighting");
} }
function victory() { function victory() {
@ -520,12 +515,12 @@ function drop() {
} }
function dead() function dead() {
{
return <<<HTML $page = "<b>You have died.</b><br><br>As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.<br><br>You may now continue back to <a href=\"index.php\">town</a>, and we hope you fair better next time.";
<b>You have died.</b><br><br>
As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points
to continue your journey.<br><br>
You may now continue back to <a href="index.php">town</a>, and we hope you fair better next time.
HTML;
} }
?>

View File

@ -66,14 +66,19 @@ function is_email($email) { // Thanks to "mail(at)philipp-louis.de" from php.net
} }
function makesafe($d) { function makesafe($d) {
return htmlentities($d);
$d = str_replace("\t","",$d);
$d = str_replace("<","&#60;",$d);
$d = str_replace(">","&#62;",$d);
$d = str_replace("\n","",$d);
$d = str_replace("|","??",$d);
$d = str_replace(" "," &nbsp;",$d);
return $d;
} }
/** function admindisplay($content, $title) { // Finalize page and output to browser.
* Finalize page and output to browser.
*/
function admindisplay($content, $title)
{
global $userrow, $controlrow; global $userrow, $controlrow;
if (!isset($controlrow)) { if (!isset($controlrow)) {
$query = db()->query('SELECT * FROM control WHERE id=1 LIMIT 1;'); $query = db()->query('SELECT * FROM control WHERE id=1 LIMIT 1;');
@ -287,16 +292,6 @@ function get_item(int $id): array|false
return $query->fetchArray(SQLITE3_ASSOC); return $query->fetchArray(SQLITE3_ASSOC);
} }
/**
* Get a drop by it's ID.
*/
function get_drop(int $id): array|false
{
$query = db()->query('SELECT * FROM drops WHERE id=? LIMIT 1;', [$id]);
if ($query === false) return false;
return $query->fetchArray(SQLITE3_ASSOC);
}
/** /**
* Get a spell by it's ID. * Get a spell by it's ID.
*/ */
@ -307,16 +302,6 @@ function get_spell(int $id): array|false
return $query->fetchArray(SQLITE3_ASSOC); return $query->fetchArray(SQLITE3_ASSOC);
} }
/**
* Get a monster by it's ID.
*/
function get_monster(int $id): array|false
{
$query = db()->query('SELECT * FROM monsters WHERE id=? LIMIT 1;', [$id]);
if ($query === false) return false;
return $query->fetchArray(SQLITE3_ASSOC);
}
/** /**
* Translate a Specials keyword to it's string. * Translate a Specials keyword to it's string.
*/ */

View File

@ -1,44 +1,40 @@
<?php <?php
$template = <<<HTML $template = <<<THEVERYENDOFYOU
<table width="100%"> <table width="100%">
<tr><td class="title"><img src="images/button_location.gif" alt="Location" title="Location" /></td></tr> <tr><td class="title"><img src="images/button_location.gif" alt="Location" title="Location" /></td></tr>
<tr><td> <tr><td>
Currently: {{currentaction}}<br> Currently: {{currentaction}}<br>
Latitude: {{latitude}}<br> Latitude: {{latitude}}<br>
Longitude: {{longitude}}<br> Longitude: {{longitude}}<br>
<a href="javascript:openmappopup()">View Map</a><br><br> <a href="javascript:openmappopup()">View Map</a><br><br>
<form action="index.php?do=move" method="post"> <form action="index.php?do=move" method="post">
<center> <center>
<input name="north" type="submit" value="North" /><br> <input name="north" type="submit" value="North" /><br>
<input name="west" type="submit" value="West" /><input name="east" type="submit" value="East" /><br> <input name="west" type="submit" value="West" /><input name="east" type="submit" value="East" /><br>
<input name="south" type="submit" value="South" /> <input name="south" type="submit" value="South" />
</center> </center>
</form> </form>
</td></tr> </td></tr>
</table> </table><br>
<br>
<table width="100%"> <table width="100%">
<tr><td class="title"><img src="images/button_towns.gif" alt="Towns" title="Towns" /></td></tr> <tr><td class="title"><img src="images/button_towns.gif" alt="Towns" title="Towns" /></td></tr>
<tr><td> <tr><td>
{{currenttown}} {{currenttown}}
Travel To:<br> Travel To:<br>
{{townslist}} {{townslist}}
</td></tr> </td></tr>
</table> </table><br>
<br>
<table width="100%"> <table width="100%">
<tr><td class="title"><img src="images/button_functions.gif" alt="Functions" title="Functions" /></td></tr> <tr><td class="title"><img src="images/button_functions.gif" alt="Functions" title="Functions" /></td></tr>
<tr><td> <tr><td>
<a href="/index.php">Home</a><br> {{forumslink}}
{{forumslink}} {{adminlink}}
{{adminlink}} <a href="users.php?do=changepassword">Change Password</a><br>
<a href="users.php?do=changepassword">Change Password</a><br> <a href="login.php?do=logout">Log Out</a><br>
<a href="login.php?do=logout">Log Out</a><br> <a href="help.php">Help</a>
<a href="help.php">Help</a> </td></tr>
</td></tr> </table><br>
</table> THEVERYENDOFYOU;
HTML; ?>