mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-09 14:16:08 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<div id="build" class="gid1"><a href="#" onClick="return Popup(0,4);" class="build_logo">
|
||||
<img class="building g1" src="img/x.gif" alt="<?php echo B1; ?>" title="<?php echo B1; ?>" />
|
||||
</a>
|
||||
<h1><?php echo B1; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo B1_DESC; ?></p>
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CUR_PROD; ?>:</th>
|
||||
<td><b><?php echo $bid1[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid1[$village->resarray['f'.$id]+1]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid10"><a href="#" onClick="return Popup(10,4);" class="build_logo">
|
||||
<img class="building g10" src="img/x.gif" alt="Warehouse" title="Warehouse" />
|
||||
</a>
|
||||
<h1>Warehouse <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">The resources wood, clay and iron are stored in your Warehouse. By increasing its level you increase your Warehouse's capacity. .</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current capacity:</th>
|
||||
<td><b><?php echo $bid10[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> units</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Capacity at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid10[$village->resarray['f'.$id]+1]['attri']*STORAGE_MULTIPLIER; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div id="build" class="gid11"><a href="#" onClick="return Popup(11,4);" class="build_logo">
|
||||
<img class="building g11" src="img/x.gif" alt="Granary" title="Granary" />
|
||||
</a>
|
||||
<h1>Granary <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Crop produced by your farms is stored in the Granary. By increasing its level you increase the Granary's capacity.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current capacity:</th>
|
||||
<td><b><?php echo $bid11[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> units</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Capacity at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid11[$village->resarray['f'.$id]+1]['attri']*STORAGE_MULTIPLIER; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<div id="build" class="gid12"><a href="#" onClick="return Popup(12,4);" class="build_logo">
|
||||
|
||||
<img class="building g12" src="img/x.gif" alt="Blacksmith" title="Blacksmith" />
|
||||
</a>
|
||||
<h1>Blacksmith <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">In the blacksmith's melting furnaces your warriors' weapons are enhanced. By increasing its level you can order the fabrication of even better weapons.
|
||||
<?php
|
||||
if ($building->getTypeLevel(12) > 0) {
|
||||
include("12_upgrades.tpl");
|
||||
} else {
|
||||
echo "<p><b>Upgrades can commence when blacksmith is completed.</b><br>\n";
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,78 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Blacksmith</td>
|
||||
<td>Action</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
$abdata = $database->getABTech($village->wid);
|
||||
$ABups = $technology->getABUpgrades('b');
|
||||
for($i=($session->tribe*10-9);$i<=($session->tribe*10-2);$i++) {
|
||||
$j = $i % 10 ;
|
||||
if ( $technology->getTech($i) || $j == 1 ) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> (Level ".$abdata['b'.$j].")
|
||||
</div>";
|
||||
if($abdata['b'.$j] != 20) {
|
||||
echo "<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'ab'.$i}[$abdata['b'.$j]+1]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'ab'.$i}[$abdata['b'.$j]+1]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'ab'.$i}[$abdata['b'.$j]+1]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'ab'.$i}[$abdata['b'.$j]+1]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'ab'.$i}[$abdata['b'.$j]+1]['time']*($bid12[$building->getTypeLevel(12)]['attri'] / 100)/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'ab'.$i}[$abdata['b'.$j]+1]['wood']."&r2=".${'ab'.$i}[$abdata['b'.$j]+1]['clay']."&r3=".${'ab'.$i}[$abdata['b'.$j]+1]['iron']."&r4=".${'ab'.$i}[$abdata['b'.$j]+1]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
}
|
||||
if($abdata['b'.$j] == 20) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Maximum<br>level</div></td></tr>";
|
||||
}
|
||||
else if(${'ab'.$i}[$abdata['b'.$j]+1]['wood'] > $village->maxstore || ${'ab'.$i}[$abdata['b'.$j]+1]['clay'] > $village->maxstore || ${'ab'.$i}[$abdata['b'.$j]+1]['iron'] > $village->maxstore) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Expand<br>warehouse</div></td></tr>";
|
||||
}
|
||||
else if (${'ab'.$i}[$abdata['b'.$j]+1]['crop'] > $village->maxcrop) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Expand<br>granary</div></td></tr>";
|
||||
}
|
||||
else if (${'ab'.$i}[$abdata['b'.$j]+1]['wood'] > $village->awood || ${'ab'.$i}[$abdata['b'.$j]+1]['clay'] > $village->aclay || ${'ab'.$i}[$abdata['b'.$j]+1]['iron'] > $village->airon || ${'ab'.$i}[$abdata['b'.$j]+1]['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0 || $village->acrop > ${'ab'.$i}[$abdata['b'.$j]+1]['crop']){
|
||||
$time = $technology->calculateAvaliable(12,${'ab'.$i}[$abdata['b'.$j]+1]);
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
|
||||
}
|
||||
else if ($building->getTypeLevel(12) <= $abdata['b'.$j]) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Upgrade<br>blacksmith</div></td></tr>";
|
||||
}
|
||||
else if (count($ABups) > 0) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Upgrade in<br>progress</div></td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "<td class=\"act\"><a class=\"research\" href=\"build.php?id=$id&a=$j&c=".$session->mchecker."\">Upgrade</a></td></tr>";
|
||||
}else{
|
||||
echo "<td class=\"act\"><a class=\"research\" href=\"banned.php\">Upgrade</a></td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if(count($ABups) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Upgrading</td><td>Duration</td><td>Complete</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($ABups as $black) {
|
||||
$unit = ($session->tribe-1)*10 + substr($black['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($black['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($black['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<div id="build" class="gid13"><a href="#" onClick="return Popup(13,4);" class="build_logo">
|
||||
|
||||
<img class="building g13" src="img/x.gif" alt="Armoury" title="Armoury" />
|
||||
</a>
|
||||
<h1>Armoury <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">In the armoury's melting furnaces your warriors' armour is enhanced. By increasing its level you can order the fabrication of even better armour.
|
||||
<?php
|
||||
if ($building->getTypeLevel(13) > 0) {
|
||||
include("13_upgrades.tpl");
|
||||
} else {
|
||||
echo "<p><b>Upgrades can commence when armoury is completed.</b><br>\n";
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,78 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Armoury</td>
|
||||
<td>Action</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
$abdata = $database->getABTech($village->wid);
|
||||
$ABups = $technology->getABUpgrades('a');
|
||||
for($i=($session->tribe*10-9);$i<=($session->tribe*10-2);$i++) {
|
||||
$j = $i % 10 ;
|
||||
if ( $technology->getTech($i) || $j == 1 ) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> (Level ".$abdata['a'.$j].")
|
||||
</div>";
|
||||
if($abdata['a'.$j] != 20) {
|
||||
echo "<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'ab'.$i}[$abdata['a'.$j]+1]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'ab'.$i}[$abdata['a'.$j]+1]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'ab'.$i}[$abdata['a'.$j]+1]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'ab'.$i}[$abdata['a'.$j]+1]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'ab'.$i}[$abdata['a'.$j]+1]['time']*($bid13[$building->getTypeLevel(13)]['attri'] / 100)/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'ab'.$i}[$abdata['a'.$j]+1]['wood']."&r2=".${'ab'.$i}[$abdata['a'.$j]+1]['clay']."&r3=".${'ab'.$i}[$abdata['a'.$j]+1]['iron']."&r4=".${'ab'.$i}[$abdata['a'.$j]+1]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
}
|
||||
if($abdata['a'.$j] == 20) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Maximum<br>level</div></td></tr>";
|
||||
}
|
||||
else if(${'ab'.$i}[$abdata['a'.$j]+1]['wood'] > $village->maxstore || ${'ab'.$i}[$abdata['a'.$j]+1]['clay'] > $village->maxstore || ${'ab'.$i}[$abdata['a'.$j]+1]['iron'] > $village->maxstore) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Expand<br>warehouse</div></td></tr>";
|
||||
}
|
||||
else if (${'ab'.$i}[$abdata['a'.$j]+1]['crop'] > $village->maxcrop) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Expand<br>granary</div></td></tr>";
|
||||
}
|
||||
else if (${'ab'.$i}[$abdata['a'.$j]+1]['wood'] > $village->awood || ${'ab'.$i}[$abdata['a'.$j]+1]['clay'] > $village->aclay || ${'ab'.$i}[$abdata['a'.$j]+1]['iron'] > $village->airon || ${'ab'.$i}[$abdata['a'.$j]+1]['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0 || $village->acrop > ${'ab'.$i}[$abdata['a'.$j]+1]['crop']){
|
||||
$time = $technology->calculateAvaliable(13,${'ab'.$i}[$abdata['a'.$j]+1]);
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
|
||||
}
|
||||
else if ($building->getTypeLevel(13) <= $abdata['a'.$j]) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Upgrade<br>armoury</div></td></tr>";
|
||||
}
|
||||
else if (count($ABups) > 0) {
|
||||
echo "<td class=\"act\"><div class=\"none\">Upgrade in<br>progress</div></td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "<td class=\"act\"><a class=\"research\" href=\"build.php?id=$id&a=$j&c=".$session->mchecker."\">Upgrade</a></td></tr>";
|
||||
}else{
|
||||
echo "<td class=\"act\"><a class=\"research\" href=\"banned.php\">Upgrade</a></td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if(count($ABups) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Upgrading</td><td>Duration</td><td>Complete</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($ABups as $arms) {
|
||||
$unit = ($session->tribe-1)*10 + substr($arms['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($arms['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($arms['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid14"><a href="#" onClick="return Popup(14,4);" class="build_logo">
|
||||
<img class="building g14" src="img/x.gif" alt="Tournament Square" title="Tournament Square" />
|
||||
</a>
|
||||
<h1>Tournament Square <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">At the Tournament Square your troops can train their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of <?php echo TS_THRESHOLD ?> squares.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current speed bonus:</th>
|
||||
<td><b><?php echo $bid14[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Speed bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid14[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,31 @@
|
||||
<div id="build" class="gid15"><a href="#" onClick="return Popup(15,4);" class="build_logo">
|
||||
<img class="building g15" src="img/x.gif" alt="Main Building" title="Main Building" />
|
||||
</a>
|
||||
<h1>Main Building <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">In the main building the village's master builders live. The higher its level the faster your master builders complete the construction of new buildings.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current construction time:</th>
|
||||
<td><b><?php echo round($bid15[$village->resarray['f'.$id]]['attri']); ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Construction time at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo round($bid15[$village->resarray['f'.$id]+1]['attri']); ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if($village->resarray['f'.$id] >= 10){
|
||||
include("Templates/Build/15_1.tpl");
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if($_REQUEST["cancel"] == "1") {
|
||||
$database->delDemolition($village->wid);
|
||||
header("Location: build.php?gid=15&cancel=0&demolish=0");
|
||||
}
|
||||
|
||||
if(!empty($_REQUEST["demolish"]) && $_REQUEST["c"] == $session->mchecker) {
|
||||
if($_REQUEST["type"] != null) {
|
||||
$type = $_REQUEST['type'];
|
||||
$database->addDemolition($village->wid,$type);
|
||||
$session->changeChecker();
|
||||
header("Location: build.php?gid=15&cancel=0&demolish=0");
|
||||
}
|
||||
}
|
||||
|
||||
if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
|
||||
echo "<h2>Demolition of the building:</h2><p>If you no longer need a building, you can order the demolition of the building.</p>";
|
||||
$VillageResourceLevels = $database->getResourceLevel($village->wid);
|
||||
$DemolitionProgress = $database->getDemolition($village->wid);
|
||||
if (!empty($DemolitionProgress)) {
|
||||
$Demolition = $DemolitionProgress[0];
|
||||
echo "<b>";
|
||||
echo "<a href='build.php?id=26&cancel=1'><img src='img/x.gif' class='del' title='cancel' alt='cancel'></a> ";
|
||||
echo "Demolition of ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": <span id=timer1>".$generator->getTimeFormat($Demolition['timetofinish']-time())."</span>";
|
||||
echo "</b>";
|
||||
} else {
|
||||
echo "
|
||||
<form action=\"build.php?gid=15&demolish=1&cancel=0&c=".$session->mchecker."\" method=\"POST\" style=\"display:inline\">
|
||||
<select name=\"type\" class=\"dropdown\">";
|
||||
for ($i=19; $i<=41; $i++) {
|
||||
if ($VillageResourceLevels['f'.$i] >= 1 && !$building->isCurrent($i) && !$building->isLoop($i)) {
|
||||
echo "<option value=".$i.">".$i.". ".$building->procResType($VillageResourceLevels['f'.$i.'t'])." (lvl ".$VillageResourceLevels['f'.$i].")</option>";
|
||||
}
|
||||
}
|
||||
echo "</select><input id=\"btn_demolish\" name=\"demolish\" class=\"dynamic_img\" value=\"Demolish\" type=\"image\" src=\"img/x.gif\" alt=\"Demolish\" title=\"Demolish\" /></form>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,120 @@
|
||||
<div id="build" class="gid16"><a href="#" onClick="return Popup(16,4);" class="build_logo">
|
||||
<img class="g16" src="img/x.gif" alt="Rally point" title="Rally point" />
|
||||
</a>
|
||||
<h1>Rally point <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Your village's troops meet here. From here you can send them out to conquer, raid or reinforce other villages.</p>
|
||||
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>">Overview</a> |
|
||||
<a href="a2b.php">Send troops</a> |
|
||||
<a href="warsim.php">Combat Simulator</a></div>
|
||||
|
||||
<?php
|
||||
$units_type = $database->getMovement("34",$village->wid,1);
|
||||
|
||||
$units_incoming = count($units_type);
|
||||
for($i=0;$i<$units_incoming;$i++){
|
||||
if($units_type[$i]['attack_type'] == 1)
|
||||
$units_incoming -= 1;
|
||||
}
|
||||
if($units_incoming >= 1){
|
||||
?>
|
||||
<h4>Incoming troops (<?php echo $units_incoming; ?>)</h4>
|
||||
<?php include("16_incomming.tpl");
|
||||
}
|
||||
?>
|
||||
|
||||
<h4>Troops in the village</h4>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td><td colspan="<?php if($village->unitarray['hero'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<a href="spieler.php?uid=<?php echo $session->uid; ?>">Own troops</a></td></tr></thead>
|
||||
<tbody class="units">
|
||||
<?php include("16_troops.tpl");
|
||||
|
||||
?>
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
if(count($village->enforcetome) > 0) {
|
||||
foreach($village->enforcetome as $enforce) {
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a></td>
|
||||
<td colspan=\"10\">";
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." troops</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
for($i=$start;$i<=($start+9);$i++) {
|
||||
if($enforce['u'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"10\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>Send back</a></div></td></tr>";
|
||||
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if(count($village->enforcetoyou) > 0) {
|
||||
echo "<h4>Troops in other village</h4>";
|
||||
foreach($village->enforcetoyou as $enforce) {
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".$database->getVillageField($enforce['vref'],"name")."</a></td>
|
||||
<td colspan=\"10\">";
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." troops</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
for($i=$start;$i<=($start+9);$i++) {
|
||||
if($enforce['u'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"10\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>Send back</a></div></td></tr>";
|
||||
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$units_type = $database->getMovement("3",$village->wid,0);
|
||||
$settlers = $database->getMovement("5",$village->wid,0);
|
||||
$units_incoming = count($units_type);
|
||||
for($i=0;$i<$units_incoming;$i++){
|
||||
if($units_type[$i]['vref'] != $village->wid)
|
||||
$units_incoming -= 1;
|
||||
}
|
||||
$units_incoming += count($settlers);
|
||||
|
||||
if($units_incoming >= 1){
|
||||
echo "<h4>Troops on their way</h4>";
|
||||
include("16_walking.tpl");
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
$units = $database->getMovement("34",$village->wid,1);
|
||||
$total_for = count($units);
|
||||
|
||||
for($y=0;$y < $total_for;$y++){
|
||||
$timer = $y+1;
|
||||
if ($units[$y]['sort_type']==3){
|
||||
if ($units[$y]['attack_type']==3){
|
||||
$actionType = "Attack on ";
|
||||
} else if ($units[$y]['attack_type']==4){
|
||||
$actionType = "Raid on ";
|
||||
}
|
||||
|
||||
if($units[$y]['attack_type'] != 1){
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$units[$y]['from']."&c=".$generator->getMapCheck($units[$y]['from'])."\">".$database->getVillageField($units[$y]['from'],"name")."</a></td>
|
||||
<td colspan=\"10\">";
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($units[$y]['from'],"owner")."\">".$database->getUserField($database->getVillageField($units[$y]['from'],"owner"),"username",0)."'s troops</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($units[$y]['from'],"owner"),"tribe",0);
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
$tribe1 = $tribe-1;
|
||||
$totalunits = $units[$y]['t'.$tribe1*10+1]+$units[$y]['t'.$tribe1*10+2]+$units[$y]['t'.$tribe1*10+3]+$units[$y]['t'.$tribe1*10+4]+$units[$y]['t'.$tribe1*10+5]+$units[$y]['t'.$tribe1*10+6]+$units[$y]['t'.$tribe1*10+7]+$units[$y]['t'.$tribe1*10+8]+$units[$y]['t'.$tribe1*10+9]+$units[$y]['t'.$tribe1*10+10];
|
||||
if($totalunits > $building->getTypeLevel(16)){
|
||||
echo "<td class=\"none\">?</td>";
|
||||
}else{
|
||||
if($units[$y]['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">0</td>";
|
||||
}else{
|
||||
echo "<td>?</td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</tr></tbody>";
|
||||
echo '
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th>Arrival</th>
|
||||
<td colspan="10">
|
||||
<div class="in small"><span id=timer'.$timer.'>'.$generator->getTimeFormat($units[$y]['endtime']-time()).'</span> h</div>';
|
||||
$datetime = $generator->procMtime($units[$y]['endtime']);
|
||||
echo "<div class=\"at small\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "on ".$datetime[0]." ";
|
||||
}
|
||||
echo "at ".$datetime[1]."</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>";
|
||||
echo "</table>";
|
||||
}
|
||||
}else if ($units[$y]['sort_type']==4){
|
||||
if ($units[$y]['attack_type']==1){
|
||||
$actionType = "Return from ";
|
||||
} else if ($units[$y]['attack_type']==2){
|
||||
$actionType = "Reinforment for ";
|
||||
} else if ($units[$y]['attack_type']==3){
|
||||
$actionType = "Return from ";
|
||||
} else if ($units[$y]['attack_type']==4){
|
||||
$actionType = "Return from ";
|
||||
}
|
||||
|
||||
|
||||
$to = $database->getMInfo($units[$y]['vref']);
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td colspan="<?php if($units[$y]['t11'] != 0) {echo"11";}else{echo"10";}?>"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo "Returning to ".$to['name']; ?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($units[$y]['t11'] != 0) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr><th>Troops</th>
|
||||
<?php
|
||||
for($i=1;$i<($units[$y]['t11'] != 0?12:11);$i++) {
|
||||
if($units[$y]['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">?</td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $units[$y]['t'.$i]."</td>";
|
||||
}
|
||||
?>
|
||||
</tr></tbody>
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th>Arrival</th>
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<?php
|
||||
echo "<div class=\"in small\"><span id=timer".$timer.">".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($units[$y]['endtime']);
|
||||
echo "<div class=\"at small\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "on ".$datetime[0]." ";
|
||||
}
|
||||
echo "at ".$datetime[1]."</div>";
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//}
|
||||
?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($village->unitarray['hero'] != 0) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
|
||||
?>
|
||||
</tr><tr><th>Troops</th>
|
||||
<?php
|
||||
for($i=$start;$i<=$end;$i++) {
|
||||
if($village->unitarray['u'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $village->unitarray['u'.$i]."</td>";
|
||||
}
|
||||
|
||||
if($village->unitarray['hero'] != 0) {
|
||||
echo "<td>";
|
||||
echo $village->unitarray['hero']."</td>";
|
||||
}
|
||||
|
||||
?>
|
||||
</tr></tbody>
|
||||
<tbody class="infos"><tr><th>Upkeep</th>
|
||||
<td colspan="<?php if($village->unitarray['hero'] == 0) {echo"10";}else{echo"11";}?>"><?php echo $technology->getUpkeep($village->unitarray,0); ?><img class="r4" src="img/x.gif" title="Crop" alt="Crop" />per hour</td></tr>
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
$units = $database->getMovement(3,$village->wid,0);
|
||||
$total_for = count($units);
|
||||
|
||||
for($y=0;$y<$total_for;$y++){
|
||||
$timer += 1;
|
||||
|
||||
if($units[$y]['attack_type'] == 2){
|
||||
$attack_type = "Reinforcing";
|
||||
}
|
||||
if($units[$y]['attack_type'] == 1){
|
||||
$attack_type = "Scouting";
|
||||
}
|
||||
if($units[$y]['attack_type'] == 3){
|
||||
$attack_type = "Attack to";
|
||||
}
|
||||
if($units[$y]['attack_type'] == 4){
|
||||
$attack_type = "Raid to";
|
||||
}
|
||||
$isoasis = $database->isVillageOases($units[$y]['to']);
|
||||
if ($isoasis ==0){
|
||||
$to = $database->getMInfo($units[$y]['to']);
|
||||
} else {
|
||||
$to = $database->getOMInfo($units[$y]['to']);}
|
||||
|
||||
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo $attack_type." ".$to['name']; ?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
echo "<tr><th> </th>";
|
||||
for($i=($session->tribe-1)*10+1;$i<=$session->tribe*10;$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($units[$y]['t11'] != 0) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr><th>Troops</th>
|
||||
<?php
|
||||
if($units[$y]['t11'] != 0) {
|
||||
$end = 12;
|
||||
}else{
|
||||
$end = 11;
|
||||
}
|
||||
for($i=1;$i<$end;$i++) {
|
||||
if($units[$y]['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $units[$y]['t'.$i]."</td>";
|
||||
}
|
||||
?>
|
||||
</tr></tbody>
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th>Arrival</th>
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<?php
|
||||
echo "<div class=\"in small\"><span id=timer$timer>".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($units[$y]['endtime']);
|
||||
echo "<div class=\"at small\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "on ".$datetime[0]." ";
|
||||
}
|
||||
echo "at ".$datetime[1]."</div>";
|
||||
?>
|
||||
<!--<div class="abort"><a href="build.php?id=39&a=4&t=5360004"><img src="img/x.gif" class="del" title="Annuleren" alt="Annuleren" /></a>-->
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$settlers = $database->getMovement(5,$village->wid,0);
|
||||
if($settlers){
|
||||
$total_for = count($settlers);
|
||||
|
||||
for($y=0;$y<$total_for;$y++){
|
||||
$timer += 1;
|
||||
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td colspan="10"><a href="karte.php?d=<?php echo $settlers[$y]['to']."&c=".$generator->getMapCheck($settlers[$y]['to']); ?>">Found new village.</a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr><th>Troops</th>
|
||||
<?php
|
||||
$units[$y]['t10']=3;
|
||||
for($i=1;$i<=10;$i++) {
|
||||
if($units[$y]['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $units[$y]['t'.$i]."</td>";
|
||||
}
|
||||
?>
|
||||
</tr></tbody>
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th>Arrival</th>
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<?php
|
||||
echo "<div class=\"in small\"><span id=timer$timer>".$generator->getTimeFormat($settlers[$y]['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($settlers[$y]['endtime']);
|
||||
echo "<div class=\"at small\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "on ".$datetime[0]." ";
|
||||
}
|
||||
echo "at ".$datetime[1]."</div>";
|
||||
?>
|
||||
<!--<div class="abort"><a href="build.php?id=39&a=4&t=5360004"><img src="img/x.gif" class="del" title="Annuleren" alt="Annuleren" /></a>-->
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,174 @@
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
|
||||
</a>
|
||||
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
|
||||
</p>
|
||||
|
||||
<?php include("17_menu.tpl"); ?>
|
||||
|
||||
<script language="JavaScript">
|
||||
<!--
|
||||
var haendler = <?php echo $market->merchantAvail(); ?>;
|
||||
var carry = <?php echo $market->maxcarry; ?>;
|
||||
//-->
|
||||
</script><form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="ft" value="mk1">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
||||
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1"><tr>
|
||||
<td class="ico">
|
||||
<a href="#" onClick="upd_res(1,1); return false;"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a>
|
||||
</td>
|
||||
<td class="nam">
|
||||
Lumber:
|
||||
</td>
|
||||
<td class="val">
|
||||
<input class="text" type="text" name="r1" id="r1" value="" maxlength="5" onKeyUp="upd_res(1)" tabindex="1">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onMouseUp="add_res(1);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="ico">
|
||||
<a href="#" onClick="upd_res(2,1); return false;"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></a>
|
||||
</td>
|
||||
<td class="nam">
|
||||
Clay:
|
||||
</td>
|
||||
<td class="val">
|
||||
<input class="text" type="text" name="r2" id="r2" value="" maxlength="5" onKeyUp="upd_res(2)" tabindex="2">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onMouseUp="add_res(2);" onClick="return false;">(<?php echo$market->maxcarry; ?>)</a>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="ico">
|
||||
<a href="#" onClick="upd_res(3,1); return false;"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></a>
|
||||
</td>
|
||||
<td class="nam">
|
||||
Iron:
|
||||
</td>
|
||||
<td class="val">
|
||||
<input class="text" type="text" name="r3" id="r3" value="" maxlength="5" onKeyUp="upd_res(3)" tabindex="3">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onMouseUp="add_res(3);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="ico">
|
||||
<a href="#" onClick="upd_res(4,1); return false;"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></a>
|
||||
</td>
|
||||
<td class="nam">
|
||||
Crop:
|
||||
</td>
|
||||
<td class="val">
|
||||
<input class="text" type="text" name="r4" id="r4" value="" maxlength="5" onKeyUp="upd_res(4)" tabindex="4">
|
||||
</td>
|
||||
<td class="max">
|
||||
<a href="#" onMouseUp="add_res(4);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
|
||||
</td>
|
||||
</tr></table>
|
||||
|
||||
<table id="target_select" class="res_target" cellpadding="1" cellspacing="1">
|
||||
<tr>
|
||||
<td class="mer">Merchants <?php echo $market->merchantAvail(); ?>/<?php echo $market->merchant; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="vil">
|
||||
<span>Villages:</span>
|
||||
<input class="text" type="text" name="dname" value="" maxlength="20" tabindex="5">
|
||||
</td>
|
||||
<tr>
|
||||
<td class="or">or</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(isset($_GET['z'])){
|
||||
$coor = $database->getCoor($_GET['z']);
|
||||
}
|
||||
else{
|
||||
$coor['x'] = "";
|
||||
$coor['y'] = "";
|
||||
}
|
||||
?>
|
||||
<td class="coo">
|
||||
<span>X:</span><input class="text" type="text" name="x" value="<?php echo $coor['x']; ?>" maxlength="4" tabindex="6">
|
||||
<span>Y:</span><input class="text" type="text" name="y" value="<?php echo $coor['y']; ?>" maxlength="4" tabindex="7">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="clear"></div><p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK" <?php if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></form></p><script language="JavaScript" type="text/javascript">
|
||||
//<!--
|
||||
document.snd.r1.focus();
|
||||
//-->
|
||||
</script>
|
||||
<p>Each merchant can carry <b><?php echo $market->maxcarry; ?></b> units of resource</p>
|
||||
<?php
|
||||
$timer = 1;
|
||||
if(count($market->recieving) > 0) {
|
||||
echo "<h4>Merchants coming:</h4>";
|
||||
foreach($market->recieving as $recieve) {
|
||||
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
|
||||
$villageowner = $database->getVillageField($recieve['from'],"owner");
|
||||
echo "<thead><tr><td><a href=\"spieler.php?uid=$villageowner\">".$database->getUserField($villageowner,"username",0)."</a></td>";
|
||||
echo "<td><a href=\"karte.php?d=".$recieve['from']."&c=".$generator->getMapCheck($recieve['from'])."\">Transport from ".$database->getVillageField($recieve['from'],"name")."</a></td>";
|
||||
echo "</tr></thead><tbody><tr><th>Arrival in</th><td>";
|
||||
echo "<div class=\"in\"><span id=timer$timer>".$generator->getTimeFormat($recieve['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($recieve['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "on ".$datetime[0]." ";
|
||||
}
|
||||
echo "at ".$datetime[1]."</div>";
|
||||
echo "</td></tr></tbody> <tr class=\"res\"> <th>Resource</th> <td colspan=\"2\"><span class=\"f10\">";
|
||||
echo "<img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$recieve['wood']." | <img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$recieve['clay']." | <img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$recieve['iron']." | <img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$recieve['crop']."</td></tr></tbody>";
|
||||
echo "</table>";
|
||||
$timer +=1;
|
||||
}
|
||||
}
|
||||
if(count($market->sending) > 0) {
|
||||
echo "<h4>Own merchants on the way:</h4>";
|
||||
foreach($market->sending as $send) {
|
||||
$villageowner = $database->getVillageField($send['to'],"owner");
|
||||
$ownername = $database->getUserField($villageowner,"username",0);
|
||||
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
|
||||
echo "<thead><tr> <td><a href=\"spieler.php?uid=$villageowner\">$ownername</a></td>";
|
||||
echo "<td><a href=\"karte.php?d=".$send['to']."&c=".$generator->getMapCheck($send['to'])."\">Transport to ".$database->getVillageField($send['to'],"name")."</a></td>";
|
||||
echo "</tr></thead> <tbody><tr> <th>Arrival in</th> <td>";
|
||||
echo "<div class=\"in\"><span id=timer".$timer.">".$generator->getTimeFormat($send['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($send['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "on ".$datetime[0]." ";
|
||||
}
|
||||
echo "at ".$datetime[1]."</div>";
|
||||
echo "</td> </tr> <tr class=\"res\"> <th>Resource</th><td>";
|
||||
echo "<img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$send['wood']." | <img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$send['clay']." | <img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$send['iron']." | <img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$send['crop']."</td></tr></tbody>";
|
||||
echo "</table>";
|
||||
$timer += 1;
|
||||
}
|
||||
}
|
||||
if(count($market->return) > 0) {
|
||||
echo "<h4>Merchants returning:</h4>";
|
||||
foreach($market->return as $return) {
|
||||
$villageowner = $database->getVillageField($return['from'],"owner");
|
||||
$ownername = $database->getUserField($villageowner,"username",0);
|
||||
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
|
||||
echo "<thead><tr> <td><a href=\"spieler.php?uid=$villageowner\">$ownername</a></td>";
|
||||
echo "<td><a href=\"karte.php?d=".$return['from']."&c=".$generator->getMapCheck($return['from'])."\">Return from ".$database->getVillageField($return['from'],"name")."</a></td>";
|
||||
echo "</tr></thead> <tbody><tr> <th>Arrival in</th> <td>";
|
||||
echo "<div class=\"in\"><span id=timer".$timer.">".$generator->getTimeFormat($return['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($return['endtime']);
|
||||
echo "<div class=\"at\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "on ".$datetime[0]." ";
|
||||
}
|
||||
echo "at ".$datetime[1]."</div>";
|
||||
echo "</td> </tr>";
|
||||
echo "</tbody></table>";
|
||||
$timer += 1;
|
||||
}
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
if(isset($_GET['u'])) {
|
||||
$u = $_GET['u'];
|
||||
}
|
||||
else {
|
||||
$u=0;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
|
||||
</a>
|
||||
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
|
||||
</p>
|
||||
|
||||
<?php include("17_menu.tpl");
|
||||
if($session->plus) {
|
||||
?>
|
||||
<table id="search_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td colspan="4">I'm searching</td>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td <?php if(isset($_GET['s']) && $_GET['s'] == 1) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=1<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a></td>
|
||||
<td <?php if(isset($_GET['s']) && $_GET['s'] == 2) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=2<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></a></td>
|
||||
<td <?php if(isset($_GET['s']) && $_GET['s'] == 3) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=3<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></a></td>
|
||||
<td <?php if(isset($_GET['s']) && $_GET['s'] == 4) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=4<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></a></td></tr></tbody>
|
||||
</table><table id="ratio_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<tbody>
|
||||
<tr><td <?php if(isset($_GET['v'])) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&v=1:1<?php if(isset($_GET['s'])) echo "&s=".$_GET['s']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>">1:1</a></td>
|
||||
</tr><tr><td <?php if(!isset($_GET['v'])) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1<?php if(isset($_GET['s'])) echo "&s=".$_GET['s']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>">1:x</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="bid_select" class="buy_select" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<td colspan="4">I'm offering</td>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td <?php if(isset($_GET['b']) && $_GET['b'] == 1) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=1<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a></td>
|
||||
<td <?php if(isset($_GET['b']) && $_GET['b'] == 2) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=2<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></a></td>
|
||||
<td <?php if(isset($_GET['b']) && $_GET['b'] == 3) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=3<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></a></td>
|
||||
<td <?php if(isset($_GET['b']) && $_GET['b'] == 4) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=4<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></a></td></tr></tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="clear"></div><table id="range" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<th colspan="5"><a name="h2"></a>Offers at the marketplace</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Offered
|
||||
<br>to me</td>
|
||||
<td>Wanted
|
||||
<br>from me</td>
|
||||
<td>Player</td>
|
||||
<td>Duration</td>
|
||||
<td>Action</td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(count($market->onsale) > 0) {
|
||||
for($i=0+$u;$i<=40+$u;$i++) {
|
||||
if(isset($market->onsale[$i])) {
|
||||
echo "<tr><td class=\"val\">";
|
||||
$reqMerc = 1;
|
||||
if($market->onsale[$i]['wamt'] > $market->maxcarry) {
|
||||
$reqMerc = round($market->onsale[$i]['wamt']/$market->maxcarry);
|
||||
if($market->onsale[$i]['wamt'] > $market->maxcarry*$reqMerc) {
|
||||
$reqMerc += 1;
|
||||
}
|
||||
}
|
||||
switch($market->onsale[$i]['gtype']) {
|
||||
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
|
||||
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
|
||||
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
|
||||
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" />"; break;
|
||||
}
|
||||
echo $market->onsale[$i]['gamt'];
|
||||
echo "</td> <td class=\"val\">";
|
||||
switch($market->onsale[$i]['wtype']) {
|
||||
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
|
||||
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
|
||||
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
|
||||
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" />"; break;
|
||||
}
|
||||
echo $market->onsale[$i]['wamt'];
|
||||
echo "</td><td class=\"pla\" title=\"".$database->getVillageField($market->onsale[$i]['vref'],"name")."\">";
|
||||
echo "<a href=\"karte.php?d=".$market->onsale[$i]['vref']."&c=".$generator->getMapCheck($market->onsale[$i]['vref'])."\">".$database->getUserField($database->getVillageField($market->onsale[$i]['vref'],"owner"),"username",0)."</a></td>";
|
||||
echo "<td class=\"dur\">".$generator->getTimeFormat($market->onsale[$i]['duration'])."</td>";
|
||||
if(($market->onsale[$i]['wtype'] == 1 && $village->awood <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 2 && $village->aclay <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 3 && $village->airon <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 4 && $village->acrop <= $market->onsale[$i]['wamt'])) {
|
||||
echo "<td class=\"act none\">Not Enough Resource</td></tr>";
|
||||
}
|
||||
else if($reqMerc > $market->merchantAvail()) {
|
||||
echo "<td class=\"act none\">Not Enough Merchant</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "<td class=\"act\"><a href=\"build.php?id=$id&t=1&a=".$session->mchecker."&g=".$market->onsale[$i]['id']."\">Accept offer</a></td>";
|
||||
}else{
|
||||
echo "<td class=\"act\"><a href=\"banned.php\">Accept offer</a></td>";
|
||||
}
|
||||
echo"</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<tr><td class=\"none\" colspan=\"5\">There are no avaliable offers on the market</td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody><tfoot><tr><td colspan="5">
|
||||
<span class="none">
|
||||
<?php
|
||||
if(!isset($_GET['u']) && count($market->onsale) < 40) {
|
||||
echo "<span class=\"none\"><b>«</b></span><span class=\"none\"><b>»</b></span>";
|
||||
}
|
||||
else if (!isset($_GET['u']) && count($market->onsale) > 40) {
|
||||
echo "<span class=\"none\"><b>«</b></span><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=40\">»</a>";
|
||||
}
|
||||
else if(isset($_GET['u']) && count($market->onsale) > $_GET['u']) {
|
||||
if(count($market->onsale) > ($_GET['u']+40) && $_GET['u']-40 < count($market->onsale) && $_GET['u'] != 0) {
|
||||
echo "<a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']-40)."\">«</a><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']+40)."\">»</a>";
|
||||
}
|
||||
else if(count($market->onsale) > $_GET['u']+40) {
|
||||
echo "<span class=\"none\"><b>«</b></span><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']+40)."\">»</a>";
|
||||
}
|
||||
else {
|
||||
echo "<a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']-40)."\">«</a><span class=\"none\"><b>»</b></span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td></tr>
|
||||
</table></div>
|
||||
@@ -0,0 +1,89 @@
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
|
||||
</a>
|
||||
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
|
||||
</p>
|
||||
|
||||
<?php include("17_menu.tpl"); ?>
|
||||
<form method="POST" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="mk2" />
|
||||
|
||||
<table id="sell" cellpadding="1" cellspacing="1">
|
||||
<tr>
|
||||
<th>Offering</th>
|
||||
<td class="val"><input class="text" tabindex="1" name="m1" value="" maxlength="6" /></td>
|
||||
<td class="res">
|
||||
<select name="rid1" tabindex="2" class="dropdown">
|
||||
<option value="1" selected="selected">Lumber</option>
|
||||
<option value="2">Clay</option>
|
||||
<option value="3">Iron</option>
|
||||
<option value="4">Crop</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="tra"><input class="check" type="checkbox" tabindex="5" name="d1" value="1" /> max. time of transport: <input class="text" tabindex="6" name="d2" value="2" maxlength="2" /> hours</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Searching</th>
|
||||
<td class="val"><input class="text" tabindex="3" name="m2" value="" maxlength="6" /></td>
|
||||
<td class="res">
|
||||
<select name="rid2" tabindex="4" class="dropdown">
|
||||
<option value="1">Lumber</option>
|
||||
<option value="2" selected="selected">Clay</option>
|
||||
<option value="3">Iron</option>
|
||||
<option value="4">Crop</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="al">
|
||||
<?php
|
||||
if($session->userinfo['alliance'] != 0) {
|
||||
echo "<input class=\"check\" type=\"checkbox\" tabindex=\"7\" name=\"ally\" value=\"1\" /> own alliance only";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><p>Merchants: <?php echo $market->merchantAvail(); ?>/<?php echo $market->merchant; ?><p><input type="image" tabindex="8" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" <?php if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p></form>
|
||||
<?php
|
||||
if(count($market->onmarket) > 0) {
|
||||
echo "<table id=\"sell_overview\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><th colspan=\"6\">Own offers</th></tr><tr><td> </td><td>Offer</td>
|
||||
<td>Search</td><td>Merchants</td><td>Alliance</td><td>Duration</td></tr></thead><tbody>";
|
||||
foreach($market->onmarket as $offer) {
|
||||
if($session->access != BANNED){
|
||||
echo "<tr><td class=\"abo\"><a href=\"build.php?id=$id&t=2&a=5&del=".$offer['id']."\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"Delete\" /></a></td>";
|
||||
echo "<td class=\"val\">";
|
||||
}else{
|
||||
echo "<tr><td class=\"abo\"><a href=\"banned.php\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"Delete\" /></a></td>";
|
||||
echo "<td class=\"val\">";
|
||||
}
|
||||
switch($offer['gtype']) {
|
||||
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
|
||||
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
|
||||
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
|
||||
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" />"; break;
|
||||
}
|
||||
echo $offer['gamt'];
|
||||
echo "</td><td class=\"val\">";
|
||||
switch($offer['wtype']) {
|
||||
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
|
||||
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
|
||||
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
|
||||
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" />"; break;
|
||||
}
|
||||
echo $offer['wamt'];
|
||||
echo "</td><td class=\"tra\">1</td><td class=\"al\">";
|
||||
echo ($offer['alliance'] == 0)? 'No' : 'Yes';
|
||||
echo "</td><td class=\"dur\">";
|
||||
if($offer['maxtime'] != 0) {
|
||||
echo $offer['maxtime']/3600;
|
||||
echo " hrs.";
|
||||
}
|
||||
else {
|
||||
echo "All";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,259 @@
|
||||
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
|
||||
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
|
||||
</a>
|
||||
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
|
||||
</p>
|
||||
|
||||
<?php include("17_menu.tpl");
|
||||
|
||||
|
||||
if(isset($_GET['c'])){
|
||||
?>
|
||||
|
||||
<p><b>NPC completed.</b> Cost 3<img src="img/x.gif" class="gold" alt="Gold" title="Gold" /></p>
|
||||
<a href="javascript: history.go(-2)">Back to building</a>
|
||||
<?php } else { ?>
|
||||
|
||||
<p>With the NPC merchant you can distribute the resources in your warehouse as you desire. <br /><br />
|
||||
The first line shows the current stock. In the second line you can choose another distribution. The third line shows the difference between the old and new stock.</p>
|
||||
|
||||
|
||||
<script language="JavaScript">
|
||||
var overall;
|
||||
function calculateRes() {
|
||||
resObj=document.getElementsByName("m2");
|
||||
overall=0;
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
var tmp="";
|
||||
for (j=0; j<resObj[i].value.length; j++)
|
||||
if ((resObj[i].value.charAt(j)>="0") && (resObj[i].value.charAt(j)<="9")) tmp=tmp+resObj[i].value.charAt(j);
|
||||
resObj[i].value=tmp;
|
||||
if (tmp=="") tmp="0";
|
||||
newRes=Math.round(parseInt(tmp)*summe/100);
|
||||
if (((i<3) && (newRes<=max123)) || ((i==3) && (newRes<=max4)))
|
||||
newHTML=newRes;
|
||||
else
|
||||
newHTML="<span class='corr'>"+newRes+"</span>";
|
||||
document.getElementById("new"+i).innerHTML=newHTML;
|
||||
overall+=parseInt(tmp);
|
||||
}
|
||||
document.getElementById("overall").innerHTML=overall+"%";
|
||||
}
|
||||
function normalize() {
|
||||
calculateRes();
|
||||
resObj=document.getElementsByName("m2");
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
tmp=parseInt(resObj[i].value);
|
||||
tmp=tmp*(100/overall);
|
||||
resObj[i].value=Math.round(tmp);
|
||||
}
|
||||
calculateRes();
|
||||
}
|
||||
|
||||
|
||||
function calculateRest() {
|
||||
resObj=document.getElementsByName("m2[]");
|
||||
overall=0;
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
var tmp="";
|
||||
for (j=0; j<resObj[i].value.length; j++)
|
||||
if ((resObj[i].value.charAt(j)>="0") && (resObj[i].value.charAt(j)<="9")) tmp=tmp+resObj[i].value.charAt(j);
|
||||
if (tmp=="") {
|
||||
tmp="0";
|
||||
newRes=0;
|
||||
resObj[i].value="";
|
||||
} else {
|
||||
newRes=parseInt(tmp);
|
||||
if ((i<3) && (newRes>max123)) newRes=max123;
|
||||
if ((i==3) && (newRes>max4)) newRes=max4;
|
||||
resObj[i].value=newRes;
|
||||
}
|
||||
dif=newRes-parseInt(document.getElementById("org"+i).innerHTML);
|
||||
newHTML=dif;
|
||||
if (dif>0) newHTML="+"+dif;
|
||||
document.getElementById("diff"+i).innerHTML=newHTML;
|
||||
overall+=newRes;
|
||||
}
|
||||
document.getElementById("newsum").innerHTML=overall;
|
||||
rest=parseInt(document.getElementById("org4").innerHTML)-overall;
|
||||
document.getElementById("remain").innerHTML=rest;
|
||||
testSum();
|
||||
}
|
||||
|
||||
function fillup(nr) {
|
||||
resObj=document.getElementsByName("m2[]");
|
||||
if (nr<3) {
|
||||
resObj[nr].value=max123;
|
||||
} else {
|
||||
resObj[nr].value=max4;
|
||||
}
|
||||
calculateRest();
|
||||
}
|
||||
function portionOut() {
|
||||
restRes=parseInt(document.getElementById("remain").innerHTML);
|
||||
rest=restRes;
|
||||
resObj=document.getElementsByName("m2[]");
|
||||
nullCount=0;
|
||||
notNullCount=0;
|
||||
// Z�hlen
|
||||
for (j=0; j<resObj.length; j++) {
|
||||
if ((restRes>0) && (resObj[j].value=="")) nullCount++;
|
||||
if ((restRes<0) && (resObj[j].value!="")) notNullCount++;
|
||||
}
|
||||
// Verteilen
|
||||
nullCount2=0;
|
||||
if (restRes>0) {
|
||||
// In allen Feldern schon Zahlen?
|
||||
if (nullCount==0) {
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
free=max123-parseInt(resObj[i].value);
|
||||
resObj[i].value=(parseInt(resObj[i].value)+Math.round(rest/(4-i)));
|
||||
rest=rest-Math.min(free,Math.round(rest/(4-i)));
|
||||
if ((i<3) && (parseInt(resObj[i].value)<max123)) nullCount2++;
|
||||
}
|
||||
} else {
|
||||
for (i=0; i<resObj.length; i++) {
|
||||
if (resObj[i].value=="") {
|
||||
resObj[i].value=Math.round(rest/nullCount);
|
||||
rest=rest-Math.round(rest/nullCount);
|
||||
nullCount--;
|
||||
}
|
||||
if ((i<3) && (parseInt(resObj[i].value)<max123)) nullCount2++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (j=0; j<resObj.length; j++) {
|
||||
if (parseInt(resObj[j].value)>0) {
|
||||
resObj[j].value=(parseInt(resObj[j].value)+Math.round(rest/notNullCount));
|
||||
rest=rest-Math.round(rest/notNullCount);
|
||||
notNullCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
calculateRest();
|
||||
// Noch irgendein Rest?
|
||||
if (rest>0) {
|
||||
if (max123>max4) {
|
||||
for (j=0; j<3; j++) {
|
||||
if (parseInt(resObj[j].value)<max123) {
|
||||
resObj[j].value=(parseInt(resObj[j].value)+Math.round(rest/nullCount2));
|
||||
rest=rest-Math.round(rest/nullCount2);
|
||||
nullCount2--;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
resObj[3].value=(parseInt(resObj[3].value)+rest);
|
||||
}
|
||||
}
|
||||
calculateRest();
|
||||
}
|
||||
|
||||
function testSum() {
|
||||
if (document.getElementById("remain").innerHTML!=0) {
|
||||
document.getElementById("submitText").innerHTML="<a href='javascript:portionOut();'>Distribute resources at (step 1 of 2)</a>";
|
||||
document.getElementById("submitText").style.display="block";
|
||||
document.getElementById("submitButton").style.display="none";
|
||||
} else {
|
||||
document.getElementById("submitText").innerHTML="";
|
||||
document.getElementById("submitText").style.display="none";
|
||||
document.getElementById("submitButton").style.display="block";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script language="JavaScript">var summe=<?php echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); ?>;var max123=<?php echo $village->maxstore; ?>;var max4=<?php echo $village->maxcrop; ?>;</script>
|
||||
<form method="post" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="mk3" />
|
||||
<input type="hidden" name="t" value="3" />
|
||||
|
||||
<table id="npc" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="5">NPC Trade</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(0);"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a>
|
||||
<span id="org0"><?php echo floor($village->awood); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(1);"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></a>
|
||||
<span id="org1"><?php echo floor($village->aclay); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(2);"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></a>
|
||||
<span id="org2"><?php echo floor($village->airon); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="all">
|
||||
<a href="javascript:fillup(3);"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></a>
|
||||
<span id="org3"><?php echo floor($village->acrop); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="sum">Sum: <span id="org4"><?php echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); ?></span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r1'])) { echo "value=\"".$_GET['r1']."\""; } ?>/>
|
||||
<input type="hidden" name="m1[]" value="<?php echo floor($village->awood); ?>" />
|
||||
</td>
|
||||
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r2'])) { echo "value=\"".$_GET['r2']."\""; } ?>/>
|
||||
<input type="hidden" name="m1[]" value="<?php echo floor($village->aclay); ?>" />
|
||||
</td>
|
||||
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r3'])) { echo "value=\"".$_GET['r3']."\""; } ?>/>
|
||||
<input type="hidden" name="m1[]" value="<?php echo floor($village->airon); ?>" />
|
||||
</td>
|
||||
|
||||
<td class="sel">
|
||||
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r4'])) { echo "value=\"".$_GET['r4']."\""; } ?>/>
|
||||
<input type="hidden" name="m1[]" value="<?php echo floor($village->acrop); ?>" />
|
||||
</td>
|
||||
|
||||
<td class="sum">Sum: <span id="newsum"><?php if(isset($_GET['r1']) && isset($_GET['r2']) && isset($_GET['r3']) && isset($_GET['r4'])) { echo $_GET['r1']+$_GET['r2']+$_GET['r3']+$_GET['r4']; } else { echo 0; } ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td class="rem">
|
||||
<span id="diff0"><?php echo 0-floor($village->awood); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="rem">
|
||||
<span id="diff1"><?php echo 0-floor($village->aclay); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="rem">
|
||||
<span id="diff2"><?php echo 0-floor($village->airon); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="rem">
|
||||
<span id="diff3"><?php echo 0-floor($village->acrop); ?></span>
|
||||
</td>
|
||||
|
||||
<td class="sum">Rest: <span id="remain">
|
||||
<?php if(isset($_GET['r1']) && isset($_GET['r2']) && isset($_GET['r3']) && isset($_GET['r4'])) {
|
||||
echo floor($village->awood+$village->acrop+$village->airon+$village->aclay)-($_GET['r1']+$_GET['r2']+$_GET['r3']+$_GET['r4']);
|
||||
} else { echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); } ?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p id="submitButton">
|
||||
<?php if($session->userinfo['gold'] > 3) { ?><a href="javascript:document.snd.submit();">Trade resources at (step 2 of 2)</a> <span class="none">(Costs: <img src="img/x.gif" class="gold_g" alt="Gold" title="Gold" /><b>3</b>)</span><?php } else { echo"<span class='none'>Trade resources at (step 2 of 2)</span> (Costs: <img src='img/x.gif' class='gold' alt='Gold' title='Gold' /><b>3</b>)"; }?> </p>
|
||||
<p id="submitText"></p>
|
||||
</form>
|
||||
<script>
|
||||
testSum();
|
||||
</script>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>"<?php if(!isset($_GET['t'])) { echo "class=\"selected\""; } ?>">Send Resouces</a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=1" <?php if(isset($_GET['t']) && $_GET['t'] == 1) { echo "class=\"selected\""; } ?>>Buy</a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=2" <?php if(isset($_GET['t']) && $_GET['t'] == 2) { echo "class=\"selected\""; } ?>>Offer</a>
|
||||
<?php if($session->userinfo['gold'] > 3) {
|
||||
?>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=3" <?php if(isset($_GET['t']) && $_GET['t'] == 3) { echo "class=\"selected\""; } ?>>NPC trading</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,72 @@
|
||||
<div id="build" class="gid18"><a href="#" onClick="return Popup(18,4);" class="build_logo">
|
||||
<img class="building g18" src="img/x.gif" alt="Embassy" title="Embassy" />
|
||||
</a>
|
||||
<h1>Embassy <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">The embassy is a place for diplomats. The higher its level the more options the king gains.</p>
|
||||
|
||||
<?php
|
||||
if($village->resarray['f'.$id] >= 3 && $session->alliance == 0) {
|
||||
include("18_create.tpl");
|
||||
}
|
||||
if($session->alliance != 0) {
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" id=\"ally_info\">
|
||||
<thead><tr>
|
||||
<th colspan=\"2\">Alliance</th>
|
||||
</tr></thead>
|
||||
|
||||
<tbody><tr>
|
||||
<th>Tag</th>
|
||||
<td>".$alliance->allianceArray['tag']."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>".$alliance->allianceArray['name']."</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td class=\"empty\" colspan=\"2\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=\"2\"><a href=\"allianz.php\"> » to the alliance</a></td>
|
||||
</tr></tbody>
|
||||
</table>";
|
||||
}
|
||||
else {
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="join">
|
||||
<form method="post" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id ?>">
|
||||
<input type="hidden" name="a" value="2">
|
||||
|
||||
<thead><tr>
|
||||
<th colspan="3">join alliance</th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<?php
|
||||
if($alliance->gotInvite) {
|
||||
foreach($alliance->inviteArray as $invite) {
|
||||
if($session->access!=BANNED){
|
||||
echo "<td class=\"abo\"><a href=\"build.php?id=".$id."&a=2&d=".$invite['id']."\"><img class=\"del\" src=\"img/x.gif\" alt=\"refuse\" title=\"refuse\" /></a></td>
|
||||
<td class=\"nam\"><a href=\"allianz.php?aid=".$invite['alliance']."\"> ".$database->getAllianceName($invite['alliance'])."</a></td>
|
||||
<td class=\"acc\"><a href=\"build.php?id=".$id."&a=3&d=".$invite['id']."\"> accept</a></td>";
|
||||
}else{
|
||||
echo "<td class=\"abo\"><a href=\"banned.php\"><img class=\"del\" src=\"img/x.gif\" alt=\"refuse\" title=\"refuse\" /></a></td>
|
||||
<td class=\"nam\"><a href=\"banned.php\"> ".$database->getAllianceName($invite['alliance'])."</a></td>
|
||||
<td class=\"acc\"><a href=\"banned.php\"> accept</a></td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<td colspan=\"3\" class=\"none\">There are no invitations available.</td>";
|
||||
}
|
||||
?>
|
||||
</tr></tbody></table>
|
||||
<?php
|
||||
if($alliance->gotInvite) {
|
||||
echo "<p class=\"error2\"></p>";
|
||||
}
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php if($session->access!=BANNED){ ?>
|
||||
<table cellpadding="1" cellspacing="1" id="found">
|
||||
<form method="post" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id ?>">
|
||||
<input type="hidden" name="ft" value="ali1">
|
||||
<thead><tr>
|
||||
<th colspan="2">found alliance</th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<th>Tag</th>
|
||||
<td class="tag">
|
||||
<input class="text" name="ally1" value="<?php echo $form->getValue("ally1"); ?>" maxlength="8">
|
||||
<span class="error"><?php echo $form->getError("ally1"); ?></span>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td class="nam">
|
||||
<input class="text" name="ally2" value="<?php echo $form->getValue("ally2"); ?>" maxlength="25">
|
||||
<span class="error"><?php echo $form->getError("ally2"); ?></span>
|
||||
</td>
|
||||
|
||||
</tr></tbody>
|
||||
</table>
|
||||
|
||||
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p><table cellpadding="1" cellspacing="1" id="join">
|
||||
|
||||
<?php }else{ ?>
|
||||
<table cellpadding="1" cellspacing="1" id="found">
|
||||
<form method="post" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id ?>">
|
||||
<input type="hidden" name="ft" value="ali1">
|
||||
<thead><tr>
|
||||
<th colspan="2">found alliance</th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<th>Tag</th>
|
||||
<td class="tag">
|
||||
<input class="text" name="ally1" disabled="disabled" value="<?php echo $form->getValue("ally1"); ?>" maxlength="8">
|
||||
<span class="error"><?php echo $form->getError("ally1"); ?></span>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td class="nam">
|
||||
<input class="text" name="ally2" disabled="disabled" value="<?php echo $form->getValue("ally2"); ?>" maxlength="25">
|
||||
<span class="error"><?php echo $form->getError("ally2"); ?></span>
|
||||
</td>
|
||||
|
||||
</tr></tbody>
|
||||
</table>
|
||||
<?php
|
||||
echo "Banned player can't create an alliance.";
|
||||
?></br><?php
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<div id="build" class="gid19"><a href="#" onClick="return Popup(19,4);" class="build_logo">
|
||||
<img class="building g19" src="img/x.gif" alt="Barracks" title="Barracks" />
|
||||
</a>
|
||||
<h1>Barracks <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">All foot soldiers are trained in the barracks. The higher the level of the barracks, the faster the troops are trained.</p>
|
||||
|
||||
<?php if ($building->getTypeLevel(19) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Name</td>
|
||||
<td>Quantity</td>
|
||||
<td>Max</td>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
include("19_train.tpl");
|
||||
?></table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" onclick="this.disabled=true;this.form.submit();"/></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>Training can commence when barracks are completed.</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(1);
|
||||
if(count($trainlist) > 0) {
|
||||
//$timer = 2*count($trainlist);
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
for ($i=($session->tribe-1)*10+1;$i<=($session->tribe-1)*10+4;$i++) {
|
||||
if ($i <> 4 && $i <> 23 && $i <> 24 && ($technology->getTech($i) || $i%10 == 1)) {
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood'])."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay'])."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron'])."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop'])."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,false)."; return false;\">(".$technology->maxUnit($i,false).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid2"><a href="#" onClick="return Popup(2,4);" class="build_logo">
|
||||
<img class="building g2" src="img/x.gif" alt="<?php echo B2; ?>" title="<?php echo B2; ?>" />
|
||||
</a>
|
||||
<h1><?php echo B2; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo B2_DESC; ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CUR_PROD; ?>:</th>
|
||||
<td><b><?php echo $bid2[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid2[$village->resarray['f'.$id]+1]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?></p></div>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<div id="build" class="gid20"><a href="#" onClick="return Popup(20,4);" class="build_logo">
|
||||
<img class="building g20" src="img/x.gif" alt="Stable" title="Stable" /> </a>
|
||||
|
||||
<h1>Stable <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Cavalry can be trained in the stable. The higher its level the faster the troops are trained.<br /></p>
|
||||
|
||||
<?php if ($building->getTypeLevel(20) > 0) { ?>
|
||||
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Quantity</td>
|
||||
<td>Max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
include("20_".$session->tribe.".tpl");
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>Training can commence when stables are completed.</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(2);
|
||||
if(count($trainlist) > 0) {
|
||||
//$timer = 2*count($trainlist);
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</span></td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
?>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?> </p></div>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
$success = 0;
|
||||
for($i=4;$i<=6;$i++) {
|
||||
if($technology->getTech($i)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
if(${'u'.$i}['drinking'] <= $building->getTypeLevel(41)) {
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".(${'u'.$i}['pop']-1)."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
}else{
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".(${'u'.$i}['pop'])."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
}
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div></td>
|
||||
<td class=\"val\">
|
||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"$i\">
|
||||
</td>
|
||||
|
||||
<td class=\"max\">
|
||||
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
|
||||
</td>
|
||||
</tr>";
|
||||
$success += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td colspan=\"3\"><div class=\"none\" align=\"center\">No units avaliable. Research at academy</div></td></tr>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
$success = 0;
|
||||
for($i=15;$i<=16;$i++) {
|
||||
if($technology->getTech($i)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div></td>
|
||||
<td class=\"val\">
|
||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"$i\">
|
||||
</td>
|
||||
|
||||
<td class=\"max\">
|
||||
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
|
||||
</td>
|
||||
</tr>";
|
||||
$success += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$success = 0;
|
||||
for($i=23;$i<=26;$i++) {
|
||||
if($technology->getTech($i)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div></td>
|
||||
<td class=\"val\">
|
||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"$i\">
|
||||
</td>
|
||||
|
||||
<td class=\"max\">
|
||||
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
|
||||
</td>
|
||||
</tr>";
|
||||
$success += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$success = 0;
|
||||
for($i=35;$i<=36;$i++) {
|
||||
if($technology->getTech($i)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div></td>
|
||||
<td class=\"val\">
|
||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"$i\">
|
||||
</td>
|
||||
|
||||
<td class=\"max\">
|
||||
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
|
||||
</td>
|
||||
</tr>";
|
||||
$success += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,109 @@
|
||||
<div id="build" class="gid21"><a href="#" onClick="return Popup(21,4, 'gid');" class="build_logo">
|
||||
<img class="building g21" src="img/x.gif" alt="Workshop" title="Workshop" /> </a>
|
||||
|
||||
<h1>Workshop <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Siege engines like catapults and rams can be built in the workshop. The higher its level the faster the units are produced.</p>
|
||||
<?php if ($building->getTypeLevel(21) > 0) { ?>
|
||||
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Quantity</td>
|
||||
<td>Max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$success = 0;
|
||||
$start = ($session->tribe == 1)? 7 : (($session->tribe == 2)? 17 : 27);
|
||||
if ($session->tribe == 1){
|
||||
$start = 7;
|
||||
}else if ($session->tribe == 2){
|
||||
$start = 17;
|
||||
}else if ($session->tribe == 3){
|
||||
$start = 27;
|
||||
}else if ($session->tribe == 4){
|
||||
$start = 37;
|
||||
}else if ($session->tribe == 5){
|
||||
$start = 47;
|
||||
}
|
||||
for($i=$start;$i<=($start+1);$i++) {
|
||||
if($technology->getTech($i)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid21[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div></td>
|
||||
<td class=\"val\">
|
||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"$i\">
|
||||
</td>
|
||||
|
||||
<td class=\"max\">
|
||||
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
|
||||
</td>
|
||||
</tr>";
|
||||
$success += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>Training can commence when workshop are completed.</b><br>\n";
|
||||
}
|
||||
|
||||
$trainlist = $technology->getTrainingList(3);
|
||||
if(count($trainlist) > 0) {
|
||||
//$timer = 2*count($trainlist);
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<div id="build" class="gid22"><a href="#" onClick="return Popup(22,4);" class="build_logo">
|
||||
|
||||
<img class="building g22" src="img/x.gif" alt="Academy" title="Academy" />
|
||||
</a>
|
||||
<h1>Academy <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">In the academy new unit types can be researched. By increasing its level you can order the research of better units.</p>
|
||||
<?php
|
||||
if ($building->getTypeLevel(22) > 0) {
|
||||
include("22_".$session->tribe.".tpl");
|
||||
} else {
|
||||
echo "<p><b>Research can commence when academy is completed.</b><br>\n";
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,153 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Academy</td>
|
||||
<td>Action</td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=2;$i<=9;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">Expand<br>warehouse</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">Expand granary</span></div></td>";
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">Expand<br>granary</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(22,${'r'.$i});
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
|
||||
}
|
||||
else if (count($acares) > 0) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
Research in progress</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">Research</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
|
||||
}
|
||||
$success += 1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(2) && !$technology->getTech(2)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u2\" title=\"Praetorian\" alt=\"Praetorian\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(2, 1);\" href=\"#\">Praetorian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 1);\">Academy</a>
|
||||
<span title=\"+2\"> Level 1</span><br /><a href=\"#\" onclick=\"return Popup(13, 4);\">Armoury </a><span title=\"+1\"> Level 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(3) && !$technology->getTech(3)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u3\" title=\"Imperian\" alt=\"Imperian\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(3, 1);\" href=\"#\">Imperian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
|
||||
<span title=\"+2\"> Level 5</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\"> Level 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(4) && !$technology->getTech(4)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u4\" title=\"Equites Legati\" alt=\"Equites Legati\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(4, 1);\" href=\"#\">Equites Legati</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\"> Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+1\"> Level 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(5) && !$technology->getTech(5)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u5\" title=\"Equites Imperatoris\" alt=\"Equites Imperatoris\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(5, 1);\" href=\"#\">Equites Imperatoris</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\"> Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+5\"> Level 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(6) && !$technology->getTech(6)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u6\" title=\"Equites Caesaris\" alt=\"Equites Caesaris\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(6, 1);\" href=\"#\">Equites Caesaris</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\"> Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
Stable</a><span title=\"+10\"> Level 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(7) && !$technology->getTech(7)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u7\" title=\"Battering Ram\" alt=\"Battering Ram\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(7, 1);\" href=\"#\">Battering Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
|
||||
<span title=\"+7\"> Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\"> Level 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(8) && !$technology->getTech(8)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u8\" title=\"Fire Catapult\" alt=\"Fire Catapult\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(8, 1);\" href=\"#\">Fire Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
|
||||
<span title=\"+10\"> Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\"> Level 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(9) && !$technology->getTech(9)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u9\" title=\"Senator\" alt=\"Senator\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(9, 1);\" href=\"#\">Senator</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point</a><span title=\"+9\"> Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
Academy</a><span title=\"+17\"> Level 20</span></td></tr>";
|
||||
}
|
||||
echo "<script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"show more\"
|
||||
: \"hide more\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
//$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,145 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Academy</td>
|
||||
<td>Action</td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
for($i=2;$i<=9;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">Expand<br>warehouse</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">Expand granary</span></div></td>";
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">Expand<br>granary</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
$time = $technology->calculateAvaliable($i);
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">Too few<br>resources</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">Research</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
|
||||
}
|
||||
$success += 1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(2) && !$technology->getTech(2)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u2\" title=\"Praetorian\" alt=\"Praetorian\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(2, 1);\" href=\"#\">Praetorian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 1);\">Academy</a>
|
||||
<span title=\"+2\">Level 1</span><br /><a href=\"#\" onclick=\"return Popup(13, 4);\">Armoury </a><span title=\"+1\">Level 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(3) && !$technology->getTech(3)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u3\" title=\"Imperian\" alt=\"Imperian\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(3, 1);\" href=\"#\">Imperian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
|
||||
<span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">Level 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(4) && !$technology->getTech(4)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u4\" title=\"Equites Legati\" alt=\"Equites Legati\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(4, 1);\" href=\"#\">Equites Legati</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+1\">Level 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(5) && !$technology->getTech(5)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u5\" title=\"Equites Imperatoris\" alt=\"Equites Imperatoris\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(5, 1);\" href=\"#\">Equites Imperatoris</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+5\">Level 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(6) && !$technology->getTech(6)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u6\" title=\"Equites Caesaris\" alt=\"Equites Caesaris\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(6, 1);\" href=\"#\">Equites Caesaris</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
Stable</a><span title=\"+10\">Level 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(7) && !$technology->getTech(7)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u7\" title=\"Battering Ram\" alt=\"Battering Ram\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(7, 1);\" href=\"#\">Battering Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
|
||||
<span title=\"+7\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\">Level 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(8) && !$technology->getTech(8)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u8\" title=\"Fire Catapult\" alt=\"Fire Catapult\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(8, 1);\" href=\"#\">Fire Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
|
||||
<span title=\"+10\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">Level 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(9) && !$technology->getTech(9)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u9\" title=\"Senator\" alt=\"Senator\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(9, 1);\" href=\"#\">Senator</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point</a><span title=\"+9\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
Academy</a><span title=\"+17\">Level 20</span></td></tr>";
|
||||
}
|
||||
echo "<script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"show more\"
|
||||
: \"hide more\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,149 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Academy</td>
|
||||
<td>Action</td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=12;$i<=19;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">Expand<br>warehouse</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">Expand granary</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">Expand<br>granary</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(22,${'r'.$i});
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
|
||||
}
|
||||
else if ( count($acares) > 0 ) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
Research in progress</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">Research</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
|
||||
}
|
||||
$success += 1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(13) && !$technology->getTech(13)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u13\" title=\"Axeman\" alt=\"Axeman\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(13, 1);\" href=\"#\">Axeman</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
|
||||
<span title=\"+2\">Level 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">Level 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(14) && !$technology->getTech(14)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u14\" title=\"Scout\" alt=\"Scout\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(14, 1);\" href=\"#\">Scout</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 1</span><br /><a href=\"#\" onclick=\"return Popup(15, 4);\">Main Building</a>
|
||||
<span title=\"+3\">Level 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(15) && !$technology->getTech(15)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u15\" title=\"Paladin\" alt=\"Paladin\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(15, 1);\" href=\"#\">Paladin</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable </a>
|
||||
<span title=\"+5\">Level 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(16) && !$technology->getTech(16)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u16\" title=\"Teutonic Knight\" alt=\"Teutonic Knight\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(16, 1);\" href=\"#\">Teutonic Knight</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
Stable </a><span title=\"+3\">Level 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(17) && !$technology->getTech(17)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u17\" title=\"Ram\" alt=\"Ram\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(17, 1);\" href=\"#\">Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
|
||||
<span title=\"+7\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop </a><span title=\"+1\">Level 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(18) && !$technology->getTech(18)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u18\" title=\"Catapult\" alt=\"Catapult\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(18, 1);\" href=\"#\">Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
|
||||
<span title=\"+10\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+12\">Level 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(19) && !$technology->getTech(19)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u19\" title=\"Chief\" alt=\"Chief\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(19, 1);\" href=\"#\">Chief</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point </a><span title=\"+4\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
Academy </a><span title=\"+17\">Level 20</span></td></tr>";
|
||||
}
|
||||
echo " <script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"show more\"
|
||||
: \"hide more\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
//$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,153 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Academy</td>
|
||||
<td>Action</td>
|
||||
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=22;$i<=29;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">Expand<br>warehouse</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">Expand granary</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">Expand<br>granary</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(22,${'r'.$i});
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
|
||||
}
|
||||
else if ( count($acares) > 0 ) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
Research in progress</td></tr>";
|
||||
}
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">Research</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
|
||||
}
|
||||
$success +=1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody></table>
|
||||
<?php if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(22) && !$technology->getTech(22)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u22\" title=\"Swordsman\" alt=\"Swordsman\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(22, 1);\" href=\"#\">Swordsman</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
|
||||
<span title=\"+2\"> Level 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\"> Level 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(23) && !$technology->getTech(23)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u23\" title=\"Pathfinder\" alt=\"Pathfinder\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(23, 1);\" href=\"#\">Pathfinder</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
|
||||
<span title=\"+2\"> Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable </a><span title=\"+1\"> Level 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(24) && !$technology->getTech(24)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u24\" title=\"Theutates Thunder\" alt=\"Theutates Thunder\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(24, 1);\" href=\"#\">Theutates Thunder</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\"> Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a>
|
||||
<span title=\"+3\"> Level 3</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(25) && !$technology->getTech(25)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u25\" title=\"Druidrider\" alt=\"Druidrider\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(25, 1);\" href=\"#\">Druidrider</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\"> Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a>
|
||||
<span title=\"+5\"> Level 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(26) && !$technology->getTech(26)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u26\" title=\"Haeduan\" alt=\"Haeduan\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(26, 1);\" href=\"#\">Haeduan</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\"> Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
Stable</a><span title=\"+10\"> Level 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(27) && !$technology->getTech(27)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u27\" title=\"Ram\" alt=\"Ram\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(27, 1);\" href=\"#\">Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
|
||||
<span title=\"+7\"> Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\"> Level 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(28) && !$technology->getTech(28)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u28\" title=\"Trebuchet\" alt=\"Trebuchet\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(28, 1);\" href=\"#\">Trebuchet</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
|
||||
<span title=\"+10\"> Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\"> Level 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(29) && !$technology->getTech(29)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u29\" title=\"Chieftain\" alt=\"Chieftain\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(29, 1);\" href=\"#\">Chieftain</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(14, 4);\">Rally Point</a><span title=\"+9\"> Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
Academy</a><span title=\"+17\"> Level 20</span></td></tr>";
|
||||
}
|
||||
echo " <script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"show more\"
|
||||
: \"hide more\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,148 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Academy</td>
|
||||
<td>Action</td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$fail = $success = 0;
|
||||
$acares = $technology->grabAcademyRes();
|
||||
for($i=32;$i<=39;$i++) {
|
||||
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
|
||||
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">Expand<br>warehouse</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['crop'] > $village->maxcrop) {
|
||||
echo "<br><span class=\"none\">Expand granary</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">Expand<br>granary</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
|
||||
$time = $technology->calculateAvaliable($i);
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
echo "<td class=\"none\">
|
||||
<div class=\"none\">Too few<br>resources</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if ( count($acares) > 0 ) {
|
||||
echo "</td>";
|
||||
echo "<td class=\"none\">
|
||||
Research in progress</td></tr>";
|
||||
}
|
||||
else {
|
||||
else if($session->access != BANNED){
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"build.php?id=$id&a=$i&c=".$session->mchecker."\">Research</a></td></tr>";
|
||||
}else{
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
|
||||
}
|
||||
$success += 1;
|
||||
}
|
||||
else {
|
||||
$fail += 1;
|
||||
}
|
||||
}
|
||||
if($success == 0) {
|
||||
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($fail > 0) {
|
||||
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
|
||||
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
|
||||
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
|
||||
if(!$technology->meetRRequirement(33) && !$technology->getTech(33)) {
|
||||
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u33\" title=\"".U33."\" alt=\"".U33."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(33, 1);\" href=\"#\">".U33."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
|
||||
<span title=\"+2\">Level 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">Level 1</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(34) && !$technology->getTech(34)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u34\" title=\"".U34."\" alt=\"".U34."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(34, 1);\" href=\"#\">".U34."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 1</span><br /><a href=\"#\" onclick=\"return Popup(15, 4);\">Main Building</a>
|
||||
<span title=\"+3\">Level 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(35) && !$technology->getTech(35)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u35\" title=\"".U35."\" alt=\"".U35."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(35, 1);\" href=\"#\">".U35."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable </a>
|
||||
<span title=\"+5\">Level 5</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(36) && !$technology->getTech(36)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u36\" title=\"".U36."\" alt=\"".U36."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(36, 1);\" href=\"#\">".U36."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
|
||||
Stable </a><span title=\"+3\">Level 10</span> </td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(17) && !$technology->getTech(17)) {
|
||||
echo "
|
||||
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u37\" title=\"".U37."\" alt=\"".U37."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(37, 1);\" href=\"#\">".U37."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
|
||||
<span title=\"+7\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop </a><span title=\"+1\">Level 1</span></td></tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(38) && !$technology->getTech(38)) {
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u38\" title=\"".U38."\" alt=\"".U38."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(38, 1);\" href=\"#\">".U38."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
|
||||
<span title=\"+10\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+12\">Level 15</span> </td>
|
||||
</tr>";
|
||||
}
|
||||
if(!$technology->meetRRequirement(39) && !$technology->getTech(39)) {
|
||||
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u39\" title=\"".U33."\" alt=\"".U33."\" src=\"img/x.gif\"/>
|
||||
<a onclick=\"return Popup(39, 1);\" href=\"#\">".U39."</a></div></td><td class=\"cond\">
|
||||
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point </a><span title=\"+4\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
|
||||
Academy </a><span title=\"+17\">Level 20</span></td></tr>";
|
||||
}
|
||||
echo " <script type=\"text/javascript\">
|
||||
//<![CDATA[
|
||||
$(\"researchFuture\").toggle = (function()
|
||||
{
|
||||
this.toggleClass(\"hide\");
|
||||
|
||||
$(\"researchFutureLink\").set(\"text\",
|
||||
this.hasClass(\"hide\")
|
||||
? \"show more\"
|
||||
: \"hide more\"
|
||||
);
|
||||
|
||||
return false;
|
||||
}).bind($(\"researchFuture\"));
|
||||
//]]>
|
||||
</script>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
//$acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,95 @@
|
||||
<div id="build" class="gid23"><a href="#" onClick="return Popup(23,4);" class="build_logo">
|
||||
<img class="building g23" src="img/x.gif" alt="Cranny" title="Cranny" />
|
||||
</a>
|
||||
<h1>Cranny <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">The cranny is used to hide some of your resources when the village is attacked. These resources cannot be stolen.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Currently hidden units per resource:</th>
|
||||
<?php
|
||||
if($session->tribe == 1) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($session->tribe == 2) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($session->tribe == 3) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*2; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($session->tribe == 4) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($session->tribe == 5) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Hidden units per resource at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<?php
|
||||
if($session->tribe == 1) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1]['attri']; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($session->tribe == 2) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1]['attri']; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($session->tribe == 3) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1]['attri']*2; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($session->tribe == 4) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1]['attri']; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if($session->tribe == 5) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1]['attri']; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,18 @@
|
||||
<div id="build" class="gid24"><a href="#" onClick="return Popup(24,4);" class="build_logo">
|
||||
<img class="building g24" src="img/x.gif" alt="Town Hall" title="Town Hall" />
|
||||
</a>
|
||||
<h1>Town Hall <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">You can hold pompous celebrations in the Town Hall. Such a celebration increases your culture points. Building up your Town Hall to a higher level will decrease the length of the celebration.
|
||||
</p>
|
||||
<?php
|
||||
if ($building->getTypeLevel(24) > 0) {
|
||||
include("Templates/Build/24_1.tpl");
|
||||
include("Templates/Build/24_2.tpl");
|
||||
} else {
|
||||
echo "<p><b>Celebrations can commence when the town hall is completed.</b><br>\n";
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,74 @@
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Celebrations</td>
|
||||
<td>Action</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
$level = $village->resarray['f'.$id];
|
||||
$inuse = $database->getVillageField($village->wid, 'celebration');
|
||||
$time = Time();
|
||||
$i = 1;
|
||||
echo "<tr><td class=\"desc\"><div class=\"tit\">".$cel[$i]['name']." (".$cel[$i]['attri']." culture points)</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$cel[$i]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$cel[$i]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$cel[$i]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$cel[$i]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round($cel[$i]['time'] * ($bid24[$building->getTypeLevel(24)]['attri'] / 100)/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".$cel[$i]['wood']."&r2=".$cel[$i]['clay']."&r3=".$cel[$i]['iron']."&r4=".$cel[$i]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if($inuse > $time){
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">Celebration</br>in progress</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if($cel[$i]['wood'] > $village->awood || $cel[$i]['clay'] > $village->aclay || $cel[$i]['iron'] > $village->airon || $cel[$i]['crop'] > $village->acrop) {
|
||||
if($village->getProd("crop")>0){
|
||||
$time = $technology->calculateAvaliable(24,$cel[$i]);
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
} else {
|
||||
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
|
||||
}
|
||||
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
|
||||
}
|
||||
else {
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">";
|
||||
echo "<a class=\"research\" href=\"celebration.php?type=$i&id=$id\">hold</a></td></tr>";
|
||||
}
|
||||
|
||||
if($level >= 10){
|
||||
$level = $village->resarray['f'.$id];
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
Great celebration (2000 culture points)
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />29700|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />33250|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />32000|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />6700|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round($gc[$level]/SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=29700&r2=33250&r3=32000&r4=6700\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
if($inuse > $time){
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">Celebration<br />in progress</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else if(29700 > $village->awood || 33250 > $village->aclay || 32000 > $village->airon || 6700 > $village->acrop) {
|
||||
$time = $technology->calculateAvaliable(24,$cel[2]);
|
||||
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
|
||||
echo "<td class=\"act\">
|
||||
<div class=\"none\">Too few<br>resources</div>
|
||||
</td></tr>";
|
||||
}
|
||||
else {
|
||||
echo "</td>";
|
||||
echo "<td class=\"act\">
|
||||
<a class=\"research\" href=\"celebration.php?type=2&id=$id\">hold</a></td></tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if(!isset($timer)) {
|
||||
$timer = 1;
|
||||
}
|
||||
$timeleft = $database->getVillageField($village->wid, 'celebration');
|
||||
if($timeleft > Time()){
|
||||
echo '</br>';
|
||||
echo '<table cellpadding="0" cellspacing="0" id="building_contract">';
|
||||
echo '<tr><td>';
|
||||
echo 'celebration still needs:';
|
||||
echo "</td><td><span id=\"timer".$timer."\">";
|
||||
echo $generator->getTimeFormat($timeleft-time());
|
||||
echo "</span> hrs.</td>";
|
||||
echo "<td>done at ".date('H:i', $timeleft)."</td></tr>";
|
||||
echo "</table>";
|
||||
$timer +=1;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<div id="build" class="gid25"><h1>Residence <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g25"
|
||||
src="img/x.gif" alt="Residence"
|
||||
title="Residence" /> </a>
|
||||
The residence is a small palace, where the king or queen lives when (s)he visits the village. The residence protects the village against enemies who want to conquer it.</p>
|
||||
|
||||
<?php
|
||||
if ($village->capital == 1) {
|
||||
echo "<p class=\"act\">This is your capital</p>";
|
||||
}
|
||||
|
||||
include("25_menu.tpl");
|
||||
|
||||
if($village->resarray['f'.$id] >= 10){
|
||||
include ("25_train.tpl");
|
||||
}
|
||||
else{
|
||||
echo '<div class="c">In order to found a new village you need a level 10 or 20 residence and 3 settlers. In order to conquer a new village you need a level 10 or 20 residence and a senator, chief or chieftain.</div>';
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<div id="build" class="gid25"><h1>Residence <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g25"
|
||||
src="img/x.gif" alt="Residence"
|
||||
title="Residence" /> </a>
|
||||
The residence is a small palace, where the king or queen lives when (s)he visits the village. The residence protects the village against enemies who want to conquer it.</p>
|
||||
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
|
||||
<p>In order to extend your empire you need culture points. These culture points increase in the course of time and do so faster as your building levels increase.</p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Production of this village:</th>
|
||||
<td><b><?php echo $database->getVillageField($village->wid, 'cp'); ?></b> Culture points per day</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Production of all villages:</th>
|
||||
<td><b><?php echo $database->getVSumField($session->uid, 'cp'); ?></b> Culture points per day</td>
|
||||
</tr>
|
||||
</table><p>Your villages have produced <b><?php echo $session->cp; ?></b> points in total. To found or conquer a new village you need <b><?php $mode = CP; $total = count($database->getProfileVillages($session->uid)); echo ${'cp'.$mode}[$total+1]; ?></b> points.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<div id="build" class="gid25"><h1>Residence <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g25"
|
||||
src="img/x.gif" alt="Residence"
|
||||
title="Residence" /> </a>
|
||||
The residence is a small palace, where the king or queen lives when (s)he visits the village. The residence protects the village against enemies who want to conquer it.</p>
|
||||
|
||||
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
|
||||
By attacking with senators, chiefs or chieftains a village's loyalty can be brought down. If it reaches zero, the village joins the realm of the attacker. The loyalty of this village is currently at <b><?php echo floor($database->getVillageField($village->wid,'loyalty')); ?></b> percent.</div>
|
||||
@@ -0,0 +1,54 @@
|
||||
<div id="build" class="gid25"><h1>Residence <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(25,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g25"
|
||||
src="img/x.gif" alt="Residence"
|
||||
title="Residence" /> </a>
|
||||
The residence is a small palace, where the king or queen lives when (s)he visits the village. The residence protects the village against enemies who want to conquer it.</p>
|
||||
|
||||
<?php include("25_menu.tpl"); ?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="expansion">
|
||||
<thead><tr>
|
||||
<th colspan="6"><a name="h2"></a>Villages founded or conquered by this village</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Village</td>
|
||||
<td>Player</td>
|
||||
<td>Inhabitants</td>
|
||||
<td>Coordinates</td>
|
||||
<td>Date</td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$slot1 = $database->getVillageField($village->wid, 'exp1');
|
||||
$slot2 = $database->getVillageField($village->wid, 'exp2');
|
||||
$slot3 = $database->getVillageField($village->wid, 'exp3');
|
||||
|
||||
if($slot1 != 0 || $slot2 != 0 || $slot3 != 0){
|
||||
for($i=1; $i <= 3; $i++){
|
||||
if (${'slot'.$i}<>0) {
|
||||
$coor = $database->getCoor(${'slot'.$i});
|
||||
$vname = $database->getVillageField(${'slot'.$i},'name');
|
||||
$owner = $database->getVillageField(${'slot'.$i},'owner');
|
||||
$pop = $database->getVillageField(${'slot'.$i},'pop');
|
||||
$vcreated = $database->getVillageField(${'slot'.$i},'created');
|
||||
$ownername = $database->getUserField($owner,'username',0);
|
||||
echo '
|
||||
<tr>
|
||||
<td class="ra">'.$i.'.</td>
|
||||
<td class="vil"><a href="karte.php?d='.${'slot'.$i}.'&c='.$generator->getMapCheck(${'slot'.$i}).'">'.$vname.'</a></td>
|
||||
<td class="pla"><a href="spieler.php?uid='.$owner.'">'.$ownername.'</a></td>
|
||||
<td class="ha">'.$pop.'</td>
|
||||
<td class="aligned_coords"><div class="cox">('.$coor['x'].'</div><div class="pi">|</div><div class="coy">'.$coor['y'].')</div></td>
|
||||
<td class="dat">'.date('d-m-Y',$vcreated).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo '<tr><td colspan="6" class="none">No other village has been founded or conquered by this village yet.</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody></table></div>
|
||||
@@ -0,0 +1,65 @@
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Naam</td>
|
||||
<td>Aantal</td>
|
||||
<td>max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$i = 20;
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time']/SPEED));
|
||||
//if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
//echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
//}
|
||||
echo "
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a></td></tr></tbody>
|
||||
";
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$trainlist = $technology->getTrainingList(20);
|
||||
if(count($trainlist) > 0) {
|
||||
$timer = 2*count($trainlist);
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
foreach($trainlist as $train) {
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />".$train['amt']." ".$train['name']."</td><td class=\"dur\"><span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span></td><td class=\"fin\">";
|
||||
$timer -= 1;
|
||||
$time = $generator->procMTime($train['commence']+(1*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at";
|
||||
}
|
||||
echo $time[1]."</span><span> o'clock</td>
|
||||
</tr><tr class=\"next\"><td colspan=\"3\">The next unit will be finished in <span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+$train['eachtime'])-time())."</span></td></tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>" <?php if(!isset($_GET['s'])) { echo "class=\"selected\""; } ?>>Train</a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=2" <?php if(isset($_GET['s']) && $_GET['s'] == 2) { echo "class=\"selected\""; } ?>>Culture points</a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=3" <?php if(isset($_GET['s']) && $_GET['s'] == 3) { echo "class=\"selected\""; } ?>>Loyalty</a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=4" <?php if(isset($_GET['s']) && $_GET['s'] == 4) { echo "class=\"selected\""; } ?>>Expansion</a>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$trainlist = $technology->getTrainingList(4);
|
||||
if(count($trainlist) > 0) {
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename 25_train.tpl ##
|
||||
## Made by: Dzoki ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
$slots = $database->getAvailableExpansionTraining();
|
||||
|
||||
if ($slots['settlers']+$slots['chiefs']>0) { ?>
|
||||
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Quantity</td>
|
||||
<td>Max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=($session->tribe-1)*10+9;$i<=($session->tribe*10);$i++) {
|
||||
if ($slots['settlers']>0 && $i%10==0 || $slots['chiefs']>0 && $i%10==9) {
|
||||
$maxunit = MIN($technology->maxUnit($i),($i%10==0?$slots['settlers']:$slots['chiefs']));
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span></div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid25[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$maxunit."; return false;\">(".$maxunit.")</a></td></tr></tbody>";
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo '<div class="c">In order to found a new village you need a level 10 or 20 residence and 3 settlers. In order to conquer a new village you need a level 10 or 20 residence and a senator, chief or chieftain.</div>';
|
||||
}
|
||||
include ("25_progress.tpl");
|
||||
?>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
error_reporting(e_all);
|
||||
if(time() - $_SESSION['time_p'] > 5) {
|
||||
$_SESSION['time_p'] = '';
|
||||
$_SESSION['error_p'] = '';
|
||||
}
|
||||
|
||||
if($_POST AND $_GET['action'] == 'change_capital') {
|
||||
$pass = mysql_escape_string($_POST['pass']);
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $session->uid);
|
||||
$data = mysql_fetch_assoc($query);
|
||||
if($data['password'] == md5($pass)) {
|
||||
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
||||
$data1 = mysql_fetch_assoc($query1);
|
||||
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . $data1['wref']);
|
||||
$data2 = mysql_fetch_assoc($query2);
|
||||
if($data2['vref'] != $village->wid) {
|
||||
for($i = 1; $i<=18; ++$i) {
|
||||
if($data2['f' . $i] > 10) {
|
||||
$query2 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . '` = 10 WHERE `vref` = ' . $data2['vref']) or die(mysql_error());
|
||||
}
|
||||
}
|
||||
|
||||
for($i=19; $i<=40; ++$i) {
|
||||
if($data2['f' . $i . 't'] == 34) {
|
||||
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $data2['vref']) or die(mysql_error());
|
||||
}
|
||||
}
|
||||
|
||||
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 0 WHERE `wref` = ' . $data1['wref']);
|
||||
$query4 = mysql_query('UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . $village->wid);
|
||||
}
|
||||
#print '<script language="javascript">location.href="build.php?id=' . $building->getTypeField(26) . '";</script>';
|
||||
} else {
|
||||
$error = '<br /><font color="red">password is wrong</font><br />';
|
||||
$_SESSION['error_p'] = $error;
|
||||
$_SESSION['time_p'] = time();
|
||||
print '<script language="javascript">location.href="build.php?id=' . $building->getTypeField(26) . '&confirm=yes";</script>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="build" class="gid26"><h1>Palace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g26"
|
||||
src="img/x.gif" alt="Palace"
|
||||
title="Palace" /> </a>
|
||||
The king or queen of the empire lives in the palace. Only one palace can exist in your realm at a time. You need a palace in order to proclaim a village to be your capital.</p>
|
||||
|
||||
<?php
|
||||
if ($building->getTypeLevel(26) > 0) {
|
||||
|
||||
include("26_menu.tpl");
|
||||
|
||||
$test=$database->getAvailableExpansionTraining();
|
||||
|
||||
if($village->resarray['f'.$id] >= 10){
|
||||
include ("26_train.tpl");
|
||||
}
|
||||
else{
|
||||
echo '<div class="c">In order to found a new village you need a level 10, 15 or 20 palace and 3 settlers. In order to conquer a new village you need a level 10, 15 or 20 palace and a senator, chief or chieftain.</div>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
||||
$data = mysql_fetch_assoc($query);
|
||||
if($data['wref'] == $village->wid) {
|
||||
?>
|
||||
<p class="none">This is your capital</p>
|
||||
<?php
|
||||
} else {
|
||||
if($_GET['confirm'] == '') {
|
||||
print '<p><a href="?id=' . $building->getTypeField(26) . '&confirm=yes">» change capital</a></p>';
|
||||
} else {
|
||||
print '<p>Are you sure, that you want to change your capital?<br /><b>You can\'t undone this!</b>.<br />For security you must enter your password to confirm:<br />
|
||||
<form method="post" action="build.php?id=' . $building->getTypeField(26) . '&action=change_capital">
|
||||
' . $_SESSION['error_p'] . '
|
||||
password: <input type="password" name="pass" /><br />
|
||||
<input type="image" id="btn_ok" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</form>
|
||||
</p>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<b>Palace under construction</b>";
|
||||
}
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<div id="build" class="gid26"><h1>Palace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g26"
|
||||
src="img/x.gif" alt="Palace"
|
||||
title="Palace" /> </a>
|
||||
The king or queen of the empire lives in the palace. Only one palace can exist in your realm at a time. You need a palace in order to proclaim a village to be your capital.</p>
|
||||
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
|
||||
<p>In order to extend your empire you need culture points. These culture points increase in the course of time and do so faster as your building levels increase.</p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Production of this village:</th>
|
||||
<td><b><?php echo $database->getVillageField($village->wid, 'cp'); ?></b> Culture points per day</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Production of all villages:</th>
|
||||
<td><b><?php echo $database->getVSumField($session->uid, 'cp'); ?></b> Culture points per day</td>
|
||||
</tr>
|
||||
</table><p>Your villages have produced <b><?php echo $session->cp; ?></b> points in total. To found or conquer a new village you need <b><?php $mode = CP; $total = count($database->getProfileVillages($session->uid)); echo ${'cp'.$mode}[$total+1]; ?></b> points.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<div id="build" class="gid26"><h1>Palace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g26"
|
||||
src="img/x.gif" alt="Palace"
|
||||
title="Palace" /> </a>
|
||||
The king or queen of the empire lives in the palace. Only one palace can exist in your realm at a time. You need a palace in order to proclaim a village to be your capital.</p>
|
||||
|
||||
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
|
||||
By attacking with senators, chiefs or chieftains a village's loyalty can be brought down. If it reaches zero, the village joins the realm of the attacker. The loyalty of this village is currently at <b><?php echo floor($database->getVillageField($village->wid,'loyalty')); ?></b> percent.</div>
|
||||
@@ -0,0 +1,55 @@
|
||||
<div id="build" class="gid26"><h1>Palace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(26,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g26"
|
||||
src="img/x.gif" alt="Palace"
|
||||
title="Palace" /> </a>
|
||||
|
||||
The king or queen of the empire lives in the palace. Only one palace can exist in your realm at a time. You need a palace in order to proclaim a village to be your capital.
|
||||
|
||||
<?php include("26_menu.tpl"); ?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="expansion">
|
||||
<thead><tr>
|
||||
<th colspan="6"><a name="h2"></a>Villages founded or conquered by this village</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Village</td>
|
||||
<td>Player</td>
|
||||
<td>Inhabitants</td>
|
||||
<td>Coordinates</td>
|
||||
<td>Date</td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$slot1 = $database->getVillageField($village->wid, 'exp1');
|
||||
$slot2 = $database->getVillageField($village->wid, 'exp2');
|
||||
$slot3 = $database->getVillageField($village->wid, 'exp3');
|
||||
|
||||
if($slot1 != 0 || $slot2 != 0 || $slot3 != 0){
|
||||
for($i=1; $i <= 3; $i++){
|
||||
if (${'slot'.$i}<>0) {
|
||||
$coor = $database->getCoor(${'slot'.$i});
|
||||
$vname = $database->getVillageField(${'slot'.$i},'name');
|
||||
$owner = $database->getVillageField(${'slot'.$i},'owner');
|
||||
$pop = $database->getVillageField(${'slot'.$i},'pop');
|
||||
$vcreated = $database->getVillageField(${'slot'.$i},'created');
|
||||
$ownername = $database->getUserField($owner,'username',0);
|
||||
echo '
|
||||
<tr>
|
||||
<td class="ra">'.$i.'.</td>
|
||||
<td class="vil"><a href="karte.php?d='.${'slot'.$i}.'&c='.$generator->getMapCheck(${'slot'.$i}).'">'.$vname.'</a></td>
|
||||
<td class="pla"><a href="spieler.php?uid='.$owner.'">'.$ownername.'</a></td>
|
||||
<td class="ha">'.$pop.'</td>
|
||||
<td class="aligned_coords"><div class="cox">('.$coor['x'].'</div><div class="pi">|</div><div class="coy">'.$coor['y'].')</div></td>
|
||||
<td class="dat">'.date('d-m-Y',$vcreated).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo '<tr><td colspan="6" class="none">No other village has been founded or conquered by this village yet.</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody></table></div>
|
||||
@@ -0,0 +1,65 @@
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Naam</td>
|
||||
<td>Aantal</td>
|
||||
<td>max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$i = 20;
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time']/SPEED));
|
||||
//if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
//echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
//}
|
||||
echo "
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a></td></tr></tbody>
|
||||
";
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$trainlist = $technology->getTrainingList(20);
|
||||
if(count($trainlist) > 0) {
|
||||
$timer = 2*count($trainlist);
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
foreach($trainlist as $train) {
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />".$train['amt']." ".$train['name']."</td><td class=\"dur\"><span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span></td><td class=\"fin\">";
|
||||
$timer -= 1;
|
||||
$time = $generator->procMTime($train['commence']+(1*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at";
|
||||
}
|
||||
echo $time[1]."</span><span> o'clock</td>
|
||||
</tr><tr class=\"next\"><td colspan=\"3\">The next unit will be finished in <span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+$train['eachtime'])-time())."</span></td></tr>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>" <?php if(!isset($_GET['s'])) { echo "class=\"selected\""; } ?>>Train</a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=2" <?php if(isset($_GET['s']) && $_GET['s'] == 2) { echo "class=\"selected\""; } ?>>Culture points</a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=3" <?php if(isset($_GET['s']) && $_GET['s'] == 3) { echo "class=\"selected\""; } ?>>Loyalty</a>
|
||||
| <a href="build.php?id=<?php echo $id; ?>&s=4" <?php if(isset($_GET['s']) && $_GET['s'] == 4) { echo "class=\"selected\""; } ?>>Expansion</a>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$trainlist = $technology->getTrainingList(4);
|
||||
if(count($trainlist) > 0) {
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename 26_train.tpl ##
|
||||
## Made by: Dzoki ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
$slots = $database->getAvailableExpansionTraining();
|
||||
|
||||
if ($slots['settlers']+$slots['chiefs']>0) { ?>
|
||||
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Quantity</td>
|
||||
<td>Max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=($session->tribe-1)*10+9;$i<=($session->tribe*10);$i++) {
|
||||
if ($slots['settlers']>0 && $i%10==0 || $slots['chiefs']>0 && $i%10==9) {
|
||||
$maxunit = MIN($technology->maxUnit($i),($i%10==0?$slots['settlers']:$slots['chiefs']));
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span></div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$maxunit."; return false;\">(".$maxunit.")</a></td></tr></tbody>";
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo '<div class="c">In order to found a new village you need a level 10, 15 or 20 palace and 3 settlers. In order to conquer a new village you need a level 10, 15 or 20 palace and a senator, chief or chieftain.</div>';
|
||||
}
|
||||
include ("26_progress.tpl");
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
<body>
|
||||
<div id="build" class="gid27">
|
||||
<a href="#" onclick="return Popup(27,4);" class="build_logo"><img class="building g27" src="img/x.gif" alt="Treasury" title="Treasury"></a>
|
||||
|
||||
<h1>Treasury <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
|
||||
<p class="build_desc">The riches of your empire are kept in the treasury. The treasury has room for one treasure. After you have captured an artefact it takes 24 hours on a normal server or 12 hours on a thrice speed server to be effective.</p>
|
||||
<?php
|
||||
|
||||
include("27_menu.tpl");
|
||||
if(isset($_GET['show'])){ include("27_show.tpl"); }else{
|
||||
if(!isset($_GET['t'])){
|
||||
include("27_1.tpl");
|
||||
}elseif(isset($_GET['t']) && $_GET['t'] == 2){
|
||||
include("27_2.tpl");
|
||||
}elseif(isset($_GET['t']) && $_GET['t'] == 3){
|
||||
include("27_3.tpl");
|
||||
}
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
$artefact = $database->getOwnArtefactInfo($village->wid);
|
||||
$result = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = " . $village->wid . ""));
|
||||
$wref = $village->wid;
|
||||
$coor = $database->getCoor($wref);
|
||||
$coor2= $database->getCoor($artefact['vref']);
|
||||
function getDistance($coorx1, $coory1, $coorx2, $coory2) {
|
||||
$max = 2 * WORLD_MAX + 1;
|
||||
$x1 = intval($coorx1);
|
||||
$y1 = intval($coory1);
|
||||
$x2 = intval($coorx2);
|
||||
$y2 = intval($coory2);
|
||||
$distanceX = min(abs($x2 - $x1), abs($max - abs($x2 - $x1)));
|
||||
$distanceY = min(abs($y2 - $y1), abs($max - abs($y2 - $y1)));
|
||||
$dist = sqrt(pow($distanceX, 2) + pow($distanceY, 2));
|
||||
return round($dist, 1);
|
||||
}
|
||||
?>
|
||||
<div class="gid27">
|
||||
<body>
|
||||
<table id="own" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">Own artefacts</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Name</td>
|
||||
<td>Village</td>
|
||||
<td>Conquered</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
|
||||
if($result == 0) {
|
||||
echo '<td colspan="4" class="none">You do not own any artefacts.</td>';
|
||||
} else {
|
||||
if($artefact['size'] == 1) {
|
||||
$reqlvl = 10;
|
||||
$effect = "village";
|
||||
} elseif($artefact['size'] == 2 or 3) {
|
||||
$reqlvl = 20;
|
||||
$effect = "account";
|
||||
}
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $artefact['type'] . '" src="img/x.gif"></td>';
|
||||
echo '<td class="nam">
|
||||
<a href="build.php?id=' . $id . '&show='.$artefact['id'].'">' . $artefact['name'] . '</a> <span class="bon">' . $artefact['effect'] . '</span>
|
||||
<div class="info">
|
||||
Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>
|
||||
</div>
|
||||
</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $artefact['vref'] . '&c=' . $generator->getMapCheck($artefact['vref']) . '">' . $database->getVillageField($artefact['vref'], "name") . '</a></td>';
|
||||
echo '<td class="dist">' . date("d/m/Y H:i", $artefact['conquered']) . '</td>';
|
||||
}
|
||||
|
||||
?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="near" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">Artefacts in your area</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
|
||||
<td>Name</td>
|
||||
|
||||
<td>Player</td>
|
||||
|
||||
<td>Distance</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
echo '<td colspan="4" class="none">There is no artefacts in your area.</td>';
|
||||
} else {
|
||||
|
||||
|
||||
function haversine($l1, $o1, $l2, $o2) {
|
||||
$l1 = deg2rad($l1);
|
||||
$sinl1 = sin($l1);
|
||||
$l2 = deg2rad($l2);
|
||||
$o1 = deg2rad($o1);
|
||||
$o2 = deg2rad($o2);
|
||||
|
||||
return (7926 - 26 * $sinl1) * asin(min(1, 0.707106781186548 * sqrt((1 - (sin($l2) * $sinl1) - cos($l1) * cos($l2) * cos($o2 - $o1)))));
|
||||
}
|
||||
|
||||
|
||||
unset($reqlvl);
|
||||
unset($effect);
|
||||
$arts = mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts");
|
||||
$rows = array();
|
||||
while($row = mysql_fetch_array($arts)) {
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . $row['vref']);
|
||||
$coor2 = mysql_fetch_assoc($query);
|
||||
|
||||
|
||||
$dist = haversine($coor['x'], $coor['y'], $coor2['x'], $coor2['y']);
|
||||
|
||||
$rows[$dist] = $row;
|
||||
|
||||
}
|
||||
ksort($rows, SORT_DESC);
|
||||
foreach($rows as $row) {
|
||||
$wref = $village->wid;
|
||||
$coor = $database->getCoor($wref);
|
||||
$wref2 = $row['vref'];
|
||||
$coor2 = $database->getCoor($wref2);
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span>';
|
||||
echo '<div class="info">';
|
||||
if($row['size'] == 1) {
|
||||
$reqlvl = 10;
|
||||
$effect = "village";
|
||||
} elseif($row['size'] == 2 or $row['size'] == 3) {
|
||||
$reqlvl = 20;
|
||||
$effect = "account";
|
||||
}
|
||||
echo '<div class="info">Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>';
|
||||
echo '</div></td><td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="dist">'.getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']).'</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,217 @@
|
||||
<body>
|
||||
<div id="build" class="gid27">
|
||||
<a href="#" onclick="return Popup(27,4);" class="build_logo"><img class="building g27" src="img/x.gif" alt="Treasury" title="Treasury"></a>
|
||||
|
||||
<h1>Treasury <span class="level">Level <?php
|
||||
|
||||
echo $village->resarray['f' . $id];
|
||||
|
||||
?></span></h1>
|
||||
|
||||
<p class="build_desc">The riches of your empire are kept in the treasury. The treasury has room for one treasure. After you have captured an artefact it takes 24 hours on a normal server or 12 hours on a thrice speed server to be effective.</p>
|
||||
|
||||
<?php
|
||||
|
||||
include ("27_menu.tpl");
|
||||
|
||||
?>
|
||||
|
||||
<table id="show_artefacts" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">Small artefacts</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Name</td>
|
||||
<td>Player</td>
|
||||
<td>Alliance</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
echo '<td colspan="4" class="none">There is no artefacts.</td>';
|
||||
} else {
|
||||
|
||||
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 1");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Village</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 2");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Village</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 3");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Village</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 4");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Village</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 5");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Village</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 6");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Village</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 7");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Village</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 8");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 8");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>10</b>, Effect <b>Village</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody></table></div>
|
||||
|
||||
<?php
|
||||
|
||||
include ("upgrade.tpl");
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,298 @@
|
||||
<body>
|
||||
<div id="build" class="gid27">
|
||||
<a href="#" onclick="return Popup(27,4);" class="build_logo"><img class="building g27" src="img/x.gif" alt="Treasury" title="Treasury"></a>
|
||||
|
||||
<h1>Treasury <span class="level">Level <?php
|
||||
|
||||
echo $Account->resarray['f' . $id];
|
||||
|
||||
?></span></h1>
|
||||
|
||||
<p class="build_desc">The riches of your empire are kept in the treasury. The treasury has room for one treasure. After you have captured an artefact it takes 24 hours on a normal server or 12 hours on a thrice speed server to be effective.</p>
|
||||
|
||||
<?php
|
||||
|
||||
include ("27_menu.tpl");
|
||||
|
||||
?>
|
||||
|
||||
<table id="show_artefacts" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">Small artefacts</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Name</td>
|
||||
<td>Player</td>
|
||||
<td>Alliance</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
echo '<td colspan="4" class="none">There is no artefacts.</td>';
|
||||
} else {
|
||||
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 1");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 1");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 2");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 2");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 3");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 3");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 4");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 4");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 5");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 5");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 6");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 6");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 7");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 7");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 8");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span><div class="info">Treasury <b>20</b>, Effect <b>Account</b></div>';
|
||||
echo '</td>';
|
||||
echo '<td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="al"><a href="allianz.php?aid=' . $database->getUserField($row['owner'], "alliance", 0) . '">' . $database->getAllianceName($database->getUserField($row['owner'], "alliance", 0)) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr><td colspan="4"></td></tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody></table></div>
|
||||
|
||||
<?php
|
||||
|
||||
include ("upgrade.tpl");
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
<div id="textmenu">
|
||||
<a href="build.php?id=<?php echo $id; ?>" <?php
|
||||
|
||||
if(!isset($_GET['t']) && $_GET['id'] == $id) {
|
||||
echo "class=\"selected\"";
|
||||
}
|
||||
|
||||
?>
|
||||
">Own artefacts</a>
|
||||
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=2" <?php
|
||||
|
||||
if(isset($_GET['t']) && $_GET['t'] == 2) {
|
||||
echo "class=\"selected\"";
|
||||
}
|
||||
|
||||
?>">Small artefacts</a>
|
||||
|
||||
| <a href="build.php?id=<?php echo $id; ?>&t=3" <?php
|
||||
|
||||
if(isset($_GET['t']) && $_GET['t'] == 3) {
|
||||
echo "class=\"selected\"";
|
||||
}
|
||||
?>">Large artefacts</a>
|
||||
</div>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
$artefact = $database->getArtefactDetails($_GET['show']);
|
||||
if($artefact['size'] == 1){
|
||||
$reqlvl = 10;
|
||||
$effect = "village";
|
||||
}elseif($artefact['size'] == 2 OR $artefact['size'] == 3){
|
||||
$reqlvl = 20;
|
||||
$effect = "account";
|
||||
}
|
||||
if ($artefact['conquered'] >= (time()-86400)){
|
||||
$active = "Inactive";
|
||||
}else{
|
||||
$active = "Active";
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="artefact image-6">
|
||||
<table id="art_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $artefact['name'];?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2" class="desc">
|
||||
|
||||
<span class="detail"><?php echo $artefact['desc'];?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Owner</th>
|
||||
<td>
|
||||
<a href="spieler.php?uid=<?php echo $artefact['owner'];?>"><?php echo $database->getUserField($artefact['owner'],"username",0);?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Village</th>
|
||||
<td>
|
||||
<a href="karte.php?d=<?php echo $artefact['vref'];?>&c=<?php echo $generator->getMapCheck($artefact['vref']);?>"><?php echo $database->getVillageField($artefact['vref'], "name");?> </a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Alliance</th>
|
||||
<td><a href="allianz.php?aid=<?php echo $database->getUserField($artefact['owner'],"alliance",0);?>"><?php echo $database->getAllianceName($database->getUserField($artefact['owner'],"alliance",0)); ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Area of effect</th>
|
||||
<td><?php echo $effect; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Bonus</th>
|
||||
<td>NOT CODED</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Required level</th>
|
||||
<td>Treasury level <b><?php echo $reqlvl; ?></b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Time of conquer</th>
|
||||
<td><?php echo date("Y-m-d H:i:s",$artefact['conquered']);?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>time of activation</th>
|
||||
<td><?php echo $active;?></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<table class="art_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Former owner(s)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Player</td>
|
||||
<td>Village</td>
|
||||
<td>conquered</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td><span class="none"><a href="spieler.php?uid=<?php echo $artefact['owner'];?>"><?php echo $database->getUserField($artefact['owner'],"username",0);?></a></span></td>
|
||||
<td><span class="none"><a href="karte.php?d=<?php echo $artefact['vref'];?>&c=<?php echo $generator->getMapCheck($artefact['vref']);?>"><?php echo $database->getVillageField($artefact['vref'], "name");?> </a></span></td>
|
||||
<td><span class="none"><?php echo date("Y-m-d H:i:s",$artefact['conquered']);?></span></td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tr></tbody></table></div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid28"><a href="#" onClick="return Popup(28,4);" class="build_logo">
|
||||
<img class="building g28" src="img/x.gif" alt="Trade Office" title="Trade Office" />
|
||||
</a>
|
||||
<h1>Trade Office <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">In the trade office the merchants' carts get improved and equipped with powerful horses. The higher its level the more your merchants are able to carry.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current merchant load:</th>
|
||||
<td><b><?php echo $bid28[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Merchant load at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid28[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,59 @@
|
||||
<div id="build" class="gid29"><a href="#" onClick="return Popup(29,4);" class="build_logo">
|
||||
<img class="building g29" src="img/x.gif" alt="Great Barracks" title="Great Barracks" />
|
||||
</a>
|
||||
<h1>Great Barracks <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Foot soldiers are trained in the great barracks. The higher the level of the barracks, the faster the troops are trained.</p>
|
||||
|
||||
<?php if ($building->getTypeLevel(29) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Name</td>
|
||||
<td>Quantity</td>
|
||||
<td>Max</td>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
include("29_train.tpl");
|
||||
?></table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>Training can commence when great barracks are completed.</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(5);
|
||||
if(count($trainlist) > 0) {
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
for ($i=($session->tribe-1)*10+1;$i<=($session->tribe-1)*10+4;$i++) {
|
||||
if ($i <> 4 && $i <> 23 && $i <> 24 && ($technology->getTech($i) || $i%10 == 1)) {
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid29[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,true)."; return false;\">(".$technology->maxUnit($i,true).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div id="build" class="gid3"><a href="#" onClick="return Popup(3,4);" class="build_logo">
|
||||
<img class="building g3" src="img/x.gif" alt="<?php echo B3; ?>" title="<?php echo B3; ?>" />
|
||||
</a>
|
||||
<h1><?php echo B3; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo B3_DESC; ?></p>
|
||||
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CUR_PROD; ?></th>
|
||||
<td><b><?php echo $bid3[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> per hour</td>
|
||||
</tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid3[$village->resarray['f'.$id]+1]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?></p></div>
|
||||
@@ -0,0 +1,59 @@
|
||||
<div id="build" class="gid30"><a href="#" onClick="return Popup(30,4);" class="build_logo">
|
||||
<img class="building g30" src="img/x.gif" alt="Great Stables" title="Great Stables" />
|
||||
</a>
|
||||
<h1>Great Stables <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Cavalry can be trained in the great stable. The higher its level the faster the troops are trained.<br /></p>
|
||||
|
||||
<?php if ($building->getTypeLevel(30) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Name</td>
|
||||
<td>Quantity</td>
|
||||
<td>Max</td>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
include("30_train.tpl");
|
||||
?></table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>Training can commence when great stables are completed.</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(6);
|
||||
if(count($trainlist) > 0) {
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
for ($i=($session->tribe-1)*10+3;$i<=($session->tribe-1)*10+6;$i++) {
|
||||
if ($i <> 3 && $i <> 13 && $i <> 14 && $technology->getTech($i)) {
|
||||
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".(${'u'.$i}['pop']-($building->getTypeLevel(41)>=1?1:0))."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid30[$village->resarray['f'.$id]]['attri'] * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / 100) / SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,true)."; return false;\">(".$technology->maxUnit($i,true).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<div id="build" class="gid31">
|
||||
<h1>City Wall <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">By building a City Wall you can protect your village against the barbarian hordes of your enemies. The higher the wall's level, the higher the bonus given to your forces' defence.</p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Defence Bonus now:</th>
|
||||
<td><b><?php echo $bid31[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr><tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Defence Bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
|
||||
<td><b><?php echo $bid31[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<div id="build" class="gid32">
|
||||
<h1>Earth Wall <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">By building a Earth Wall you can protect your village against the barbarian hordes of your enemies. The higher the wall's level, the higher the bonus given to your forces' defence.</p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Defence Bonus now:</th>
|
||||
<td><b><?php echo $bid32[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr><tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Defence Bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
|
||||
<td><b><?php echo $bid32[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<div id="build" class="gid33">
|
||||
<h1>Palisade <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">By building a Palisade you can protect your village against the barbarian hordes of your enemies. The higher the wall's level, the higher the bonus given to your forces' defence.</p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Defence Bonus now:</th>
|
||||
<td><b><?php echo $bid33[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr><tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Defence Bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
|
||||
<td><b><?php echo $bid33[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid34"><a href="#" onClick="return Popup(34,4);" class="build_logo">
|
||||
<img class="building g34" src="img/x.gif" alt="Stonemason's Lodge" title="Stonemason's Lodge" />
|
||||
</a>
|
||||
<h1>Stonemason's Lodge <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">The stonemason's lodge is an expert at cutting stone. The further the building is extended the higher the stability of the village's buildings.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current stability bonus:</th>
|
||||
<td><b><?php echo $bid34[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Stability bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid34[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid35"><a href="#" onClick="return Popup(35,4);" class="build_logo">
|
||||
<img class="building g35" src="img/x.gif" alt="Brewery" title="Brewery" />
|
||||
</a>
|
||||
<h1>Brewery <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Tasty mead is brewed in the Brewery and later quaffed by the soldiers during the celebrations.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current bonus:</th>
|
||||
<td><b><?php echo $bid35[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid35[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,71 @@
|
||||
<div id="build" class="gid36"><h1>Vallenzetter <span class="level">Niveau 1</span></h1>
|
||||
<p class="build_desc">
|
||||
<a href="#" onClick="return Popup(36,4, 'gid');"
|
||||
class="build_logo"> <img
|
||||
class="building g36"
|
||||
src="img/x.gif" alt="Vallenzetter"
|
||||
title="Vallenzetter" /> </a>
|
||||
Met goed verstopte vallen, beschermt de vallenzetter zijn dorp. Onachtzame aanvallers kunnen zo gevangen genomen worden en zijn geen gevaar meer voor het dorp.</p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Actuele maximale aantal</th>
|
||||
|
||||
<td><b>10</b> Vallen</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Maximale aantal bij niveau 2</th>
|
||||
<td><b>22</b> Vallen</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<p>Je bezit op het moment <b>0</b> vallen, daarvan zijn er <b>0</b> bezet.</p>
|
||||
<form method="POST" name="snd" action="build.php"><input type="hidden"
|
||||
name="id" value="22" /> <input type="hidden"
|
||||
name="z" value="17" /> <input type="hidden" name="a"
|
||||
value="2" />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<td>Naam</td>
|
||||
<td>Aantal</td>
|
||||
<td>max</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit"><img class="unit u99" src="img/x.gif"
|
||||
alt="Val"
|
||||
title="Val" /> <a href="#"
|
||||
onClick="return Popup(36,4,'gid');">Vallen</a> <span class="info">(Aanwezig: 0)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<span><img class="r1" src="img/x.gif"
|
||||
alt="Hout" title="Hout" />20|</span><span><img class="r2" src="img/x.gif"
|
||||
alt="Klei" title="Klei" />30|</span><span><img class="r3" src="img/x.gif"
|
||||
alt="IJzer" title="IJzer" />10|</span><span><img class="r4" src="img/x.gif"
|
||||
alt="Graan" title="Graan" />20|</span><span><img class="r5" src="img/x.gif" alt="Graanverbruik"
|
||||
title="Graanverbruik" />0|<img class="clock" src="img/x.gif"
|
||||
alt="duur" title="duur" />0:10:00</span>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t99" value="0"
|
||||
maxlength="4"></td>
|
||||
<td class="max"><a href="#"
|
||||
onClick="document.snd.t99.value=10">(10)</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p><input type="image" value="ok" name="s1" id="btn_train"
|
||||
class="dynamic_img" src="img/x.gif" alt="train" /></p>
|
||||
</form>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/*-------------------------------------------------------*\
|
||||
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
|
||||
+---------------------------------------------------------+
|
||||
| Developed by: Manni < manuel_mannhardt@web.de > |
|
||||
| Dzoki < dzoki.travian@gmail.com > |
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\*-------------------------------------------------------*/
|
||||
|
||||
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
||||
$hero_info = mysql_fetch_array($hero);
|
||||
|
||||
$define['reset_level'] = 3; // Until which level you are able to reset your points
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div id="build" class="gid37">
|
||||
<a href="#" onclick="return Popup(37,4, 'gid');" class="build_logo"><img class="building g37" src="img/x.gif" alt="Hero's mansion" title="Hero's mansion"></a>
|
||||
|
||||
<h1>Hero's mansion <span class="level">Level <?php echo $village->resarray['f' . $id]; ?></span></h1>
|
||||
|
||||
<p class="build_desc">In the Hero's mansion you can train your own hero and at level 10, 15 and 20 you can conquer oases with Hero in the immediate vicinity.</p>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
if($hero_info['trainingtime'] <= time()) {
|
||||
if($hero_info['trainingtime'] != 0) {
|
||||
if($hero_info['dead'] == 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET trainingtime = '0' WHERE uid = " . $session->uid . "");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$village->wid."");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_GET['land'])) {
|
||||
include("37_land.tpl");
|
||||
} else {
|
||||
if(mysql_num_rows($hero) == 0){
|
||||
include("37_train.tpl");
|
||||
}
|
||||
if(mysql_num_rows($hero) != 0 AND $hero_info['trainingtime'] > time()){
|
||||
include("37_train2.tpl");
|
||||
}
|
||||
if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 1){
|
||||
include("37_revive.tpl");
|
||||
}
|
||||
if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 0 AND $hero_info['trainingtime'] <= time()){
|
||||
include("37_hero.tpl");
|
||||
}
|
||||
}
|
||||
include ("upgrade.tpl"); ?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,312 @@
|
||||
<?php
|
||||
|
||||
/*-------------------------------------------------------*\
|
||||
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
|
||||
+---------------------------------------------------------+
|
||||
| Developed by: Manni < manuel_mannhardt@web.de > |
|
||||
| Dzoki < dzoki.travian@gmail.com > |
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\*-------------------------------------------------------*/
|
||||
|
||||
include_once("GameEngine/Data/hero_full.php");
|
||||
|
||||
if ( isset($_POST['name'])) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."hero SET `name`='".($_POST['name'])."' where `uid`='".$session->uid."'") or die("ERROR:".mysql_error());
|
||||
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
||||
$hero_info = mysql_fetch_array($hero);
|
||||
echo "Heros name has been changed";
|
||||
}
|
||||
|
||||
$hero = $units->Hero($session->uid);
|
||||
|
||||
?>
|
||||
<?php if ($hero_info['experience'] >= 495000) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."hero SET `experience` = 495000 where `uid`='".$session->uid."'");
|
||||
mysql_query("UPDATE ".TB_PREFIX."hero SET `level` = 100 where `uid`='".$session->uid."'");
|
||||
?>
|
||||
<table id="distribution" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<th colspan="5"><?php
|
||||
|
||||
if(isset($_GET['rename'])){
|
||||
echo "<form action=\"\" method=\"POST\"><input type=\"hidden\" name=\"userid\" value=\"".$session->uid."\"><input type=\"hidden\" name=\"hero\" value=\"1\"><input type=\"text\" class=\"text\" name=\"name\" maxlength=\"20\" value=\"".$hero_info['name']."\">";
|
||||
}else{
|
||||
echo "<a href=\"build.php?id=".$id."&rename\">".$hero_info['name']."</a></form>";
|
||||
}
|
||||
|
||||
?> Level 100 <span class="info">( <?php echo"<img class=\"unit u".$hero_info['unit']."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($hero_info['unit'])."\" title=\"".$technology->getUnitName($hero_info['unit'])."\" /> ".$technology->getUnitName($hero_info['unit']); ?> )</span></th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<th>Offence</th>
|
||||
<td class="val"><?php echo $hero['atk']; ?></td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo (2*$hero_info['attack'])+1; ?>px;" alt="<?php echo $hero['atk']; ?>" title="<?php echo $hero['atk']; ?>" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=off\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['attack']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Defence</th>
|
||||
<td class="val"><?php echo $hero['di'] . "/" . $hero['dc']; ?></td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo (2*$hero_info['defence'])+1; ?>px;" alt="<?php echo ($hero['di']) . "/" . ($hero['dc']); ?>" title="<?php echo ($hero['di']) . "/" . ($hero['dc']); ?>" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=deff\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['defence']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Off-Bonus</th>
|
||||
<td class="val"><?php echo ($hero['ob']-1)*100; ?>%</td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero['ob']-1)*1000+1; ?>px;" alt="<?php echo ($hero['ob']-1)*100; ?>%" title="<?php echo ($hero['ob']-1)*100; ?>%" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=obonus\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['attackbonus']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Def-Bonus</th>
|
||||
<td class="val"><?php echo ($hero['db']-1)*100; ?>%</td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero['db']-1)*1000+1; ?>px;" alt="<?php echo ($hero['db']-1)*100; ?>%" title="<?php echo ($hero['db']-1)*100; ?>%" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=dbonus\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['defencebonus']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Regeneration</th>
|
||||
<td class="val"><?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day</td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['regeneration']*2)+1; ?>px;" alt="<?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day" title="<?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=reg\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['regeneration']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" class="empty"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th title="until the next level">Experience:</th>
|
||||
<td class="val">100%</td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:200px;" alt="100%" title="100%" /></td>
|
||||
<td class="up"></td>
|
||||
<td class="rem"><?php echo $hero_info['points']; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php }else{ ?>
|
||||
<table id="distribution" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<th colspan="5"><?php
|
||||
|
||||
if(isset($_GET['rename'])){
|
||||
echo "<form action=\"\" method=\"POST\"><input type=\"hidden\" name=\"userid\" value=\"".$session->uid."\"><input type=\"hidden\" name=\"hero\" value=\"1\"><input type=\"text\" class=\"text\" name=\"name\" maxlength=\"20\" value=\"".$hero_info['name']."\">";
|
||||
}else{
|
||||
echo "<a href=\"build.php?id=".$id."&rename\">".$hero_info['name']."</a></form>";
|
||||
}
|
||||
|
||||
?> Level <?php echo $hero_info['level']; ?> <span class="info">( <?php echo"<img class=\"unit u".$hero_info['unit']."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($hero_info['unit'])."\" title=\"".$technology->getUnitName($hero_info['unit'])."\" /> ".$technology->getUnitName($hero_info['unit']); ?> )</span></th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<th>Offence</th>
|
||||
<td class="val"><?php echo $hero['atk']; ?></td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo (2*$hero_info['attack'])+1; ?>px;" alt="<?php echo $hero['atk']; ?>" title="<?php echo $hero['atk']; ?>" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['attack'] < 100){
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=off\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
}else{
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['attack']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Defence</th>
|
||||
<td class="val"><?php echo $hero['di'] . "/" . $hero['dc']; ?></td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo (2*$hero_info['defence'])+1; ?>px;" alt="<?php echo ($hero['di']) . "/" . ($hero['dc']); ?>" title="<?php echo ($hero['di']) . "/" . ($hero['dc']); ?>" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['defence'] < 100){
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=deff\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
}else{
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['defence']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Off-Bonus</th>
|
||||
<td class="val"><?php echo ($hero['ob']-1)*100; ?>%</td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero['ob']-1)*1000+1; ?>px;" alt="<?php echo ($hero['ob']-1)*100; ?>%" title="<?php echo ($hero['ob']-1)*100; ?>%" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['attackbonus'] < 100){
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=obonus\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
}else{
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['attackbonus']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Def-Bonus</th>
|
||||
<td class="val"><?php echo ($hero['db']-1)*100; ?>%</td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero['db']-1)*1000+1; ?>px;" alt="<?php echo ($hero['db']-1)*100; ?>%" title="<?php echo ($hero['db']-1)*100; ?>%" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['defencebonus'] < 100){
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=dbonus\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
}else{
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['defencebonus']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Regeneration</th>
|
||||
<td class="val"><?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day</td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['regeneration']*2)+1; ?>px;" alt="<?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day" title="<?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['regeneration'] < 100){
|
||||
if($hero_info['points'] > 0){
|
||||
echo "<a href=\"build.php?id=".$id."&add=reg\">(<b>+</b>)</a>";
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
}else{
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['regeneration']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" class="empty"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th title="until the next level">Experience:</th>
|
||||
<td class="val"><?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%</td>
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100*2 ?>px;" alt="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" title="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" /></td>
|
||||
<td class="up"></td>
|
||||
<td class="rem"><?php echo $hero_info['points']; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if(isset($_GET['e'])){
|
||||
echo "<p><font size=\"1\" color=\"red\"><b>Error: name too short</b></font></p>";
|
||||
}
|
||||
?>
|
||||
<?php if($hero_info['level'] <= 3){ ?>
|
||||
<p>You can <a href="build.php?id=<?php echo $id; ?>&add=reset">reset</a> your points until you are level <b>3</b> or lower!</p>
|
||||
<?php } ?>
|
||||
|
||||
<p>Your hero has <b><?php echo floor($hero_info['health']); ?></b>% of his hit points.<br/>
|
||||
Your hero has conquered <b><?php echo $database->VillageOasisCount($village->wid); ?></b> <a href="build.php?id=<?php echo $id; ?>&land">oases</a>.</p>
|
||||
|
||||
<?php
|
||||
|
||||
if(isset($_GET['add'])) {
|
||||
if($_GET['add'] == "reset") {
|
||||
if($hero_info['level'] <= 3){
|
||||
if($hero_info['attack'] != 0 OR $hero_info['defence'] != 0 OR $hero_info['attackbonus'] != 0 OR $hero_info['defencebonus'] != 0 OR $hero_info['regeneration'] != 0){
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+10)."' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "off") {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "deff") {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "obonus") {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "dbonus") {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "reg") {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/* Hero's mansion oases page
|
||||
Copyright: Travianx Project */
|
||||
|
||||
$oasisarray = $database->getOasis($village->wid);
|
||||
|
||||
?>
|
||||
<table id="oases" cellpadding="1" cellspacing="1">
|
||||
<thead><tr>
|
||||
<th colspan="4">oases</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Coordinates</td>
|
||||
<td>Loyality</td>
|
||||
<td>Resources</td>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
|
||||
for ($i=0; $i<count($oasisarray); $i++) {
|
||||
$oasiscoor = $database->getCoor($oasisarray[$i]['wref']);
|
||||
?>
|
||||
<tr>
|
||||
<td class="nam">
|
||||
<!-- a href="build.php?a=37&gid=37&c=016&del=374&land" --><img class="del" src="img/x.gif" alt="delete" title="delete"></a>
|
||||
<a href="karte.php?d=<?php echo $oasisarray[$i]['wref']; ?>&c=<?php echo $generator->getMapCheck($oasisarray[$i]['wref']) ?>"><?php echo $oasisarray[$i]['name']; ?></a>
|
||||
</td>
|
||||
<td class="aligned_coords">
|
||||
<div class="cox">(<?php echo $oasiscoor['x']; ?></div>
|
||||
<div class="pi">|</div>
|
||||
<div class="coy"><?php echo $oasiscoor['y']; ?>)</div>
|
||||
</td>
|
||||
<td class="zp"><?php echo floor($oasisarray[$i]['loyalty']); ?>%</td>
|
||||
<td class="res"><?php
|
||||
switch($oasisarray[$i]['type']) {
|
||||
case 1:
|
||||
case 2:
|
||||
?><img class="r1" src="img/x.gif" alt="Wood" title="Wood" />+25%<?php
|
||||
break;
|
||||
case 3:
|
||||
?><img class="r1" src="img/x.gif" alt="Wood" title="Wood" />+25%
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop" />+25%<?php
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
?><img class="r2" src="img/x.gif" alt="Clay" title="Clay" />+25%<?php
|
||||
break;
|
||||
case 6:
|
||||
?><img class="r2" src="img/x.gif" alt="Clay" title="Clay" />+25%
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop" />+25%<?php
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
?><img class="r3" src="img/x.gif" alt="Iron" title="Iron" />+25%<?php
|
||||
break;
|
||||
case 9:
|
||||
?><img class="r3" src="img/x.gif" alt="Iron" title="Iron" />+25%
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop" />+25%<?php
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
?><img class="r4" src="img/x.gif" alt="Crop" title="Crop" />+25%<?php
|
||||
break;
|
||||
case 12:
|
||||
?><img class="r4" src="img/x.gif" alt="Crop" title="Crop" />+50%<?php
|
||||
break;
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
/*-------------------------------------------------------*\
|
||||
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
|
||||
+---------------------------------------------------------+
|
||||
| Developed by: Manni < manuel_mannhardt@web.de > |
|
||||
| Dzoki < dzoki.travian@gmail.com > |
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\*-------------------------------------------------------*/
|
||||
|
||||
if($hero_info['unit'] == 1) {
|
||||
$name = "Legionnaire";
|
||||
} else if($hero_info['unit'] == 2) {
|
||||
$name = "Praetorian";
|
||||
} else if($hero_info['unit'] == 3) {
|
||||
$name = "Imperian";
|
||||
} else if($hero_info['unit'] == 5) {
|
||||
$name = "Equites Imperatoris";
|
||||
} else if($hero_info['unit'] == 6) {
|
||||
$name = "Equites Caesaris";
|
||||
} else if($hero_info['unit'] == 11) {
|
||||
$name = "Clubswinger";
|
||||
} else if($hero_info['unit'] == 12) {
|
||||
$name = "Spearman";
|
||||
} else if($hero_info['unit'] == 13) {
|
||||
$name = "Axeman";
|
||||
} else if($hero_info['unit'] == 15) {
|
||||
$name = "Paladin";
|
||||
} else if($hero_info['unit'] == 16) {
|
||||
$name = "Teutonic Knight";
|
||||
} else if($hero_info['unit'] == 21) {
|
||||
$name = "Phalanx";
|
||||
} else if($hero_info['unit'] == 22) {
|
||||
$name = "Swordsman";
|
||||
} else if($hero_info['unit'] == 24) {
|
||||
$name = "Theutates Thunder";
|
||||
} else if($hero_info['unit'] == 25) {
|
||||
$name = "Druidrider";
|
||||
} else if($hero_info['unit'] == 26) {
|
||||
$name = "Haeduan";
|
||||
}
|
||||
|
||||
$wood = (${'h'.$hero_info['unit'].'_full'}[$hero_info['level']]['wood']);
|
||||
$clay = (${'h'.$hero_info['unit'].'_full'}[$hero_info['level']]['clay']);
|
||||
$iron = (${'h'.$hero_info['unit'].'_full'}[$hero_info['level']]['iron']);
|
||||
$crop = (${'h'.$hero_info['unit'].'_full'}[$hero_info['level']]['crop']);
|
||||
$training_time = $generator->getTimeFormat(round((${'h'.$hero_info['unit'].'_full'}[$hero_info['level']]['time']) / SPEED));
|
||||
$training_time2 = time() + (${'h'.$hero_info['unit'].'_full'}[$hero_info['level']]['time']) / SPEED;
|
||||
?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Revive hero</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php if($hero_info['unit'] == 1 OR 11 OR 21){ ?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $hero_info['unit']; ?>" src="img/x.gif" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
|
||||
<?php echo $name . " (Level " . $hero_info['level'] . ")"; ?>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Wood" title="Wood" /><?php echo $wood; ?>|
|
||||
<img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $clay; ?>|
|
||||
<img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $iron; ?>|
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $crop; ?>|
|
||||
<img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" />6|
|
||||
<img class="clock" src="img/x.gif" alt="Duration" title="Duration" />
|
||||
<?php echo $training_time; ?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="val" width="20%"><center>
|
||||
<?php
|
||||
if($village->awood < $wood OR $village->aclay < $clay OR $village->airon < $iron OR $village->acrop < $crop) {
|
||||
echo "<span class=\"none\">No enough resources</span>";
|
||||
}else {
|
||||
echo "<a href=\"build.php?id=".$id."&revive=1\">Revive</a>";
|
||||
}
|
||||
|
||||
?></center></td>
|
||||
</tr>
|
||||
<?php }else { ?>
|
||||
|
||||
|
||||
<?php if($database->checkIfResearched($village->wid, 't'.$hero_info['unit']) != 0){ ?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $hero_info['unit']; ?>" src="img/x.gif" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
|
||||
<?php echo $name . " (Level " . $hero_info['level'] . ")"; ?>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Wood" title="Wood" /><?php echo $wood; ?>|
|
||||
<img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $clay; ?>|
|
||||
<img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $iron; ?>|
|
||||
<img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $crop; ?>|
|
||||
<img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" />6|
|
||||
<img class="clock" src="img/x.gif" alt="Duration" title="Duration" />
|
||||
<?php echo $training_time; ?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="val" width="20%"><center>
|
||||
<?php
|
||||
if($village->awood < $wood OR $village->aclay < $clay OR $village->airon < $iron OR $village->acrop < $crop) {
|
||||
echo "<span class=\"none\">No enough resources</span>";
|
||||
}else {
|
||||
echo "<a href=\"build.php?id=".$id."&revive=1\">Revive</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
</center></td>
|
||||
</tr>
|
||||
<?php } } ?>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
if($_GET['revive'] == 1){
|
||||
mysql_query("UPDATE ".TB_PREFIX."hero SET `dead` = '0', `health` = '100', `trainingtime` = '".$training_time2."' WHERE `uid` = '".$session->uid."'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$village->wid."");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
|
||||
if($hero_info['trainingtime'] <= time()) {
|
||||
if($hero_info['trainingtime'] != 0) {
|
||||
if($hero_info['dead'] == 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET trainingtime = '0' WHERE uid = " . $session->uid . "");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$village->wid."");
|
||||
}
|
||||
}
|
||||
}
|
||||
include ("37_train.tpl");
|
||||
?>
|
||||
@@ -0,0 +1,609 @@
|
||||
<?php
|
||||
/*============================+
|
||||
+ Travian File: 37_train.tpl +
|
||||
+ Developed by vnnbot.net +
|
||||
+=============================*/
|
||||
|
||||
|
||||
//check if there is unit needed in the village
|
||||
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".$village->wid."");
|
||||
$units = mysql_fetch_array($result);
|
||||
|
||||
$output="<table cellpadding=1 cellspacing=1 class=\"build_details\">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan=2>Train New Hero</th>
|
||||
</tr>
|
||||
</thead>";
|
||||
|
||||
if($session->tribe == 1) {
|
||||
$output.=" <tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u1\" src=\"img/x.gif\" alt=\"Legionnaire\" title=\"Legionnaire\" />
|
||||
Legionnaire
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u1['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u1['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u1['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u1['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$output.=$generator->getTimeFormat(round($u1['time'] / SPEED)*3);
|
||||
$output.="</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
|
||||
if($village->awood < $u1['wood'] || $village->aclay < $u1['clay'] || $village->airon < $u1['iron'] || $village->acrop < $u1['crop'])
|
||||
$output.="<span class=\"none\">Not enough resources</span>";
|
||||
elseif($units['u1'] == 0)
|
||||
$output.="<span class=\"none\">Not available units</span>";
|
||||
else $output.="<a href=\"build.php?id=".$id."&train=1\">Train</a>";
|
||||
|
||||
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't2') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u2\" src=\"img/x.gif\" alt=\"Praetorian\" title=\"Praetorian\" />
|
||||
Praetorian
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u2['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u2['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u2['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u2['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$output.=$generator->getTimeFormat(round($u2['time'] / SPEED)*3);
|
||||
|
||||
$output.="</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u2['wood'] OR $village->aclay < $u2['clay'] OR $village->airon < $u2['iron'] OR $village->acrop < $u2['crop'])
|
||||
$output.="<span class=\"none\">Not enough resources</span>";
|
||||
elseif($units['u2'] == 0)
|
||||
$output.="<span class=\"none\">Not available units</span>";
|
||||
else
|
||||
$output.="<a href=\"build.php?id=".$id."&train=2\">Train</a>";
|
||||
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't3') != 0){
|
||||
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u3\" src=\"img/x.gif\" alt=\"Imperian\" title=\"Imperian\" />
|
||||
Imperian
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u3['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u3['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u3['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u3['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
|
||||
$output.= $generator->getTimeFormat(round($u3['time'] / SPEED)*3);
|
||||
|
||||
$output.= "</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u3['wood'] OR $village->aclay < $u3['clay'] OR $village->airon < $u3['iron'] OR $village->acrop < $u3['crop']) {
|
||||
$output.="<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u3'] == 0){
|
||||
$output.="<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.="<a href=\"build.php?id=".$id."&train=3\">Train</a>";
|
||||
}
|
||||
"</center></td>
|
||||
</tr> " ;
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't5') != 0){
|
||||
$output.= "<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u5\" src=\"img/x.gif\" alt=\"Equites Imperatoris\" title=\"Equites Imperatoris\" />
|
||||
Equites Imperatoris
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u5['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u5['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u5['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u5['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u5['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u5['wood'] OR $village->aclay < $u5['clay'] OR $village->airon < $u5['iron'] OR $village->acrop < $u5['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u5'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=5\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't6') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u6\" src=\"img/x.gif\" alt=\"Equites Caesaris\" title=\"Equites Caesaris\" />
|
||||
Equites Caesaris
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u6['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u6['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u6['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u6['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u6['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center> ";
|
||||
|
||||
if($village->awood < $u6['wood'] OR $village->aclay < $u6['clay'] OR $village->airon < $u6['iron'] OR $village->acrop < $u6['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u6'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=6\">Train</a>";
|
||||
}
|
||||
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
if($session->tribe == 2) {
|
||||
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u11\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u11['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u11['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u11['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u11['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u11['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u11['wood'] OR $village->aclay < $u11['clay'] OR $village->airon < $u11['iron'] OR $village->acrop < $u11['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u11'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=11\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't12') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u12\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u12['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u12['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u12['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u12['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u12['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u12['wood'] OR $village->aclay < $u12['clay'] OR $village->airon < $u12['iron'] OR $village->acrop < $u12['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u12'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=12\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't13') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u13\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u13['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u13['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u13['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u13['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u13['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u13['wood'] OR $village->aclay < $u13['clay'] OR $village->airon < $u13['iron'] OR $village->acrop < $u13['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u13'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=13\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't15') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u15\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u15['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u15['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u15['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u15['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u15['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u15['wood'] OR $village->aclay < $u15['clay'] OR $village->airon < $u15['iron'] OR $village->acrop < $u15['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u15'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=15\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't16') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u16\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u16['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u16['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u16['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u16['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u16['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u16['wood'] OR $village->aclay < $u16['clay'] OR $village->airon < $u16['iron'] OR $village->acrop < $u16['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u16'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=16\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($session->tribe == 3) {
|
||||
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u21\" src=\"img/x.gif\" alt=\"Phalanx\" title=\"Phalanx\" />
|
||||
Phalanx
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u21['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u21['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u21['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u21['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u21['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u21['wood'] OR $village->aclay < $u21['clay'] OR $village->airon < $u21['iron'] OR $village->acrop < $u21['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u21'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=21\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't22') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u22\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u22['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u22['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u22['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u22['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u22['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u22['wood'] OR $village->aclay < $u22['clay'] OR $village->airon < $u22['iron'] OR $village->acrop < $u22['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u22'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=22\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't24') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u24\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u24['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u24['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u24['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u24['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u24['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u24['wood'] OR $village->aclay < $u24['clay'] OR $village->airon < $u24['iron'] OR $village->acrop < $u24['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u24'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=24\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't25') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u25\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u25['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u25['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u25['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u25['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u25['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u25['wood'] OR $village->aclay < $u25['clay'] OR $village->airon < $u25['iron'] OR $village->acrop < $u25['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u25'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=25\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't26') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u26\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u26['wood']."|
|
||||
<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$u26['clay']."|
|
||||
<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$u26['iron']."|
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$u26['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />".
|
||||
$generator->getTimeFormat(round($u26['time'] / SPEED)*3)."
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u26['wood'] OR $village->aclay < $u26['clay'] OR $village->airon < $u26['iron'] OR $village->acrop < $u26['crop']) {
|
||||
$output.= "<span class=\"none\">Not enough resources</span>";
|
||||
}else if($units['u26'] == 0){
|
||||
$output.= "<span class=\"none\">Not available units</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=26\">Train</a>";
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//HERO TRAINING
|
||||
if($session->tribe == 1){
|
||||
if($_GET['train'] == 1){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '1', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u1` = `u1` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 2){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '2', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u2['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u2` = `u2` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 3){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '3', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u3['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u3` = `u3` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 5){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '5', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u5['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u5` = `u5` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 6){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '6', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u6['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u6` = `u6` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($session->tribe == 2){
|
||||
if($_GET['train'] == 11){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '11', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u11['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u11` = `u11` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
//echo headers_sent();
|
||||
header("Location: build.php?id=".$id."");
|
||||
//echo "<script>document.location.herf=\"./build.php?id=".$id."\"</script>";
|
||||
}
|
||||
if($_GET['train'] == 12){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '12', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u12['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u12` = `u12` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 13){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '13', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u13['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u13` = `u13` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 15){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '15', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u15['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u15` = `u15` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 16){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '16', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u16['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u16` = `u16` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($session->tribe == 3){
|
||||
if($_GET['train'] == 21){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '21', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u21['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u21` = `u21` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 22){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '22', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u22['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u22` = `u22` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 24){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '24', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u24['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u24` = `u24` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 25){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '25', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u25['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u25` = `u25` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
if($_GET['train'] == 26){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES (''".$session->uid."', '" . $village->wid . "', '0', '26', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u26['time'] / SPEED)*3))."', '50')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u26` = `u26` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo $output;
|
||||
|
||||
?>
|
||||
</table>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/*-------------------------------------------------------*\
|
||||
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
|
||||
+---------------------------------------------------------+
|
||||
| Developed by: Manni < manuel_mannhardt@web.de > |
|
||||
| Dzoki < dzoki.travian@gmail.com > |
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\*-------------------------------------------------------*/
|
||||
|
||||
if($hero_info['unit'] == 1) {
|
||||
$name = "Legionnaire";
|
||||
} else if($hero_info['unit'] == 2) {
|
||||
$name = "Praetorian";
|
||||
} else if($hero_info['unit'] == 3) {
|
||||
$name = "Imperian";
|
||||
} else if($hero_info['unit'] == 5) {
|
||||
$name = "Equites Imperatoris";
|
||||
} else if($hero_info['unit'] == 6) {
|
||||
$name = "Equites Caesaris";
|
||||
} else if($hero_info['unit'] == 11) {
|
||||
$name = "Clubswinger";
|
||||
} else if($hero_info['unit'] == 12) {
|
||||
$name = "Spearman";
|
||||
} else if($hero_info['unit'] == 13) {
|
||||
$name = "Axeman";
|
||||
} else if($hero_info['unit'] == 15) {
|
||||
$name = "Paladin";
|
||||
} else if($hero_info['unit'] == 16) {
|
||||
$name = "Teutonic Knight";
|
||||
} else if($hero_info['unit'] == 21) {
|
||||
$name = "Phalanx";
|
||||
} else if($hero_info['unit'] == 22) {
|
||||
$name = "Swordsman";
|
||||
} else if($hero_info['unit'] == 24) {
|
||||
$name = "Theutates Thunder";
|
||||
} else if($hero_info['unit'] == 25) {
|
||||
$name = "Druidrider";
|
||||
} else if($hero_info['unit'] == 26) {
|
||||
$name = "Haeduan";
|
||||
}
|
||||
|
||||
if($hero_info['trainingtime'] <= time()) {
|
||||
if($hero_info['trainingtime'] != 0) {
|
||||
if($hero_info['dead'] == 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET trainingtime = '0', dead = '0' WHERE uid = " . $session->uid . "");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$village->wid."");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($hero_info['trainingtime'] > time()) {
|
||||
$timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
|
||||
|
||||
?>
|
||||
<table id="distribution" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php echo "<tr class='next'><th>Hero will be ready in <span id=timer1>" . $timeleft . "</span></th></tr>"; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tr>
|
||||
<td><img class="u<?php echo $hero_info['unit']; ?>" src="img/x.gif" /> <?php echo $name . " (<b>" . $hero_info['name'] . "</b>) "; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid38"><a href="#" onClick="return Popup(38,4);" class="build_logo">
|
||||
<img class="building g38" src="img/x.gif" alt="Great Warehouse" title="Great Warehouse" />
|
||||
</a>
|
||||
<h1>Great Warehouse <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Wood, clay and iron are stored in the warehouse. The great warehouse offers you more space and keeps your goods drier and safer than the normal one.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current capacity:</th>
|
||||
<td><b><?php echo $bid38[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> units</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Capacity at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid38[$village->resarray['f'.$id]+1]['attri']*STORAGE_MULTIPLIER; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div id="build" class="gid39"><a href="#" onClick="return Popup(39,4);" class="build_logo">
|
||||
<img class="building g39" src="img/x.gif" alt="Great Granary" title="Great Granary" />
|
||||
</a>
|
||||
<h1>Great Granary <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Crop produced by your farms is stored in the granary. The great granary offers you more space and keeps your crops drier and safer than the normal one.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current capacity:</th>
|
||||
<td><b><?php echo $bid39[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> units</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Capacity at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid39[$village->resarray['f'.$id]+1]['attri']*STORAGE_MULTIPLIER; ?></b> units</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div id="build" class="gid4"><a href="#" onClick="return Popup(4,4);" class="build_logo">
|
||||
<img class="building g4" src="img/x.gif" alt="<?php echo B4; ?>" title="<?php echo B4; ?>" />
|
||||
</a>
|
||||
<h1><?php echo B4; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id];?></span></h1>
|
||||
<p class="build_desc"><?php echo B4_DESC; ?></p>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th><?php echo CUR_PROD; ?></th>
|
||||
<td><b><?php echo $bid4[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_PROD; echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid4[$village->resarray['f'.$id]+1]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?></p></div>
|
||||
@@ -0,0 +1,10 @@
|
||||
<div id="build" class="gid41"><a href="#" onClick="return Popup(41,4);" class="build_logo">
|
||||
<img class="building g41" src="img/x.gif" alt="Horse Drinking Trough" title="Horse Drinking Trough" />
|
||||
</a>
|
||||
<h1>Horse Drinking Trough <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">The horse drinking trough of the Romans decreases the training time of cavalry and the upkeep of these troops as well.</p>
|
||||
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,59 @@
|
||||
<div id="build" class="gid42"><a href="#" onClick="return Popup(42,4);" class="build_logo">
|
||||
<img class="building g42" src="img/x.gif" alt="Great Workshop" title="Great Workshop" />
|
||||
</a>
|
||||
<h1>Great Workshop <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Siege engines like catapults and rams can be built in the great workshop. The higher its level the faster the units are produced.</p>
|
||||
|
||||
<?php if ($building->getTypeLevel(42) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t3" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead><tr>
|
||||
<td>Name</td>
|
||||
<td>Quantity</td>
|
||||
<td>Max</td>
|
||||
</tr></thead><tbody>
|
||||
<?php
|
||||
include("42_train.tpl");
|
||||
?></table>
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" /></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>Training can commence when great workshop is completed.</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(7);
|
||||
if(count($trainlist) > 0) {
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
for ($i=($session->tribe-1)*10+7;$i<=($session->tribe-1)*10+8;$i++) {
|
||||
if ($technology->getTech($i)) {
|
||||
echo "<tr><td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "</div>
|
||||
</td>
|
||||
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,true)."; return false;\">(".$technology->maxUnit($i,true).")</a></td></tr></tbody>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid5"><a href="#" onClick="return Popup(5,4);" class="build_logo">
|
||||
<img class="building g5" src="img/x.gif" alt="Sawmill" title="Sawmill" />
|
||||
</a>
|
||||
<h1>Sawmill <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Here wood delivered by your Woodcutters is processed. Based on its level your sawmill can increase your wood production by up to 25 percent.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current wood bonus:</th>
|
||||
<td><b><?php echo $bid5[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Wood bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid5[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid6"><a href="#" onClick="return Popup(6,4);" class="build_logo">
|
||||
<img class="building g6" src="img/x.gif" alt="Brickyard" title="Brickyard" />
|
||||
</a>
|
||||
<h1>Brickyard <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Here clay is processed into bricks. Based on its level your Brickyard can increase your clay production by up to 25 percent.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current clay bonus:</th>
|
||||
<td><b><?php echo $bid6[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Clay bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid6[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid7"><a href="#" onClick="return Popup(7,4);" class="build_logo">
|
||||
<img class="building g7" src="img/x.gif" alt="Iron Foundry" title="Iron Foundry" />
|
||||
</a>
|
||||
<h1>Iron Foundry <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Iron is smelted here. Based on its level your Iron Foundry can increase your iron production by up to 25 percent.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current iron bonus:</th>
|
||||
<td><b><?php echo $bid7[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Iron bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid7[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid8"><a href="#" onClick="return Popup(8,4);" class="build_logo">
|
||||
<img class="building g8" src="img/x.gif" alt="Grain Mill" title="Grain Mill" />
|
||||
</a>
|
||||
<h1>Grain Mill <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Here your grain is milled in order to produce flour. Based on its level your grain mill can increase your crop production by up to 25 percent.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current crop bonus:</th>
|
||||
<td><b><?php echo $bid8[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Crop bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid8[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="build" class="gid9"><a href="#" onClick="return Popup(9,4);" class="build_logo">
|
||||
<img class="building g9" src="img/x.gif" alt="Bakery" title="Bakery" />
|
||||
</a>
|
||||
<h1>Bakery <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc">Here the flour produced in your mill is used to bake bread. In addition with the Grain Mill the increase in crop production can go up to 50 percent.</p>
|
||||
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="build_value">
|
||||
<tr>
|
||||
<th>Current crop bonus:</th>
|
||||
<td><b><?php echo $bid9[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
|
||||
?>
|
||||
<th>Crop bonus at level <?php echo $village->resarray['f'.$id]+1; ?>:</th>
|
||||
<td><b><?php echo $bid9[$village->resarray['f'.$id]+1]['attri']; ?></b> Percent</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -0,0 +1,373 @@
|
||||
<?php
|
||||
$normalA = $database->getOwnArtefactInfoByType($village->wid,6);
|
||||
$largeA = $database->getOwnUniqueArtefactInfo($session->uid,6,2);
|
||||
|
||||
$mainbuilding = $building->getTypeLevel(15);
|
||||
$cranny = $building->getTypeLevel(23);
|
||||
$granary = $building->getTypeLevel(11);
|
||||
$warehouse = $building->getTypeLevel(10);
|
||||
$embassy = $building->getTypeLevel(18);
|
||||
$wall = $village->resarray['f40'];
|
||||
$rallypoint = $building->getTypeLevel(16);
|
||||
$hero = $building->getTypeLevel(37);
|
||||
$market = $building->getTypeLevel(17);
|
||||
$barrack = $building->getTypeLevel(19);
|
||||
$cropland = $building->getTypeLevel(4);
|
||||
$grainmill = $building->getTypeLevel(8);
|
||||
$residence = $building->getTypeLevel(25);
|
||||
$academy = $building->getTypeLevel(22);
|
||||
$armoury = $building->getTypeLevel(13);
|
||||
$woodcutter = $building->getTypeLevel(1);
|
||||
$palace = $building->getTypeLevel(26);
|
||||
$claypit = $building->getTypeLevel(2);
|
||||
$ironmine = $building->getTypeLevel(3);
|
||||
$blacksmith = $building->getTypeLevel(12);
|
||||
$stable = $building->getTypeLevel(20);
|
||||
$trapper = $building->getTypeLevel(36);
|
||||
$treasury = $building->getTypeLevel(27);
|
||||
$sawmill = $building->getTypeLevel(5);
|
||||
$brickyard = $building->getTypeLevel(6);
|
||||
$ironfoundry = $building->getTypeLevel(7);
|
||||
$workshop = $building->getTypeLevel(21);
|
||||
$stonemasonslodge = $building->getTypeLevel(34);
|
||||
$townhall = $building->getTypeLevel(24);
|
||||
$tournamentsquare = $building->getTypeLevel(14);
|
||||
$bakery = $building->getTypeLevel(9);
|
||||
$tradeoffice = $building->getTypeLevel(28);
|
||||
$greatbarracks = $building->getTypeLevel(29);
|
||||
$greatstable = $building->getTypeLevel(30);
|
||||
$brewery = $building->getTypeLevel(35);
|
||||
$horsedrinkingtrough = $building->getTypeLevel(41);
|
||||
$herosmansion = $building->getTypeLevel(37);
|
||||
$greatwarehouse = $building->getTypeLevel(38);
|
||||
$greatgranary = $building->getTypeLevel(39);
|
||||
$greatworkshop = $building->getTypeLevel(42);
|
||||
|
||||
foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
|
||||
$UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type'])));
|
||||
$$UnderConstruction = ($$UnderConstruction == 0 ? -1 : $$UnderConstruction);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<div id="build" class="gid0"><h1>Construct new building</h1>
|
||||
<?php
|
||||
if($mainbuilding == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/mainbuilding.tpl");
|
||||
}
|
||||
if(($cranny == 0 || $cranny == 10) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
|
||||
include("avaliable/cranny.tpl");
|
||||
}
|
||||
if(($granary == 0 || $granary == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40 ) {
|
||||
include("avaliable/granary.tpl");
|
||||
}
|
||||
if($wall == 0) {
|
||||
if($session->tribe == 1 && $id != 39) {
|
||||
include("avaliable/citywall.tpl");
|
||||
}
|
||||
if($session->tribe == 2 && $id != 39) {
|
||||
include("avaliable/earthwall.tpl");
|
||||
}
|
||||
if($session->tribe == 3 && $id != 39) {
|
||||
include("avaliable/palisade.tpl");
|
||||
}
|
||||
if($session->tribe == 4 && $id != 39) {
|
||||
include("avaliable/earthwall.tpl");
|
||||
}
|
||||
if($session->tribe == 5 && $id != 39) {
|
||||
include("avaliable/citywall.tpl");
|
||||
}
|
||||
}
|
||||
if(($warehouse == 0 || $warehouse == 20) && $id != 39 && $id != 40) {
|
||||
include("avaliable/warehouse.tpl");
|
||||
}
|
||||
if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
include("avaliable/greatwarehouse.tpl");
|
||||
}
|
||||
if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
include("avaliable/greatgranary.tpl");
|
||||
}
|
||||
if(($trapper ==0 || $trapper == 10) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) {
|
||||
include("avaliable/trapper.tpl");
|
||||
}
|
||||
if($rallypoint == 0 && $id != 40) {
|
||||
include("avaliable/rallypoint.tpl");
|
||||
}
|
||||
if($embassy == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/embassy.tpl");
|
||||
}
|
||||
//fix hero
|
||||
if($hero == 0 && $mainbuilding >= 3 && $rallypoint >= 1 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
|
||||
include("avaliable/hero.tpl");
|
||||
}
|
||||
//fix barracks
|
||||
if($rallypoint >= 1 && $mainbuilding >= 3 && $barrack == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
|
||||
include("avaliable/barracks.tpl");
|
||||
}
|
||||
if($mainbuilding >= 3 && $academy >= 1 && $armoury == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/armoury.tpl");
|
||||
}
|
||||
if($cropland >= 5 && $grainmill == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/grainmill.tpl");
|
||||
}
|
||||
//fix marketplace
|
||||
if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
|
||||
include("avaliable/marketplace.tpl");
|
||||
}
|
||||
//fix residence
|
||||
if($mainbuilding >= 5 && $residence == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40 && $palace == 0) {
|
||||
include("avaliable/residence.tpl");
|
||||
}
|
||||
if($academy == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) {
|
||||
include("avaliable/academy.tpl");
|
||||
}
|
||||
//fix palace
|
||||
if($palace == 0 && $embassy >= 1 && $mainbuilding >= 5 && $$UnderConstruction <> -1 && $id != 39 && $id != 40 && $residence == 0) {
|
||||
include("avaliable/palace.tpl");
|
||||
}
|
||||
if($blacksmith == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) {
|
||||
include("avaliable/blacksmith.tpl");
|
||||
}
|
||||
if($stonemasonslodge == 0 && $palace >= 3 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/stonemason.tpl");
|
||||
}
|
||||
if($stable == 0 && $blacksmith >= 3 && $academy >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/stable.tpl");
|
||||
}
|
||||
if($treasury == 0 && $mainbuilding >= 10 && $id != 39 && $id != 40) {
|
||||
include("avaliable/treasury.tpl");
|
||||
}
|
||||
if($brickyard == 0 && $claypit >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40 ) {
|
||||
include("avaliable/brickyard.tpl");
|
||||
}
|
||||
if($sawmill == 0 && $woodcutter >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/sawmill.tpl");
|
||||
}
|
||||
if($ironfoundry == 0 && $ironmine >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/ironfoundry.tpl");
|
||||
}
|
||||
if($workshop == 0 && $academy >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/workshop.tpl");
|
||||
}
|
||||
if($tournamentsquare == 0 && $rallypoint >= 15 && $id != 39 && $id != 40) {
|
||||
include("avaliable/tsquare.tpl");
|
||||
}
|
||||
if($bakery == 0 && $grainmill >= 5 && $cropland >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/bakery.tpl");
|
||||
}
|
||||
if($townhall == 0 && $mainbuilding >= 10 && $academy >= 10 && $id != 39 && $id != 40) {
|
||||
include("avaliable/townhall.tpl");
|
||||
}
|
||||
if($tradeoffice == 0 && $market == 20 && $stable >= 10 && $id != 39 && $id != 40) {
|
||||
include("avaliable/tradeoffice.tpl");
|
||||
}
|
||||
if($session->tribe == 1 && $horsedrinkingtrough == 0 && $rallypoint >= 10 && $stable == 20 && $id != 39 && $id != 40) {
|
||||
include("avaliable/horsedrinking.tpl");
|
||||
}
|
||||
if($session->tribe == 2 && $brewery == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) {
|
||||
include("avaliable/brewery.tpl");
|
||||
}
|
||||
if($greatbarracks == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/greatbarracks.tpl");
|
||||
}
|
||||
if($greatstable == 0 && $stable == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/greatstable.tpl");
|
||||
}
|
||||
if($greatworkshop == 0 && $workshop == 20 && $village->capital == 0 && $id != 39 && $id != 40 && GREAT_WKS) {
|
||||
include("avaliable/greatworkshop.tpl");
|
||||
}
|
||||
if($id != 39 && $id != 40) {
|
||||
?>
|
||||
<p class="switch"><a id="soon_link" href="javascript:show_build_list('soon');">show soon available buildings</a></p>
|
||||
|
||||
<div id="build_list_soon" class="hide">
|
||||
<?php
|
||||
if($rallypoint == 0 && $session->tribe == 3 && $trapper == 0 ) {
|
||||
include("soon/trapper.tpl");
|
||||
}
|
||||
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
include("soon/greatwarehouse.tpl");
|
||||
}
|
||||
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
include("soon/greatgranary.tpl");
|
||||
}
|
||||
if($hero == 0 && ($mainbuilding <= 2 || $rallypoint == 0)){
|
||||
include("soon/hero.tpl");
|
||||
}
|
||||
if($barrack == 0 && ($rallypoint == 0 || $mainbuilding <= 2) ) {
|
||||
include("soon/barracks.tpl");
|
||||
}
|
||||
if($armoury == 0 && ($mainbuilding <= 2 || $academy == 0)) {
|
||||
include("soon/armoury.tpl");
|
||||
}
|
||||
if($cropland <= 4) {
|
||||
include("soon/grainmill.tpl");
|
||||
}
|
||||
if($marketplace == 0 && ($mainbuilding <= 2 || $granary <= 0 || $warehouse <= 0)) {
|
||||
include("soon/marketplace.tpl");
|
||||
}
|
||||
if($residence == 0 && $mainbuilding <= 4) {
|
||||
include("soon/residence.tpl");
|
||||
}
|
||||
if($academy == 0 && ($mainbuilding <= 2 || $barrack <= 2)) {
|
||||
include("soon/academy.tpl");
|
||||
}
|
||||
if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4) {
|
||||
include("soon/palace.tpl");
|
||||
}
|
||||
if($blacksmith == 0 && ($academy <= 2 || $mainbuilding <= 2)) {
|
||||
include("soon/blacksmith.tpl");
|
||||
}
|
||||
if($stonemasonslodge == 0 && $palace <= 2 && $palace != 0 && $mainbuilding >= 2 && $mainbuilding <= 4 && $residence == 0) {
|
||||
include("soon/stonemason.tpl");
|
||||
}
|
||||
if($stable == 0 && (($blacksmith <= 2 && $blacksmith != 0) || ($academy >= 2 && $academy <= 4))) {
|
||||
include("soon/stable.tpl");
|
||||
}
|
||||
if($treasury == 0 && $mainbuilding <= 9 && $mainbuilding >= 5) {
|
||||
include("soon/treasury.tpl");
|
||||
}
|
||||
if($brickyard == 0 && $claypit <= 9 && $claypit >= 5 && $mainbuilding >= 2 && $mainbuilding <= 4) {
|
||||
include("soon/brickyard.tpl");
|
||||
}
|
||||
if($sawmill == 0 && $woodcutter <= 9 && $woodcutter >= 5 && $mainbuilding >= 2 && $mainbuilding <= 4) {
|
||||
include("soon/sawmill.tpl");
|
||||
}
|
||||
if($ironfoundry == 0 && $ironmine <= 9 && $ironmine >= 5 && $mainbuilding >= 2 && $mainbuilding <= 4) {
|
||||
include("soon/ironfoundry.tpl");
|
||||
}
|
||||
if($workshop == 0 && $academy <= 9 && $academy >= 5 && $mainbuilding >= 2 && $mainbuilding <= 4) {
|
||||
include("soon/workshop.tpl");
|
||||
}
|
||||
if($tournamentsquare == 0 && $rallypoint <= 14 && $rallypoint >= 7) {
|
||||
include("soon/tsquare.tpl");
|
||||
}
|
||||
if($bakery == 0 && $grainmill <= 4 && $grainmill != 0 && $cropland >= 5 && $cropland <= 9 && $mainbuilding >= 2 && $mainbuilding <= 4) {
|
||||
include("soon/bakery.tpl");
|
||||
}
|
||||
if($townhall == 0 && ($mainbuilding <= 9 && $mainbuilding >= 5) || ($academy >= 5 && $academy <= 9)) {
|
||||
include("soon/townhall.tpl");
|
||||
}
|
||||
if($tradeoffice == 0 && $market <= 19 && $market >= 10 || $stable >= 5 && $stable <= 9) {
|
||||
include("soon/tradeoffice.tpl");
|
||||
}
|
||||
if($session->tribe == 1 && $horsedrinkingtrough == 0 && $rallypoint <= 9 && $rallypoint >= 5 || $stable <= 19 && $stable >= 10 && $session->tribe == 1) {
|
||||
include("soon/horsedrinking.tpl");
|
||||
}
|
||||
if($brewery == 0 && $rallypoint <= 9 && $rallypoint >= 5 || $granary <= 19 && $granary >= 10 && $session->tribe == 2) {
|
||||
include("soon/brewery.tpl");
|
||||
}
|
||||
if($greatbarracks == 0 && $barrack >= 18 && $village->capital == 0) {
|
||||
include("soon/greatbarracks.tpl");
|
||||
}
|
||||
if($greatstable == 0 && $stable >= 18 && $village->capital == 0) {
|
||||
include("soon/greatstable.tpl");
|
||||
}
|
||||
if($greatworkshop == 0 && $workshop >= 18 && $village->capital == 0 && GREAT_WKS) {
|
||||
include("soon/greatworkshop.tpl");
|
||||
}
|
||||
?>
|
||||
</div><p class="switch"><a id="all_link" class="hide"
|
||||
href="javascript:show_build_list('all');">show more</a></p>
|
||||
|
||||
<div id="build_list_all" class="hide">
|
||||
<?php
|
||||
if($academy == 0 && ($mainbuilding == 1 || $barrack == 0)) {
|
||||
include("soon/academy.tpl");
|
||||
}
|
||||
if($palace == 0 && ($embassy == 0 || $mainbuilding <= 2)) {
|
||||
include("soon/palace.tpl");
|
||||
}
|
||||
if($blacksmith == 0 && ($academy == 0 || $mainbuilding == 1)) {
|
||||
include("soon/blacksmith.tpl");
|
||||
}
|
||||
if($stonemason == 0 && ($palace == 0 || $mainbuilding <= 2) && $residence == 0) {
|
||||
include("soon/stonemason.tpl");
|
||||
}
|
||||
if($stable == 0 && ($blacksmith == 0 || $academy <= 2)) {
|
||||
include("soon/stable.tpl");
|
||||
}
|
||||
if($treasury == 0 && $mainbuilding <= 5) {
|
||||
include("soon/treasury.tpl");
|
||||
}
|
||||
if($brickyard == 0 && ($claypit <= 5 || $mainbuilding <= 2)) {
|
||||
include("soon/brickyard.tpl");
|
||||
}
|
||||
if($sawmill == 0 && ($woodcutter <= 5 || $mainbuilding <= 2)) {
|
||||
include("soon/sawmill.tpl");
|
||||
}
|
||||
if($ironfoundry == 0 && ($ironmine <= 5 || $mainbuilding <= 2)) {
|
||||
include("soon/ironfoundry.tpl");
|
||||
}
|
||||
if($workshop == 0 && ($academy <= 5 || $mainbuilding <= 2)) {
|
||||
include("soon/workshop.tpl");
|
||||
}
|
||||
if($tournamentsquare == 0 && $rallypoint <= 7) {
|
||||
include("soon/tsquare.tpl");
|
||||
}
|
||||
if($bakery == 0 && ($grainmill == 0 || $cropland <= 5 || $mainbuilding <= 2)) {
|
||||
include("soon/bakery.tpl");
|
||||
}
|
||||
if($townhall == 0 && ($mainbuilding <= 5 || $academy <= 5)) {
|
||||
include("soon/townhall.tpl");
|
||||
}
|
||||
if($tradeoffice == 0 && ($market <= 10 || $stable <= 5)) {
|
||||
include("soon/tradeoffice.tpl");
|
||||
}
|
||||
if($session->tribe == 1 && $horsedrinkingtrough == 0 && ($rallypoint <= 5 || $stable <= 10)) {
|
||||
include("soon/horsedrinking.tpl");
|
||||
}
|
||||
if($brewery == 0 && ($rallypoint <= 5 || $granary <= 10) && $session->tribe == 2) {
|
||||
include("soon/brewery.tpl");
|
||||
}
|
||||
if($greatbarracks == 0 && $barrack >= 15 && $village->capital == 0) {
|
||||
include("soon/greatbarracks.tpl");
|
||||
}
|
||||
if($greatstable == 0 && $stable >= 15 && $village->capital == 0) {
|
||||
include("soon/greatstable.tpl");
|
||||
}
|
||||
if($greatworkshop == 0 && $workshop >= 15 && $village->capital == 0 && GREAT_WKS) {
|
||||
include("soon/greatworkshop.tpl");
|
||||
}
|
||||
?>
|
||||
</div><script language="JavaScript" type="text/javascript">
|
||||
function show_build_list(list) {
|
||||
// aktuelle liste, aktueller link
|
||||
var build_list = document.getElementById('build_list_'+list);
|
||||
var link = document.getElementById(list+'_link');
|
||||
|
||||
var all_link = document.getElementById('all_link');
|
||||
var soon_link = document.getElementById('soon_link');
|
||||
|
||||
var build_list_all = document.getElementById('build_list_all');
|
||||
var build_list_soon = document.getElementById('build_list_soon');
|
||||
|
||||
if (build_list.className == 'hide') {
|
||||
build_list.className = '';
|
||||
if (link == soon_link) {
|
||||
link.innerHTML = 'hide soon available buildings';
|
||||
if (all_link !== null) {
|
||||
all_link.className = '';
|
||||
}
|
||||
} else {
|
||||
link.innerHTML = 'hide more';
|
||||
}
|
||||
} else {
|
||||
build_list.className = 'hide';
|
||||
if (link == soon_link) {
|
||||
link.innerHTML = 'show soon available buildings';
|
||||
if (all_link !== null) {
|
||||
all_link.innerHTML = 'show more';
|
||||
all_link.className = 'hide';
|
||||
build_list_all.className = 'hide';
|
||||
}
|
||||
} else {
|
||||
link.innerHTML = 'show more';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<h2>Academy</h2>
|
||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||
<tbody><tr>
|
||||
<td class="desc">In the academy new unit types can be researched. By increasing its level you can order the research of better units.</td>
|
||||
<td rowspan="3" class="bimg">
|
||||
<a href="#" onClick="return Popup(22,4);">
|
||||
<img class="building g22" src="img/x.gif" alt="Academy" title="Academy" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$_GET['bid'] = 22;
|
||||
include("availupgrade.tpl");
|
||||
?>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,16 @@
|
||||
<h2>Armoury</h2>
|
||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||
<tbody><tr>
|
||||
<td class="desc">In the armoury's melting furnaces your warriors' armour is enhanced. By increasing its level you can order the fabrication of even better armour.</td>
|
||||
<td rowspan="3" class="bimg">
|
||||
<a href="#" onClick="return Popup(13,4);">
|
||||
<img class="building g13" src="img/x.gif" alt="Armoury" title="Armoury" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$_GET['bid'] = 13;
|
||||
include("availupgrade.tpl");
|
||||
?>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
$bid = $_GET['bid'];
|
||||
unset($_GET['bid']);
|
||||
$bindicator = $building->canBuild($id,$bid);
|
||||
$uprequire = $building->resourceRequired($id,$bid);
|
||||
?>
|
||||
<td class="res">
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $uprequire['wood']; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $uprequire['clay']; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $uprequire['iron']; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $uprequire['crop']; ?> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
} ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="link">
|
||||
<?php
|
||||
if($bindicator == 2) {
|
||||
echo "<span class=\"none\">The workers are already at work.</span>";
|
||||
}
|
||||
else if($bindicator == 3) {
|
||||
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
|
||||
}
|
||||
else if($bindicator == 4) {
|
||||
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
|
||||
}
|
||||
else if($bindicator == 5) {
|
||||
echo "<span class=\"none\">Upgrade Warehouse.</span>";
|
||||
}
|
||||
else if($bindicator == 6) {
|
||||
echo "<span class=\"none\">Upgrade Granary.</span>";
|
||||
}
|
||||
else if($bindicator == 7) {
|
||||
$neededtime = $building->calculateAvaliable($id,$bid);
|
||||
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
|
||||
}
|
||||
else if($bindicator == 8) {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=".$session->checker."\">Construct building.</a>";
|
||||
}
|
||||
else if($bindicator == 9) {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=".$session->checker."\">Construct building. (waiting loop)</a>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
@@ -0,0 +1,16 @@
|
||||
<h2>Bakery</h2>
|
||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||
<tbody><tr>
|
||||
<td class="desc">Here the flour produced in your mill is used to bake bread. In conjunction with the grain mill the increase in crop production can go up to 50 percent.</td>
|
||||
<td rowspan="3" class="bimg">
|
||||
<a href="#" onClick="return Popup(9,4);">
|
||||
<img class="building g9" src="img/x.gif" alt="Bakery" title="Bakery" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$_GET['bid'] = 9;
|
||||
include("availupgrade.tpl");
|
||||
?>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,17 @@
|
||||
<h2>Barracks</h2>
|
||||
|
||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||
<tbody><tr>
|
||||
<td class="desc">In the barracks infantry can be trained. The higher its level the faster the troops are trained.</td>
|
||||
<td rowspan="3" class="bimg">
|
||||
<a href="#" onClick="return Popup(19,4);">
|
||||
<img class="building g19" src="img/x.gif" alt="Barracks" title="Barracks" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$_GET['bid'] = 19;
|
||||
include("availupgrade.tpl");
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,18 @@
|
||||
<h2>Blacksmith</h2>
|
||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||
<tbody><tr>
|
||||
<td class="desc">In the blacksmith's melting furnaces your warriors' weapons are enhanced. By increasing its level you can order the fabrication of even better weapons.
|
||||
|
||||
</td>
|
||||
<td rowspan="3" class="bimg">
|
||||
<a href="#" onClick="return Popup(12,4);">
|
||||
<img class="building g12" src="img/x.gif" alt="Blacksmith" title="Blacksmith" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$_GET['bid'] = 12;
|
||||
include("availupgrade.tpl");
|
||||
?>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,16 @@
|
||||
<h2>Brewery</h2>
|
||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||
<tbody><tr>
|
||||
<td class="desc">In the Teuton’s brewery mead is brewed, the soldiers drink to give themselves Dutch courage before battle. The higher the level of the brewery, the greater is the attack bonus. The mead-festivals always last 72 hours.</td>
|
||||
<td rowspan="3" class="bimg">
|
||||
<a href="#" onClick="return Popup(19,4);">
|
||||
<img class="building g35" src="img/x.gif" alt="Brewery" title="Brewery" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$_GET['bid'] = 35;
|
||||
include("availupgrade.tpl");
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,16 @@
|
||||
<h2>Brickyard</h2>
|
||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||
<tbody><tr>
|
||||
<td class="desc">Here clay is processed into bricks. Based on its level your Brickyard can increase your clay production up to 25 percent.</td>
|
||||
<td rowspan="3" class="bimg">
|
||||
<a href="#" onClick="return Popup(6,4);">
|
||||
<img class="building g6" src="img/x.gif" alt="Brickyard" title="Brickyard" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$_GET['bid'] = 6;
|
||||
include("availupgrade.tpl");
|
||||
?>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user