Esempio n. 1
0
    tBegin("Summon Item Amulets");
    $forest = $acc["forest"];
    $death = $acc["death"];
    $air = $acc["air"];
    $earth = $acc["earth"];
    $sql = "SELECT b.name, b.id, b.root, b.type FROM accbuildings AS ab, buildings AS b WHERE ab.building = b.id AND ab.account = '{$acc['id']}' GROUP BY b.id ORDER BY b.name ASC";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows == 0) {
        echo 'You haven\'t built any item buildings yet, so you can\'t summon any items.';
    } else {
        unset($array);
        while ($row = $db->fetch_array($result)) {
            $array[count($array)] = $row;
        }
        $rooted = gRootArray($array);
        $children = gGetChildrenArray($rooted);
        $sorted = gSortArray($children, "name", "ASC");
        echo 'Select a building from the list below to see all its items.<br><br>';
        tBegin();
        $switch = FALSE;
        for ($m = 0; $m < count($sorted); $m++) {
            $row = $sorted[$m];
            if ($row["type"] == 1) {
                if (!$switch) {
                    echo '<tr>';
                }
                echo '
					<td width="50%" align="center">
					<a href="index.php?page=spellbook&action=building&path=', $row["path"], '">', $row["name"], '</a>
					</td>
Esempio n. 2
0
function gGetCreatureMax($id)
{
    global $db, $gdCreatureMaxIncrement;
    $sql = "SELECT buildings.level, buildings.value, buildings.root, buildings.name, buildings.id FROM accbuildings, buildings WHERE buildings.type = '2' AND accbuildings.building = buildings.id AND accbuildings.account = '{$id}'";
    $result = $db->query($sql);
    while ($newrow = $db->fetch_array($result, MYSQL_ASSOC)) {
        $array[count($array)] = $newrow;
    }
    $rooted = gRootArray($array);
    $children = gGetChildrenArray($rooted);
    return $children[0]["value"] + $gdCreatureMaxIncrement;
}
Esempio n. 3
0
     for ($m = 0; $m < count($children); $m++) {
         echo $children[$m]["name"];
         if ($m < count($children) - 1) {
             echo ', ';
         }
     }
 }
 tEnd();
 // ****************************
 // *	Creature Max Buildings	*
 // ****************************
 tBegin("Creature Maximum Buildings");
 if (count($cmaxbuildings) == 0) {
     echo 'You don\'t have any creature maximum buildings yet.';
 } else {
     $rooted = gRootArray($cmaxbuildings);
     $children = gGetChildrenArray($rooted);
     echo $children[0]["name"], ' (maximum number of creatures allowed: ', $children[0]["value"] + $gdCreatureMaxIncrement, ')';
 }
 tEnd();
 // ******************
 // *	Build Buildings*
 // ******************
 tBegin("Build New Buildings");
 if (count($newbuildings) == 0) {
     echo '<font class="alert">You can\'t build any new buildings anymore. You have to gain character levels first.</font>';
 } else {
     // filter away not-rooted buildings
     $atleastone = FALSE;
     for ($m = 0; $m < count($newbuildings); $m++) {
         if ($newbuildings[$m]["root"] != 0 && $newbuildings[$m]["root"] != "") {