コード例 #1
0
 } else {
     foreach ($curses as $curse) {
         $timeleft = gCalcTimeDif($curse["time"], time());
         if ($curse["status"] == 1) {
             $display = "mage is in vacation mode";
         } elseif (!$timeleft) {
             $display = "no time left";
         } else {
             $display = $timeleft["days"] . ' days, ' . $timeleft["hours"] . ' hours, ' . $timeleft["minutes"] . ' minutes left';
         }
         echo $curse["cursename"], ' on <a href="index.php?page=playerinfo&action=viewinfo&aid=', $curse["aid"], '">', $curse["aname"], '</a>: ', $gdCurses[$curse["curse"]]["description"], ' (', $curse["shards"], ' active shards left, ', $display, ', <a href="index.php?page=spellbook&action=removecurse&cuid=', $curse["id"], '">try to remove curse</a>)<br>';
     }
 }
 tEnd();
 $array = array();
 tBegin("Enemy Curses");
 $removeall = FALSE;
 // curse on you
 if ($acc["castcurse"] != 0) {
     $sql = "SELECT ca.*, a.id AS aid, a.name AS aname FROM castcurses AS ca, accounts AS a WHERE ca.id = '{$acc['castcurse']}' AND ca.account = a.id";
     $result = $db->query($sql);
     while ($row = $db->fetch_array($result)) {
         $row["cursename"] = $gdCurses[$row["curse"]]["name"];
         $row["url"] = "index.php?page=spellbook&action=castcurse&type=dispell&tid={$acc['id']}&target=mage&cid=0";
         $array[] = $row;
     }
 }
 // curse on one of your creatures
 $sql = "SELECT ca.*, a.id AS aid, a.name AS aname, c.name AS creaturename, s.id AS sid, c.id AS cid FROM castcurses AS ca, summons AS s, creatures AS c, accounts AS a WHERE s.account = '{$acc['id']}' AND s.castcurse != '0' AND s.castcurse = ca.id AND s.creature = c.id AND ca.account = a.id";
 $result = $db->query($sql);
 while ($row = $db->fetch_array($result)) {
コード例 #2
0
ファイル: amulets.php プロジェクト: KristofMols/castlequest2
            }
            // cost text
            $cost = $creature->ability["brimstone"] . " brimstone, " . $creature->ability["crystal"] . " crystal, " . $creature->ability["essence"] . " essence";
            // race only item
            if ($row["race"] != 0) {
                $raceonly = "<br>This item can only be used by {$row['racename']} creatures.";
            }
            tBegin('
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				<td width="25%">
				' . $count . '' . $row["name"] . ' Amulet' . $multiple . '
				</td>
				<td width="25%" align="center">
				' . $addon . '
				</td>
				<td width="35%" align="center">
				' . $cost . '
				</td>
				<td width="15%" align="center">
				<a href="index.php?page=amulets&action=use&amid=' . $row["amid"] . '' . $use . '">use</a>, ' . $enchant . ', <a href="index.php?page=amulets&action=sacrifice&amid=' . $row["amid"] . '' . $use . '">sacrifice</a>
				</td>
				</tr>
				</table>
				');
            echo '
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				<td colspan="3">
				', $creature->ability["description"], '
				', $raceonly, '
				', $upgrade, '
コード例 #3
0
     echo 'You can learn special skills when you are level ', gdSkillLevelMin, '.<br>';
 } else {
     echo '<a href="index.php?page=character&action=skills">View your skill tree.</a><br>';
 }
 echo '<a href="index.php?page=character&action=tree">View the complete skill tree.</a><br>';
 tEnd();
 tBegin("Private Notes (<a href=\"index.php?page=character&action=changeprivate\">change</a>)");
 echo gTags($acc["private"]);
 tEnd();
 tBegin("Personal Info (<a href=\"index.php?page=character&action=changeinfo\">change</a>)");
 echo gTags($acc["info"]);
 tEnd();
 tBegin("Kingdom History");
 echo '<a href="index.php?page=playerinfo&action=kingdomhistory&aid=', $acc["id"], '">View your kingdom history.</a><br>';
 tEnd();
 tBegin("Income");
 $sum = 0;
 $types = array("Brimstone", "Crystal", "Essence", "Granite");
 $shorttypes = array("b", "c", "e", "g");
 for ($m = 0; $m < 4; $m++) {
     $type = $shorttypes[$m] . "_workers";
     // calculate worker bonus
     $bonusval = 1;
     foreach ($gdWorkerBonus as $val => $bonus) {
         if ($acc[$type] >= $val) {
             $bonusval = $bonus;
         }
     }
     // calculate income
     $income = round($acc[$type] * gdWorkerIncome * $bonusval);
     echo $types[$m], ' Income: ', $income, ' ', strtolower($types[$m]), ' / hour<br>';
コード例 #4
0
				</td>
				<td width="45%" align="center">
				';
            if ($fnewbuildings[$m]["type"] == 2) {
                echo 'increases creature maximum to ', $fnewbuildings[$m]["value"] + $gdCreatureMaxIncrement;
            } else {
                echo $gdBuildingTypes[$fnewbuildings[$m]["type"]]["functionname"];
            }
            echo '
				</td>
				<td width="20%" align="center">
				', $fnewbuildings[$m]["granite"] * $gdBuildingCostMultiplier, ' granite
				</td>
				<td width="15%" align="center">
				<a href="index.php?page=buildings&action=constructbuilding&bid=', $fnewbuildings[$m]["id"], '">construct</a>
				</td>
				</tr>
				';
        }
        echo '</table>';
    }
    tEnd();
    // **********************
    // *	Arcane Chamber	*
    // **********************
    if ($acc["level"] >= gdArcaneLevelMin) {
        tBegin("Arcane Chamber");
        echo '<a href="index.php?page=playerinfo&action=arcanechamber&aid=', $acc["id"], '">Visit your arcane chamber.</a><br>';
        tEnd();
    }
}
コード例 #5
0
ファイル: rodia.php プロジェクト: KristofMols/castlequest2
<?php

