Esempio n. 1
0
			"<i>I am a Nether Creator. I magically create eggs which become creatures after being properly hatched.
			';
        echo 'If you give me an amulet and ', gdNetherEggBasePrice, ' kingdom resources, I will create such an egg for you.';
        echo '"</i><br><br>';
        fTitle("index.php?page=travel&action=usecreator");
        $sql = "SELECT a.id, c.name FROM amulets AS a, creatures AS c WHERE a.account = '{$acc['id']}' AND a.type = '0' AND a.target = c.id AND (c.type = 0 OR c.type = 1 OR c.type = 4 OR c.race=49 OR c.race=50 OR c.race=51 OR c.race=52) ORDER BY c.name ASC";
        $result = $db->query($sql);
        $numrows = $db->num_rows($result);
        if ($numrows == 0) {
            echo 'You don\'t have any amulets at the moment.<br>';
        } else {
            $array = array();
            while ($row = $db->fetch_array($result)) {
                $array[] = array("name" => $row["name"], "value" => $row["id"]);
            }
            fSelect("Amulet:", "amulet", $array);
        }
        fEnd("Buy Egg");
    }
}
if ($action == "scholar" && $scholarperc < 100) {
    echo 'When your enter the area, you notice that the nethers are enthousiasticly building the Nether Scholar Shop.
		<p>It is currently ' . $scholarperc . '% complete';
} elseif ($action == "scholar") {
    $open = gGetMisc("scholar");
    if ($open == 0) {
        echo 'The Nether Scholar shop is currently closed.<br>';
    } elseif ($open > 1) {
        echo 'The Nether Scholar is currently on vacation!<br>';
    } else {
        echo '
Esempio n. 2
0
        echo '<br>';
    }
    if ($numrows != 0) {
        if (!$acc["attacked"]) {
            echo '<br><a href="index.php?page=defense&action=removeallcreatures">Empty all defense slots.</a><br>';
        }
    }
    tEnd();
    tBegin("Create Defense Slot");
    if ($acc["attacked"]) {
        echo 'You can\'t create a defense slot while you are under attack.<br>';
    } else {
        echo 'Cost per defense slot level: ', $gdDefenseSlotCost, ' granite.';
        fTitle("index.php?page=defense&action=submitcreateslot");
        fText("Level:", "level", 1, 5);
        fSelect("Class:", "class", $gdClass);
        fEnd("Create");
    }
    tEnd();
    tBegin("Defense Slot Configuration");
    // defense slot configs
    echo '
		<a href="index.php?page=defense&action=slotconfigs">Use/modify defense slot configurations.</a><br>
		';
    tEnd();
    tBegin("Creature List");
    echo '<a href="index.php?page=defense&action=creaturelist">Click here</a> to see a list of your creatures and the defense slot level they need.</a><br>';
    tEnd();
    tBegin("Allied Defense");
    echo '
		<a href="index.php?page=defense&action=allieddefense">Click here</a> to see all the creatures of other kingdom inhabitants that are currently defending your castle.<br>
Esempio n. 3
0
    }
    fSelect("Enchantment:", "genchantment", $array, $default);
    unset($default);
    $array = array();
    $array[] = array("name" => "Any Quality", "value" => "ANY");
    if ($gquality == "ANY" || !isset($gquality)) {
        $default = 0;
    }
    for ($m = 0; $m < count($gdGemQuality); $m++) {
        $name = $gdGemQuality[$m]["name"];
        $array[] = array("name" => $name, "value" => $m);
        if (!isset($default) && $gquality == $m) {
            $default = count($array) - 1;
        }
    }
    fSelect("Quality:", "gquality", $array, $default);
    fEnd("Filter");
    tEnd();
}
// **********************
// *	Buildings		*
// **********************
include_once "actions/kd_hatcheries.php";
if ($action == "buildings") {
    // kingdom check
    if (is_null($acc[x]) && is_null($acc[y])) {
        $kingdom = $acc["kingdom"];
    } elseif ($acc["tkdrelation"] == 2) {
        $kingdom = $acc["tkd"];
    } else {
        die("Messing around?");
Esempio n. 4
0
 unset($array);
 while (list($key, $row) = each($gdGenders)) {
     if ($acc["gender"]["name"] == $row["name"]) {
         $default = count($array);
     }
     $array[count($array)] = $row;
     $array[count($array) - 1]["value"] = $key;
 }
 fRadio("Gender:", "gender", $array, $default);
 unset($array);
 for ($m = 0; $m < count($gdColorSettings); $m++) {
     if ($acc["colorsetting"] == $gdColorSettings[$m]["value"]) {
         $default = $m;
     }
 }
 fSelect("Color setting:", "colorsetting", $gdColorSettings, $default);
 fEnd("Change");
 tEnd();
 tBegin("Add a group");
 fTitle("index.php?page=options&action=addgroup");
 fText("Group name (max 10 characters):", "groupname", "", 20, false, 10);
 fEnd("Create group");
 tEnd();
 tBegin("Manage groups");
 $sql = "SELECT id, name FROM groups WHERE account = '{$acc['id']}' ORDER BY groups.order DESC, name";
 $result = $db->query($sql);
 while ($row = $db->fetch_array($result)) {
     echo $row["name"] . " (";
     echo '<a href="index.php?page=options&action=renamegroup&groupid=' . $row["id"] . '">Rename</a>';
     echo ", ";
     echo '<a href="index.php?page=options&action=removegroup&groupid=' . $row["id"] . '">Remove</a>';
Esempio n. 5
0
        $row["name"] = $gdItemEnchantments[$row["value"]]["name"];
        $array[] = $row;
        if (isset($enchantment) && $enchantment == $row["value"]) {
            $default = $i;
        }
        $i++;
    }
    if ($numrows == 0) {
        echo 'You haven\'t learned any enchantments yet.<br>';
    } else {
        if (isset($aiid)) {
            fTitle("index.php?page=items&action=submitenchant&aiid={$aiid}");
        } else {
            fTitle("index.php?page=items&action=submitenchant&amid={$amid}");
        }
        fSelect("Enchantment:", "enchantment", $array, $default);
        fText("Brimstone:", "brimstone", $brimstone > 0 ? "{$brimstone}" : "0");
        fText("Crystal:", "crystal", $crystal > 0 ? "{$crystal}" : "0");
        fText("Essence:", "essence", $essence > 0 ? "{$essence}" : "0");
        fText("Granite:", "granite", $granite > 0 ? "{$granite}" : "0");
        fText("Creature race:", "race", $crace > 0 ? "{$crace}" : "");
        fEnd("Add resources");
    }
}
if ($action == "usepackage") {
    $no = 0;
    if ($acc["attacked"]) {
        echo 'You can\'t use a package while under attack.<br>';
        $no = 1;
    }
    $sql = "LOCK TABLES packages WRITE, accounts WRITE";
Esempio n. 6
0
        } else {
            echo 'Topic is private now!<br><br><br>';
        }
        $action = "readtopic";
    }
}
if ($action == "violation") {
    echo 'Please choose the reason:<br>';
    $sql = "SELECT id, subject, days FROM violations ORDER BY subject ASC";
    $result = $db->query($sql);
    fTitle("index.php?page=kingdom&action=submitviolation&aid={$aid}");
    $array = array();
    while ($row = $db->fetch_array($result)) {
        $array[] = array("name" => "{$row['subject']} ({$row['days']} days)", "value" => $row["id"]);
    }
    fSelect("Violation:", "violation", $array);
    fText("Optional note:", "note");
    fEnd("Ban");
}
if ($action == "submitviolation") {
    $no = 0;
    if (!$violation || !$aid || !in_array($acc["id"], $moderators)) {
        echo 'Invalid data.<br>';
        $no = 1;
    } else {
        $sql = "SELECT subject, text, days FROM violations WHERE id = '{$violation}'";
        $result = $db->query($sql);
        $numrows = $db->num_rows($result);
        if ($numrows != 1) {
            echo 'Invalid violation.<br>';
            $no = 1;
Esempio n. 7
0
    $sql = "SELECT * FROM buildings ORDER BY name ASC";
    $result = $db->query($sql);
    $array[0] = array("name" => "No Root", "value" => 0);
    $m = 1;
    while ($newrow = $db->fetch_array($result)) {
        $array[$m]["name"] = $newrow["name"];
        $array[$m]["value"] = $newrow["id"];
        if ($row["root"] == $newrow["id"]) {
            $default = $m;
        }
        $m++;
    }
    if ($row["root"] == "") {
        $default = 0;
    }
    fSelect("Root:", "root", $array, $default);
    fText("Value:", "value", $row["value"]);
    fEnd("Change");
}
if ($action == "submitchangebuilding") {
    $no = 0;
    if (!$name || !$granite || !$level || !$bid) {
        echo 'Data is incomplete.';
        $no = 1;
    }
    if (!$type) {
        $type = 0;
    }
    if (!$value) {
        $value = 0;
    }
Esempio n. 8
0
                }
                // stolen
                if ($type == "stolen") {
                    $description = "Enchanted creatures will steal more.";
                }
                $row = array("value" => $m, "name" => $gdGemSpells[$m]["name"] . ' Enchantment: ' . $description);
                $array[] = $row;
            }
        }
        if (!$found) {
            echo 'Your kingdom level is too low to cast gem spells.<br>';
        } else {
            echo 'Please choose the spell and the name of the creature you want to cast the wave enchant on. You can only place one wave enchant on each wave, so choose your creature carefully.<br>';
            fTitle("index.php?page=kingdom&action=castenchantment2&kdbid={$kdbid}&wave={$wave}");
            fText("Creature Name:", "creaturename");
            fSelect("Gem Spell:", "gemspell", $array);
            fEnd("Continue");
        }
    }
}
if ($action == "castenchantment2") {
    $no = 0;
    $sql = "SELECT {$gdTravelChallengeCreatureSelect} FROM creatures AS c, races AS r, summons AS s, accounts AS a WHERE c.name = '{$creaturename}' AND c.race = r.id AND s.creature = c.id AND s.account = a.id AND a.kingdom = '{$acc['kingdom']}'";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows == 0) {
        echo 'You don\'t have such a creature in your kingdom!<br>You need to have at least one creature of the type you are about to cast a spell on in your kingdom.<br>';
        $no = 1;
    } else {
        $row = $db->fetch_array($result);
        $creature = new creature($row);
Esempio n. 9
0
    tBegin("Add warlord");
    if (count($accounts) == 0) {
        echo 'There are no mages in the kingdom that are not already a leader.<br>';
    } else {
        fTitle("index.php?page=kingdom&action=submitaddleader");
        fSelect("Mage:", "aid", $accounts);
        fEnd("Make Warlord");
    }
    tEnd();
    tBegin("Change King");
    echo '<font class="alert">Warning: after making someone else king, you will become a normal inhabitant and won\'t be able to appoint new leaders. This change can not be undone, so think carefully before appointing a new king!</font><br><br>';
    if (count($accounts) + count($warlords) == 0) {
        echo 'There are no other mages in the kingdom.<br>';
    } else {
        fTitle("index.php?page=kingdom&action=submitchangeking");
        fSelect("Mage:", "aid", $total);
        fEnd("Make King");
    }
    tEnd();
}
if ($action == "removeleader") {
    $no = 0;
    if ($acc["leadertype"] != 2) {
        echo 'You are not the king.<br>';
        $no = 1;
    } else {
        if (!$aid) {
            echo 'Invalid data.<br>';
            $no = 1;
        } else {
            $sql = "SELECT id FROM accounts WHERE id = '{$aid}' AND leadertype != '0' AND kingdom = '{$acc['kingdom']}' AND id != '{$acc['id']}'";
Esempio n. 10
0
    $sql = "SELECT id, name FROM signs WHERE type='mage' ORDER BY name";
    $result = $db->query($sql);
    while ($sign = $db->fetch_array($result)) {
        $array[] = array("name" => $sign["name"], "value" => $sign["id"]);
    }
    if ($acc["level"] >= gdArcaneLevelMin) {
        fSelect("Birthsign gem:", "bsgem", $array);
    } else {
        echo '<input type="hidden" name="bsgem" value="0"/>';
    }
    $array = array();
    $array[0] = array("name" => "Any", "value" => 0);
    for ($m = 0; $m < count($gdClass); $m++) {
        $array[] = $gdClass[$m];
    }
    fSelect("Class:", "class", $array);
    fEnd("Find Suitable Target");
    tEnd();
    tBegin("Ignore List");
    echo '<a href="index.php?page=playerinfo&action=ignorelist">View ignore list.</a><br>';
    tEnd();
}
if ($action == "ignorelist") {
    $sql = "SELECT a.id, a.name FROM accounts AS a, ignores AS i WHERE i.account = '{$acc['id']}' AND i.target = a.id";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows == 0) {
        echo 'You are ignoring no one right now.<br>';
        $no = 1;
    } else {
        while ($row = $db->fetch_array($result)) {
Esempio n. 11
0
    $result = $db->query($sql);
    $row = $db->fetch_array($result);
    fTitle("index.php?page=character&action=submitchangetutorial&tid=" . $row["id"]);
    fText("Topic:", "topic", $row["topic"]);
    $sql = "SELECT topic, id FROM tutorial ORDER BY id ASC";
    $result = $db->query($sql);
    unset($array);
    $array[0] = array("name" => "no parent", "value" => 0);
    while ($newrow = $db->fetch_array($result)) {
        $array[count($array)]["name"] = $newrow["topic"];
        $array[count($array) - 1]["value"] = $newrow["id"];
        if ($row["parent"] == $newrow["id"]) {
            $default = count($array) - 1;
        }
    }
    fSelect("Parent:", "parent", $array, $default);
    fTextarea("Text:", "text", $row["text"]);
    fEnd("Change");
}
if ($action == "submitchangetutorial") {
    $no = 0;
    if (!$topic || !$text) {
        echo 'Data is incomplete.';
        $no = 1;
    }
    if (!$parent) {
        $parent = 0;
    }
    $sql = "SELECT * FROM tutorial WHERE id = '{$tid}'";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
Esempio n. 12
0
if ($action == "deleteshard2") {
    $sql = "DELETE FROM shards WHERE id = '{$shid}'";
    $result = $db->query($sql);
    echo 'Shard deleted.';
}
if ($action == "changeshard") {
    $sql = "SELECT * FROM shards WHERE id = '{$shid}'";
    $result = $db->query($sql);
    $row = $db->fetch_array($result);
    fTitle("index.php?page=spellbook&action=submitchangeshard&shid=" . $row["id"]);
    fText("Name:", "name", $row["name"]);
    for ($m = count($gdClass); $m > 0; $m--) {
        $fgdClass[$m] = $gdClass[$m - 1];
    }
    $fgdClass[0] = array("value" => 0, "name" => "No Class");
    fSelect("Class:", "class", $fgdClass, $row["class"]);
    fText("Poweritem level requirement:", "level", $row["level"]);
    fText("Pool:", "pool", $row["pool"]);
    fEnd("Change");
}
if ($action == "submitchangeshard") {
    $no = 0;
    if (!$name || !$level) {
        echo 'Data is incomplete.';
        $no = 1;
    }
    if (!$class) {
        $class = 0;
    }
    $sql = "SELECT id FROM shards WHERE name = '{$name}'";
    $result = $db->query($sql);