finish hero_full.php

This commit is contained in:
yi12345
2013-06-16 10:38:34 +03:00
commit 98e94af807
2800 changed files with 115529 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+53
View File
@@ -0,0 +1,53 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid1[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; 20 ?>:</th>
<td><b><?php echo $bid1[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}else{
if($next<=10){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid1[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
<td><b><?php echo $bid1[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}}
?>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+38
View File
@@ -0,0 +1,38 @@
<?php
include("next.tpl");
?>
<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> Resource units</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
<td><b><?php echo $bid10[$next]['attri']*STORAGE_MULTIPLIER; ?></b> Resource units</td>
<?php
}else{
?>
<th>Capacity at level 20:</th>
<td><b><?php echo $bid10[20]['attri']*STORAGE_MULTIPLIER; ?></b> Resource units</td>
<?php
}
}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+39
View File
@@ -0,0 +1,39 @@
<?php
include("next.tpl");
?>
<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> Crop units</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
<td><b><?php echo $bid11[$next]['attri']*STORAGE_MULTIPLIER; ?></b> Crop units</td>
<?php
}else{
?>
<th>Capacity at level 20:</th>
<td><b><?php echo $bid11[20]['attri']*STORAGE_MULTIPLIER; ?></b> Crop units</td>
<?php
}
}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+16
View File
@@ -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>
+78
View File
@@ -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&amp;a=$j&amp;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>";
}
?>
+16
View File
@@ -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&#39;s melting furnaces your warriors&#39; 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>
+78
View File
@@ -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&amp;a=$j&amp;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>";
}
?>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Speed bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid14[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Speed bonus at level 20:</th>
<td><b><?php echo $bid14[20]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+41
View File
@@ -0,0 +1,41 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Construction time at level <?php echo $next; ?>:</th>
<td><b><?php echo round($bid15[$next]['attri']); ?></b> Percent</td>
<?php
}else{
?>
<th>Construction time at level 20:</th>
<td><b><?php echo round($bid15[20]['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>
+56
View File
@@ -0,0 +1,56 @@
<?php
if($_REQUEST["cancel"] == "1") {
if($session->access != BANNED){
$database->delDemolition($village->wid);
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0");
}else{
header("Location: banned.php");
}
}
if(!empty($_REQUEST["demolish"]) && $_REQUEST["c"] == $session->mchecker) {
if($session->access != BANNED){
if($_REQUEST["type"] != null) {
$type = $_REQUEST['type'];
$database->addDemolition($village->wid,$type);
$session->changeChecker();
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0");
}
}else{
header("Location: banned.php");
}
}
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>";
if($session->gold >= 2) {
if($session->access!=BANNED){
?> <a href="?buildingFinish=1" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php
}else{
?> <a href="banned.php" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php
}
}
echo "</b>";
} else {
echo "
<form action=\"build.php?gid=15&amp;demolish=1&amp;cancel=0&amp;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>";
}
}
?>
+249
View File
@@ -0,0 +1,249 @@
<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> <?php if($session->goldclub==1){ ?>|
<a href="build.php?id=<?php echo $id; ?>&amp;t=99">Gold Club</a>
<?php } ?>
</div>
<?php
$units_type = $database->getMovement("34",$village->wid,1);
$settlers = $database->getMovement("7",$village->wid,1);
$units_incoming = count($units_type);
$settlers_incoming = count($settlers);
for($i=0;$i<$units_incoming;$i++){
if($units_type[$i]['attack_type'] == 1 && $units_type[$i]['sort_type'] == 3)
$units_incoming -= 1;
}
if($units_incoming > 0 or $settlers_incoming > 0){
?>
<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) {
$colspan = 10+$enforce['hero'];
if($enforce['from']!=0){
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=\"$colspan\">";
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>&nbsp;</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($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></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>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><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>";
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a>Taskmaster</a></td>
<td colspan=\"$colspan\">";
echo "<a> village of the elders troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = 4;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</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($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></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>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><span class=none><b>Send back</b></span></div></td></tr>";
echo "</tbody></table>";
}
}
}
if(count($village->enforcetoyou) > 0) {
echo "<h4>Troops in other village</h4>";
foreach($village->enforcetoyou as $enforce) {
$colspan = 10+$enforce['hero'];
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=\"$colspan\">";
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>&nbsp;</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($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></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>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><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>";
}
}
if(count($database->getPrisoners3($village->wid)) > 0) {
echo "<h4>Prisoners</h4>";
foreach($database->getPrisoners3($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">prisoners in ".$database->getVillageField($prisoners['wref'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</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($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($prisoners,$tribe,0,1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>Kill</a></div></td></tr>";
echo "</tbody></table>";
}
}
if(count($database->getPrisoners($village->wid)) > 0) {
echo "<h4>Prisoners</h4>";
foreach($database->getPrisoners($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
$colspan2 = 11+$prisoners['t11'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">prisoners from ".$database->getVillageField($prisoners['from'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</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($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><td colspan=\"11\"><div class='sup'><img class=\"r6\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" /></div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['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>
+78
View File
@@ -0,0 +1,78 @@
<?php
if(!$session->goldclub) {
include "Templates/Build/16.tpl";
}else{
?>
<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> <?php if($session->goldclub==1){ ?>|
<a href="build.php?id=<?php echo $id; ?>&amp;t=99">Gold Club</a>
<?php } ?>
</div>
<div id="raidList">
<?php include "Templates/goldClub/farmlist.tpl"; ?>
</div>
<br />
<?php if($hideevasion == 0){ ?>
<table cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="4">evasion settings</th>
</tr>
<tr>
<td></td>
<td>village</td>
<td>own troops</td>
<td>reinforcement</td>
</tr>
</thead>
<tbody>
<?php
for($i=0;$i<=count($session->villages)-1;$i++) {
$wref = $session->villages[$i];
$vname = $database->getVillageField($wref,"name");
$vchecked = $database->getVillageField($wref,"evasion");
$reinf = $database->getEnforceVillage($wref,0);
if($vchecked == 1){ $checked = 'checked'; }else{ $checked = ''; }
?>
<tr>
<td><input type="checkbox" class="check" name="hideShow" onclick="window.location.href = '?gid=16&t=99&evasion=<?php echo $wref;?>';" <?php echo $checked; ?>></td>
<td><?php echo $vname; ?></td>
<td><?php echo $database->getUnitsNumber($wref); ?></td>
<td><?php echo count($reinf); ?></td>
</tr>
<?php
}
$user = $database->getUserArray($session->uid, 1);
?>
</tbody>
</table>
<form action="build.php?id=39&t=99" method="POST">
<br />
<tr>
Send troops away a maximun of <input class="text" type="text" name="maxevasion" value="<?php echo $user['maxevasion']; ?>" maxlength="3" style="width:50px;"> times
<span class="none">(costs: <img src="<?php echo GP_LOCATE; ?>img/a/gold_g.gif" alt="Gold" title="Gold"/><b>2</b> per evasion)</span>
</tr>
<tr>
<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"/></p></form>
</tr>
</form>
<?php } ?>
</div>
<?php } ?>
+276
View File
@@ -0,0 +1,276 @@
<?php
include_once("GameEngine/Data/unitdata.php");
$units = $database->getMovement("34",$village->wid,1);
$total_for = count($units);
$send = $database->getMovement("1",$village->wid,1);
$total_for2 = count($send);
for($y=0;$y < $total_for;$y++){
for($i=0;$i < $total_for2;$i++){
if($units[$y]['ref'] == $send[$i]['ref2']){
$res1 = mysql_query("SELECT * FROM " . TB_PREFIX . "send where id = ".$send[$i]['ref']."");
$res = mysql_fetch_array($res1);
}
}
$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 ";
}
$reinfowner = $database->getVillageField($units[$y]['from'],"owner");
if($units[$y]['attack_type'] != 1){
if($units[$y]['from'] != 0){
if($units[$y]['t11'] != 0 && $reinfowner == $session->uid) {
$colspan = 11;
}else{
$colspan = 10;
}
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=\"$colspan\">";
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>&nbsp;</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 && $reinfowner == $session->uid) {
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=$colspan;$i++) {
$totalunits = $units[$y]['t1']+$units[$y]['t2']+$units[$y]['t3']+$units[$y]['t4']+$units[$y]['t5']+$units[$y]['t6']+$units[$y]['t7']+$units[$y]['t8']+$units[$y]['t9']+$units[$y]['t10']+$units[$y]['t11'];
if($units[$y]['attack_type'] == 2){
if($reinfowner != $session->uid){
echo "<td class=\"none\">?</td>";
}else{
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
echo $units[$y]['t'.$i]."</td>";
}
}}else{
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,3,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,3,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,3,2,0));
$total_artefact = $artefact + $artefact1 + $artefact2;
if($totalunits > $building->getTypeLevel(16) && $total_artefact == 0){
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]." hours</div>
</div>
</td>
</tr>
</tbody>";
echo "</table>";
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a>village of the elders</a></td>
<td colspan=\"10\">";
echo "<a>Taskmaster's troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</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=1;$i<=10;$i++) {
echo "<td class=\"none\">?</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>&nbsp;</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\">0</td>";
}
else {
echo "<td>";
echo $units[$y]['t'.$i]."</td>";
}
}
?>
</tr>
<?php
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
if($units[$y]['attack_type']!=2 and $units[$y]['attack_type']!=1 and $totalres != ""){?>
<tr><th>Bounty</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
$totalcarry = $units[$y]['t1']*${'u'.$start.''}['cap']+$units[$y]['t2']*${'u'.($start+1).''}['cap']+$units[$y]['t3']*${'u'.($start+2).''}['cap']+$units[$y]['t4']*${'u'.($start+3).''}['cap']+$units[$y]['t5']*${'u'.($start+4).''}['cap']+$units[$y]['t6']*${'u'.($start+5).''}['cap']+$units[$y]['t7']*${'u'.($start+6).''}['cap']+$units[$y]['t8']*${'u'.($start+7).''}['cap']+$units[$y]['t9']*${'u'.($start+8).''}['cap']+$units[$y]['t10']*${'u'.($start+9).''}['cap'];
echo "<div class=\"in small\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$res['wood']."<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$res['clay']."<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$res['iron']."<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$res['crop']."</div>";
echo "<div class=\"in small\"><img class=\"car\" src=\"gpack/travian_default/img/a/car.gif\" alt=\"carry\" title=\"carry\"/>".$totalres."/".$totalcarry."</div>";
?>
</tr>
<?php } ?>
<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
}
}
$settlers = $database->getMovement("7",$village->wid,1);
$total_for3 = count($settlers);
for($x=0;$x < $total_for3;$x++){
$timer = $x+1;
$to = $database->getMInfo($settlers[$x]['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="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>&nbsp;</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
for($z=1;$z<=9;$z++) {
$settlers[$x]['t'.$z]=0;
}
$settlers[$x]['t10']=3;
for($i=1;$i<11;$i++) {
if($settlers[$x]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
echo $settlers[$x]['t'.$i]."</td>";
}
}
?>
</tr>
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="10">
<?php
echo "<div class=\"in small\"><span id=timer".$timer.">".$generator->getTimeFormat($settlers[$x]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($settlers[$x]['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 } ?>
+34
View File
@@ -0,0 +1,34 @@
<?php
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</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>
+155
View File
@@ -0,0 +1,155 @@
<?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>&nbsp;</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>";
if (($units[$y]['starttime']+90)>time()){
?>
<div class="abort"><a href="build.php?id=<?php echo $_GET['id']."&mode=troops&cancel=1&moveid=".$units[$y]['moveid']; ?>"><img src="img/x.gif" class="del" /></a></div>
<?php } ?>
</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>&nbsp;</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
for($x=1;$x<=9;$x++) {
$units[$y]['t'.$x]=0;
}
$units[$y]['t10']=3;
for($i=1;$i<=10;$i++) {
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</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($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>";
if (($units[$y]['starttime']+90)>time()){
?>
<div class="abort"><a href="build.php?id=<?php echo $_GET['id']."&mode=troops&cancel=1&moveid=".$units[$y]['moveid']; ?>"><img src="img/x.gif" class="del" /></a></div>
<?php } ?>
</div>
</td>
</tr>
</tbody>
</table>
<?php
}
}
?>
+299
View File
@@ -0,0 +1,299 @@
<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>
<?php
$allres = $_POST['r1']+$_POST['r2']+$_POST['r3']+$_POST['r4'];
if($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
$getwref = $database->getVilWref($_POST['x'],$_POST['y']);
$checkexist = $database->checkVilExist($getwref);
}
else if($_POST['dname']!=""){
$getwref = $database->getVillageByName($_POST['dname']);
$checkexist = $database->checkVilExist($getwref);
}
if($checkexist){
$villageOwner = $database->getVillageField($getwref,'owner');
$userAccess = $database->getUserField($villageOwner,'access',0);
}
$maxcarry = $market->maxcarry;
$maxcarry *= $market->merchantAvail();
if(isset($_POST['ft'])=='check' && $allres!=0 && $allres <= $maxcarry && ($_POST['x']!="" && $_POST['y']!="" or $_POST['dname']!="") && $checkexist){
?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="ft" value="mk1">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="hidden" name="send3" value="<?php echo $_POST['send3']; ?>">
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1">
<tr>
<td class="ico"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></td>
<td class="nam"> Wood</td>
<td class="val"><input class="text disabled" type="text" name="r1" id="r1" value="<?php echo $_POST['r1']; ?>" readonly="readonly"></td>
<td class="max"> / <span class="none"><B><?php echo $market->maxcarry; ?></B></span> </td>
</tr>
<tr>
<td class="ico"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></td>
<td class="nam"> Clay</td>
<td class="val"><input class="text disabled" type="text" name="r2" id="r2" value="<?php echo $_POST['r2']; ?>" readonly="readonly"></td>
<td class="max"> / <span class="none"><b><?php echo$market->maxcarry; ?></b></span> </td>
</tr>
<tr>
<td class="ico"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></td>
<td class="nam"> Iron</td>
<td class="val"><input class="text disabled" type="text" name="r3" id="r3" value="<?php echo $_POST['r3']; ?>" readonly="readonly">
</td>
<td class="max"> / <span class="none"><b><?php echo $market->maxcarry; ?></b></span> </td>
</tr>
<tr>
<td class="ico"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></td>
<td class="nam"> Wheat</td>
<td class="val"> <input class="text disabled" type="text" name="r4" id="r4" value="<?php echo $_POST['r4']; ?>" readonly="readonly">
</td>
<td class="max"> / <span class="none"><B><?php echo $market->maxcarry; ?></B></span></td>
</tr></table>
<table id="target_validate" class="res_target" cellpadding="1" cellspacing="1">
<tbody><tr>
<th>Coordinates:</th>
<?php
if($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
$getwref = $database->getVilWref($_POST['x'],$_POST['y']);
$getvilname = $database->getVillageField($getwref, "name");
$getvilowner = $database->getVillageField($getwref, "owner");
$getvilcoor['y'] = $_POST['y'];
$getvilcoor['x'] = $_POST['x'];
$time = $generator->procDistanceTime($getvilcoor,$village->coor,$session->tribe,0);
}
else if($_POST['dname']!=""){
$getwref = $database->getVillageByName($_POST['dname']);
$getvilcoor = $database->getCoor($getwref);
$getvilname = $database->getVillageField($getwref, "name");
$getvilowner = $database->getVillageField($getwref, "owner");
$time = $generator->procDistanceTime($getvilcoor,$village->coor,$session->tribe,0);
}
?>
<td><a href="karte.php?d=<?php echo $getwref; ?>&c=<?php echo $generator->getMapCheck($getwref); ?>"><?php echo $getvilname; ?>(<?php echo $getvilcoor['x']; ?>|<?php echo $getvilcoor['y']; ?>)<span class="clear"></span></a></td>
</tr>
<tr>
<th>Player:</th>
<td><a href="spieler.php?uid=<?php echo $getvilowner; ?>"><?php echo $database->getUserField($getvilowner,username,0); ?></a></td>
</tr>
<tr>
<th>duration:</th>
<td><?php echo $generator->getTimeFormat($time); ?></td>
</tr>
<tr>
<th>Merchants:</th>
<td><?php
$resource = array($_POST['r1'],$_POST['r2'],$_POST['r3'],$_POST['r4']);
echo ceil((array_sum($resource)-0.1)/$market->maxcarry); ?></td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
</tbody></table>
<input type="hidden" name="getwref" value="<?php echo $getwref; ?>">
<div class="clear"></div>
<p>
<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"; }?>/></p></form>
<?php }else{ ?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="ft" value="check">
<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>
<td class="vil">
<span>Villages:</span>
<input class="text" type="text" name="dname" value="" maxlength="30" 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>
<?php if($session->goldclub == 1){?>
<p><select name="send3"><option value="1" selected="selected">1x</option><option value="2">2x</option><option value="3">3x</option></select>go</p>
<?php
}else{
?>
<input type="hidden" name="send3" value="1">
<?php
}
?>
<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"; }?>/></p></form>
<?php
$error = '';
if(isset($_POST['ft'])=='check'){
if(!$checkexist){
$error = '<span class="error"><b>No Coordinates selected</b></span>';
}elseif($getwref == $village->wid){
$error = '<span class="error"><b>You cannot send resources to the same village</b></span>';
}elseif($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){
$error = '<span class="error"><b>Player is Banned. You cannot send resources to him.</b></span>';
}elseif($_POST['r1']==0 && $_POST['r2']==0 && $_POST['r3']==0 && $_POST['r4']==0){
$error = '<span class="error"><b>Resources not selected.</b></span>';
}elseif(!$_POST['x'] && !$_POST['y'] && !$_POST['dname']){
$error = '<span class="error"><b>Enter coordinates or village name.</b></span>';
}elseif($allres > $maxcarry){
$error = '<span class="error"><b>Too few merchants.</b></span>';
}
echo $error;
}
?>
<p>
<?php } ?>
<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>
+134
View File
@@ -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>&laquo;</b></span><span class=\"none\"><b>&raquo;</b></span>";
}
else if (!isset($_GET['u']) && count($market->onsale) > 40) {
echo "<span class=\"none\"><b>&laquo;</b></span><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=40\">&raquo;</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)."\">&laquo;</a><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']+40)."\">&raquo;</a>";
}
else if(count($market->onsale) > $_GET['u']+40) {
echo "<span class=\"none\"><b>&laquo;</b></span><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']+40)."\">&raquo;</a>";
}
else {
echo "<a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']-40)."\">&laquo;</a><span class=\"none\"><b>&raquo;</b></span>";
}
}
?>
</td></tr>
</table></div>
+118
View File
@@ -0,0 +1,118 @@
<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>
<?php
if(isset($_GET['e1']))
{
echo "<p class=\"error2\">Not enough resources</p>";
}
elseif(isset($_GET['e2']))
{
echo "<p class=\"error2\">Invalid offer</p>";
}
elseif(isset($_GET['e3']))
{
echo "<p class=\"error2\">Not enough merchants</p>";
}
else
{
echo "<p>Merchants: ".$market->merchantAvail()."/".$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>&nbsp;</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>
+271
View File
@@ -0,0 +1,271 @@
<?php if($session->gold > 2){ ?>
<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&#65533;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" />
<?php
$wwvillage = $database->getResourceLevel($village->wid);
if($wwvillage['f99t']!=40){
?>
<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:&nbsp;<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:&nbsp;<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:&nbsp;<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 }else{ ?>
</br></br>
<?php echo "You can't use NPC trade in WW village.";
}} ?>
</div>
<?php
}else{
header("Location: build.php?id=".$_GET['id']."");
}
?>
+75
View File
@@ -0,0 +1,75 @@
<?php if($session->goldclub == 1 && count($database->getProfileVillages($session->uid)) > 1) { ?>
<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['action'])){
$routeaccess = 1;
}
if(isset($_GET['create']) && $session->gold > 1){
$routeaccess = 1;
include("17_create.tpl");
}else if($_GET['action'] == 'editRoute' && isset($_GET['routeid']) && $_GET['routeid'] != ""){
$traderoute = $database->getTradeRouteUid($_GET['routeid']);
if($traderoute == $session->uid){
include("17_edit.tpl");
}
}else{
?>
<p>Trade route allows you to set up routes for your merchant that he will walk every day at a certain hour. <br /><br />
Standard this holds on for 7 days, but you can extend it with 7 days for the cost of <img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold">2.</p>
<table id="npc" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th></th>
<th>description</th>
<th>start</th>
<th>Merchants</th>
<th>time left</th>
</tr></thead><tbody>
<?php
$routes = $database->getTradeRoute($session->uid);
if(count($routes) == 0) {
echo "<td colspan=\"5\" class=\"none\">No active trade routes.</td></tr>";
}else{
foreach($routes as $route){
?>
<tr>
<th><label><input class="radio" type="radio" onclick="window.location.href = '?id=<?php echo $id; ?>&t=4&routeid=<?php echo $route['id']; ?>';" name="routeid" value="<?php echo $route['id']; ?>" <?php if($routeid == $route['id']) { echo "checked"; } ?>></label></th>
<th>
<?php
echo "Trade route to <a href=karte.php?d=".$route['wid']."&c=".$generator->getMapCheck($route['wid']).">".$database->getVillageField($route['wid'],"name")."</a>";
?>
</th>
<th><?php if($route['start'] > 9){ echo $route['start'];}else{ echo "0".$route['start'];} echo ":00"; ?></th>
<th><?php echo $route['deliveries']."x".$route['merchant']; ?></th>
<th><?php echo ceil(($route['timeleft']-time())/86400); echo " days"; ?></th>
</tr>
<?php }} ?>
</tbody><tfoot><tr>
<th>
</th>
<th colspan="4">
<?php $routeid=$routeid == 0? $routeid=0:$routeid; ?>
<a href="build.php?action=extendRoute&routeid=<?php echo $routeid; ?>">extend</a>*
| <a href="build.php?id=<?php echo $id; ?>&t=4&action=editRoute&routeid=<?php echo $routeid; ?>">edit</a>
| <a href="build.php?action=delRoute&routeid=<?php echo $routeid; ?>">delete</a>
</th></tr></tfoot></table>
* Extend the trade route by 7 days for <img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold">2
<br>
<div class="options">
<a class="arrow" href="build.php?gid=17&t=4&create">» Create new trade route</a>
</div>
</div>
<?php
}}else{
header("Location: build.php?id=".$_GET['id']."");
}
?>
+78
View File
@@ -0,0 +1,78 @@
<form action="build.php" method="post">
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
<input type="hidden" name="action" value="addRoute">
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
<thead>
<tr>
<th colspan="2">Create trade route</th>
</tr>
</thead>
<tbody>
<tr>
<th>
target village: </th>
<td>
<select id="tvillage" name="tvillage">
<?php
if($session->villages[0] == $village->wid){
$firstvillage = 2;
}else{
$firstvillage = 1;
}
for($i=1;$i<=count($session->villages);$i++) {
if($i == $firstvillage){
$select = 'selected="selected"';
}else{
$select = '';
}
if($session->villages[$i-1] != $village->wid){
$coor = $database->getCoor($session->villages[$i-1]);
echo "<option value=\"".$session->villages[$i-1]."\" ".$select.">".$database->getVillageField($session->villages[$i-1],'name')." (".$coor['x']."|".$coor['y'].")</option>";
}
}
?> </select>
</td>
</tr>
<tr>
<th>
Resources: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="Lumber"> <input class="text" type="text" name="r1" id="r1" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="Clay"> <input class="text" type="text" name="r2" id="r2" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="Iron"> <input class="text" type="text" name="r3" id="r3" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="Crop"> <input class="text" type="text" name="r4" id="r4" value="" maxlength="5" tabindex="1" style="width:50px;">
</td>
</tr>
<tr>
<th>
start time: </th>
<td>
<select name="start"><option value="0" selected="selected">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select>
</td>
</tr>
<tr>
<th>
deliveries: </th>
<td>
<select name="deliveries"><option value="1" selected="selected">1</option><option value="2">2</option><option value="3">3</option></select>
</td>
</tr>
<tr>
<th>
costs: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold"> 2
</td>
</tr>
<tr>
<th>
Duration: </th>
<td>
7 days
</td>
</tr>
</tbody></table>
</div>
</div>
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
</form>
</div>
+40
View File
@@ -0,0 +1,40 @@
<?php $edited_route = $database->getTradeRoute2($_GET['routeid']); ?>
<form action="build.php" method="post">
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
<input type="hidden" name="action" value="editRoute">
<input type="hidden" name="routeid" value="<?php echo $_GET['routeid']; ?>">
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
<thead>
<tr>
<th colspan="2">Edit trade route</th>
</tr>
</thead>
<tbody>
<tr>
<th>
Resources: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="Lumber"> <input class="text" type="text" name="r1" id="r1" value="<?php echo $edited_route['wood']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="CLay"> <input class="text" type="text" name="r2" id="r2" value="<?php echo $edited_route['clay']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="Iron"> <input class="text" type="text" name="r3" id="r3" value="<?php echo $edited_route['iron']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="Crop"> <input class="text" type="text" name="r4" id="r4" value="<?php echo $edited_route['crop']; ?>" maxlength="5" tabindex="1" style="width:50px;">
</td>
</tr>
<tr>
<th>
start time: </th>
<td>
<select name="start"><?php for($i=0;$i<=23;$i++){?><option value="<?php echo $i; ?>" <?php if($i == $edited_route['start']){echo "selected";} ?>><?php if($i > 9){echo $i;}else{echo "0".$i;}?></option><?php } ?></select>
</td>
</tr>
<tr>
<th>
deliveries: </th>
<td>
<select name="deliveries"><?php for($i=1;$i<=3;$i++){?><option value="<?php echo $i; ?>" <?php if($i == $edited_route['deliveries']){echo "selected";} ?>><?php echo $i; ?></option><?php } ?></select>
</td>
</tr>
</tbody></table>
</div>
</div>
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
</form>
</div>
+17
View File
@@ -0,0 +1,17 @@
<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; ?>&amp;t=1" <?php if(isset($_GET['t']) && $_GET['t'] == 1) { echo "class=\"selected\""; } ?>>Buy</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=2" <?php if(isset($_GET['t']) && $_GET['t'] == 2) { echo "class=\"selected\""; } ?>>Offer</a>
<?php if($session->userinfo['gold'] > 2) {
?>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=3" <?php if(isset($_GET['t']) && $_GET['t'] == 3) { echo "class=\"selected\""; } ?>>NPC trading</a>
<?php
}
?>
<?php if($session->goldclub == 1 && count($database->getProfileVillages($session->uid)) > 1) {
?>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=4" <?php if(isset($_GET['t']) && $_GET['t'] == 4) { echo "class=\"selected\""; } ?>>trade routes</a>
<?php
}
?>
</div>
+66
View File
@@ -0,0 +1,66 @@
<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\">&nbsp;&raquo; to the alliance</a></td>
</tr></tbody>
</table>";
}
else if($village->resarray['f'.$id] >= 1) {
?>
<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) {
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']."\">&nbsp;".$database->getAllianceName($invite['alliance'])."</a></td>
<td class=\"acc\"><a href=\"build.php?id=".$id."&a=3&d=".$invite['id']."\">&nbsp;accept</a></td><tr>";
}
}
else {
echo "<td colspan=\"3\" class=\"none\">There are no invitations available.</td>";
}
?>
</tr></tbody></table>
<?php
if($alliance->gotInvite) {
echo "<p class=\"error2\" style=\"color: #DD0000\">".$form->getError("ally_accept")."</p>";
}
}
include("upgrade.tpl");
?>
</p></div>
+59
View File
@@ -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="15">
<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="50">
<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
}
?>
+60
View File
@@ -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['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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>
+85
View File
@@ -0,0 +1,85 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
if($session->tribe != 4){
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=round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\"></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>";
}
}
}else{
for ($i=31;$i<=40;$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'])."|<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=round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\"></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>";
}
}
?>
+55
View File
@@ -0,0 +1,55 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid2[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 20; ?>:</th>
<td><b><?php echo $bid2[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}else{
if($next<=10){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid2[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
<td><b><?php echo $bid2[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}}
?>
</table>
<?php
include("upgrade.tpl");
?></p></div>
+73
View File
@@ -0,0 +1,73 @@
<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
if($session->tribe != 4){
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['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</span></td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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>
+62
View File
@@ -0,0 +1,62 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$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\" />";
}
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\">
</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>";
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$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=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\">
</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>";
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$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\" />";
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\">
</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>";
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$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\" />";
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\">
</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>";
}
?>
+54
View File
@@ -0,0 +1,54 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$success = 0;
for($i=45;$i<=46;$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=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
</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>";
}
?>
+138
View File
@@ -0,0 +1,138 @@
<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
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$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 == 5){
$start = 47;
}
if($session->tribe != 4){
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\" />";
$dur=round(${'u'.$i}['time'] * ($bid21[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\">
</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['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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>
+17
View File
@@ -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>
+153
View File
@@ -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&amp;a=$i&amp;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\">&nbsp;Level 1</span><br /><a href=\"#\" onclick=\"return Popup(13, 4);\">Armoury </a><span title=\"+1\">&nbsp;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\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">&nbsp;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\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+1\">&nbsp;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\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+5\">&nbsp;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\">&nbsp;Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable</a><span title=\"+10\">&nbsp;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\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\">&nbsp;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\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">&nbsp;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\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy</a><span title=\"+17\">&nbsp;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>";
}
?>
+149
View File
@@ -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&amp;a=$i&amp;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>";
}
?>
+153
View File
@@ -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&amp;a=$i&amp;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\">&nbsp;Level 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">&nbsp;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\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable </a><span title=\"+1\">&nbsp;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\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a>
<span title=\"+3\">&nbsp;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\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a>
<span title=\"+5\">&nbsp;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\">&nbsp;Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable</a><span title=\"+10\">&nbsp;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\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\">&nbsp;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\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">&nbsp;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\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy</a><span title=\"+17\">&nbsp;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>";
}
?>
+148
View File
@@ -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&amp;a=$i&amp;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>";
}
?>
+143
View File
@@ -0,0 +1,143 @@
<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=42;$i<=49;$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 {
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"build.php?id=$id&amp;a=$i&amp;c=".$session->mchecker."\">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(43) && !$technology->getTech(43)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u43\" title=\"".U43."\" alt=\"".U33."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(43, 1);\" href=\"#\">".U43."</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(44) && !$technology->getTech(44)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u44\" title=\"".U44."\" alt=\"".U44."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(34, 1);\" href=\"#\">".U44."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(44, 5);\">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(45) && !$technology->getTech(45)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u45\" title=\"".U45."\" alt=\"".U45."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(45, 1);\" href=\"#\">".U45."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(45, 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(46) && !$technology->getTech(46)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u46\" title=\"".U46."\" alt=\"".U46."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(46, 1);\" href=\"#\">".U46."</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(47) && !$technology->getTech(47)) {
echo "
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u47\" title=\"".U47."\" alt=\"".U47."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(47, 1);\" href=\"#\">".U47."</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(48) && !$technology->getTech(48)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u48\" title=\"".U48."\" alt=\"".U48."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(48, 1);\" href=\"#\">".U48."</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(49) && !$technology->getTech(49)) {
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u49\" title=\"".U49."\" alt=\"".U43."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(49, 1);\" href=\"#\">".U49."</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>";
}
?>
+83
View File
@@ -0,0 +1,83 @@
<?php
include("next.tpl");
$artefact_2 = count($database->getOwnUniqueArtefactInfo2($session->uid,7,3,0));
$artefact1_2 = count($database->getOwnUniqueArtefactInfo2($village->wid,7,1,1));
$artefact2_2 = count($database->getOwnUniqueArtefactInfo2($session->uid,7,2,0));
if($artefact_2 > 0){
$artefact_bouns = 6;
}else if($artefact1_2 > 0){
$artefact_bouns = 3;
}else if($artefact2_2 > 0){
$artefact_bouns = 2;
}else{
$artefact_bouns = 1;
}
$good_effect = $bad_effect = 1;
$foolartefact = $database->getFoolArtefactInfo(7,$village->wid,$seesion->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$bad_effect = $arte['effect2'];
}else{
$good_effect = $arte['effect2'];
}
}
}
?>
<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 == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*2*CRANNY_CAPACITY; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*CRANNY_CAPACITY; ?></b> units</td>
<?php
}
?>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
if($next<=10){
?>
<th>Hidden units per resource at level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:</th>
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}}else{
?>
<th>Hidden units per resource at level 20:</th>
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[10]['attri']*2*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[10]['attri']*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+18
View File
@@ -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>
+74
View File
@@ -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>
+18
View File
@@ -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;
}
?>
+26
View File
@@ -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>
+28
View File
@@ -0,0 +1,28 @@
<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>
<?php if($database->getVillageField($village->wid, 'natar') == 0){ ?>
<td><b><?php echo $database->getVillageField($village->wid, 'cp'); ?></b> Culture points per day</td>
<?php }else{ ?>
<td><b>0</b> Culture points per day</td>
<?php } ?>
</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>
+13
View File
@@ -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>
+54
View File
@@ -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>
+65
View File
@@ -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>
+7
View File
@@ -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; ?>&amp;s=2" <?php if(isset($_GET['s']) && $_GET['s'] == 2) { echo "class=\"selected\""; } ?>>Culture points</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;s=3" <?php if(isset($_GET['s']) && $_GET['s'] == 3) { echo "class=\"selected\""; } ?>>Loyalty</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;s=4" <?php if(isset($_GET['s']) && $_GET['s'] == 4) { echo "class=\"selected\""; } ?>>Expansion</a>
</div>
+34
View File
@@ -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['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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 }
?>
+88
View File
@@ -0,0 +1,88 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
#################################################################################
## -= 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 && $session->tribe != 4) {
$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\" />";
$dur=round(${'u'.$i}['time'] * ($bid25[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=".${'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");
?>
+97
View File
@@ -0,0 +1,97 @@
<?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());
}
}
for($i=19; $i<=40; ++$i) {
if($data2['f' . $i . 't'] == 29 or $data2['f' . $i . 't'] == 30 or $data2['f' . $i . 't'] == 38 or $data2['f' . $i . 't'] == 39 or $data2['f' . $i . 't'] == 42) {
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $village->wid) 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);
}
} 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">&raquo 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>
+27
View File
@@ -0,0 +1,27 @@
<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>
<?php if($database->getVillageField($village->wid, 'natar') == 0){ ?>
<td><b><?php echo $database->getVillageField($village->wid, 'cp'); ?></b> Culture points per day</td>
<?php }else{ ?>
<td><b>0</b> Culture points per day</td>
<?php } ?>
</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>
+13
View File
@@ -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>
+55
View File
@@ -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>
+65
View File
@@ -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>
+7
View File
@@ -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; ?>&amp;s=2" <?php if(isset($_GET['s']) && $_GET['s'] == 2) { echo "class=\"selected\""; } ?>>Culture points</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;s=3" <?php if(isset($_GET['s']) && $_GET['s'] == 3) { echo "class=\"selected\""; } ?>>Loyalty</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;s=4" <?php if(isset($_GET['s']) && $_GET['s'] == 4) { echo "class=\"selected\""; } ?>>Expansion</a>
</div>
+34
View File
@@ -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['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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 }
?>
+88
View File
@@ -0,0 +1,88 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
#################################################################################
## -= 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 && $session->tribe != 4) {
$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\" />";
$dur=round(${'u'.$i}['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=".${'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");
?>
+25
View File
@@ -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>
+151
View File
@@ -0,0 +1,151 @@
<?php
$artefact1 = $database->getOwnArtefactInfo2($village->wid);
$result = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = " . $village->wid . ""));
$wref = $village->wid;
$coor = $database->getCoor($wref);
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>
<?php
if($result == 0) {
echo '<tr><td colspan="4" class="none">You do not own any artefacts.</td></tr>';
} else {
foreach($artefact1 as $artefact){
$coor2 = $database->getCoor($artefact['vref']);
if($artefact['size'] == 1 && $artefact['type'] != 11){
$reqlvl = 10;
$effect = "village";
}else{
if($artefact['type'] != 11){
$reqlvl = 20;
}else{
$reqlvl = 10;
}
$effect = "account";
}
echo '<tr><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 && $row['type'] != 11){
$reqlvl = 10;
$effect = "village";
}else{
if($row['type'] != 11){
$reqlvl = 20;
}else{
$reqlvl = 10;
}
$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>
+217
View File
@@ -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>
+298
View File
@@ -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>
+25
View File
@@ -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>
+97
View File
@@ -0,0 +1,97 @@
<?php
$artefact = $database->getArtefactDetails($_GET['show']);
if($artefact['size'] == 1 && $artefact['type'] != 11){
$reqlvl = 10;
$effect = "village";
}else{
if($artefact['type'] != 11){
$reqlvl = 20;
}else{
$reqlvl = 10;
}
$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>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Merchant load at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid28[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Merchant load at level 20:</th>
<td><b><?php echo $bid28[20]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+59
View File
@@ -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['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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>
+51
View File
@@ -0,0 +1,51 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
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\" />";
$dur=round(${'u'.$i}['time'] * ($bid29[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\"></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>";
}
}
?>
+56
View File
@@ -0,0 +1,56 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid3[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 20; ?>:</th>
<td><b><?php echo $bid3[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}else{
if($next<=10){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid3[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
<td><b><?php echo $bid3[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}}
?>
</table>
<?php
include("upgrade.tpl");
?></p></div>
+59
View File
@@ -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['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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>
+51
View File
@@ -0,0 +1,51 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
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\" />";
$dur=round(${'u'.$i}['time'] * ($bid30[$village->resarray['f'.$id]]['attri'] * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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=\"10\"></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>";
}
}
?>
+35
View File
@@ -0,0 +1,35 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid31[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Defence Bonus at level 20:</th>
<td><b><?php echo $bid31[20]['attri']; ?></b> Percent</td>
<?php
}
}
?>
</tr></table>
<?php
include("upgrade.tpl");
?>
</p>
</div>
+35
View File
@@ -0,0 +1,35 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid32[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Defence Bonus at level 20:</th>
<td><b><?php echo $bid32[20]['attri']; ?></b> Percent</td>
<?php
}
}
?>
</tr></table>
<?php
include("upgrade.tpl");
?>
</p>
</div>
+35
View File
@@ -0,0 +1,35 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid33[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Defence Bonus at level 20:</th>
<td><b><?php echo $bid33[20]['attri']; ?></b> Percent</td>
<?php
}
}
?>
</tr></table>
<?php
include("upgrade.tpl");
?>
</p>
</div>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Stability bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid34[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Stability bonus at level 20:</th>
<td><b><?php echo $bid34[20]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=10){
?>
<th>Bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid35[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Bonus at level 10:</th>
<td><b><?php echo $bid35[10]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+137
View File
@@ -0,0 +1,137 @@
<?php
include("next.tpl");
?>
<div id="build" class="gid36"><h1>Trapper <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></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="Trapper"
title="Trapper" /> </a>
The trapper protects your village with well hidden traps. This means that unwary enemies can be imprisoned and won't be able to harm your village anymore. </p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th>Currect maximum traps to train:</th>
<td><b><?php echo $bid36[$village->resarray['f'.$id]]['attri']*TRAPPER_CAPACITY; ?></b> Traps</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Maximum traps to train at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid36[$next]['attri']*TRAPPER_CAPACITY; ?></b> Traps</td>
<?php
}else{
?>
<th>Maximum traps to train at level 20:</th>
<td><b><?php echo $bid36[20]['attri']*TRAPPER_CAPACITY; ?></b> Traps</td>
<?php
}
}
?>
</tr>
</table>
<p>Your currently have <b><?php echo $village->unitarray['u99']; ?></b> traps, <b><?php echo $village->unitarray['u99o']; ?></b> of which are occupied.</p>
<?php if ($building->getTypeLevel(36) > 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>
<tr>
<td class="desc">
<div class="tit"><img class="unit u99" src="img/x.gif"
alt="Trap"
title="Trap" /> <a href="#"
onClick="return Popup(36,4,'gid');">Trap</a> <span class="info">(Available: <?php echo $village->unitarray['u99']; ?>)</span>
</div>
<div class="details">
<span><img class="r1" src="img/x.gif"
alt="Lumber" title="Lumber" />20|</span><span><img class="r2" src="img/x.gif"
alt="Clay" title="Clay" />30|</span><span><img class="r3" src="img/x.gif"
alt="Iron" title="Iron" />10|</span><span><img class="r4" src="img/x.gif"
alt="Crop" title="Crop" />20|</span><span><img class="r5" src="img/x.gif" alt="Crop consumption"
title="Crop consumption" />0|<img class="clock" src="img/x.gif"
alt="Duration" title="Duration" /><?php $dur=$generator->getTimeFormat(round(${'u99'}['time'] * ($bid19[$village->resarray['f'.$id]]['attri']*TRAPPER_CAPACITY / 100) / SPEED));
echo ($dur=="0:00:00")? "0:00:01":$dur; ?></span>
</div>
</td>
<?php
$trainlist = $technology->getTrainingList(8);
foreach($trainlist as $train) {
$train_amt += $train['amt'];
}
$max = $technology->maxUnit(99,false);
$max1 = 0;
for($i=19;$i<41;$i++){
if($village->resarray['f'.$i.'t'] == 36){
$max1 += $bid36[$village->resarray['f'.$i]]['attri']*TRAPPER_CAPACITY;
}
}
if($max > $max1 - ($village->unitarray['u99'] + $train_amt)){
$max = $max1 - ($village->unitarray['u99'] + $train_amt);
}
if($max < 0){
$max = 0;
}
?>
<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=<?php echo $max; ?>">(<?php echo $max; ?>)</a></td>
</tr>
</tbody>
</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();"/></p></form>
<?php
} else {
echo "<b>Training can commence when trapper are completed.</b><br>\n";
}
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=\"".U99."\" title=\"".U99."\" />";
echo $train['amt']." ".U99."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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>
+99
View File
@@ -0,0 +1,99 @@
<?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['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";
}
$name1 = $hero_info['name'];
if(isset($_GET['land'])) {
include("37_land.tpl");
} else {
if(mysql_num_rows($hero) == 0){
include("37_train.tpl");
}elseif($hero_info['intraining'] == 1){
$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>
<?php
echo "<tr>
<td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$hero_info['unit']."\" src=\"img/x.gif\" alt=\"".$name."\" title=\"".$name."\" />
$name ($name1)
</div>"
?>
</tr>
</table>
<?php
}
if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 1 AND $hero_info['intraining'] == 0){
include("37_revive.tpl");
}
if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 0 AND $hero_info['trainingtime'] <= time() AND $hero_info['inrevive'] == 0 AND $hero_info['intraining'] == 0){
include("37_hero.tpl");
}
}
include ("upgrade.tpl"); ?>
</div>
+217
View File
@@ -0,0 +1,217 @@
<?php
/*-------------------------------------------------------*\
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
+---------------------------------------------------------+
| Developed by: Manni < manuel_mannhardt@web.de > |
| Dzoki < dzoki.travian@gmail.com > |
| Reworked by: Esfomeado < vps1992@live.com.pt > |
| 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 "Hero name has been changed";
}
$hero = $units->Hero($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 <?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['points'] > 0 && $hero_info['attack'] < 100){
if($session->access != BANNED){
echo "<a href=\"build.php?id=".$id."&add=off\">(<b>+</b>)</a>";
}else{
header("Location: banned.php");
}
}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 && $hero_info['defence'] < 100){
if($session->access != BANNED){
echo "<a href=\"build.php?id=".$id."&add=deff\">(<b>+</b>)</a>";
}else{
header("Location: banned.php");
}
}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 && $hero_info['attackbonus'] < 100){
if($session->access != BANNED){
echo "<a href=\"build.php?id=".$id."&add=obonus\">(<b>+</b>)</a>";
}else{
header("Location: banned.php");
}
}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 && $hero_info['defencebonus'] < 100){
if($session->access != BANNED){
echo "<a href=\"build.php?id=".$id."&add=dbonus\">(<b>+</b>)</a>";
}else{
header("Location: banned.php");
}
}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 && $hero_info['regeneration'] < 100){
if($session->access != BANNED){
echo "<a href=\"build.php?id=".$id."&add=reg\">(<b>+</b>)</a>";
}else{
header("Location: banned.php");
}
}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>
<?php if($hero_info['experience'] < 495000){ ?>
<th title="until the next level">Experience:</th>
<td class="val"><?php echo (int) (($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>
<?php }else{ ?>
<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>
<?php } ?>
</tr>
</tbody>
</table>
<?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" && $hero_info['attack'] < 100) {
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" && $hero_info['defence'] < 100) {
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" && $hero_info['attackbonus'] < 100) {
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" && $hero_info['defencebonus'] < 100) {
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" && $hero_info['regeneration'] < 100) {
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."");
}
}
}
?>
+81
View File
@@ -0,0 +1,81 @@
<?php
/* Hero's mansion oases page
Copyright: Travianx Project */
$oasisarray = $database->getOasis($village->wid);
if($_GET['gid']==37 && isset($_GET['del'])){
if($session->access != BANNED){
$database->removeOases($_GET['del']);
header("Location: build.php?id=".$id."&land");
}else{
header("Location: banned.php");
}
}
?>
<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?gid=37&c=<?php echo $generator->getMapCheck($oasisarray[$i]['wref']); ?>&del=<?php echo $oasisarray[$i]['wref']; ?>&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>
+187
View File
@@ -0,0 +1,187 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
/*-------------------------------------------------------*\
| ********* 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['level'] <= 60){
$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 * $artefact_bonus2 / $artefact_bonus));
$training_time2 = time() + round((${'h'.$hero_info['unit'].'_full'}[$hero_info['level']]['time']) / SPEED * $artefact_bonus2 / $artefact_bonus);
}else{
$wood = (${'h'.$hero_info['unit'].'_full'}[60]['wood']);
$clay = (${'h'.$hero_info['unit'].'_full'}[60]['clay']);
$iron = (${'h'.$hero_info['unit'].'_full'}[60]['iron']);
$crop = (${'h'.$hero_info['unit'].'_full'}[60]['crop']);
$training_time = $generator->getTimeFormat(round((${'h'.$hero_info['unit'].'_full'}[60]['time']) / SPEED * $artefact_bonus2 / $artefact_bonus));
$training_time2 = time() + round((${'h'.$hero_info['unit'].'_full'}[60]['time']) / SPEED * $artefact_bonus2 / $artefact_bonus);
}
?>
<table cellpadding="1" cellspacing="1" class="build_details">
<thead>
<tr>
<th colspan="2">Revive hero</th>
</tr>
</thead>
<?php
if($hero_info['inrevive'] == 1) {
$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>
<?php
echo "<tr>
<td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$hero_info['unit']."\" src=\"img/x.gif\" alt=\"".$name."\" title=\"".$name."\" />
$name ($name1)
</div>"
?>
</tr>
</table>
<?php }else{ 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 && $hero_info['inrevive'] == 0 && $hero_info['intraining'] == 0 && $hero_info['dead'] == 1){
if($session->access != BANNED){
mysql_query("UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".$training_time2."', `wref` = '".$village->wid."' WHERE `uid` = '".$session->uid."'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$wood." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$clay." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$iron." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$crop." WHERE `wref` = '" . $village->wid . "'");
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($hero_info['inrevive'] == 0 && $hero_info['intraining'] == 0) {
include ("37_train.tpl");
}
?>
+772
View File
@@ -0,0 +1,772 @@
<?php
/*============================+
+ Travian File: 37_train.tpl +
+ Developed by vnnbot.net +
+=============================*/
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
//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=\"".U1."\" title=\"".U1."\" />
".U1."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U2."\" title=\"".U2."\" />
".U2."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U3."\" title=\"".U3."\" />
".U3."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U5."\" title=\"".U5."\" />
".U5."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U6."\" title=\"".U6."\" />
".U6."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U11."\" title=\"".U11."\" />
".U11."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U12."\" title=\"".U12."\" />
".U12."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U13."\" title=\"".U13."\" />
".U13."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U15."\" title=\"".U15."\" />
".U15."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U16."\" title=\"".U16."\" />
".U16."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U21."\" title=\"".U21."\" />
".U21."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U22."\" title=\"".U22."\" />
".U22."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U24."\" title=\"".U24."\" />
".U24."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U25."\" title=\"".U25."\" />
".U25."
</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 * $artefact_bonus2 / $artefact_bonus)*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=\"".U26."\" title=\"".U26."\" />
".U26."
</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 * $artefact_bonus2 / $artefact_bonus)*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
$count_hero = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . ""));
if($session->tribe == 1){
if($_GET['train'] == 1){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '1', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u1` = `u1` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u1['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u1['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u1['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u1['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 2){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '1', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u2` = `u2` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u2['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u2['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u2['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u2['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 3){
if($session->access != BANNED){
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`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '3', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u3['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u3` = `u3` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u3['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u3['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u3['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u3['crop']." WHERE `wref` = '" . $village->wid . "'");
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 5){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '5', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u5['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u5` = `u5` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u5['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u5['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u5['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u5['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 6){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '6', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u6['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u6` = `u6` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u6['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u6['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u6['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u6['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
}
if($session->tribe == 2){
if($_GET['train'] == 11){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '11', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u11['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u11` = `u11` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u11['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u11['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u11['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u11['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 12){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '12', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u12['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u12` = `u12` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u12['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u12['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u12['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u12['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 13){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '13', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u13['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u13` = `u13` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u13['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u13['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u13['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u13['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 15){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '15', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u15['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u15` = `u15` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u15['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u15['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u15['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u15['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 16){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '16', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u16['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u16` = `u16` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u16['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u16['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u16['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u16['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
}
if($session->tribe == 3){
if($_GET['train'] == 21){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '21', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u21['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u21` = `u21` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u21['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u21['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u21['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u21['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 22){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '22', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u22['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u22` = `u22` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u22['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u22['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u22['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u22['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 24){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '24', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u24['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u24` = `u24` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u24['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u24['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u24['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u24['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 25){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '25', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u25['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u25` = `u25` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u25['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u25['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u25['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u25['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 26){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '26', '".addslashes($session->username)."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u26['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u26` = `u26` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u26['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u26['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u26['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u26['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
}
echo $output;
?>
</table>
+38
View File
@@ -0,0 +1,38 @@
<?php
include("next.tpl");
?>
<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> Resource units</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
<td><b><?php echo $bid38[$next]['attri']*STORAGE_MULTIPLIER; ?></b> Resource units</td>
<?php
}else{
?>
<th>Capacity at level 20:</th>
<td><b><?php echo $bid38[20]['attri']*STORAGE_MULTIPLIER; ?></b> Resource units</td>
<?php
}
}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+39
View File
@@ -0,0 +1,39 @@
<?php
include("next.tpl");
?>
<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> Crop units</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
<td><b><?php echo $bid39[$next]['attri']*STORAGE_MULTIPLIER; ?></b> Crop units</td>
<?php
}else{
?>
<th>Capacity at level 20:</th>
<td><b><?php echo $bid39[20]['attri']*STORAGE_MULTIPLIER; ?></b> Crop units</td>
<?php
}
}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+56
View File
@@ -0,0 +1,56 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid4[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 20; ?>:</th>
<td><b><?php echo $bid4[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}else{
if($next<=10){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid4[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
<td><b><?php echo $bid4[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?></p></div>
+10
View File
@@ -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>
+59
View File
@@ -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['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
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>
+50
View File
@@ -0,0 +1,50 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
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\" />";
$dur=round(${'u'.$i}['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
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,true)."; return false;\">(".$technology->maxUnit($i,true).")</a></td></tr></tbody>";
}
}
?>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Wood bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid5[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Wood bonus at level 5:</th>
<td><b><?php echo $bid5[5]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Clay bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid6[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Clay bonus at level 5:</th>
<td><b><?php echo $bid6[5]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Iron bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid7[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Iron bonus at level 5:</th>
<td><b><?php echo $bid7[5]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Crop bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid8[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Crop bonus at level 5:</th>
<td><b><?php echo $bid8[5]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<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)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Crop bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid9[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Crop bonus at level 5:</th>
<td><b><?php echo $bid9[5]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+480
View File
@@ -0,0 +1,480 @@
<?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);
$mainbuilding1 = $database->getBuildingByType2($village->wid,15);
$cranny1 = $database->getBuildingByType2($village->wid,23);
$granary1 = $database->getBuildingByType2($village->wid,11);
$warehouse1 = $database->getBuildingByType2($village->wid,10);
$embassy1 = $database->getBuildingByType2($village->wid,18);
$wall1 = $database->getBuildingByField2($village->wid,40);
$rallypoint1 = $database->getBuildingByType2($village->wid,16);
$hero1 = $database->getBuildingByType2($village->wid,37);
$market1 = $database->getBuildingByType2($village->wid,17);
$barrack1 = $database->getBuildingByType2($village->wid,19);
$cropland1 = $database->getBuildingByType2($village->wid,4);
$grainmill1 = $database->getBuildingByType2($village->wid,8);
$residence1 = $database->getBuildingByType2($village->wid,25);
$academy1 = $database->getBuildingByType2($village->wid,22);
$armoury1 = $database->getBuildingByType2($village->wid,13);
$woodcutter1 = $database->getBuildingByType2($village->wid,1);
$palace1 = $database->getBuildingByType2($village->wid,26);
$claypit1 = $database->getBuildingByType2($village->wid,2);
$ironmine1 = $database->getBuildingByType2($village->wid,3);
$blacksmith1 = $database->getBuildingByType2($village->wid,12);
$stable1 = $database->getBuildingByType2($village->wid,20);
$trapper1 = $database->getBuildingByType2($village->wid,36);
$treasury1 = $database->getBuildingByType2($village->wid,27);
$sawmill1 = $database->getBuildingByType2($village->wid,5);
$brickyard1 = $database->getBuildingByType2($village->wid,6);
$ironfoundry1 = $database->getBuildingByType2($village->wid,7);
$workshop1 = $database->getBuildingByType2($village->wid,21);
$stonemasonslodge1 = $database->getBuildingByType2($village->wid,34);
$townhall1 = $database->getBuildingByType2($village->wid,24);
$tournamentsquare1 = $database->getBuildingByType2($village->wid,14);
$bakery1 = $database->getBuildingByType2($village->wid,9);
$tradeoffice1 = $database->getBuildingByType2($village->wid,28);
$greatbarracks1 = $database->getBuildingByType2($village->wid,29);
$greatstable1 = $database->getBuildingByType2($village->wid,30);
$brewery1 = $database->getBuildingByType2($village->wid,35);
$horsedrinkingtrough1 = $database->getBuildingByType2($village->wid,41);
$herosmansion1 = $database->getBuildingByType2($village->wid,37);
$greatwarehouse1 = $database->getBuildingByType2($village->wid,38);
$greatgranary1 = $database->getBuildingByType2($village->wid,39);
$greatworkshop1 = $database->getBuildingByType2($village->wid,42);
?>
<div id="build" class="gid0"><h1>Construct new building</h1>
<?php
if($mainbuilding == 0 && $mainbuilding1 == 0 && $id != 39 && $id != 40) {
include("avaliable/mainbuilding.tpl");
}
if((($cranny == 0 && $cranny1 == 0) || $cranny == 10) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
include("avaliable/cranny.tpl");
}
if((($granary == 0 && $granary1 == 0) || $granary == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40 ) {
include("avaliable/granary.tpl");
}
if($wall == 0 && $wall1 == 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 && $warehouse1 == 0) || $warehouse == 20) && $mainbuilding >= 1 && $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 && $trapper1 == 0) || $trapper == 20) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) {
include("avaliable/trapper.tpl");
}
if($rallypoint == 0 && $rallypoint1 == 0 && $id != 40) {
include("avaliable/rallypoint.tpl");
}
if($embassy == 0 && $embassy1 == 0 && $id != 39 && $id != 40) {
include("avaliable/embassy.tpl");
}
//fix hero
if($hero == 0 && $hero1 == 0 && $mainbuilding >= 3 && $rallypoint >= 1 && $id != 39 && $id != 40) {
include("avaliable/hero.tpl");
}
//fix barracks
if($rallypoint >= 1 && $mainbuilding >= 3 && $barrack == 0 && $barrack1 == 0 && $id != 39 && $id != 40) {
include("avaliable/barracks.tpl");
}
if($mainbuilding >= 3 && $academy >= 1 && $armoury == 0 && $armoury1 == 0 && $id != 39 && $id != 40) {
include("avaliable/armoury.tpl");
}
if($cropland >= 5 && $grainmill == 0 && $grainmill1 == 0 && $id != 39 && $id != 40) {
include("avaliable/grainmill.tpl");
}
//fix marketplace
if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $market1 == 0 && $id != 39 && $id != 40) {
include("avaliable/marketplace.tpl");
}
//fix residence
if($mainbuilding >= 5 && $residence == 0 && $residence1 == 0 && $id != 39 && $id != 40 && $palace == 0 && $palace1 == 0) {
include("avaliable/residence.tpl");
}
if($academy == 0 && $academy1 == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) {
include("avaliable/academy.tpl");
}
//fix palace
if($palace == 0 && $palace1 == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0 && $residence1 == 0) {
//Fix Castle
//id user
$user = $session->uid;
//search Castle in array structure village
$test = in_array(26, $database->caststruc($user));
//if Castle no ready include palace.tpl
if (!$test){
include("avaliable/palace.tpl");
}
//end Fix
}
if($blacksmith == 0 && $blacksmith1 == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) {
include("avaliable/blacksmith.tpl");
}
if($stonemasonslodge == 0 && $stonemasonslodge1 == 0 && $palace >= 3 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $village->capital == 1) {
include("avaliable/stonemason.tpl");
}
if($stable == 0 && $stable1 == 0 && $blacksmith >= 3 && $academy >= 5 && $id != 39 && $id != 40) {
include("avaliable/stable.tpl");
}
if($treasury == 0 && $treasury1 == 0 && $mainbuilding >= 10 && $id != 39 && $id != 40) {
include("avaliable/treasury.tpl");
}
if($brickyard == 0 && $brickyard1 == 0 && $claypit >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40 ) {
include("avaliable/brickyard.tpl");
}
if($sawmill == 0 && $sawmill1 == 0 && $woodcutter >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
include("avaliable/sawmill.tpl");
}
if($ironfoundry == 0 && $ironfoundry1 == 0 && $ironmine >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
include("avaliable/ironfoundry.tpl");
}
if($workshop == 0 && $workshop1 == 0 && $academy >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
include("avaliable/workshop.tpl");
}
if($tournamentsquare == 0 && $tournamentsquare1 == 0 && $rallypoint >= 15 && $id != 39 && $id != 40) {
include("avaliable/tsquare.tpl");
}
if($bakery == 0 && $bakery1 == 0 && $grainmill >= 5 && $cropland >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
include("avaliable/bakery.tpl");
}
if($townhall == 0 && $townhall1 == 0 && $mainbuilding >= 10 && $academy >= 10 && $id != 39 && $id != 40) {
include("avaliable/townhall.tpl");
}
if($tradeoffice == 0 && $tradeoffice1 == 0 && $market == 20 && $stable >= 10 && $id != 39 && $id != 40) {
include("avaliable/tradeoffice.tpl");
}
if($session->tribe == 1 && $horsedrinkingtrough == 0 && $horsedrinkingtrough1 == 0 && $rallypoint >= 10 && $stable == 20 && $id != 39 && $id != 40) {
include("avaliable/horsedrinking.tpl");
}
if($session->tribe == 2 && $brewery == 0 && $brewery1 == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) {
include("avaliable/brewery.tpl");
}
if($greatbarracks == 0 && $greatbarracks1 == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
include("avaliable/greatbarracks.tpl");
}
if($greatstable == 0 && $greatstable1 == 0 && $stable == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
include("avaliable/greatstable.tpl");
}
if($greatworkshop == 0 && $greatworkshop1 == 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 && $palace == 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 && $palace == 0 && $residence == 0) {
//Fix Castle
//id user
$user = $session->uid;
//connect to DB
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
//loop search village user
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysql_fetch_array($query)){
//loop structure village
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1);
//search Castle in array structure village
$test = in_array(26,$strutture);
if ($test){
break;
}
}
//if Castle no ready include palace.tpl
if (!$test){
include("soon/palace.tpl");
}
//end Fix
}
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)) {
//Fix Castle
//id user
$user = $session->uid;
//connect to DB
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
//loop search village user
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysql_fetch_array($query)){
//loop structure village
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1);
//search Castle in array structure village
$test = in_array(26,$strutture);
if ($test){
break;
}
}
//if Castle no ready include palace.tpl
if (!$test){
include("soon/palace.tpl");
}
//end Fix
}
if($blacksmith == 0 && ($academy == 0 || $mainbuilding == 1)) {
include("soon/blacksmith.tpl");
}
if($stonemason == 0 && ($palace == 0 || $mainbuilding <= 2) && $residence == 0 && $village->capital == 1) {
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>
</div>
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+16
View File
@@ -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>
+16
View File
@@ -0,0 +1,16 @@
<h2>Armoury</h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc">In the armoury&#39;s melting furnaces your warriors&#39; 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>

Some files were not shown because too many files have changed in this diff Show More