topic("Rodia");
if (!$action) {
    tBegin("The Stonehenge Library: public area");
    echo '
		Rodia is the huge island you are living on.<br>
		A mountain range is separating the shores from the center of the land, called the Rodian plains.
		Right now you are in the library, located in the ruined city of Stonehenge. This improvised library contains all the information that was saved from New Surathil after the Nether rebellion.<br><br>
		
		The information on this page changes hourly.<br><br>
		
		<a href="index.php?page=rodia&action=statistics&age=1&pagenumber=1">Click here</a> for statistics about the Chaos Age.<br>
		<a href="index.php?page=rodia&action=statistics&age=2&pagenumber=1">Click here</a> for statistics about the Age of Recovery.<br>
		<a href="index.php?page=rodia&action=statistics&age=3&pagenumber=1">Click here</a> for statistics about the Itherian Age.<br>
		<a href="index.php?page=rodia&action=statistics&age=4&pagenumber=1">Click here</a> for statistics about the Age of Rebirth.<br>
		<a href="index.php?page=rodia&action=statistics&age=5&pagenumber=1">Click here</a> for statistics about the Age of Resurgence.<br>
		<a href="index.php?page=rodia&action=statistics&age=6&pagenumber=1">Click here</a> for statistics about the Age of Conflict.<br>
		<a href="index.php?page=rodia&action=statistics&age=7&pagenumber=1">Click here</a> for statistics about the Age of Reinforcement.<br>
		<a href="index.php?page=rodia&action=statistics&age=8&pagenumber=1">Click here</a> for statistics about the Age of Transition.<br>
		';
    tEnd();
    $sql = "SELECT text FROM misctext WHERE name = 'rodia'";
    $result = mysql_Query($sql);
    $text = mysql_result($result, 0);
    $sql = "SELECT text FROM misctext WHERE name = 'rodia2'";
    $result = mysql_Query($sql);
    $text2 = mysql_result($result, 0);
    eval("?>" . $text . $text2 . "<?");
}
if ($action == "statistics") {
コード例 #6
0
        echo '<br><br>Only logged in players can post comments.<br>';
    }
}
if (!$action) {
    $sql = "SELECT a.name AS aname, a.email AS aemail, an.topic, an.text, an.time, an.id FROM accounts AS a, announcements AS an WHERE an.account = a.id AND an.parent = '0' ORDER BY an.time DESC LIMIT 0,15";
    $result = $db->query($sql);
    while ($row = $db->fetch_array($result)) {
        $date = date("Y-m-d @ H:i", $row["time"]);
        tBegin('
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
			<td width="50%">
			' . $row["topic"] . ' ' . $addon . '
			</td>
			<td width="20%" align="center">
			by <a href="mailto:' . $row["aemail"] . '">' . $row["aname"] . '</a>
			</td>
			<td width="30%" align="center">
			' . $date . '
			</td>
			</tr>
			</table>
			');
        echo gTags($row["text"], TRUE);
        $newsql = "SELECT count(*) FROM announcements WHERE parent = '{$row['id']}'";
        $newresult = $db->query($newsql);
        $comments = $db->result($newresult, 0);
        echo '<div align="right"><a href="indexnl.php?page=nl_announcements&action=comments&anid=', $row[id], '">', $comments, ' comments</a></div>';
        tEnd();
    }
}
コード例 #7
0
ファイル: sb_items.php プロジェクト: KristofMols/castlequest2
            }
            for ($m = 0; $m < count($array); $m++) {
                $row = $array[$m];
                unset($raceonly);
                $creature = new creature($row);
                if ($row["race"] != 0) {
                    $raceonly = "<br>This item can only be used by {$row['racename']} creatures.";
                }
                tBegin('
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
					<td width="30%">
					' . $row["itemname"] . '
					</td>
					<td width="50%" align="center">
					' . $row[cost] . '
					</td>
					<td width="20%" align="center">
					<a href="index.php?page=spellbook&action=summonitems&iid=' . $row["id"] . '&path=' . $path . '">summon amulets</a>
					</td>
					</tr>
					</table>
					');
                echo '
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
					<td colspan="3">
					', $creature->ability["description"], '
					', $raceonly, '
					</td>
					</tr>
コード例 #8
0
                } else {
                    $addon = "";
                }
                if (!gCheckAttackCreature($row)) {
                    $weakaddon = '<tr><td colspan="4" align="left"><font class="alert">This creature is too weak for your level so you can not attack with it.</font></td></tr>';
                } else {
                    $weakaddon = "";
                }
                tBegin('
					<table width="100%" border="0" cellspacing="0" cellpadding="1">
					<tr>
					<td width="40%" align="left">
					' . $creature->data["creaturename"] . ' ' . $addon . '
					</td>
					<td width="40%" align="center">
					' . $chance . '% chance of success
					</td>
					<td width="20%" align="center">
					<a href="index.php?page=spellbook&action=summoncreatures&cid=' . $creature->data["cid"] . '">summon amulets</a>
					</td>
					</tr>
					</table>
					');
                echo '
					<table width="100%" border="0" cellspacing="0" cellpadding="1">
					<tr>
					<td align="left" width="15%">
					Damage: ', $creature->data["damage"], '<br>
					Health: ', $creature->data["maxhealth"], '
					</td>
					<td align="left" width="20%">
コード例 #9
0
ファイル: travel.php プロジェクト: KristofMols/castlequest2
        }
        echo '</tr>';
    }
    echo '
		</table>
		</td>
		<td width="30" align="right" valign="center">
		<a href="index.php?page=travel&action=move&direction=right&nametag=', $name, '#', $name, '"><img src="', $cq2imageurl, 'arrows/right.jpg" border="0">
		</td>
		</tr>
		<tr height="30">
		<td width="30" align="left" valign="bottom">
		<a href="index.php?page=travel&action=move&direction=downleft&nametag=', $name, '#', $name, '"><img src="', $cq2imageurl, 'arrows/downleft.jpg" border="0">
		</td>
		<td width="330" align="center" valign="bottom">
		<a href="index.php?page=travel&action=move&direction=down&nametag=', $name, '#', $name, '"><img src="', $cq2imageurl, 'arrows/down.jpg" border="0" align="center">
		</td>
		<td width="30" align="right" valign="bottom">
		<a href="index.php?page=travel&action=move&direction=downright&nametag=', $name, '#', $name, '"><img src="', $cq2imageurl, 'arrows/downright.jpg" border="0">
		</td>
		</tr>
		</table>
		';
    tEnd();
    tBegin("Teleport");
    echo '<a href="index.php?page=travel&action=teleport&kid=', $yourkingdom[id], '">Teleport to ', $yourkingdom[name], '</a><br>';
    if ($yourkingdom["id"] != $meetingpoint["id"]) {
        echo '<a href="index.php?page=travel&action=teleport&kid=', $meetingpoint[id], '">Teleport to ', $meetingpoint[name], '</a><br>';
    }
    tEnd();
}
コード例 #10
0
ファイル: admin.php プロジェクト: KristofMols/castlequest2
			';
        tEnd();
    }
    tEnd();
    tBegin("Pending Reports");
    $sql = "SELECT r.*, a.name, a2.name AS adminname FROM (reports AS r, accounts AS a) LEFT JOIN accounts AS a2 ON r.admin = a2.id WHERE r.admin != '{$acc['id']}' AND r.processed = 'no' AND r.reporter = a.id ORDER BY (r.admin = 1) ASC, r.date ASC";
    $result = $db->query($sql);
    while ($row = $db->fetch_array($result)) {
        if ($row["admin"] == 0) {
            echo ucfirst($row["type"]), ' by ', $row["name"], ' on ', $row["date"], ': <a href="index.php?page=admin&action=addreport&rid=', $row["id"], '">process this report</a>.<br>';
        } else {
            echo ucfirst($row["type"]), ' by ', $row["name"], ' on ', $row["date"], ' flagged by ', $row["adminname"], ': <a href="index.php?page=admin&action=viewreport&rid=', $row["id"], '">view this report</a>.<br>';
        }
    }
    tEnd();
    tBegin("Processed Reports");
    $sql = "SELECT r.*, a.name, a2.name AS adminname FROM reports AS r, accounts AS a, accounts AS a2 WHERE r.processed = 'yes' AND r.reporter = a.id AND r.admin = a2.id ORDER BY r.date DESC";
    $result = $db->query($sql);
    while ($row = $db->fetch_array($result)) {
        echo ucfirst($row["type"]), ' by ', $row["name"], ' on ', $row["date"], ' processed by ', $row["adminname"], ': <a href="index.php?page=admin&action=viewreport&rid=', $row["id"], '">view this report</a>.<br>';
    }
    tEnd();
}
if ($action == "editnotes") {
    $sql = "SELECT text FROM misctext WHERE name = 'adminnotes'";
    $result = $db->query($sql);
    $notes = $db->result($result, 0);
    fTitle("index.php?page=admin&action=submiteditnotes");
    fTextarea("Notes:", "notes", $notes);
    fEnd("Edit");
}
コード例 #11
0
ファイル: help.php プロジェクト: KristofMols/castlequest2
    while ($row = $db->fetch_array($result)) {
        $m++;
        echo '<a href="index.php?page=help&topic=', $row["topic"], '">', $row["topic"], '</a><br>';
        if (round($numrows / 3 * 1) == $m || round($numrows / 3 * 2) == $m) {
            echo '
				</td>
				<td width="33%" align="center" valign="top">
				';
        }
    }
    echo '
		</tr>
		</table>
		';
    tEnd();
    tBegin("FAQ");
    $sql = "SELECT id, question, answer FROM faq ORDER BY importance DESC";
    $result = $db->query($sql);
    if ($acc["admin"]) {
        echo '<a href="index.php?page=help&action=newfaq">New FAQ Question</a><br><br>';
    }
    unset($array);
    while ($row = $db->fetch_array($result)) {
        $array[count($array)] = $row;
        echo '
			<a name="top"></a>
			<a href="#faq', $row["id"], '">', $row["question"], '</a><br>
			';
    }
    echo '<br><br><br>';
    for ($m = 0; $m < count($array); $m++) {
コード例 #12
0
        $sql = "UPDATE accounts SET brimstone = brimstone - '{$res['brimstone']}', crystal = crystal - '{$res['crystal']}', essence = essence - '{$res['essence']}', granite = granite - '{$res['granite']}', power = power - '{$res['power']}', powerbalance = powerbalance - '{$res['pb']}', x = '{$res['x']}', y = '{$res['y']}' WHERE id = '{$acc['id']}'";
        $result = $db->query($sql);
        echo 'Teleportation succesful.';
    }
}
if ($action == "pool") {
    if ($totallvl < $gdPoolRequiredLevel) {
        $xcount = floor($totallvl / ceil($gdPoolRequiredLevel / count($gdPoolNames)));
        tBegin("Shard Pool");
        echo '
			As you walk into the Stonehenge city hall, you notice that the construction of the new shard pool is finished. The water in the pool however has not yet reached the required magical properties to materialise shards. By sacrificing mature creatures into the water, you can increase the magical properties of the water.
			<p>' . $gdPoolNames[$xcount] . '</p>';
        tEnd();
    } else {
        if ($acc["level"] >= $gdCurseLevelMin) {
            tBegin("Shard Pool");
            $sql = "SELECT value FROM misc WHERE name = 'pool'";
            $result = $db->query($sql);
            $totallvl = $db->result($result, 0);
            echo '
				As you near the magical pool, you start to hear faint voices coming from the water. These voices are caused by the hundreds of trapped creature souls in the water. The souls give the pool magical properties that can crystallize raw resources into powerful shards.<br><br>
				';
            fTitle("index.php?page=Stonehenge&action=pool2");
            fText("Brimstone:", "brimstone");
            fText("Crystal:", "crystal");
            fText("Essence:", "essence");
            fText("Granite:", "granite");
            fEnd("Throw in pool");
            tEnd();
        } else {
            echo 'You are not powerful enough to use the shard pool.';
コード例 #13
0
        $sql = "UPDATE accounts SET arcanechamber = 0, sign = '{$signid}' WHERE id = '{$acc['id']}'";
        $result = $db->query($sql);
        $sql = "INSERT INTO `bsgemlog` (`gemowner` , `newowner` , `stolen` , `gemsign` , `gemlevel` , `gemquality` , `time`)\r\n\t\t\t\t\tVALUES ('{$acc['id']}', '{$acc['id']}', '{$arcanechamber}', '{$acc['sign']}', '{$acc['level']}', '{$quality}', NOW( ));";
        $result = $db->query($sql);
        $sql = "select * from signs where id = '{$signid}'";
        $result = $db->query($sql);
        $gemsign = $db->fetch_array($result);
        echo 'You produce a gem.<br>';
        echo 'You are aligned towards the ' . $gemsign["description"] . ' ' . $gemsign["name"], ' sign.';
        $no = 1;
    }
    $sql = "UNLOCK TABLES";
    $result = $db->query($sql);
}
if ($action == "mathdwarf") {
    tBegin("Mathematics Dwarf");
    $cache = md5(uniqid(rand()));
    echo '
		While studying the birth certificate scrolls at the library, you encounter the Mathematics Dwarf.<br>
		
		<i>"I really need a duplicate of a rare number I found on one of the scrolls here...<br>
		Please, can you copy it for me?"</i><br><br>
		
		<img src="travelcounter.php?cache=', $cache, '"><br><br>
		
		Just refresh the page if you\'re not sure about the number.<br><br>
		';
    fTitle("index.php?page=playerinfo&action=submitnumber&aid={$aid}");
    fText("Copy:", "number", "", 5);
    echo '<input type="hidden" name="formtype" value="submitnumber">';
    fEnd("Give Number");
コード例 #14
0
ファイル: options.php プロジェクト: KristofMols/castlequest2
        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>';
            echo ")<br>";
        }
        echo '<br><br><a href="index.php?page=options&action=changegrouporder">Change group order</a>';
        tEnd();
        tBegin("Image Pack");
        echo '
			The image pack allows you to store all the image files on your hard disk so that you don\'t have to receive them from the server anymore.
			We strongly advise every active player to download and use it, because it allows you to load pages much faster and it lowers the traffic to and from the server.<br><br>
			
			To download the image pack, click <a href="docs/imagepack_2003-11-04.zip">here</a> (last updated: 2003-11-04).<br>
			Unzip the page in a folder of your choice and enter the full path to the image directory below (for example: c:\\cq2).
			If you don\'t want to use the pack anymore, just fill in an empty path and the images will be loaded from the server again.<br><br>
			
			<i>Important notice for Mozilla/Firefox users:</i><br>
			Firefox doesn\'t support local javascript loading by default. Because of this, the image pack will not function correctly when using these browsers. To fix this problem, follow <a href="index.php?page=options&action=firefoxinstructions">these instructions</a>.<br><br>
			
			If you enter an invalid path, everything will look ugly. To fix this, you have to enter a correct or empty path below.<br><br>
			';
        fTitle("index.php?page=options&action=changeimagepath");
        fText("Image path:", "imagepath", $acc["imagepath"]);
コード例 #15
0
ファイル: battles.php プロジェクト: KristofMols/castlequest2
        echo 'Invalid data.<br>';
        $no = 1;
    } else {
        $sql = "SELECT b.*, a.name, a.id AS aid FROM battles AS b, accounts AS a WHERE b.id = '{$bid}' AND b.status = '3' AND ((b.account = '{$acc['id']}' AND b.target = a.id) OR (b.target = '{$acc['id']}' AND b.account = a.id))";
        $result = $db->query($sql);
        $numrows = $db->num_rows($result);
    }
    if ($numrows != 1) {
        echo 'Invalid bid.<br>';
        $no = 1;
    }
    if ($no == 0) {
        $row = $db->fetch_array($result);
        tBegin("General Information");
        if ($row["account"] == $acc["id"]) {
            echo 'We attacked <a href="index.php?page=playerinfo&action=viewinfo&aid=', $row["aid"], '">', $row["name"], '</a>.<br>';
        } else {
            echo 'We were attacked by <a href="index.php?page=playerinfo&action=viewinfo&aid=', $row["aid"], '">', $row["name"], '</a>.<br>';
        }
        $date = date("Y-m-d H:i:s", $row["time"]);
        echo 'Date of battle: ', $date, '.<br>';
        tEnd();
        tBegin("Report");
        if ($row["account"] == $acc["id"]) {
            echo gParseReport(stripslashes($row["accountreport"]));
        } else {
            echo gParseReport(stripslashes($row["targetreport"]));
        }
        tEnd();
    }
}
コード例 #16
0
					</table>
					';
                tEnd();
                tBegin('Race: ' . $row["racename"]);
                echo '
					<table width="100%" cellspacing="0" cellpadding="1">
					<tr>
					<td align="left" width="30%" valign="top">
					Forest Defense: ', $row["forest"], '%<br>
					Death Defense: ', $row["death"], '%
					</td>
					<td align="left" width="40%" valign="top">
					Air Defense: ', $row["air"], '%<br>
					Earth Defense: ', $row["earth"], '%
					</td>
					</tr>
					</table>
					';
                tEnd();
            }
            if ($row["description"] != "") {
                tBegin("Race Description");
                echo gTags(stripslashes($row["description"]));
                tEnd();
            }
        }
    }
}
?>
			
			
コード例 #17
0
ファイル: kd_pub.php プロジェクト: KristofMols/castlequest2
    tEnd();
    tBegin("Ban Account");
    fTitle("index.php?page=kingdom&action=ban");
    fText("Name:", "name");
    fEnd("Ban");
    tEnd();
    if (in_array($acc["id"], $moderators)) {
        tBegin("Violations");
        $sql = "SELECT id, subject, days FROM violations ORDER BY subject ASC";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result)) {
            echo $row["subject"], ' (', $row["days"], '): <a href="index.php?page=kingdom&action=editviolation&vid=', $row["id"], '">edit</a>, <a href="index.php?page=kingdom&action=deleteviolation&vid=', $row["id"], '">delete</a><br>';
        }
        echo '<br><a href="index.php?page=kingdom&action=addviolation">Add violation.</a><br>';
        tEnd();
        tBegin("Violation Logs");
        echo '<a href="index.php?page=kingdom&action=violationlogs">View logs.</a>';
        tEnd();
    }
}
if ($action == "readtopic") {
    // kingdom check
    if (is_null($acc[x]) && is_null($acc[y])) {
        $kingdom = $acc["kingdom"];
        $privatesql = "";
    } elseif ($acc["tkdrelation"] == 2) {
        $kingdom = $acc["tkd"];
        $privatesql = " AND p.private < '2'";
    } elseif ($acc["tkdrelation"] != 1) {
        $kingdom = $acc["tkd"];
        $privatesql = " AND p.private = '0'";
コード例 #18
0
ファイル: kingdom.php プロジェクト: KristofMols/castlequest2
    echo '
		The treasure room holds all the resources of the kingdom.
		Therefore, it is a popular target for kingdom battles.
		You can protect your treasure room by assigning creatures to it.<br>
		Resources in the treasury receive ', gdTreasuryInterest, '% interest on a daily basis.<br><br>
		
		<a href="index.php?page=kingdom&action=buildingdefense&hid=0">View defense.</a><br>
		';
    if ($kdbattles[0]) {
        echo '
			<br>
			<font class="alert">The treasure room is under attack at the moment.</font><br>
			';
    }
    tEnd();
    tBegin("Shard Vault");
    echo '
		The shard vault holds all the shards used by mages to curse opponents.
		Because the shards require a great deal of power to sustain the curse spell, they need a specific, powerful place: the vault.
		When all the shards of a curse are destroyed, the curse is gone too.
		You can protect your shard vault by assigning creatures to it.<br><br>
		
		<a href="index.php?page=kingdom&action=buildingdefense&hid=-1">View defense.</a><br><br>
		
		<a href="index.php?page=kingdom&action=shards">View shards.</a>
		';
    if ($kdbattles[-1]) {
        echo '
			<br>
			<font class="alert">The shard vault is under attack at the moment.</font><br>
			';
コード例 #19
0
<?php

if ($encounterid) {
    tBegin("Random Encounter");
    $total = 0;
    for ($m = 0; $m < count($gdEncounters); $m++) {
        $total += $gdEncounters[$m][1];
    }
    $pick = rand(1, $total);
    $total = $gdEncounters[0][1];
    $encounter = 0;
    while ($pick > $total) {
        $encounter++;
        $total += $gdEncounters[$encounter][1];
    }
    $sql = "UPDATE encounters SET type = '{$encounter}' WHERE account = '{$acc['id']}'";
    $result = $db->query($sql);
    $resources = array(array("value" => "brimstone", "name" => "brimstone"), array("value" => "crystal", "name" => "crystal"), array("value" => "essence", "name" => "essence"), array("value" => "granite", "name" => "granite"));
    // encounters
    if ($encounter == 0 || $encounter == 1) {
        echo '
				You encounter a ', $gdEncounters[$encounter][0], '.<br>
				There is place for exactly one gem inside.<br>
				You do not know what will become of that gem once you close the box.<br><br>
				';
        $sql = "SELECT g.id, s.name AS signname, g.level AS glevel, g.type AS gtype, g.quality, s.type AS signtype FROM gems AS g, signs AS s WHERE g.owner = 'mage' AND g.target = '{$acc['id']}' AND g.sign = s.id ORDER BY s.name, g.level, g.type, g.quality ASC";
        $result = $db->query($sql);
        $numrows = $db->num_rows($result);
        if ($numrows == 0) {
            echo 'Unfortunately, you do not have any gems.<br>';
        } else {
コード例 #20
0
ファイル: library.php プロジェクト: KristofMols/castlequest2
                    if ($curse["proficiency"] != "" && $gdDispellProficiency[$curse["proficiency"] + 1]) {
                        if ($curse["creaturename"] != "") {
                            $display = $curse["creaturename"] . " ";
                        } else {
                            $display = "";
                        }
                        echo '<a href="index.php?page=library&action=buycurse&curse=', $curse["curse"], '&creature=', $curse["creature"], '">', $display, '', $gdCurses[$curse["curse"]]["name"], ' ', $gdDispellProficiency[$curse["proficiency"] + 1]["name"], '</a>: ', $gdCurses[$curse["curse"]]["description"], ' (', $gdDispellProficiency[$curse["proficiency"] + 1]["chance"], '% chance of successful casting, ', $gdCurses[$curse["curse"]]["pb"], '% power balance lost upon casting, ', $gdDispellProficiency[$curse["proficiency"] + 1]["cost"], ' essence)<br>';
                    } elseif (!$curse["proficiency"]) {
                        echo '<a href="index.php?page=library&action=submitnewcurse&curse=', $curse["curse"], '">', $gdCurses[$curse["curse"]]["name"], ' ', $gdDispellProficiency[0]["name"], '</a>: ', $gdCurses[$curse["curse"]]["description"], ' (', $gdDispellProficiency[0]["chance"], '% chance of successful casting, ', $gdCurses[$curse["curse"]]["pb"], '% power balance lost upon casting, ', $gdDispellProficiency[0]["cost"], ' essence)<br>';
                    }
                }
            }
            tEnd();
        }
    }
    tBegin("Special");
    if ($acc["attacked"]) {
        echo 'You can\'t buy these things while you are under attack.<br>';
    } else {
        $books = $gdSpecialBooks[$library];
        for ($m = 0; $m < count($books); $m++) {
            if ($books[$m]["cost"] > 0) {
                $cost = $books[$m]["cost"] . " essence";
            } else {
                $cost = "free";
            }
            echo '<a href="index.php?page=library&action=readbook&bid=', $m, '">', $books[$m]["name"], '</a> (', $cost, ')<br>';
        }
    }
    tEnd();
}
コード例 #21
0
<?php

if ($acc["owner"]) {
    include_once "admin/achangelog.php";
}
topic("Changelog");
echo 'Only big patches are on this page. Small bug fixes happen all the time and are not recorded.<br><br>';
$sql = "SELECT text, time FROM changelog ORDER BY time DESC";
$result = $db->query($sql);
while ($row = $db->fetch_array($result)) {
    $date = date("Y-m-d @ H:i", $row["time"]);
    tBegin($date);
    echo $row["text"];
    tEnd();
}
コード例 #22
0
ファイル: rules.php プロジェクト: KristofMols/castlequest2
	Because of the limited amount of accounts our server can handle, we are removing inactive accounts at a steady rate.
	This means that everyone who is not in vacation mode and hasn\'t played CQ2 for over a week will be removed from the game, allowing one extra player to enter the game.
	Players can only stay in vacation mode for 30 days. After that they will be killed as well.
	';
tEnd();
tBegin("6. External Devices");
echo '
	The use or distribution of external devices of any kind, such as macro\'s, travel scripts, Proxomitron or CGI-scripts, is strictly forbidden. Every tool that interacts with the game in any way not provided by the game itself is considered an external device. This also includes the auto-refresh option of browsers like Opera.
	';
tEnd();
tBegin("7. Personal Info");
echo '
	All game rules also apply to the personal info of a player.
	In addition to that, the use of any methods to hinder the display of the \'Player Information\'-page is not allowed. This includes very big images, large images (>100kb) and too many images. 
	';
tEnd();
tBegin("8. Bugs and exploits");
echo '
	You are not allowed to abuse or distribute any bugs you encounter during play.
	Violation will result in your immediate removal from the game.
	You have to report any bugs or imbalances you encounter to the developers using the appropriate form.
	';
tEnd();
tBegin("9. The marketplace");
echo '
	The marketplace is used to trade items for other items within the game. It is not allowed to sell items/accounts for currency not provided by CQ2, such as real money.
	';
tEnd();
echo '
	<br><br>If you think the rules are incomplete, you can always <a href="mailto:', $PhantomMail, '">contact</a> the moderators and suggest additional rules.<br><br>
	';
コード例 #23
0
                    echo 'currently empty';
                }
                echo '
					</td>
					<td width="30%" align="center">
					Health: ', $newrow["health"], '%
					</td>
					</tr>
					';
            }
            if ($numrows != 0) {
                echo '</table>';
            }
            tEnd();
        }
        tBegin("Diplomacy");
        if ($acc["kingdom"] == $row["id"]) {
            echo 'You are living in this kingdom.<br>';
        } else {
            $sql = "SELECT type, kingdom, target FROM relations WHERE (kingdom = '{$acc['kingdom']}' AND target = '{$row['id']}') OR (kingdom = '{$row['id']}' AND target = '{$acc['kingdom']}')";
            $result = $db->query($sql);
            $numrows = $db->num_rows($result);
            if ($numrows == 0) {
                $status = '0';
            } else {
                $relrow = $db->fetch_array($result);
                $status = $relrow["type"];
            }
            if ($status == 0) {
                echo '
					', $row["name"], ' is currently neutral towards you.<br>
コード例 #24
0
ファイル: Aether.php プロジェクト: KristofMols/castlequest2
    echo '
		"<i>I can teach Nether Creatures to listen to another name.
		If you give me enough resources, I will give it a try. I do not guarantee that it will work though.
		I can either pick a name for you or teach the creature a name of your choosing.<br><br>
		';
    $sql = "SELECT {$gdCreatureSelect} FROM (summons AS s, creatures AS c, races AS r) LEFT JOIN accitems AS ai ON s.item = ai.id LEFT JOIN items AS i ON ai.item = i.id WHERE s.account = '{$acc['id']}' AND s.creature = c.id AND c.race = r.id AND r.id!=49 AND r.id!=50 AND r.id!=51 AND r.id!=52 AND s.mods != ''";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows == 0) {
        echo 'Unfortunately you do not have any Nether creatures right now."</i><br><br>';
    } else {
        echo '"</i><br><br>
			
			<form method="POST" action="index.php?page=travel&action=submitscholarname">
			';
        tBegin();
        $array = array();
        while ($row = $db->fetch_array($result)) {
            $creature = new Creature($row);
            $row["skill"] = $creature->data["sortskill"];
            $array[] = $row;
        }
        gSortCreatures($array);
        foreach ($array as $row) {
            $creature = new Creature($row);
            $url = array("<input type='checkbox' name='summons[", "#id", "]'>&nbsp;&nbsp;", "#creaturename");
            $creature->echoCreature($url);
        }
        echo '
			</table>
			<br><br>
コード例 #25
0
			<a href="index.php?page=playerinfo&action=viewinfo&aid=', $row["aid"], '">', $row["name"], '</a><br>
			', $date, '
			</td>
			</tr>
			<tr>
			<td colspan="2">
			', gTags($row["text"]), '
			</td>
			</tr>
			</table>
			
			';
        // convert to report
        if ($acc["admin"]) {
            echo '<br><br>';
            tBegin("Convert to report");
            fTitle("index.php?page=report&action=submit&reporter={$row['aid']}");
            fHidden("description", htmlspecialchars(stripslashes($row["subject"])) . "<br><br>" . addslashes($row["text"]));
            fRadio("Type:", "type", array(array("name" => "Question", "value" => "question"), array("name" => "Bug/Advice Report", "value" => "bug"), array("name" => "Abuse Report", "value" => "abuse")));
            fEnd("Convert");
            tEnd();
        }
    }
}
if ($action == "readallmails") {
    $sql = "UPDATE mails SET receiverstatus = '1' WHERE receiver = '{$acc['id']}' AND receiverstatus = '0'";
    $result = $db->query($sql);
    echo 'All your mails are marked as read now!<br>';
    if (is_null($acc["x"]) || $acc["tkd"]) {
        $action = "postoffice";
    }